Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Apr 2021 02:52:54 GMT
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 8c5a0d0eb2f4 - main - - Update OpenTTD to version 1.11.0 - Now requires C++17 and built with CMake - Finally, convert to options and helpers - Drop no longer needed Makefile targets
Message-ID:  <202104080252.1382qsOM028277@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8c5a0d0eb2f465e003a8b7109131329f7f8bea3f

commit 8c5a0d0eb2f465e003a8b7109131329f7f8bea3f
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2021-04-08 02:48:56 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2021-04-08 02:51:54 +0000

    - Update OpenTTD to version 1.11.0
    - Now requires C++17 and built with CMake
    - Finally, convert to options and helpers
    - Drop no longer needed Makefile targets
---
 games/openttd/Makefile                             | 137 ++++-----------------
 games/openttd/distinfo                             |   5 +-
 games/openttd/files/openttd.in                     |   2 +-
 .../files/patch-cmake_InstallAndPackage.cmake      |  19 +++
 games/openttd/files/patch-config.lib               |  82 ------------
 games/openttd/files/patch-icu68                    |  17 ---
 games/openttd/pkg-plist                            |   7 ++
 7 files changed, 51 insertions(+), 218 deletions(-)

diff --git a/games/openttd/Makefile b/games/openttd/Makefile
index fbc0f41e1dca..62f35a61a1d9 100644
--- a/games/openttd/Makefile
+++ b/games/openttd/Makefile
@@ -1,8 +1,7 @@
 # Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
 
 PORTNAME=	openttd
-DISTVERSION=	1.10.3
-PORTREVISION=	1
+DISTVERSION=	1.11.0
 CATEGORIES=	games
 MASTER_SITES=	https://proxy.binaries.openttd.org/openttd-releases/${DISTVERSION}/
 DISTNAME=	${PORTNAME}-${DISTVERSION}-source
@@ -15,130 +14,38 @@ LICENSE=	GPLv2
 LIB_DEPENDS=	libpng.so:graphics/png \
 		liblzo2.so:archivers/lzo2
 
-USES=		cpe gmake pkgconfig tar:xz
-HAS_CONFIGURE=	yes
-CONFIGURE_ENV=	STRIP="${STRIP_CMD} ${STRIP}"
-CONFIGURE_ARGS=	--prefix-dir="${PREFIX}" --data-dir="${DATADIR_REL}"
-MAKE_ARGS=	VERBOSE=1
+USES=		cmake compiler:c++17-lang cpe pkgconfig tar:xz
+CMAKE_ARGS=	-DCMAKE_INSTALL_BINDIR:PATH=bin \
+		-DCMAKE_INSTALL_DATADIR:PATH=share
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${DISTVERSION}
-CXXFLAGS=	# Set to empty as OpenTTD treats it as an addition to CFLAGS
 
 SUB_FILES=	pkg-message
 
-PORTDOCS=	README.md admin_network.md compiling_lang_files.md \
-		debugging_desyncs.md desync.md directory_structure.md \
-		changelog.txt elrail.svg elrail_tile.png elrail_track.png \
-		known-bugs.txt landscape.html landscape_externals.html \
-		landscape_grid.html logging_and_performance_metrics.md \
-		multiplayer.md obg_format.txt \
-		obm_format.txt obs_format.txt ottd-colourtext-palette.png \
-		tileh.png
-
 DESKTOP_ENTRIES="OpenTTD" "${COMMENT}" "${PORTNAME}" "${PORTNAME}" \
 		"Game;Simulation;StrategyGame;" false
 
