On Sat, Jun 18, 2016 at 03:54:45PM -0400, Daniel Wilkins wrote: > The old version was something like 3 years old and 2000 weeklies behind. > I've talked to the dev and it now builds cleanly without patches(or rather, > I made the changes needed and got it merged into the project.) > > Now it'll actually run the official expansions properly, as well as all the > other additions since 2013. > >
Here is a patch against current ports cvs triggered by Daniel's update. WANTLIB and LIB_DEPENDS have been regenerated. the do-install paths have been corrected, I removed the dos2unix stuff as I don't think it is that big a deal in the end, and it matches upstream. The datafile path substitutions have been reduced to one file (yay), and perl has been switched out in lieu of sed. Unfortunately the Makefile.common has some mean tricks to really break our ability to feed CC/CXX, so I did some hack'n'slash patching of it. I am not sure that this is best, I have employed their recommended PACKAGE_REPOSITORY=1 setting to 'not completely gut all their optimizations'.. but I'd love it if anyone can confirm its okay :-) looks to just use -O2. Turning on aggressive debugging things like DEBUGANYWAY kinda broke mouse input making it really hard to play, so avoiding that path. Lastly I think we need to use ports gcc now. works good here on current amd64 Cheers! -ryan ? eduke32.diff Index: Makefile =================================================================== RCS file: /cvs/ports/games/eduke32/Makefile,v retrieving revision 1.7 diff -u -p -r1.7 Makefile --- Makefile 22 Oct 2014 13:55:07 -0000 1.7 +++ Makefile 19 Jun 2016 06:43:09 -0000 @@ -1,12 +1,11 @@ # $OpenBSD: Makefile,v 1.7 2014/10/22 13:55:07 jasper Exp $ COMMENT = Enhanced Duke Nukem 3D engine -RDATE = 20120301 -RTAG = 2394 +RDATE = 20160610 +RTAG = 5775 DISTNAME = eduke32_src_${RDATE}-${RTAG} PKGNAME = eduke32-2.0.0.${RTAG} -REVISION = 2 -EXTRACT_SUFX = .tar.bz2 +EXTRACT_SUFX = .tar.xz CATEGORIES = games x11 HOMEPAGE = http://www.eduke32.com/ @@ -25,12 +24,15 @@ BUILD_DEPENDS = archivers/unzip \ BUILD_DEPENDS += devel/nasm .endif -WANTLIB = SDL c m pthread stdc++ SDL_mixer>=3 vorbisfile vpx +WANTLIB += c m ogg png pthread vorbis vorbisfile vpx z +WANTLIB += SDL2 SDL2_mixer FLAC execinfo LIB_DEPENDS = audio/libvorbis \ - multimedia/libvpx \ - devel/sdl \ - devel/sdl-mixer + audio/flac \ + devel/sdl2 \ + devel/sdl2-mixer \ + devel/libexecinfo \ + multimedia/libvpx # dlopen()'d; shows as Extra in check-lib-depends but it is used LIB_DEPENDS += x11/gtk+2 @@ -38,31 +40,23 @@ WANTLIB += gtk-x11-2.0 RUN_DEPENDS = games/duke3ddata -MASTER_SITES = http://dukeworld.duke4.net/eduke32/synthesis/old/${RDATE}-${RTAG}/ \ - http://dukeworld.duke4.net/eduke32/synthesis/${RDATE}-${RTAG}/ +MASTER_SITES = http://dukeworld.duke4.net/eduke32/synthesis/${RDATE}-${RTAG}/ + +MODULES = gcc4 +MODGCC4_LANGS = c c++ +MODGCC4_ARCHS = * # make sure we can see compilation output, respect CC/CXX, don't strip! -MAKE_FLAGS = PRETTY_OUTPUT=0 CC="${CC}" CXX="${CXX}" DEBUGANYWAY=1 +MAKE_ENV = CC="${CC}" CXX="${CXX}" PRETTY_OUTPUT=0 PACKAGE_REPOSITORY=1 USE_GMAKE = Yes NO_TEST = Yes -WRKDIST = ${WRKDIR}/eduke32_${RDATE}-${RTAG}/ +WRKDIST = ${WRKDIR}/eduke32_${RDATE}-${RTAG} post-extract: # check for data files in correct location - @perl -pi -e "s,/usr/share/games/eduke32,${TRUEPREFIX}/share/duke3d," \ - ${WRKSRC}/source/astub.c - @perl -pi -e "s,/usr/share/games/eduke32,${TRUEPREFIX}/share/duke3d," \ - ${WRKSRC}/source/game.c - @perl -pi -e "s,./eduke32,eduke32," ${WRKSRC}/build/include/editor.h - # make plaintext files less annoying to read... - @perl -MExtUtils::Command -e dos2unix \ - ${WRKSRC}/tiles.cfg \ - ${WRKSRC}/names.h \ - ${WRKSRC}/GNU.TXT \ - ${WRKSRC}/buildlic.txt \ - ${WRKSRC}/samples/*.sample \ - ${WRKSRC}/samples/*.txt + @sed -i "s,/usr/share/games/eduke32,${TRUEPREFIX}/share/duke3d," \ + ${WRKSRC}/source/common.c do-install: ${INSTALL_PROGRAM} ${WRKBUILD}/eduke32 ${PREFIX}/bin @@ -71,17 +65,25 @@ do-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/eduke32 ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/eduke32 # mapster32 help files - ${INSTALL_DATA} ${WRKDIST}/m32help.hlp ${PREFIX}/share/duke3d/ - ${INSTALL_DATA} ${WRKDIST}/SEHELP.HLP ${PREFIX}/share/duke3d/ - ${INSTALL_DATA} ${WRKDIST}/STHELP.HLP ${PREFIX}/share/duke3d/ + ${INSTALL_DATA} ${WRKDIST}/package/sdk/m32help.hlp \ + ${PREFIX}/share/duke3d/ + ${INSTALL_DATA} ${WRKDIST}/package/sdk/SEHELP.HLP \ + ${PREFIX}/share/duke3d/ + ${INSTALL_DATA} ${WRKDIST}/package/sdk/STHELP.HLP \ + ${PREFIX}/share/duke3d/ # mapster32 config and config header file - ${INSTALL_DATA} ${WRKDIST}/tiles.cfg ${PREFIX}/share/duke3d/ - ${INSTALL_DATA} ${WRKDIST}/names.h ${PREFIX}/share/duke3d/ + ${INSTALL_DATA} ${WRKDIST}/package/sdk/tiles.cfg \ + ${PREFIX}/share/duke3d/ + ${INSTALL_DATA} ${WRKDIST}/package/sdk/names.h \ + ${PREFIX}/share/duke3d/ # eduke32/mapster32 licenses - ${INSTALL_DATA} ${WRKDIST}/GNU.TXT ${PREFIX}/share/doc/eduke32/ - ${INSTALL_DATA} ${WRKDIST}/buildlic.txt ${PREFIX}/share/doc/eduke32/ + ${INSTALL_DATA} ${WRKDIST}/package/common/gpl-2.0.txt \ + ${PREFIX}/share/doc/eduke32/ + ${INSTALL_DATA} ${WRKDIST}/package/common/buildlic.txt \ + ${PREFIX}/share/doc/eduke32/ # sample game mapping/modding data files - ${INSTALL_DATA} ${WRKDIST}/samples/* ${PREFIX}/share/examples/eduke32/ + ${INSTALL_DATA} ${WRKDIST}/package/sdk/samples/* \ + ${PREFIX}/share/examples/eduke32/ .if ${MACHINE_ARCH:Mi386} CFLAGS += -fno-pie Index: distinfo =================================================================== RCS file: /cvs/ports/games/eduke32/distinfo,v retrieving revision 1.2 diff -u -p -r1.2 distinfo --- distinfo 2 Mar 2013 13:03:17 -0000 1.2 +++ distinfo 19 Jun 2016 06:43:09 -0000 @@ -1,2 +1,2 @@ -SHA256 (eduke32_src_20120301-2394.tar.bz2) = zuxpT5DIOfFCCG2jzlRpAAcIaj+pGPAhSAEZEICypGc= -SIZE (eduke32_src_20120301-2394.tar.bz2) = 3200173 +SHA256 (eduke32_src_20160610-5775.tar.xz) = znVDHKAUXxw3k01ck0OTmC8ntqpkYZpAI85U5P1QyPk= +SIZE (eduke32_src_20160610-5775.tar.xz) = 14532340 Index: patches/patch-Makefile_common =================================================================== RCS file: /cvs/ports/games/eduke32/patches/patch-Makefile_common,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-Makefile_common --- patches/patch-Makefile_common 17 Jul 2012 21:29:50 -0000 1.1.1.1 +++ patches/patch-Makefile_common 19 Jun 2016 06:43:09 -0000 @@ -1,14 +1,73 @@ -$OpenBSD: patch-Makefile_common,v 1.1.1.1 2012/07/17 21:29:50 rfreeman Exp $ - -Use default optimisation options. - ---- Makefile.common.orig Fri Mar 9 06:15:40 2012 -+++ Makefile.common Fri Mar 9 06:16:13 2012 -@@ -89,7 +89,6 @@ endif - - ifneq (0,$(RELEASE)) - # Debugging disabled -- debug+= -O$(OPTLEVEL) - ifneq ($(CC),clang) - debug+= -funswitch-loops +$OpenBSD$ +--- Makefile.common.orig Sat Jun 4 21:46:28 2016 ++++ Makefile.common Sat Jun 18 23:37:57 2016 +@@ -7,35 +7,19 @@ PRETTY_OUTPUT ?= 1 + + # Tools + CROSS= +-ifneq ($(CROSS),) +- undefine CC +- undefine CXX +- undefine AR +- undefine RC +- undefine RANLIB +- undefine STRIP +-endif + +-CC=$(CROSS)gcc +-CXX=$(CROSS)g++ +-AR=$(CROSS)ar +-RC=$(CROSS)windres +-RANLIB=$(CROSS)ranlib +-STRIP=$(CROSS)strip +-AS=nasm +-PKG_CONFIG=pkg-config ++CC?=$(CROSS)gcc ++CXX?=$(CROSS)g++ ++AR?=$(CROSS)ar ++RC?=$(CROSS)windres ++RANLIB?=$(CROSS)ranlib ++STRIP= ++AS?=nasm ++PKG_CONFIG?=pkg-config + + DONT_PRINT = > /dev/null 2>&1 + DONT_FAIL = ; exit 0 + +-# Override defaults that absolutely will not work. +-ifeq ($(CC),cc) +- override CC=gcc +-endif +-ifeq ($(AS),as) +- override AS=nasm +-endif +- + COBJC=$(CC) -x objective-c + COBJCXX=$(CXX) -x objective-c++ + L_CC=$(CC) +@@ -283,14 +267,9 @@ GUI_LIBS= + LIBDIRS= + + ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4))) +- F_NO_STACK_PROTECTOR := -fno-stack-protector +- # there are some link-time issues with stack protectors, so make it possible to override +- F_STACK_PROTECTOR_ALL ?= -fstack-protector-all + ifeq (0,$(CLANG)) + F_JUMP_TABLES := -fjump-tables endif +- M_TUNE_GENERIC := -mtune=generic +- M_STACKREALIGN := -mstackrealign + endif + + W_STRICT_OVERFLOW := -Wno-strict-overflow +@@ -663,10 +642,6 @@ DLLSUFFIX=.so + + SDL_TARGET ?= 2 + SDL_FRAMEWORK ?= 0 +- +-ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4))) +- L_SSP := -lssp +-endif + + # ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 5))) + # ifneq (0,$(LTO)) Index: patches/patch-build_Makefile_shared =================================================================== RCS file: patches/patch-build_Makefile_shared diff -N patches/patch-build_Makefile_shared --- patches/patch-build_Makefile_shared 17 Jul 2012 21:29:50 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,32 +0,0 @@ -$OpenBSD: patch-build_Makefile_shared,v 1.1.1.1 2012/07/17 21:29:50 rfreeman Exp $ - -Default optimisations. - ---- build/Makefile.shared.orig Fri Dec 9 14:08:47 2011 -+++ build/Makefile.shared Fri Mar 9 05:59:46 2012 -@@ -21,24 +21,14 @@ BUILDCFLAGS= - # This is easier than trying to squeeze it out of gcc --version: - GCC_MAJOR ?= 4 - ifeq (4,$(GCC_MAJOR)) -- F_NO_STACK_PROTECTOR := -fno-stack-protector -- # there are some link-time issues with stack protectors, so make it possible to override -- F_STACK_PROTECTOR_ALL ?= -fstack-protector-all - ifneq ($(CC),clang) - F_JUMP_TABLES := -fjump-tables - endif -- M_TUNE_GENERIC := -mtune=generic -- M_STACKREALIGN := -mstackrealign -- L_SSP := -lssp - endif - - - ifndef ARCH -- ifeq ($(findstring i686, $(shell uname -m)), i686) -- ARCH=-march=pentium3 $(M_TUNE_GENERIC) -mmmx # -msse2 -mfpmath=sse,387 -malign-double $(M_STACKREALIGN) -- else -- ARCH= -- endif -+ ARCH= - endif - - # Detect the platform if it wasn't explicitly given to us from Index: patches/patch-build_include_compat_h =================================================================== RCS file: patches/patch-build_include_compat_h diff -N patches/patch-build_include_compat_h --- patches/patch-build_include_compat_h 1 May 2015 16:51:25 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,28 +0,0 @@ -$OpenBSD: patch-build_include_compat_h,v 1.2 2015/05/01 16:51:25 ajacoutot Exp $ - -this is committed upstream as of 2012-08-18, fixes build on hppa, ppc - ---- build/include/compat.h.orig Thu Aug 9 04:05:30 2012 -+++ build/include/compat.h Thu Aug 9 04:11:36 2012 -@@ -140,7 +140,20 @@ static inline float nearbyintf(float x) - # endif - # define B_ENDIAN_C_INLINE 1 - --#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) -+#elif defined(__OpenBSD__) -+# include <endian.h> -+# if _BYTE_ORDER == _LITTLE_ENDIAN -+# define B_LITTLE_ENDIAN 1 -+# define B_BIG_ENDIAN 0 -+# elif _BYTE_ORDER == _BIG_ENDIAN -+# define B_LITTLE_ENDIAN 0 -+# define B_BIG_ENDIAN 1 -+# endif -+# define B_SWAP64(x) __swap64(x) -+# define B_SWAP32(x) __swap32(x) -+# define B_SWAP16(x) __swap16(x) -+ -+#elif defined(__FreeBSD__) || defined(__NetBSD__) - # include <sys/endian.h> - # if _BYTE_ORDER == _LITTLE_ENDIAN - # define B_LITTLE_ENDIAN 1 Index: patches/patch-build_src_dynamicgtk_c =================================================================== RCS file: patches/patch-build_src_dynamicgtk_c diff -N patches/patch-build_src_dynamicgtk_c --- patches/patch-build_src_dynamicgtk_c 13 Jan 2013 09:26:35 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-build_src_dynamicgtk_c,v 1.1 2013/01/13 09:26:35 sthen Exp $ ---- build/src/dynamicgtk.c.orig Fri Jan 11 23:10:36 2013 -+++ build/src/dynamicgtk.c Fri Jan 11 23:10:42 2013 -@@ -20,7 +20,7 @@ int32_t dynamicgtk_init(void) - - if (handle) return 1; - -- handle = dlopen("libgtk-x11-2.0.so.0", RTLD_NOW|RTLD_GLOBAL); -+ handle = dlopen("libgtk-x11-2.0.so", RTLD_NOW|RTLD_GLOBAL); - if (!handle) return -1; - - memset(&dynamicgtksyms, 0, sizeof(dynamicgtksyms)); Index: patches/patch-build_src_glbuild_c =================================================================== RCS file: patches/patch-build_src_glbuild_c diff -N patches/patch-build_src_glbuild_c --- patches/patch-build_src_glbuild_c 17 Jul 2012 21:29:50 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,25 +0,0 @@ -$OpenBSD: patch-build_src_glbuild_c,v 1.1.1.1 2012/07/17 21:29:50 rfreeman Exp $ - -allow dlopen to find our libGL.so, falling back to libGL.so.1 for -linux or others. - ---- build/src/glbuild.c.orig Tue Oct 11 17:52:53 2011 -+++ build/src/glbuild.c Fri Mar 9 01:12:27 2012 -@@ -338,6 +338,8 @@ int32_t loadgldriver(const char *driver) - driver = "opengl32.dll"; - #elif defined __APPLE__ - driver = "/System/Library/Frameworks/OpenGL.framework/OpenGL"; -+#elif defined __OpenBSD__ -+ driver = "libGL.so"; - #else - driver = "libGL.so.1"; - #endif -@@ -936,6 +938,8 @@ int32_t loadglulibrary(const char *driver) - driver = "glu32.dll"; - #elif defined __APPLE__ - driver = "/System/Library/Frameworks/OpenGL.framework/OpenGL"; // FIXME: like I know anything about Apple. Hah. -+#elif defined __OpenBSD__ -+ driver = "libGLU.so"; - #else - driver = "libGLU.so.1"; - #endif Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/games/eduke32/pkg/PLIST,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 PLIST --- pkg/PLIST 17 Jul 2012 21:29:50 -0000 1.1.1.1 +++ pkg/PLIST 19 Jun 2016 06:43:09 -0000 @@ -2,8 +2,8 @@ @bin bin/eduke32 @bin bin/mapster32 share/doc/eduke32/ -share/doc/eduke32/GNU.TXT share/doc/eduke32/buildlic.txt +share/doc/eduke32/gpl-2.0.txt share/doc/pkg-readmes/${FULLPKGNAME} share/duke3d/SEHELP.HLP share/duke3d/STHELP.HLP @@ -13,11 +13,17 @@ share/duke3d/tiles.cfg share/examples/eduke32/ share/examples/eduke32/_clipshape0.map share/examples/eduke32/a.m32 +share/examples/eduke32/aspect.map share/examples/eduke32/duke3d.def.sample +share/examples/eduke32/dump_used_assets.m32 share/examples/eduke32/enhance.con.sample share/examples/eduke32/m32script_ex.map +share/examples/eduke32/r_usenewshading.map share/examples/eduke32/ror.map +share/examples/eduke32/splitscr.con share/examples/eduke32/spriteclip.txt +share/examples/eduke32/startpos.m32 +share/examples/eduke32/test_tileoffsets.map share/examples/eduke32/tests.m32 share/examples/eduke32/trueror1.map share/examples/eduke32/weapons.con.sample