Jamepad is built on Github Actions. Take a look at the workflow files to see what's happening.
Updating SDL version submodule to a new version:
cd SDL
git checkout release-x.x.x
cd..
git add SDL
git commit -m "Update to SDL x.x.x"
git push
If you need to built locally, follow the steps taken there.
Now following is the old manual approach_
- Clone the repo on Linux. Run
./gradlew linuxNatives
- The binaries for Windows are cross-compiled and so also need to be built on Linux (or MacOS). Run
./gradlew windowsNatives
- Clone the repo on a mac. Copy the files you just built (from the
libs
folder) to the mac. - On the mac, run
./gradlew OSXNatives
- Run
./gradlew dist
to generate a .jar file with all the dependencies bundled.
The following packages (or equivalents) are needed:
ant
build-essential
sdl2-dev
If you've built C stuff for different platforms and bitnesses, you probably have all this stuff. If not, use your package manager to get them all. It should be something like this if you're on Ubuntu or Debian or whatever:
sudo apt-get install ant build-essential sdl2-dev
sdl2-config must be in the path.
If your distro doesn't have an up to date version of SDL or you get errors, you can build it yourself from source:
./configure CFLAGS=-fPIC CPPFLAGS=-fPIC --disable-audio --disable-render --disable-power --disable-filesystem ; make ; sudo make install
If you want to make the binaries smaller you can disable parts of SDL you don't need with configure flags. (We only make use of Joystick, GameController and Events systems). However this is not well tested.
Linux:
sudo apt-get install mingw-w64
MacOS:
brew install mingw-w64
You need to install cross compiled Windows 32 and 64 bit versions of SDL, e.g.
./configure --host=i686-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem ; make ; sudo make install
./configure --host=x86_64-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem ; make ; sudo make install
sdl2-config is assumed to be in /usr/local/cross-tools/ if it is not found there you will need to edit JamepadNativesBuild.java with the correct path.
The OS X binaries currently must be built on OS X. You can build the Windows ones too with cross compiler. It is probably possible to build the Linux binaries here too, but I haven't tried that out.
The dependencies are pretty much the same (ant, g++). These packages can be installed from homebrew.