-OPTIONS_DEFINE=	DOCS
-
-.if defined(WITH_MIDI_PLAYER)
-CONFIGURE_ARGS+=	--with-midi="${WITH_MIDI_PLAYER}"
-.endif
-
-.if defined(WITH_MIDI_PLAYER_ARGS)
-CONFIGURE_ARGS+=	--with-midi-arg="${WITH_MIDI_PLAYER_ARGS}"
-.endif
-
-.if defined(WITH_FLUIDSYNTH)
-LIB_DEPENDS+=	libfluidsynth.so:audio/fluidsynth
-.else
-CONFIGURE_ARGS+=	--without-fluidsynth
-.endif
-
-.if defined(WITH_DEDICATED_SERVER_ONLY)
-CONFIGURE_ARGS+=	--enable-dedicated
-# Aid it to find lzo2 headers; client build gets it via sdl-config
-CFLAGS+=	-I${LOCALBASE}/include
-USE_RC_SUBR=	${PORTNAME}
-.else
-CONFIGURE_ARGS+=	--with-sdl=sdl1
-USES+=		compiler:c++11-lib gnome sdl
-USE_CXXSTD=	gnu++11
-CXXFLAGS+=	-DU_USING_ICU_NAMESPACE=1
-LIB_DEPENDS+=	libfreetype.so:print/freetype2 \
-		libicui18n.so:devel/icu \
-		libicu-le-hb.so:devel/icu-le-hb \
-		libiculx.so:devel/icu-lx \
-		libfontconfig.so:x11-fonts/fontconfig
-USE_SDL=	sdl
-INSTALLS_ICONS=	yes
-.endif
+OPTIONS_DEFINE=	DOCS FLUIDSYNTH SAVE_PASSWORDS SERVER
+SERVER_PREVENTS=	FLUIDSYNTH
 
-.if defined(WITH_OPEN_GAME_FILES)
-RUN_DEPENDS+=	${LOCALBASE}/share/${PORTNAME}/baseset/opengfx/opengfx.obg:games/opengfx \
-		${LOCALBASE}/share/${PORTNAME}/baseset/openmsx/openmsx.obm:games/openmsx \
-		${LOCALBASE}/share/${PORTNAME}/baseset/opensfx/opensfx.obs:games/opensfx
-.endif
+FLUIDSYNTH_LIB_DEPENDS=	libfluidsynth.so:audio/fluidsynth
 
-.if defined(WITH_SAVE_PASSWORDS)
-EXTRA_PATCHES=	${FILESDIR}/extra-patch-save-passwords
-.endif
+SAVE_PASSWORDS_DESC=	Save passwords between server restarts
+SAVE_PASSWORDS_EXTRA_PATCHES=	${FILESDIR}/extra-patch-save-passwords
 
-.include <bsd.port.pre.mk>
+SERVER_DESC=		Build dedicated server only (no GUI)
+SERVER_USES_OFF=	gnome sdl
+SERVER_USE_OFF=		SDL=sdl
+SERVER_CMAKE_ON=	-DOPTION_DEDICATED:BOOL=ON
+SERVER_LIB_DEPENDS_OFF=	libfontconfig.so:x11-fonts/fontconfig \
+			libfreetype.so:print/freetype2 \
+			libicui18n.so:devel/icu \
+			libicu-le-hb.so:devel/icu-le-hb \
+			libiculx.so:devel/icu-lx
+SERVER_VARS=		USE_RC_SUBR=${PORTNAME}
+SERVER_VARS_OFF=	INSTALLS_ICONS=yes
 
-pre-everything::
-.if !defined(WITH_MIDI_PLAYER)
-	@${ECHO_MSG} "Define WITH_MIDI_PLAYER=/path/to/player to build with external MIDI player"
-.endif
-.if !defined(WITH_MIDI_PLAYER_ARGS)
-	@${ECHO_MSG} "Define WITH_MIDI_PLAYER_ARGS=arguments for external MIDI player"
-.endif
-.if !defined(WITH_FLUIDSYNTH)
-	@${ECHO_MSG} "Define WITH_FLUIDSYNTH to enable new Fluidsynth music driver"
-.endif
-.if !defined(WITH_DEDICATED_SERVER_ONLY)
-	@${ECHO_MSG} "Define WITH_DEDICATED_SERVER_ONLY to build CLI-based dedicated server"
-.endif
-.if !defined(WITH_OPEN_GAME_FILES)
-	@${ECHO_MSG} "Define WITH_OPEN_GAME_FILES to install with libre graphics, music, and sounds"
-.endif
-.if !defined(WITH_SAVE_PASSWORDS)
-	@${ECHO_MSG} "Define WITH_SAVE_PASSWORDS to save passwords between server restarts"
-.endif
-
-post-extract:
-	@${MV} ${WRKSRC}/README.md ${WRKSRC}/changelog.txt \
-		${WRKSRC}/known-bugs.txt ${WRKSRC}/docs
-
-post-patch:
-	@${REINPLACE_CMD} -e 's,/usr/local,${LOCALBASE},' ${WRKSRC}/config.lib
-	@${REINPLACE_CMD} -e 's,OSX,${OPSYS:tu},' ${WRKSRC}/Makefile.grf.in
-
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
-	@${MKDIR} ${STAGEDIR}${DATADIR}/ai ${STAGEDIR}${DATADIR}/baseset \
-		${STAGEDIR}${DATADIR}/game ${STAGEDIR}${DATADIR}/lang \
-		${STAGEDIR}${DATADIR}/scripts
-	${INSTALL_DATA} ${WRKSRC}/bin/ai/*.nut ${STAGEDIR}${DATADIR}/ai
-	${INSTALL_DATA} ${WRKSRC}/bin/baseset/* ${STAGEDIR}${DATADIR}/baseset
-	${INSTALL_DATA} ${WRKSRC}/bin/game/* ${STAGEDIR}${DATADIR}/game
-	${INSTALL_DATA} ${WRKSRC}/bin/lang/* ${STAGEDIR}${DATADIR}/lang
-	${INSTALL_DATA} ${WRKSRC}/bin/scripts/* ${STAGEDIR}${DATADIR}/scripts
-	${INSTALL_MAN} ${WRKSRC}/docs/${PORTNAME}.6 \
-		${STAGEDIR}${MANPREFIX}/man/man6
-.if !defined(WITH_DEDICATED_SERVER_ONLY)
-	${INSTALL_DATA} ${WRKSRC}/media/openttd.32.xpm \
-		${STAGEDIR}${PREFIX}/share/pixmaps
-.  for n in 16 32 48 64 128 256
-	@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps
-	${INSTALL_DATA} ${WRKSRC}/media/openttd.${n}.png \
-		${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps/openttd.png
-.  endfor
-.else
+post-install-SERVER-on:
 	@${REINPLACE_CMD} -E '/icons|pixmaps/d' ${TMPPLIST}
-.endif
-
-post-install-DOCS-on:
-	@${MKDIR} ${STAGEDIR}${DOCSDIR}
-	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/docs/,} ${STAGEDIR}${DOCSDIR}
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/games/openttd/distinfo b/games/openttd/distinfo
index 898af48e0206..ce172b03098e 100644
--- a/games/openttd/distinfo
+++ b/games/openttd/distinfo
@@ -1,3 +1,2 @@
-TIMESTAMP = 1596997202
-SHA256 (openttd-1.10.3-source.tar.xz) = c11601ef547eb1f6d4f9a035bd19e0a760b47872ce7d9b4117aaa45ac377b53b
-SIZE (openttd-1.10.3-source.tar.xz) = 6815924
+SHA256 (openttd-1.11.0-source.tar.xz) = 5e65184e07368ba1afa62dbb3e35abaee6c4da6730ff4bc9eb4447d53363c7a8
+SIZE (openttd-1.11.0-source.tar.xz) = 6805420
diff --git a/games/openttd/files/openttd.in b/games/openttd/files/openttd.in
index d436fc0bc1cb..cc15887baaad 100644
--- a/games/openttd/files/openttd.in
+++ b/games/openttd/files/openttd.in
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+#
 # PROVIDE: openttd
 # REQUIRE: LOGIN
 # KEYWORD: shutdown
diff --git a/games/openttd/files/patch-cmake_InstallAndPackage.cmake b/games/openttd/files/patch-cmake_InstallAndPackage.cmake
new file mode 100644
index 000000000000..270b498a63db
--- /dev/null
+++ b/games/openttd/files/patch-cmake_InstallAndPackage.cmake
@@ -0,0 +1,19 @@
+--- cmake/InstallAndPackage.cmake.orig	2021-04-01 12:33:44 UTC
++++ cmake/InstallAndPackage.cmake
+@@ -33,7 +33,6 @@ install(DIRECTORY
+         COMPONENT language_files)
+ 
+ install(FILES
+-                ${CMAKE_SOURCE_DIR}/COPYING.md
+                 ${CMAKE_SOURCE_DIR}/README.md
+                 ${CMAKE_SOURCE_DIR}/changelog.txt
+                 ${CMAKE_SOURCE_DIR}/docs/multiplayer.md
+@@ -58,7 +57,7 @@ if(OPTION_INSTALL_FHS)
+             COMPONENT manual)
+ endif()
+ 
+-if(UNIX AND NOT APPLE)
++if(UNIX AND NOT APPLE AND NOT OPTION_DEDICATED)
+     install(DIRECTORY
+                     ${CMAKE_BINARY_DIR}/media/icons
+                     ${CMAKE_BINARY_DIR}/media/pixmaps
diff --git a/games/openttd/files/patch-config.lib b/games/openttd/files/patch-config.lib
deleted file mode 100644
index f7ec57c342ca..000000000000
--- a/games/openttd/files/patch-config.lib
+++ /dev/null
@@ -1,82 +0,0 @@
---- config.lib.orig	2016-04-01 18:33:55 UTC
-+++ config.lib
-@@ -816,15 +816,15 @@ check_params() {
- 	pre_detect_with_lzma=$with_lzma
- 	detect_lzma
- 
--	if [ "$with_lzma" = "0" ] || [ -z "$lzma_config" ]; then
-+	if [ "$with_lzma" = "0" ] || [ -z "$lzma" ]; then
- 		log 1 "WARNING: lzma was not detected or disabled"
- 		log 1 "WARNING: OpenTTD doesn't require lzma, but it does mean that many features"
- 		log 1 "WARNING: (like loading most savegames/scenarios and joining most servers)"
- 		log 1 "WARNING: will be disabled."
- 		if [ "$pre_detect_with_lzma" = "0" ]; then
- 			log 1 "WARNING: We strongly suggest you to install liblzma."
--			log 1 "configure: error: no liblzma detected"
- 		else
-+			log 1 "configure: error: no liblzma detected"
- 			log 1 " If you want to compile without lzma use --without-lzma as parameter"
- 			exit
- 		fi
-@@ -1468,7 +1468,6 @@ make_cflags_and_ldflags() {
- 			# -fomit-frame-pointer and -pg do not go well together (gcc errors they are incompatible)
- 			CFLAGS="-fomit-frame-pointer $CFLAGS"
- 		fi
--		CFLAGS="-O2 $CFLAGS"
- 	else
- 		OBJS_SUBDIR="debug"
- 
-@@ -1675,16 +1674,14 @@ make_cflags_and_ldflags() {
- 		fi
- 	fi
- 
--	if [ -n "$lzma_config" ]; then
--		CFLAGS="$CFLAGS -DWITH_LIBLZMA"
--		CFLAGS="$CFLAGS `$lzma_config --cflags | tr '\n\r' '  '`"
--
--		if [ "$enable_static" != "0" ]; then
-+	if [ "$with_lzma" != "0" ]; then
-+		if [ "$enable_static" != "0" ] && [ "$os" != "OSX" ]; then
- 			CFLAGS="$CFLAGS -DLZMA_API_STATIC"
--			LIBS="$LIBS `$lzma_config --libs --static | tr '\n\r' '  '`"
-+			LIBS="$LIBS $lzma"
- 		else
--			LIBS="$LIBS `$lzma_config --libs | tr '\n\r' '  '`"
-+			LIBS="$LIBS -llzma"
- 		fi
-+		CFLAGS="$CFLAGS -DWITH_LIBLZMA"
- 	fi
- 
- 	if [ "$with_lzo2" != "0" ]; then
-@@ -2692,6 +2689,10 @@ detect_lzo2() {
- 	detect_library "$with_lzo2" "lzo2" "liblzo2.a" "lzo/" "lzo1x.h"
- }
- 
-+detect_lzma() {
-+	detect_library "$with_lzma" "lzma" "liblzma.a" "" "lzma.h"
-+}
-+
- detect_fluidsynth() {
- 	detect_library "$with_fluidsynth" "fluidsynth" "" "" "fluidsynth.h"
- }
-@@ -2756,10 +2757,6 @@ detect_pkg_config() {
- 	log 1 "checking $2... found"
- }
- 
--detect_lzma() {
--	detect_pkg_config "$with_lzma" "liblzma" "lzma_config" "5.0"
--}
--
- detect_xdg_basedir() {
- 	detect_pkg_config "$with_xdg_basedir" "libxdg-basedir" "xdg_basedir_config" "1.2"
- }
-@@ -3523,8 +3520,7 @@ showhelp() {
- 	echo "  --with-sdl[=\"pkg-config sdl\"]  enables SDL video driver support"
- 	echo "  --with-zlib[=\"pkg-config zlib\"]"
- 	echo "                                 enables zlib support"
--	echo "  --with-liblzma[=\"pkg-config liblzma\"]"
--	echo "                                 enables liblzma support"
-+	echo "  --with-liblzma[=liblzma.a]     enables liblzma support"
- 	echo "  --with-liblzo2[=liblzo2.a]     enables liblzo2 support"
- 	echo "  --with-png[=\"pkg-config libpng\"]"
- 	echo "                                 enables libpng support"
diff --git a/games/openttd/files/patch-icu68 b/games/openttd/files/patch-icu68
deleted file mode 100644
index 1c2fa15cf409..000000000000
--- a/games/openttd/files/patch-icu68
+++ /dev/null
@@ -1,17 +0,0 @@
-Regressed by https://github.com/unicode-org/icu/commit/c3fe7e09d844
-
-src/gfx_layout.cpp:119:9: error: use of undeclared identifier 'FALSE'
-        return FALSE;
-               ^
-
---- src/gfx_layout.cpp.orig	2020-08-09 17:56:38 UTC
-+++ src/gfx_layout.cpp
-@@ -116,7 +116,7 @@ void Font::getGlyphAdvance(LEGlyphID glyph, LEPoint &a
- 
- le_bool Font::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
- {
--	return FALSE;
-+	return false;
- }
- 
- /**
diff --git a/games/openttd/pkg-plist b/games/openttd/pkg-plist
index b4d8412f27ba..f02729341eae 100644
--- a/games/openttd/pkg-plist
+++ b/games/openttd/pkg-plist
@@ -1,5 +1,9 @@
 bin/openttd
 man/man6/openttd.6.gz
+%%PORTDOCS%%%%DOCSDIR%%/README.md
+%%PORTDOCS%%%%DOCSDIR%%/changelog.txt
+%%PORTDOCS%%%%DOCSDIR%%/known-bugs.txt
+%%PORTDOCS%%%%DOCSDIR%%/multiplayer.md
 %%DATADIR%%/ai/compat_0.7.nut
 %%DATADIR%%/ai/compat_1.0.nut
 %%DATADIR%%/ai/compat_1.1.nut
@@ -12,6 +16,7 @@ man/man6/openttd.6.gz
 %%DATADIR%%/ai/compat_1.8.nut
 %%DATADIR%%/ai/compat_1.9.nut
 %%DATADIR%%/ai/compat_1.10.nut
+%%DATADIR%%/ai/compat_1.11.nut
 %%DATADIR%%/baseset/no_music.obm
 %%DATADIR%%/baseset/no_sound.obs
 %%DATADIR%%/baseset/openttd.grf
@@ -34,6 +39,7 @@ man/man6/openttd.6.gz
 %%DATADIR%%/game/compat_1.8.nut
 %%DATADIR%%/game/compat_1.9.nut
 %%DATADIR%%/game/compat_1.10.nut
+%%DATADIR%%/game/compat_1.11.nut
 %%DATADIR%%/lang/afrikaans.lng
 %%DATADIR%%/lang/arabic_egypt.lng
 %%DATADIR%%/lang/basque.lng
@@ -106,3 +112,4 @@ share/icons/hicolor/64x64/apps/openttd.png
 share/icons/hicolor/128x128/apps/openttd.png
 share/icons/hicolor/256x256/apps/openttd.png
 share/pixmaps/openttd.32.xpm
+share/pixmaps/openttd.64.xpm



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104080252.1382qsOM028277>