diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 7bb54abd80..3ea1ba0ea9 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -170,6 +170,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`stpuzzles`](stpuzzles/) | Simon Tatham's Portable Puzzle Collection | | https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ | | [`stress-ng`](stress-ng/) | stress-ng | 0.11.23 | https://github.com/ColinIanKing/stress-ng | | [`Super-Mario`](Super-Mario/) | Super-Mario Clone | | https://github.com/Bennyhwanggggg/Super-Mario-Clone-Cpp | +| [`tuxracer`](tuxracer/) | Tux Racer | 0.61 | http://tuxracer.sourceforge.net/ | | [`tcl`](tcl/) | Tcl | 8.6.11 | https://www.tcl-lang.org/ | | [`termcap`](termcap/) | GNU termcap | 1.3.1 | https://www.gnu.org/software/termutils/ | | [`tinycc`](tinycc/) | Tiny C Compiler (TinyCC) | dev | https://github.com/TinyCC/tinycc | diff --git a/Ports/tuxracer/package.sh b/Ports/tuxracer/package.sh new file mode 100755 index 0000000000..c08a539607 --- /dev/null +++ b/Ports/tuxracer/package.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=tuxracer +useconfigure="true" +version="0.61" +files="http://ftp.e.kth.se/pub/mpkg/distfiles/tuxracer/${version}/tuxracer-${version}.tar.gz tuxracer-${version}.tar.gz a311d09080598fe556134d4b9faed7dc0c2ed956ebb10d062e5d4df022f91eff +http://ftp.e.kth.se/pub/mpkg/distfiles/tuxracer/${version}/tuxracer-data-${version}.tar.gz tuxracer-data-${version}.tar.gz 3783d204b7bb1ed16aa5e5a1d5944de10fbee05bc7cebb8f616fce84301f3651" +auth_type=sha256 +depends=("glu" "SDL2" "SDL2_mixer" "tcl") +configopts=( + "--with-gl-inc=${SERENITY_INSTALL_ROOT}/usr/include/LibGL" + "--with-gl-lib-name=gl" + "--with-sdl-prefix=${SERENITY_INSTALL_ROOT}/usr/local" + "--with-tcl-lib-name=tcl8.6" + "--without-x" +) +launcher_name="Tux Racer" +launcher_category="Games" +launcher_command="/usr/local/bin/tuxracer" + +pre_configure() { + export CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2" + export CXXFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2" + export LIBS="-lmodplug -lSDL2" +} + +post_configure() { + unset LIBS + unset CXXFLAGS + unset CFLAGS +} + +post_install() { + resourcePath="${SERENITY_INSTALL_ROOT}/usr/local/share/tuxracer" + mkdir -p "${resourcePath}" + cp -r tuxracer-data-${version}/* "${resourcePath}/" +} diff --git a/Ports/tuxracer/patches/configure.patch b/Ports/tuxracer/patches/configure.patch new file mode 100644 index 0000000000..d6e803788d --- /dev/null +++ b/Ports/tuxracer/patches/configure.patch @@ -0,0 +1,29 @@ +--- tuxracer-0.61-original/configure 2021-12-23 14:26:17.978567580 +0000 ++++ tuxracer-0.61/configure 2021-12-24 12:12:08.718881004 +0000 +@@ -1674,7 +1674,7 @@ + + ; return 0; } + EOF +-if { (eval echo configure:1678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if [ "$ac_func" = "isnan" ]; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -3415,7 +3415,7 @@ + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +-LIBS="-lSDL_mixer $LIBS" ++LIBS="-lSDL2_mixer $LIBS" + cat > conftest.$ac_ext < 0 ) { + for ( i=0; i