Sunday, February 28, 2021

WIP UPDATE: games/openttd

Hi,

Here's an update to openttd-1.11.0-beta2.

Upstream claims new OpenGL support, faster video, and 60fps.

The build system has been switched to CMake. This led to the GTK icons
and .desktop file not being installed, a bug upstream claims will be
fixed before release; see:
https://github.com/OpenTTD/OpenTTD/issues/8613
https://github.com/OpenTTD/OpenTTD/issues/8778

The endian patch no longer applies and seems to have been refactored
although the original pull request was merged. I'd appreciate a
test on PowerPC to make sure this is still correct.

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/openttd/Makefile,v
retrieving revision 1.70
diff -u -p -r1.70 Makefile
--- Makefile 10 Aug 2020 21:10:35 -0000 1.70
+++ Makefile 1 Mar 2021 06:00:18 -0000
@@ -2,9 +2,9 @@

COMMENT= open source clone of the game Transport Tycoon Deluxe

-V = 1.10.3
+V = 1.11.0-beta2
DISTNAME = openttd-$V-source
-PKGNAME = openttd-$V
+PKGNAME = openttd-1.11.0beta2

CATEGORIES= games

@@ -15,8 +15,9 @@ MAINTAINER = Anthony J. Bentley <anthony
# GPLv2 only
PERMIT_PACKAGE= Yes

+WANTLIB += ${COMPILER_LIBCXX}
WANTLIB += SDL2 c fluidsynth fontconfig freetype icudata icui18n icuuc
-WANTLIB += lzma lzo2 m png pthread ${COMPILER_LIBCXX} xdg-basedir z
+WANTLIB += lzma lzo2 m png pthread z

COMPILER = base-clang ports-gcc base-gcc

@@ -25,13 +26,14 @@ EXTRACT_SUFX = .tar.xz

DIST_SUBDIR = openttd

+MODULES = devel/cmake
+
LIB_DEPENDS= archivers/lzo2 \
audio/fluidsynth \
devel/sdl2 \
graphics/png \
textproc/icu4c \
- archivers/xz \
- x11/libxdg-basedir
+ archivers/xz

RUN_DEPENDS = audio/timidity \
devel/desktop-file-utils \
@@ -40,36 +42,21 @@ RUN_DEPENDS = audio/timidity \
games/openttd-data/opensfx \
x11/gtk+3,-guic

-CONFIGURE_STYLE= simple
-CONFIGURE_ARGS+= --prefix-dir=${PREFIX} \
- --binary-dir=bin \
- --data-dir=share/openttd \
- --icon-dir=share/pixmaps \
- --man-dir=man/man6 \
- --personal-dir=.openttd \
- --install-dir=${WRKINST} \
- --with-png \
- --with-zlib \
- --without-allegro \
- --CFLAGS_BUILD="${CFLAGS}" \
- --disable-strip
-
-MAKE_ENV+= VERBOSE=1
+CONFIGURE_ARGS = -DCMAKE_INSTALL_BINDIR=bin \
+ -DCMAKE_INSTALL_DATADIR=share

-USE_GMAKE= Yes
NO_TEST= Yes

DOCSDIR= ${PREFIX}/share/doc/openttd
EXAMPLESDIR= ${PREFIX}/share/examples/openttd
GAMEDIR= ${PREFIX}/share/openttd

-FAKE_FLAGS=BUNDLE_DIR=${WRKINST}/bundle BUNDLES_DIR=${WRKINST}/bundle
-
WRKDIST = ${WRKDIR}/openttd-$V

DEBUG_PACKAGES = ${BUILD_PACKAGES}

