diff options
Diffstat (limited to 'games/openttd')
-rw-r--r-- | games/openttd/Makefile | 57 | ||||
-rw-r--r-- | games/openttd/PLIST | 6 | ||||
-rw-r--r-- | games/openttd/distinfo | 14 | ||||
-rw-r--r-- | games/openttd/patches/patch-cmake_InstallAndPackage.cmake | 55 | ||||
-rw-r--r-- | games/openttd/patches/patch-config.lib | 46 | ||||
-rw-r--r-- | games/openttd/patches/patch-src_core_alloc__func.hpp | 21 | ||||
-rw-r--r-- | games/openttd/patches/patch-src_core_endian__type.hpp | 20 |
7 files changed, 87 insertions, 132 deletions
diff --git a/games/openttd/Makefile b/games/openttd/Makefile index ff469c71270..cd67f8e0d08 100644 --- a/games/openttd/Makefile +++ b/games/openttd/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.97 2021/04/21 11:41:45 adam Exp $ +# $NetBSD: Makefile,v 1.98 2021/05/04 17:08:05 nia Exp $ -DISTNAME= openttd-1.10.3-source +DISTNAME= openttd-1.11.2-source PKGNAME= ${DISTNAME:S/-source//} -PKGREVISION= 3 CATEGORIES= games MASTER_SITES= https://proxy.binaries.openttd.org/openttd-releases/${PKGVERSION_NOREV}/ EXTRACT_SUFX= .tar.xz @@ -13,51 +12,39 @@ COMMENT= Open source clone of Transport Tycoon Deluxe LICENSE= gnu-gpl-v2 WRKSRC= ${WRKDIR}/${PKGNAME_NOREV} -HAS_CONFIGURE= yes +USE_CMAKE= yes USE_LANGUAGES= c c++ -USE_TOOLS+= gmake pkg-config -BUILD_DEFS+= VARBASE -BUILD_TARGET= bundle - -# C++11 -GCC_REQD+= 4.8 +USE_TOOLS+= pkg-config +CONFIGURE_DIRS= build +CMAKE_ARG_PATH= .. -CONFIGURE_ARGS+= --os=UNIX -CONFIGURE_ARGS+= --prefix-dir=${PREFIX} -CONFIGURE_ARGS+= --binary-dir=bin -CONFIGURE_ARGS+= --data-dir=share/openttd -CONFIGURE_ARGS+= --doc-dir=share/doc/openttd -CONFIGURE_ARGS+= --icon-theme-dir=share/icons/hicolor -CONFIGURE_ARGS+= --install-dir=${DESTDIR} -CONFIGURE_ARGS+= --man-dir=${PKGMANDIR}/man6 -CONFIGURE_ARGS+= --menu-dir=share/applications -CONFIGURE_ARGS+= --personal-dir=.openttd -CONFIGURE_ARGS+= --shared-dir=${VARBASE}/games/openttd +# C++17 +GCC_REQD+= 7 -CONFIGURE_ARGS+= --without-allegro +BUILD_DEFS+= VARBASE .include "../../mk/bsd.prefs.mk" -.if ${OPSYS} == "Darwin" -CONFIGURE_ARGS+= --disable-cocoa-quickdraw -CONFIGURE_ARGS+= --with-cocoa -CONFIGURE_ARGS+= --without-application-bundle -CONFIGURE_ARGS+= --without-osx-sysroot -.else -CONFIGURE_ARGS+= --with-sdl=sdl2 -.include "../../devel/SDL2/buildlink3.mk" -.include "../../x11/libxdg-basedir/buildlink3.mk" -BUILDLINK_API_DEPENDS.libxdg-basedir+= libxdg-basedir>=1.2.0 -.endif +CMAKE_ARGS+= -DPERSONAL_DIR=.openttd +CMAKE_ARGS+= -DSHARED_DIR=${VARBASE}/games/openttd +CMAKE_ARGS+= -DGLOBAL_DIR=${PREFIX}/share/openttd +CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release +CMAKE_ARGS+= -DCMAKE_INSTALL_BINDIR=bin +CMAKE_ARGS+= -DCMAKE_INSTALL_DATADIR=share +CMAKE_ARGS+= -DCMAKE_DISABLE_FIND_PACKAGE_Allegro=ON +CMAKE_ARGS+= -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON +CMAKE_ARGS+= -DCMAKE_DISABLE_FIND_PACKAGE_Grfcodec=ON -MAKE_FLAGS.NetBSD+= MD5SUM="/usr/bin/cksum -n -a md5" +BUILDLINK_TRANSFORM+= opt:-std=c++17:-std=gnu++17 # alloca -BUILDLINK_TRANSFORM+= opt:-std=c++11:-std=gnu++11 # alloca +pre-configure: + ${MKDIR} ${WRKSRC}/build .include "../../archivers/lzo/buildlink3.mk" .include "../../archivers/xz/buildlink3.mk" .include "../../audio/fluidsynth/buildlink3.mk" .include "../../converters/libiconv/buildlink3.mk" +.include "../../devel/SDL2/buildlink3.mk" .include "../../devel/zlib/buildlink3.mk" .include "../../fonts/fontconfig/buildlink3.mk" .include "../../graphics/freetype2/buildlink3.mk" diff --git a/games/openttd/PLIST b/games/openttd/PLIST index f9db7c2e103..4407d6eeebe 100644 --- a/games/openttd/PLIST +++ b/games/openttd/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.27 2020/04/05 14:41:21 nia Exp $ +@comment $NetBSD: PLIST,v 1.28 2021/05/04 17:08:05 nia Exp $ bin/openttd man/man6/openttd.6 share/applications/openttd.desktop @@ -17,6 +17,7 @@ share/openttd/ai/compat_0.7.nut share/openttd/ai/compat_1.0.nut share/openttd/ai/compat_1.1.nut share/openttd/ai/compat_1.10.nut +share/openttd/ai/compat_1.11.nut share/openttd/ai/compat_1.2.nut share/openttd/ai/compat_1.3.nut share/openttd/ai/compat_1.4.nut @@ -27,7 +28,6 @@ share/openttd/ai/compat_1.8.nut share/openttd/ai/compat_1.9.nut share/openttd/baseset/no_music.obm share/openttd/baseset/no_sound.obs -share/openttd/baseset/openttd.32.bmp share/openttd/baseset/openttd.grf share/openttd/baseset/opntitle.dat share/openttd/baseset/orig_dos.obg @@ -40,6 +40,7 @@ share/openttd/baseset/orig_win.obg share/openttd/baseset/orig_win.obm share/openttd/baseset/orig_win.obs share/openttd/game/compat_1.10.nut +share/openttd/game/compat_1.11.nut share/openttd/game/compat_1.2.nut share/openttd/game/compat_1.3.nut share/openttd/game/compat_1.4.nut @@ -114,3 +115,4 @@ share/openttd/scripts/pre_dedicated.scr.example share/openttd/scripts/pre_server.scr.example share/openttd/scripts/readme.txt share/pixmaps/openttd.32.xpm +share/pixmaps/openttd.64.xpm diff --git a/games/openttd/distinfo b/games/openttd/distinfo index 5388393b191..74a2b5e4dfb 100644 --- a/games/openttd/distinfo +++ b/games/openttd/distinfo @@ -1,9 +1,7 @@ -$NetBSD: distinfo,v 1.37 2020/10/03 10:17:15 nia Exp $ +$NetBSD: distinfo,v 1.38 2021/05/04 17:08:05 nia Exp $ -SHA1 (openttd-1.10.3-source.tar.xz) = 5a68b97d1f84e9f7e361c12996e741fe64537802 -RMD160 (openttd-1.10.3-source.tar.xz) = 863de2742c84f198d44d02268575cd5233f1c56f -SHA512 (openttd-1.10.3-source.tar.xz) = d1cd535e8e49f0ac147704341287af1b16bde6725fd9152dd36dcb780559b400da8bb31c4e8eb665a0d11e9b1f5bf8a96be0f97f7a85bd967eec534fdd3dd0d4 -Size (openttd-1.10.3-source.tar.xz) = 6815924 bytes -SHA1 (patch-config.lib) = 1e8319816aba9d7bf4d0f749c0a4725d1747388a -SHA1 (patch-src_core_alloc__func.hpp) = 17fcfe3ce984cd453f6756f4f212c8fe8ab15ed1 -SHA1 (patch-src_core_endian__type.hpp) = 23564a89fd0e2ebe97043c7d16d5831831b65f40 +SHA1 (openttd-1.11.2-source.tar.xz) = 1894134b7bfc7c645ce9c4fe5747db3dd40abf61 +RMD160 (openttd-1.11.2-source.tar.xz) = 19d5edf788076fe562bcc8f095e44dd3910c83b0 +SHA512 (openttd-1.11.2-source.tar.xz) = 9a6364bf19627db9f8ec58bfa85fa3a8febf1109f3b5fb9053bef810ac2d0c41df91b58f0b253dd45320a29cae2e8485df794afa7b5240f19759f98fd65c35ea +Size (openttd-1.11.2-source.tar.xz) = 6783972 bytes +SHA1 (patch-cmake_InstallAndPackage.cmake) = 18b02c11bf59639124c2a852d5a19dda3ae0ff81 diff --git a/games/openttd/patches/patch-cmake_InstallAndPackage.cmake b/games/openttd/patches/patch-cmake_InstallAndPackage.cmake new file mode 100644 index 00000000000..c05f59cd9cb --- /dev/null +++ b/games/openttd/patches/patch-cmake_InstallAndPackage.cmake @@ -0,0 +1,55 @@ +$NetBSD: patch-cmake_InstallAndPackage.cmake,v 1.1 2021/05/04 17:08:05 nia Exp $ + +Do not try to generate Linux distribution packages. + +--- cmake/InstallAndPackage.cmake.orig 2021-05-03 18:41:45.000000000 +0000 ++++ cmake/InstallAndPackage.cmake +@@ -145,47 +145,9 @@ elseif(UNIX) + if(OPTION_PACKAGE_DEPENDENCIES) + set(CPACK_GENERATOR "TXZ") + set(PLATFORM "generic") +- elseif(NOT OPTION_INSTALL_FHS) ++ else() + set(CPACK_GENERATOR "TXZ") + set(PLATFORM "unknown") +- else() +- find_program(LSB_RELEASE_EXEC lsb_release) +- execute_process(COMMAND ${LSB_RELEASE_EXEC} -is +- OUTPUT_VARIABLE LSB_RELEASE_ID +- OUTPUT_STRIP_TRAILING_WHITESPACE +- ) +- if(LSB_RELEASE_ID) +- if(LSB_RELEASE_ID STREQUAL "Ubuntu" OR LSB_RELEASE_ID STREQUAL "Debian") +- execute_process(COMMAND ${LSB_RELEASE_EXEC} -cs +- OUTPUT_VARIABLE LSB_RELEASE_CODENAME +- OUTPUT_STRIP_TRAILING_WHITESPACE +- ) +- string(TOLOWER "${LSB_RELEASE_ID}-${LSB_RELEASE_CODENAME}" PLATFORM) +- +- set(CPACK_GENERATOR "DEB") +- include(PackageDeb) +- else() +- set(UNSUPPORTED_PLATFORM_NAME "LSB-based Linux distribution '${LSB_RELEASE_ID}'") +- endif() +- elseif(EXISTS "/etc/os-release") +- file(STRINGS "/etc/os-release" OS_RELEASE_CONTENTS REGEX "^ID=") +- string(REGEX MATCH "ID=(.*)" _ ${OS_RELEASE_CONTENTS}) +- set(DISTRO_ID ${CMAKE_MATCH_1}) +- if(DISTRO_ID STREQUAL "arch") +- set(PLATFORM "arch") +- set(CPACK_GENERATOR "TXZ") +- else() +- set(UNSUPPORTED_PLATFORM_NAME "Linux distribution '${DISTRO_ID}' from /etc/os-release") +- endif() +- else() +- set(UNSUPPORTED_PLATFORM_NAME "Linux distribution") +- endif() +- +- if(NOT PLATFORM) +- set(PLATFORM "generic") +- set(CPACK_GENERATOR "TXZ") +- message(WARNING "Unknown ${UNSUPPORTED_PLATFORM_NAME} found for packaging; can only pack to a txz. Please consider creating a Pull Request to add support for this distribution.") +- endif() + endif() + + set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-linux-${PLATFORM}-${CPACK_SYSTEM_NAME}") diff --git a/games/openttd/patches/patch-config.lib b/games/openttd/patches/patch-config.lib deleted file mode 100644 index 60d17362ed8..00000000000 --- a/games/openttd/patches/patch-config.lib +++ /dev/null @@ -1,46 +0,0 @@ -$NetBSD: patch-config.lib,v 1.3 2020/08/18 03:27:49 tnn Exp $ - -Compile 'strip' test with CFLAGS, so -isysroot can be passed on OSX. -Correct library detection on NetBSD. -On Darwin, be able to locate iconv.h inside the SDK. -Use pkg-config to detect liblzo2 as hand-crafted method seems unreliable. - ---- config.lib.orig 2020-06-01 21:22:01.000000000 +0000 -+++ config.lib -@@ -2088,7 +2088,7 @@ check_strip() { - elif [ "$os" = "OSX" ]; then - # Most targets have -V in strip, to see if they exists... OSX doesn't.. so execute something - echo "int main(int argc, char *argv[]) { }" > strip.test.c -- $cxx_host strip.test.c -o strip.test -+ $cc_host $CFLAGS strip.test.c -o strip.test - check_compiler "host strip" "strip" "$host" "$strip" "$STRIP" "strip" "strip" "3" "strip.test" - rm -f strip.test.c strip.test - else -@@ -2633,7 +2633,7 @@ detect_library() { - if [ -z "$res" ]; then - log 2 " trying /opt/local/include/$4$5... no" - fi -- if [ -z "$res" ] && [ "$os" = "NETBSD" ]; then -+ if [ -z "$res" ]; then - eval "$2=`ls -1 /usr/pkg/include/$4*.h 2>/dev/null | egrep \"\/$5\$\"`" - eval "res=\$$2" - if [ -z "$res" ]; then -@@ -2725,7 +2725,7 @@ detect_zlib() { - } - - detect_lzo2() { -- detect_library "$with_lzo2" "lzo2" "liblzo2.a" "lzo/" "lzo1x.h" -+ detect_pkg_config "$with_lzo2" "lzo2" "lzo2" "2.10" - } - - detect_fluidsynth() { -@@ -2885,6 +2885,9 @@ detect_iconv() { - break - fi - done -+ if [ -z "$iconv" ] && [ "$os" = "OSX" ]; then -+ iconv=`xcrun --show-sdk-path`/usr/include/iconv.h -+ fi - else - # Make sure it exists - iconv=`ls $with_iconv/include/iconv.h 2>/dev/null` diff --git a/games/openttd/patches/patch-src_core_alloc__func.hpp b/games/openttd/patches/patch-src_core_alloc__func.hpp deleted file mode 100644 index 18f1f73e11c..00000000000 --- a/games/openttd/patches/patch-src_core_alloc__func.hpp +++ /dev/null @@ -1,21 +0,0 @@ -$NetBSD: patch-src_core_alloc__func.hpp,v 1.1 2017/06/28 18:18:36 adam Exp $ - -Prefer built-in alloca() to avoid crashes. - ---- src/core/alloc_func.hpp.orig 2017-06-26 13:04:45.346333800 +0000 -+++ src/core/alloc_func.hpp -@@ -131,8 +131,14 @@ static inline T *ReallocT(T *t_ptr, size - } - - /** alloca() has to be called in the parent function, so define AllocaM() as a macro */ -+#ifdef __GNUC__ -+#define AllocaM(T, num_elements) \ -+ (CheckAllocationConstraints<T>(num_elements), \ -+ (T*)__builtin_alloca((num_elements) * sizeof(T))) -+#else - #define AllocaM(T, num_elements) \ - (CheckAllocationConstraints<T>(num_elements), \ - (T*)alloca((num_elements) * sizeof(T))) -+#endif - - #endif /* ALLOC_FUNC_HPP */ diff --git a/games/openttd/patches/patch-src_core_endian__type.hpp b/games/openttd/patches/patch-src_core_endian__type.hpp deleted file mode 100644 index 55cb8a4887e..00000000000 --- a/games/openttd/patches/patch-src_core_endian__type.hpp +++ /dev/null @@ -1,20 +0,0 @@ -$NetBSD: patch-src_core_endian__type.hpp,v 1.1 2019/09/23 09:49:52 nia Exp $ - -NetBSD does not have endian definitions in param.h - ---- src/core/endian_type.hpp.orig 2019-09-16 19:15:04.000000000 +0000 -+++ src/core/endian_type.hpp -@@ -35,6 +35,13 @@ - # else - # define TTD_ENDIAN TTD_BIG_ENDIAN - # endif -+#elif defined(__NetBSD__) -+# include <sys/endian.h> -+# if BYTE_ORDER == LITTLE_ENDIAN -+# define TTD_ENDIAN TTD_LITTLE_ENDIAN -+# else -+# define TTD_ENDIAN TTD_BIG_ENDIAN -+# endif - #elif !defined(TESTING) - # include <sys/param.h> - # if __BYTE_ORDER == __LITTLE_ENDIAN |