diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..a5cb2667b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,196 @@ +--- +name: Build +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + ubuntu: + name: Ubuntu 24.04 + runs-on: ${{ format('ubuntu-24.04{0}', matrix.arch == 'arm64' && '-arm' || '') }} + strategy: + fail-fast: false + matrix: + arch: [x64, arm64] + container: + image: ubuntu:24.04 + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install dependencies + run: | + apt-get update + apt-get install -y --no-install-recommends build-essential file gettext libsdl2-dev libsdl2-ttf-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libvorbis-dev libgl1-mesa-dev + + - name: Build Neverball + run: | + make -j$(nproc) + + - name: Run binaries check + run: | + file neverball neverputt mapc + ./neverball --version + + - name: Create standalone tarball + shell: bash + run: | + set -euo pipefail + bundle="neverball-${{ github.sha }}-linux-${{ matrix.arch }}" + rm -rf "$bundle" + mkdir -p "$bundle" + cp -a neverball neverputt mapc "$bundle/" + cp -a data locale "$bundle/" + cp -a README.md LICENSE.md "$bundle/" || true + tar -czf "$bundle.tar.gz" "$bundle" + + - name: Upload standalone tarball + uses: actions/upload-artifact@v6 + with: + name: neverball-linux-${{ matrix.arch }} + path: neverball-${{ github.sha }}-linux-${{ matrix.arch }}.tar.gz + + fedora: + name: Fedora 43 + runs-on: ${{ format('ubuntu-24.04{0}', matrix.arch == 'arm64' && '-arm' || '') }} + strategy: + fail-fast: false + matrix: + arch: [x64, arm64] + container: + image: fedora:43 + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install dependencies + run: | + dnf install -y @development-tools file gettext-devel SDL2-devel SDL2_ttf-devel libcurl-devel libjpeg-turbo-devel libpng-devel libvorbis-devel mesa-libGL-devel + + - name: Build Neverball + run: | + make -j$(nproc) + + - name: Run binaries check + run: | + file neverball neverputt mapc + ./neverball --version + + - name: Create standalone tarball + shell: bash + run: | + set -euo pipefail + bundle="neverball-${{ github.sha }}-linux-${{ matrix.arch }}" + rm -rf "$bundle" + mkdir -p "$bundle" + cp -a neverball neverputt mapc "$bundle/" + cp -a data locale "$bundle/" + cp -a README.md LICENSE.md "$bundle/" || true + tar -czf "$bundle.tar.gz" "$bundle" + + - name: Upload standalone tarball + uses: actions/upload-artifact@v6 + with: + name: neverball-linux-fedora-${{ matrix.arch }} + path: neverball-${{ github.sha }}-linux-${{ matrix.arch }}.tar.gz + + steam-linux-runtime: + name: Steam Linux Runtime 4.0 + if: false # Disabled due to missing libsdl2-ttf in the image (libsdl3-ttf not picked by SDL2 compat?). Should port to SDL3 anyways. + runs-on: ${{ format('ubuntu-24.04{0}', matrix.arch == 'arm64' && '-arm' || '') }} + strategy: + fail-fast: false + matrix: + arch: [x64, arm64] + container: + image: ${{ format('registry.gitlab.steamos.cloud/steamrt/steamrt4/sdk{0}', matrix.arch == 'arm64' && '/arm64' || '') }} + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Build Neverball + run: | + make -j$(nproc) + + - name: Run binaries check + run: | + file neverball neverputt mapc + ./neverball --version + + windows: + name: Windows MSYS2 + runs-on: ${{ matrix.arch == 'arm64' && 'windows-11-arm' || 'windows-2025' }} + strategy: + fail-fast: false + matrix: + arch: [x64, arm64] + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + update: true + msystem: ${{ matrix.arch == 'arm64' && 'CLANGARM64' || 'CLANG64' }} + install: > + base-devel + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-toolchain + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-pkgconf + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-gettext + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-SDL2 + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-SDL2_ttf + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-curl + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-libjpeg-turbo + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-libpng + mingw-w64-clang-${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-libvorbis + + - name: Build Neverball + shell: msys2 {0} + run: | + make CC=clang -j"$(nproc 2>/dev/null || echo 1)" + + - name: Run binaries check + shell: msys2 {0} + run: | + file neverball.exe neverputt.exe mapc.exe + ./neverball.exe --version + + - name: Create standalone tarball + shell: msys2 {0} + run: | + set -euo pipefail + bundle="neverball-${{ github.sha }}-windows-${{ matrix.arch }}" + rm -rf "$bundle" + mkdir -p "$bundle" + + cp -a neverball.exe neverputt.exe mapc.exe "$bundle/" + cp -a data locale "$bundle/" + cp -a README.md LICENSE.md "$bundle/" || true + + # Resolve MinGW/Clang prefix dynamically (clang64 / clangarm64) + mingw_prefix="$(cygpath -u "$MINGW_PREFIX")" + + # Collect DLL dependencies + dlls=$( + (ldd neverball.exe; ldd neverputt.exe; ldd mapc.exe) | + awk -v p="$mingw_prefix/bin/" '/=>/ {print $3} { if (index($1, p) == 1) print $1 }' | + grep -Ei "^$mingw_prefix/bin/.*\.dll$" | + sort -u + ) + + for dll in $dlls; do + cp -a "$dll" "$bundle/" + done + + tar -czf "$bundle.tar.gz" "$bundle" + + - name: Upload standalone tarball + uses: actions/upload-artifact@v6 + with: + name: neverball-windows-${{ matrix.arch }} + path: neverball-${{ github.sha }}-windows-${{ matrix.arch }}.tar.gz diff --git a/Makefile b/Makefile index 68c825f13..ebae03435 100644 --- a/Makefile +++ b/Makefile @@ -483,7 +483,7 @@ WINDRES ?= windres sh scripts/translate-desktop.sh < $< > $@ %.ico.o: dist/ico/%.ico - echo "1 ICON \"$<\"" | $(WINDRES) -o $@ + echo "1 ICON \"$<\"" | $(WINDRES) -o $@ - #------------------------------------------------------------------------------ diff --git a/README.md b/README.md index 1c91fbd98..0e6c4791d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Release highlights can be found in [doc/release-notes.md](doc/release-notes.md). ## Documentation * [LICENSE.md](LICENSE.md): a description of licensing and exceptions -* [doc/install.txt](doc/install.txt): instructions on how to build the +* [doc/install.md](doc/install.md): instructions on how to build the game from source code * [doc/manual.txt](doc/manual.txt): a detailed description of how to play and configure the game diff --git a/doc/install.md b/doc/install.md new file mode 100644 index 000000000..076403dfd --- /dev/null +++ b/doc/install.md @@ -0,0 +1,146 @@ +# Neverball + +## Requirements + +| Name | | +| --------- | -------------------------------------- | +| SDL 2.0 | https://github.com/libsdl-org/SDL | +| SDL2_ttf | https://github.com/libsdl-org/SDL_ttf | +| libvorbis | https://xiph.org/vorbis | +| libpng | https://libpng.org/pub/png/libpng.html | +| libjpeg | https://ijg.org | +| libcurl | optional, see below | +| libintl | optional, see below | + +### Ubuntu / Debian + +```shell +sudo apt install build-essential gettext libsdl2-dev libsdl2-ttf-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libvorbis-dev +``` + +### Fedora + +```shell +sudo dnf install @development-tools gettext-devel SDL2-devel SDL2_ttf-devel libcurl-devel libjpeg-turbo-devel libpng-devel libvorbis-devel +``` + +## Compilation + +Under Unix and Linux, simply run: + +```shell +make +``` + +### Windows (MSYS2) + +Under Windows, install the MSYS2 environment and run: + +```shell +make +``` + +### Cross-compilation for Windows (Fedora example) + +Cross-compilation for Windows is supported. On Fedora Linux: + +```shell +make sols clean-src +mingw32-make -o sols PLATFORM=mingw +``` + +## Optional features + +Optional features can be enabled at compile time by passing one or more additional arguments to `make`. Most of these features require additional libraries to be installed. + +### Native language support + +Disable NLS: + +```shell +make ENABLE_NLS=0 +``` + +- Enabled by default. +- Requires an additional library on non-GLIBC systems. +- Dependency: libintl (GNU gettext): https://www.gnu.org/software/gettext/ + +### Package downloads + +Use libcurl for package downloads (enabled by default). Set this to any other value (e.g. `ENABLE_FETCH=0`) to disable downloads: + +```shell +make ENABLE_FETCH=curl +``` + +- Dependency: libcurl: https://curl.se/libcurl + +### Tilt input devices + +Nintendo Wii Remote support on Linux: + +```shell +make ENABLE_TILT=wii +``` + +- Dependencies: BlueZ (https://www.bluez.org), libwiimote (https://libwiimote.sourceforge.net) + +Hillcrest Labs Loop support: + +```shell +make ENABLE_TILT=loop +``` + +- Dependencies: libusb-1.0 (http://libusb.org/wiki/Libusb1.0), libfreespace (https://github.com/hcrest/libfreespace) + +Leap Motion support on Linux: + +```shell +make ENABLE_TILT=leapmotion +``` + +- Dependency: Leap Motion V2 SDK: https://developer.leapmotion.com + +### Head-mounted display (HMD) + +OpenHMD support (including the Oculus Rift): + +```shell +make ENABLE_HMD=openhmd +``` + +- Dependency: OpenHMD: http://openhmd.net + +Oculus Rift support: + +```shell +make ENABLE_HMD=libovr +``` + +- Dependency: Oculus SDK: https://developer.oculusvr.com + +### Radiant console output + +Map compiler output to Radiant console: + +```shell +make ENABLE_RADIANT_CONSOLE=1 +``` + +- Dependency: SDL2_net: https://github.com/libsdl-org/SDL_net + +## Installation + +By default, an uninstalled build may be executed in place. A system-wide installation on Linux would probably copy the game to `/opt/neverball`. + +To be able to use the NetRadiant level editor, the game data and binaries must be installed in the same location. Distributions that wish to package Neverball, Neverputt, and their shared data separately should take care to use symlinks and launcher scripts to support this. + +## Distribution + +The `dist` subdirectory contains some miscellaneous files: + +- `.desktop` files +- high resolution icons in PNG, SVG and ICO formats + +Web: https://neverball.org + diff --git a/doc/install.txt b/doc/install.txt deleted file mode 100644 index 360d9f56e..000000000 --- a/doc/install.txt +++ /dev/null @@ -1,103 +0,0 @@ - - * Neverball * - - -* REQUIREMENTS - - SDL 2.0 http://libsdl.org/download-2.0.php - SDL2_ttf http://libsdl.org/projects/SDL_ttf/ - libvorbis http://xiph.org/vorbis/ - libpng http://libpng.org/pub/png/libpng.html - libjpeg http://ijg.org/ - libcurl optional, see below - libintl optional, see below - - -* COMPILATION - -Under Unix and Linux, simply run - - make - -Under Windows, install the MSYS2 environment and run - - make - -Cross-compilation for Windows is also supported. On Fedora Linux, run - - make sols clean-src - mingw32-make -o sols PLATFORM=mingw - - -* OPTIONAL FEATURES - -Optional features can be enabled at compile time by passing one or -more additional arguments to make. Most of these features require -additional libraries to be installed. - -make ENABLE_NLS=0 - Native language support. This is enabled by default. Requires an - additional library on non-GLIBC systems. - - libintl http://www.gnu.org/software/gettext/ - -make ENABLE_FETCH=curl - Use libcurl for package downloads. This is enabled by default. Set - this to any other value (e.g., ENABLE_FETCH=0) to disable downloads. - - libcurl https://curl.se/libcurl/ - -make ENABLE_TILT=wii - Nintendo Wii Remote support on Linux. - - BlueZ http://www.bluez.org/ - libwiimote http://libwiimote.sourceforge.net/ - -make ENABLE_TILT=loop - Hillcrest Labs Loop support. - - libusb-1.0 http://libusb.org/wiki/Libusb1.0 - libfreespace http://libfreespace.hillcrestlabs.com/ - -make ENABLE_TILT=leapmotion - Leap Motion support on Linux. - - V2 SDK https://developer.leapmotion.com/ - -make ENABLE_HMD=openhmd - Head-mounted display support (including the Oculus Rift). - - OpenHMD http://openhmd.net/ - -make ENABLE_HMD=libovr - Oculus Rift support. - - Oculus SDK https://developer.oculusvr.com/ - -make ENABLE_RADIANT_CONSOLE=1 - Map compiler output to Radiant console. - - SDL2_net http://www.libsdl.org/projects/SDL_net/ - - -* INSTALLATION - -By default, an uninstalled build may be executed in place. A system -wide installation on Linux would probably copy the game to -/opt/neverball. - -To be able to use the NetRadiant level editor, the game data and -binaries must be installed in the same location. Distributions that -wish to package Neverball, Neverputt and their shared data separately -should take care to use symlinks and launcher scripts to support this. - - -* DISTRIBUTION - -The dist subdirectory contains some miscellaneous files: - - * .desktop files - * high resolution icons in PNG, SVG and ICO formats - - -Web: