On Fri, Apr 26, 2019 at 12:47:35PM +0100, Stuart Henderson wrote:
[...]
>
> This is now failing in builds done without network access (e.g. I ran
> into a failure on the i386 bulk build). If the internal copy of the
> geoip database is >30 days old, it tries to fetch a new one (via
> thirdparty/fetch-geoip-db.sh):
>
> ===> Configuring for openra-20190314p0
> ===> Building for openra-20190314p0
> Updating GeoIP country database from MaxMind.
> gmake: *** [Makefile:317: geoip-dependencies] Error 6
> *** Error 2 in games/openra (/usr/ports/infrastructure/mk/bsd.port.mk:2800
> '/usr/obj/ports/openra-20190314/.build_done')
> *** Error 1 in games/openra (/usr/ports/infrastructure/mk/bsd.port.mk:2466
> 'build')
> ===> Exiting games/openra with an error
> *** Error 1 in /usr/ports (infrastructure/mk/bsd.port.subdir.mk:137 'build')
> Error: job failed with 256 on i386-2 at 1556233372
>
> If it's not too awkward to patch it to use a non-gzipped file, I'd
> suggest removing the internal copy and makefile infrastructure,
> and replace with a RUN_DEPENDS on net/libmaxminddb,-db, and use
> ${LOCALSTATEDIR}/db/GeoIP/GeoLite2-Country.mmdb (either directly
> or via symlink).
Thanks for reporting this! Diff below addresses this by using
net/libmaxminddb,-db. I tested it with a quick multiplayer lobby and
multiplayer gameplay without noticing any issues.
In the process, I noticed that runtime failed because patches for
OpenAL-CS.dll.config and SharpFont.dll.config were removed that included needed
os lines (in revision from April 2nd), so re-add them. SDL2-CS.dll.config
doesn't need that because SDL2 claims to be linux.
ok?
Index: Makefile
===================================================================
RCS file: /cvs/ports/games/openra/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile 2 Apr 2019 18:52:40 -0000 1.2
+++ Makefile 26 Apr 2019 22:01:09 -0000
@@ -6,7 +6,7 @@ DISTNAME = openra-${V}
CATEGORIES = games x11
HOMEPAGE = https://www.openra.net
MAINTAINER = Thomas Frohwein <[email protected]>
-REVISION = 0
+REVISION = 1
# GPLv3 (openra)
# MIT (StyleCopPlus, StyleCop, SharpZipLib, NUnit, NUnit.Console, Open.Nat,
@@ -30,6 +30,7 @@ MODLUA_VERSION = 5.1
MODLUA_SA = Yes
BUILD_DEPENDS = net/curl
RUN_DEPENDS = devel/desktop-file-utils \
+ net/libmaxminddb,-db \
x11/gtk+3,-guic
LIB_DEPENDS = audio/openal \
devel/sdl2
@@ -37,9 +38,12 @@ USE_GMAKE = Yes
# Target 'test' only checks the official mods for erroneous yaml files
NO_TEST = Yes
+SUBST_VARS += LOCALSTATEDIR
+
do-gen:
${SUBST_CMD} ${WRKSRC}/launch-game.sh
${SUBST_CMD} ${WRKSRC}/launch-dedicated.sh
+ ${SUBST_CMD} ${WRKSRC}/OpenRA.Game/Network/GeoIP.cs
post-install:
cd ${WRKSRC} && ${MAKE_PROGRAM} install-linux-shortcuts
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/games/openra/patches/patch-Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-Makefile
--- patches/patch-Makefile 31 Mar 2019 05:09:06 -0000 1.1.1.1
+++ patches/patch-Makefile 26 Apr 2019 22:01:09 -0000
@@ -2,6 +2,8 @@ $OpenBSD: patch-Makefile,v 1.1.1.1 2019/
set the installdir to PREFIX/share rather than PREFIX/lib
don't get VERSION from git
+disable fetch-geoip-db.sh which is not compatible with building without network
+access
Index: Makefile
--- Makefile.orig
@@ -24,3 +26,12 @@ Index: Makefile
# dependencies
UNAME_S := $(shell uname -s)
+@@ -314,7 +314,7 @@ osx-dependencies: cli-dependencies geoip-dependencies
+ @ $(CP_R) thirdparty/download/osx/*.dll.config .
+
+ geoip-dependencies:
+- @./thirdparty/fetch-geoip-db.sh
++# @./thirdparty/fetch-geoip-db.sh
+ @ $(CP) thirdparty/download/GeoLite2-Country.mmdb.gz .
+
+ dependencies: $(os-dependencies)
Index: patches/patch-OpenRA_Game_Network_GeoIP_cs
===================================================================
RCS file: patches/patch-OpenRA_Game_Network_GeoIP_cs
diff -N patches/patch-OpenRA_Game_Network_GeoIP_cs
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-OpenRA_Game_Network_GeoIP_cs 26 Apr 2019 22:01:09 -0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+
+get geoip from the net/libmaxminddb,-db port per sthen@'s recommendation
+
+Index: OpenRA.Game/Network/GeoIP.cs
+--- OpenRA.Game/Network/GeoIP.cs.orig
++++ OpenRA.Game/Network/GeoIP.cs
+@@ -55,9 +55,9 @@ namespace OpenRA.Network
+ {
+ try
+ {
+- using (var fileStream = new
FileStream("GeoLite2-Country.mmdb.gz", FileMode.Open, FileAccess.Read))
+- using (var gzipStream = new
GZipInputStream(fileStream))
+- database = new
Reader(gzipStream);
++ using (var fileStream = new
FileStream("${LOCALSTATEDIR}/db/GeoIP/GeoLite2-Country.mmdb", FileMode.Open,
FileAccess.Read))
++ //using (var gzipStream = new
GZipInputStream(fileStream))
++ database = new
Reader(fileStream);
+ }
+ catch (Exception e)
+ {
+@@ -84,4 +84,4 @@ namespace OpenRA.Network
+ }
+ }
+ }
+-}
+\ No newline at end of file
++}
Index: patches/patch-thirdparty_download_OpenAL-CS_dll_config
===================================================================
RCS file: patches/patch-thirdparty_download_OpenAL-CS_dll_config
diff -N patches/patch-thirdparty_download_OpenAL-CS_dll_config
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-thirdparty_download_OpenAL-CS_dll_config 26 Apr 2019
22:01:09 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+add openbsd to dllmap
+
+Index: thirdparty/download/OpenAL-CS.dll.config
+--- thirdparty/download/OpenAL-CS.dll.config.orig
++++ thirdparty/download/OpenAL-CS.dll.config
+@@ -3,4 +3,5 @@
+ <dllmap dll="soft_oal.dll" os="windows" target="soft_oal.dll"/>
+ <dllmap dll="soft_oal.dll" os="osx"
target="/System/Library/Frameworks/OpenAL.framework/OpenAL"/>
+ <dllmap dll="soft_oal.dll" os="linux" target="libopenal.so.1"/>
++ <dllmap dll="soft_oal.dll" os="openbsd" target="libopenal.so.1"/>
+ </configuration>
Index: patches/patch-thirdparty_download_SharpFont_dll_config
===================================================================
RCS file: patches/patch-thirdparty_download_SharpFont_dll_config
diff -N patches/patch-thirdparty_download_SharpFont_dll_config
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-thirdparty_download_SharpFont_dll_config 26 Apr 2019
22:01:09 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+add openbsd to dllmap
+
+Index: thirdparty/download/SharpFont.dll.config
+--- thirdparty/download/SharpFont.dll.config.orig
++++ thirdparty/download/SharpFont.dll.config
+@@ -3,4 +3,5 @@
+ <dllmap dll="freetype6" os="linux" target="libfreetype.so.6" />
+ <dllmap dll="freetype6" os="osx"
target="/Library/Frameworks/Mono.framework/Libraries/libfreetype.6.dylib" />
+ <dllmap dll="freetype6" os="freebsd" target="libfreetype.so.6" />
++ <dllmap dll="freetype6" os="openbsd" target="libfreetype.so.6" />
+ </configuration>
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/games/openra/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST 31 Mar 2019 05:09:06 -0000 1.1.1.1
+++ pkg/PLIST 26 Apr 2019 22:01:09 -0000
@@ -35,7 +35,6 @@ share/openra/COPYING
share/openra/Eluant.dll
share/openra/Eluant.dll.config
share/openra/FuzzyLogicLibrary.dll
-share/openra/GeoLite2-Country.mmdb.gz
share/openra/ICSharpCode.SharpZipLib.dll
share/openra/MaxMind.Db.dll
share/openra/Open.Nat.dll