Punting stupid problems along forever just gets worse and worse.
In a decade, what will this mess look like?  It's so complicated
someone is going to break it in a different way.

> On Wed, Aug 09, 2017 at 04:21:34PM -0600, Theo de Raadt wrote:
> > That type of diff dissapoints me.  Upstreams should be told to follow API,
> > rather than ABI.
> 
> The real upstream of this uLong nonsense is zlib.net. They're not going
> to change it for me. And it wouldn't solve the issue of libpng linking
> against the wrong zlib.
> 
> Here is a different approach, filtering out all clashing symbols.
> 
> This seems to work great and is pretty unobtrusive, even if it's not all
> that elegant.
> 
> Index: Makefile
> ===================================================================
> RCS file: /home/vcs/cvs/openbsd/ports/games/tome4/Makefile,v
> retrieving revision 1.7
> diff -u -p -r1.7 Makefile
> --- Makefile  31 May 2017 08:08:16 -0000      1.7
> +++ Makefile  11 Aug 2017 21:52:39 -0000
> @@ -5,7 +5,7 @@ COMMENT-data =        data for Tales of Maj'Eya
>  
>  # '
>  
> -V =          1.5.1
> +V =          1.5.5
>  PKGNAME-main =       tome4-${V}
>  PKGNAME-data =       tome4-data-${V}
>  CATEGORIES = games x11
> @@ -42,6 +42,10 @@ WANTLIB-data =
>  COMPILER =   gcc
>  COMPILER_LANGS =     c
>  
> +# Disable luajit support where broken and missing. See also lang/luajit
> +.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "amd64"
> +CONFIGURE_ARGS += --lua=default
> +.endif
>  
>  NO_TEST =    Yes
>  
> @@ -57,7 +61,7 @@ do-configure:
>       sed -i 's/gcc /${CC} /g' ${WRKSRC}/build/te4core.lua
>       ${SUBST_CMD} ${WRKSRC}/src/getself.c
>       ${SUBST_CMD} ${WRKSRC}/premake4.lua
> -     @cd ${WRKSRC} ; premake4 gmake
> +     cd ${WRKSRC} ; premake4 ${CONFIGURE_ARGS} gmake
>  
>  do-install:
>       ${INSTALL_PROGRAM} ${WRKSRC}/t-engine ${PREFIX}/bin/tome4
> Index: distinfo
> ===================================================================
> RCS file: /home/vcs/cvs/openbsd/ports/games/tome4/distinfo,v
> retrieving revision 1.2
> diff -u -p -r1.2 distinfo
> --- distinfo  27 Mar 2017 18:28:29 -0000      1.2
> +++ distinfo  11 Aug 2017 21:52:39 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (t-engine4-src-1.5.1.tar.bz2) = 
> er5VbR72iQ0WrlO4KSwQWSVDopR6QCS7mjtnARp00Lg=
> -SIZE (t-engine4-src-1.5.1.tar.bz2) = 421336208
> +SHA256 (t-engine4-src-1.5.5.tar.bz2) = 
> A3zO5JMhPF4gdJ00gfVnbwUJlbtop7vYCu23fV17WGw=
> +SIZE (t-engine4-src-1.5.5.tar.bz2) = 421330688
> Index: patches/patch-build_exclude-zlib_ld
> ===================================================================
> RCS file: patches/patch-build_exclude-zlib_ld
> diff -N patches/patch-build_exclude-zlib_ld
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-build_exclude-zlib_ld       11 Aug 2017 21:52:39 -0000
> @@ -0,0 +1,28 @@
> +$OpenBSD$
> +
> +Fix black screen on 32bit archs because of zlib struct size mismatch 
> affecting
> +libpng and SDL2.
> +
> +Hide libz symbols of newer copy provided with the game.
> +
> +
> +Index: build/exclude-zlib.ld
> +--- build/exclude-zlib.ld.orig
> ++++ build/exclude-zlib.ld
> +@@ -0,0 +1,16 @@
> ++TOME {
> ++    local:
> ++            adler32; adler32_combine; compress; compress2; compressBound;
> ++            crc32; crc32_combine; deflate; deflateBound; deflateCopy;
> ++            deflateEnd; deflateInit2_; deflateInit_; deflateParams;
> ++            deflatePrime; deflateReset; deflateSetDictionary;
> ++            deflateSetHeader; deflateTune; get_crc_table; gzclearerr;
> ++            gzclose; gzdirect; gzdopen; gzeof; gzerror; gzflush; gzgetc;
> ++            gzgets; gzopen; gzprintf; gzputc; gzputs; gzread; gzrewind;
> ++            gzseek; gzsetparams; gztell; gzungetc; gzwrite; inflate;
> ++            inflateBack; inflateBackEnd; inflateBackInit_; inflateCopy;
> ++            inflateEnd; inflateGetHeader; inflateInit2_; inflateInit_;
> ++            inflatePrime; inflateReset; inflateSetDictionary; inflateSync;
> ++            inflateSyncPoint; inflate_fast; inflate_table; uncompress;
> ++            zError; zcalloc; zcfree; zlibCompileFlags; zlibVersion;
> ++};
> Index: patches/patch-build_te4core_lua
> ===================================================================
> RCS file: 
> /home/vcs/cvs/openbsd/ports/games/tome4/patches/patch-build_te4core_lua,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 patch-build_te4core_lua
> --- patches/patch-build_te4core_lua   28 Dec 2016 18:34:57 -0000      1.1.1.1
> +++ patches/patch-build_te4core_lua   11 Aug 2017 21:52:39 -0000
> @@ -1,6 +1,7 @@
>  $OpenBSD: patch-build_te4core_lua,v 1.1.1.1 2016/12/28 18:34:57 awolk Exp $
> ---- build/te4core.lua.orig   Fri Dec  2 11:29:13 2016
> -+++ build/te4core.lua        Fri Dec  2 11:29:23 2016
> +Index: build/te4core.lua
> +--- build/te4core.lua.orig
> ++++ build/te4core.lua
>  @@ -40,7 +40,7 @@ project "TEngine"
>       links { "physfs", "lua".._OPTIONS.lua, "fov", "luasocket", 
> "luaprofiler", "lpeg", "tcodimport", "lxp", "expatstatic", "luamd5", 
> "luazlib", "luabitop", "te4-bzip" }
>       defines { "_DEFAULT_VIDEOMODE_FLAGS_='SDL_HWSURFACE|SDL_DOUBLEBUF'" }
> @@ -10,3 +11,11 @@ $OpenBSD: patch-build_te4core_lua,v 1.1.
>   
>       if _OPTIONS.relpath=="32" then linkoptions{"-Wl,-rpath 
> -Wl,\\\$\$ORIGIN/lib "} end
>       if _OPTIONS.relpath=="64" then linkoptions{"-Wl,-rpath 
> -Wl,\\\$\$ORIGIN/lib64 "} end
> +@@ -126,6 +126,7 @@ project "TEngine"
> + 
> +     configuration "bsd"
> +             libdirs {"/usr/local/lib/"}
> ++            linkoptions { "-Wl,--version-script=exclude-zlib.ld" }
> +             links { "SDL2", "SDL2_ttf", "SDL2_image", "png", "openal", 
> "vorbisfile", "GL", "GLU", "m", "pthread" }
> +             defines { [[TENGINE_HOME_PATH='".t-engine"']], 'SELFEXE_BSD' }
> + 
> 

Reply via email to