Skip to content

Commit

Permalink
Fix compilation documentation for macOS/MSYS2
Browse files Browse the repository at this point in the history
  • Loading branch information
dciabrin committed Dec 14, 2023
1 parent a93ed40 commit e034827
Showing 1 changed file with 20 additions and 32 deletions.
52 changes: 20 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,17 @@ packages, available in the ngdevkit tap:
brew install pkg-config autoconf automake zip imagemagick sox

If you're running on Windows 10, you can use native pre-built packages
for the [MSYS2][msys2] environment. When running in a MSYS2 shell, you
can install the packages as follows:

echo -e '\n[ngdevkit]\nSigLevel = PackageOptional\nServer = https://dciabrin.net/msys2-ngdevkit/$arch' >> /etc/pacman.conf
pacman -Sy
pacman -S mingw-w64-x86_64-ngdevkit mingw-w64-x86_64-ngdevkit-gngeo
for the [MSYS2][msys2] environment, available for the ucrt64 subsystem.
To use them, start a MSYS2 shell for ucrt64, and configure the packages
as follows:

MSYSTEM=UCRT64 /usr/bin/bash -l
echo -e "\n[ngdevkit]\nSigLevel = Optional TrustAll\nServer = https://dciabrin.net/msys2-ngdevkit/\$arch" >> /etc/pacman.conf
# install pacboy with `pacman -S pactoys` if necessary
pacboy -Sy
pacboy -S ngdevkit:u ngdevkit-gngeo:u
# the remaining packages are only required for the examples
pacman -S autoconf automake make zip mingw-w64-x86_64-imagemagick mingw-w64-x86_64-sox

Additionally, on Windows 10, you also need an [official Python 3
release for Windows][pywin] from https://www.python.org installed on
your machine. Assuming you installed it in the default localtion for a
user called `ngdevkit`, you can proceed and install PyGame with:

C:/Users/ngdevkit/AppData/Local/Programs/Python/Python39/python -m pip install pygame

pacboy -S autoconf automake make zip imagemagick:u sox:u

If you can't install pre-built binary packages, you can clone the
[ngdevkit](ngdevkit) git repository and follow the build instructions:
Expand All @@ -85,39 +80,32 @@ If you can't install pre-built binary packages, you can clone the
### Compiling examples

Once everything is installed and ngdevkit is available in your
path, you can compile prepare the compilation with:
path, you can prepare the compilation with:

# import the GLSL CRT shader for GnGeo
git submodule update --init --recursive

And build all the examples with the following commands if you are running
Linux:

cd examples
autoreconf -iv
./configure
make

For macOS, make sure you use brew's python3 and gmake:

cd examples
export PATH=/usr/local/opt/python3/bin:$PATH
export PATH=$HOMEBREW_PREFIX/opt/python3/bin:$PATH
autoreconf -iv
./configure
gmake

For Windows, you have to build the examples with extra flags and
pass the location of the external Python 3 installation written
as an MSYS2 path:

cd examples
# ensure Windows-native binaries are available in PATH
export PATH=/mingw64/bin:$PATH
autoreconf -I/mingw64/share/aclocal -iv
./configure --enable-msys2 --with-python=/c/Users/ngdevkit/AppData/Local/Programs/Python/Python39/python
make
For Windows, make sure you shell uses the ucrt64 subsystem. Older versions
of this repo assumed you used mingw64, which is now deprecated. Also,
python3 and pygame are now autoconfigured, so the examples can be
build with the following commands:

# build all the examples
# make sure you are using the UCRT64 subsystem
MSYSTEM=UCRT64 /usr/bin/bash
autoreconf -iv
./configure
make
Expand All @@ -128,7 +116,7 @@ as an MSYS2 path:
Once you have built the examples, go into a subdirectory to
test the compiled example and run GnGeo from the makefile:

cd examples/01-helloworld
cd 01-helloworld
make gngeo
# or run "make gngeo-fullscreen" for a more immersive test

Expand All @@ -149,7 +137,7 @@ ngdevkit provides a modified version of GnGeo which supports remote
debugging via GDB. You need to start GnGeo in debug mode and run
GDB to attach to it:

cd examples/01-helloworld
cd 01-helloworld
# start GnGeo in debug mode
eval $(make -n gngeo) -D &
m68k-neogeo-elf-gdb rom.elf
Expand Down

0 comments on commit e034827

Please sign in to comment.