post-install:
+ gunzip ${PREFIX}/man/man6/openttd.6.gz
${INSTALL_DATA_DIR} ${GAMEDIR}/media
cd ${WRKSRC}/media/ && umask 022 && pax -rw . ${GAMEDIR}/media
${INSTALL_DATA_DIR} ${EXAMPLESDIR}
Index: distinfo
===================================================================
RCS file: /cvs/ports/games/openttd/distinfo,v
retrieving revision 1.37
diff -u -p -r1.37 distinfo
--- distinfo 10 Aug 2020 21:10:35 -0000 1.37
+++ distinfo 1 Mar 2021 06:00:18 -0000
@@ -1,2 +1,2 @@
-SHA256 (openttd/openttd-1.10.3-source.tar.xz) = wRYB71R+sfbU+aA1vRngp2C0eHLOfZtBF6qkWsN3tTs=
-SIZE (openttd/openttd-1.10.3-source.tar.xz) = 6815924
+SHA256 (openttd/openttd-1.11.0-beta2-source.tar.xz) = QKJ0TWuYRahSI20fWXL5lP9tZRSJEeljmRJOcOBUKJg=
+SIZE (openttd/openttd-1.11.0-beta2-source.tar.xz) = 6844328
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-CMakeLists_txt 1 Mar 2021 06:00:18 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+Disable allegro support.
+Ours (4.2.3 at time of writing) is old and seemingly incompatible.
+Index: CMakeLists.txt
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -120,7 +120,6 @@ find_package(LZO)
+ find_package(PNG)
+
+ if(NOT WIN32)
+- find_package(Allegro)
+ if(NOT APPLE)
+ find_package(Freetype)
+ find_package(SDL2)
+@@ -249,7 +248,6 @@ if(NOT OPTION_DEDICATED)
+ link_package(Fluidsynth)
+ link_package(SDL)
+ link_package(SDL2 TARGET SDL2::SDL2)
+- link_package(Allegro)
+ link_package(FREETYPE TARGET Freetype::Freetype)
+ link_package(Fontconfig TARGET Fontconfig::Fontconfig)
+ link_package(ICU_lx)
Index: patches/patch-Makefile_bundle_in
===================================================================
RCS file: patches/patch-Makefile_bundle_in
diff -N patches/patch-Makefile_bundle_in
--- patches/patch-Makefile_bundle_in 7 Apr 2020 15:13:34 -0000 1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-Makefile_bundle_in,v 1.8 2020/04/07 15:13:34 solene Exp $
-
-Don't gzip(1) the manual page.
-
-Index: Makefile.bundle.in
---- Makefile.bundle.in.orig
-+++ Makefile.bundle.in
-@@ -75,7 +75,6 @@ endif
- ifdef MAN_DIR
- $(Q)mkdir -p "$(BUNDLE_DIR)/man/"
- $(Q)cp "$(ROOT_DIR)/docs/openttd.6" "$(BUNDLE_DIR)/man/"
-- $(Q)gzip -9 "$(BUNDLE_DIR)/man/openttd.6"
- endif
- $(Q)cp "$(ROOT_DIR)/media/openttd.32.xpm" "$(BUNDLE_DIR)/media/"
- $(Q)cp "$(ROOT_DIR)/media/openttd."*.png "$(BUNDLE_DIR)/media/"
-@@ -211,7 +210,7 @@ endif
- ifdef MAN_DIR
- ifndef DO_NOT_INSTALL_MAN
- $(Q)install -d "$(INSTALL_MAN_DIR)"
-- $(Q)install -m 644 "$(BUNDLE_DIR)/man/openttd.6.gz" "$(INSTALL_MAN_DIR)/${BINARY_NAME}.6.gz"
-+ $(Q)install -m 644 "$(BUNDLE_DIR)/man/openttd.6" "$(INSTALL_MAN_DIR)/${BINARY_NAME}.6"
- endif
- endif
- ifdef MENU_DIR
Index: patches/patch-config_lib
===================================================================
RCS file: patches/patch-config_lib
diff -N patches/patch-config_lib
--- patches/patch-config_lib 7 Apr 2020 15:13:34 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-config_lib,v 1.7 2020/04/07 15:13:34 solene Exp $
-Don't build with -O1. The reason they add it is irrevelant to OpenBSD anyway.
-Index: config.lib
---- config.lib.orig
-+++ config.lib
-@@ -1525,7 +1525,7 @@ make_cflags_and_ldflags() {
- cc_build_is_gcc=`basename "$cc_build" | grep "gcc" 2>/dev/null`
- if [ -n "$cc_build_is_gcc" ]; then
- # Just add -O1 to the tools needed for building.
-- CFLAGS_BUILD="$CFLAGS_BUILD -D_FORTIFY_SOURCE=2 -O1"
-+ CFLAGS_BUILD="$CFLAGS_BUILD -D_FORTIFY_SOURCE=2"
- if [ "$os" = "MINGW" ]; then
- # Prevent undefined references when _FORTIFY_SOURCE > 0
- LDFLAGS_BUILD="$LDFLAGS_BUILD -fstack-protector"
Index: patches/patch-src_core_endian_type_hpp
===================================================================
RCS file: patches/patch-src_core_endian_type_hpp
diff -N patches/patch-src_core_endian_type_hpp
--- patches/patch-src_core_endian_type_hpp 12 Feb 2020 10:23:36 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-src_core_endian_type_hpp,v 1.1 2020/02/12 10:23:36 cwen Exp $
-
-Fix endianness detection, see:
-https://github.com/OpenTTD/OpenTTD/pull/7996
-
-Index: src/core/endian_type.hpp
---- src/core/endian_type.hpp.orig
-+++ src/core/endian_type.hpp
-@@ -35,6 +35,13 @@
- # else
- # define TTD_ENDIAN TTD_BIG_ENDIAN
- # endif
-+#elif defined(__OpenBSD__)
-+# include <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
Index: patches/patch-src_string_func_h
===================================================================
RCS file: /cvs/ports/games/openttd/patches/patch-src_string_func_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-src_string_func_h
--- patches/patch-src_string_func_h 7 Apr 2020 15:13:34 -0000 1.4
+++ patches/patch-src_string_func_h 1 Mar 2021 06:00:18 -0000
@@ -3,7 +3,7 @@ Don't use openttd's internal copy of str
Index: src/string_func.h
--- src/string_func.h.orig
+++ src/string_func.h
-@@ -248,7 +248,7 @@ static inline bool IsWhitespace(WChar c)
+@@ -260,7 +260,7 @@ static inline bool IsWhitespace(WChar c)

No comments:

Post a Comment