pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/games/0ad



Module Name:    pkgsrc
Committed By:   nikita
Date:           Fri May  5 14:55:18 UTC 2023

Modified Files:
        pkgsrc/games/0ad: Makefile distinfo
        pkgsrc/games/0ad/patches: patch-build_premake_extern__libs5.lua
            patch-libraries_source_nvtt_src_CMakeLists.txt
Added Files:
        pkgsrc/games/0ad/patches: patch-build_premake_premake5.lua

Log Message:
0ad: fix part of the rpath issues + use pkgconfig for miniupnpc


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 pkgsrc/games/0ad/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/games/0ad/distinfo
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/games/0ad/patches/patch-build_premake_extern__libs5.lua \
    pkgsrc/games/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/games/0ad/patches/patch-build_premake_premake5.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/games/0ad/Makefile
diff -u pkgsrc/games/0ad/Makefile:1.5 pkgsrc/games/0ad/Makefile:1.6
--- pkgsrc/games/0ad/Makefile:1.5       Fri May  5 08:30:25 2023
+++ pkgsrc/games/0ad/Makefile   Fri May  5 14:55:18 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2023/05/05 08:30:25 nikita Exp $
+# $NetBSD: Makefile,v 1.6 2023/05/05 14:55:18 nikita Exp $
 
 .include "Makefile.common"
 
@@ -12,7 +12,7 @@ LICENSE=      gnu-gpl-v2 AND gnu-lgpl-v2.1
 WRKSRC=                ${WRKDIR}/${DISTNAME:S/-unix-build//}
 # Requires C++17 and add "--std" option itself
 GCC_REQD+=     7
-USE_LANGUAGES= c c++
+USE_LANGUAGES= c c++17
 
 USE_TOOLS+=    cmake bash gmake pax perl pkg-config
 
@@ -27,6 +27,12 @@ SUBST_FILES.sysincludedir=   build/premake
 SUBST_FILES.sysincludedir+=    build/premake/premake5.lua
 SUBST_SED.sysincludedir+=      -e "s,/usr/local/,${PREFIX}/,g"
 
+SUBST_CLASSES+=                        rpath
+SUBST_MESSAGE.rpath=           Adjusting rpath
+SUBST_STAGE.rpath=             pre-configure
+SUBST_FILES.rpath+=            build/premake/premake5.lua
+SUBST_SED.rpath+=              -e "s,@@PREFIXLIB@@,${PREFIX}/lib,g"
+
 # thanks to Guix:
 # 0ad only builds fine with a specific version of mozjs
 # (version 78.6 for 0ad-0.0.25).
@@ -67,6 +73,14 @@ BUILD_DIRS=  build/workspaces/gcc
 
 .include "options.mk"
 
+# currently fails to build with precompiled headers on
+# NetBSD with gcc.
+# .if ${PKGSRC_COMPILER:M} == "distcc"
+CONFIGURE_PCH?=                --without-pch
+# .else
+# CONFIGURE_PCH?=
+# .endif
+
 # nvtt, notes from gentoo:
 # Build bundled NVTT
 # nvtt is abandoned upstream and 0ad has forked it and added fixes.
@@ -79,34 +93,31 @@ do-configure:
                --libdir=${PREFIX}/lib/${PKGBASE} \
                --with-system-premake5 \
                --with-system-mozjs \
-               --without-pch \
-               ${CONFIGURE_EDITOR} ${CONFIGURE_TESTS}
+               ${CONFIGURE_PCH} ${CONFIGURE_EDITOR} ${CONFIGURE_TESTS}
 
 do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/binaries/system/pyrogenesis ${DESTDIR}${PREFIX}/bin
        ${INSTALL_SCRIPT} ${WRKSRC}/build/resources/0ad.sh ${DESTDIR}${PREFIX}/bin/0ad
 .if !empty(PKG_OPTIONS:Meditor)
        ${INSTALL_PROGRAM} ${WRKSRC}/binaries/system/ActorEditor ${DESTDIR}${PREFIX}/bin
-       # why? you have the rpath. don't produce nonsense?
-       ${PREFIX}/bin/patchelf --force-rpath --set-rpath \
-               ${PREFIX}/lib/${PKGBASE}:${PREFIX}/lib \
-               ${DESTDIR}${PREFIX}/bin/ActorEditor
+       # TODO: prevent this in the build-system.
        ${PREFIX}/bin/patchelf --replace-needed \
                "../../../binaries/system/libAtlasUI.so" libAtlasUI.so \
                ${DESTDIR}${PREFIX}/bin/ActorEditor
        cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} \
                libAtlasUI.so libAtlasObject.a ${DESTDIR}${PREFIX}/lib/${PKGBASE}
 .endif
-       # TODO: all of these should be .so.
-       cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} libatlas.a \
+       cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} \
+               libCollada.so libatlas.a \
                libengine.a libgladwrapper.a libglooxwrapper.a libgraphics.a \
                libgui.a liblobby.a liblowlevel.a libmocks_real.a libmocks_test.a \
                libmongoose.a libnetwork.a librlinterface.a libscriptinterface.a \
-               libsimulation2.a libtinygettext.a libCollada.so \
-               libnvcore.so libnvimage.so libnvmath.so libnvtt.so \
+               libsimulation2.a libtinygettext.a \
                ${DESTDIR}${PREFIX}/lib/${PKGBASE}
        # TODO: second part of rpath is missing after build
 .for f in libnvcore libnvimage libnvmath libnvtt
+       cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} \
+               ${f}.so ${DESTDIR}${PREFIX}/lib/${PKGBASE}
        ${PREFIX}/bin/patchelf \
                --force-rpath \
                --set-rpath ${PREFIX}/lib/${PKGBASE}:${PREFIX}/lib \

Index: pkgsrc/games/0ad/distinfo
diff -u pkgsrc/games/0ad/distinfo:1.2 pkgsrc/games/0ad/distinfo:1.3
--- pkgsrc/games/0ad/distinfo:1.2       Fri May  5 00:08:13 2023
+++ pkgsrc/games/0ad/distinfo   Fri May  5 14:55:18 2023
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.2 2023/05/05 00:08:13 nikita Exp $
+$NetBSD: distinfo,v 1.3 2023/05/05 14:55:18 nikita Exp $
 
 BLAKE2s (0ad-0.0.26-alpha-unix-build.tar.xz) = c731d26db0269bc9de34bf75705eb2031a105b676217a1da916c79c2d2237015
 SHA512 (0ad-0.0.26-alpha-unix-build.tar.xz) = aaf647d5d8454c244015d2a198beeaaebc571a5bc96446f3acff8dbd05f9843029c500bf4162651a5e1fcdb42bd5fb5b4f5c512c78372479fbd8565dd093f272
 Size (0ad-0.0.26-alpha-unix-build.tar.xz) = 75599800 bytes
-SHA1 (patch-build_premake_extern__libs5.lua) = e3d804571682c04cada5c39c11313874039ead72
+SHA1 (patch-build_premake_extern__libs5.lua) = 5f7d96cb825eaf1de991f584643a36485c20be82
+SHA1 (patch-build_premake_premake5.lua) = 1cc910e3a836377d8b9638916dea2bd9556f24f2
 SHA1 (patch-build_workspaces_clean-workspaces.sh) = 6c48565a0463d6f9e3ab914e2923811b121935cc
 SHA1 (patch-build_workspaces_update-workspaces.sh) = 4a6ec008da64a98230173f3a242cea2503321631
 SHA1 (patch-libraries_source_fcollada_include_FCDocument_FCDocument.h) = 96aef76c02ae4a3f47fdb7c31bf7d11490ba5d09
@@ -13,7 +14,7 @@ SHA1 (patch-libraries_source_fcollada_sr
 SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h) = fd181f746bba33ceb917a5de4794296c229213fc
 SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp) = f71f1f361601b2ce561c00a811d33bce6735a06d
 SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h) = 6887cca8e6ff1765a6b666bd595f8bcb41c2a90f
-SHA1 (patch-libraries_source_nvtt_src_CMakeLists.txt) = 2d956e3ae9f6ec5fc2db8a33f99d3ffc066a2e40
+SHA1 (patch-libraries_source_nvtt_src_CMakeLists.txt) = 396a5b06b588d7bff6cc751de074d71063de834d
 SHA1 (patch-libraries_source_nvtt_src_src_nvtt_CMakeLists.txt) = f42c1f4c57a3ef23a793a216f858b909dcf01e98
 SHA1 (patch-libraries_source_spidermonkey_build.sh) = 34225c82659cc236bff076301dd52adca9888f92
 SHA1 (patch-source_lib_allocators_page__aligned.cpp) = c25054afd543a1a90530964a63b2b692b1687765

Index: pkgsrc/games/0ad/patches/patch-build_premake_extern__libs5.lua
diff -u pkgsrc/games/0ad/patches/patch-build_premake_extern__libs5.lua:1.1 pkgsrc/games/0ad/patches/patch-build_premake_extern__libs5.lua:1.2
--- pkgsrc/games/0ad/patches/patch-build_premake_extern__libs5.lua:1.1  Thu May  4 15:20:52 2023
+++ pkgsrc/games/0ad/patches/patch-build_premake_extern__libs5.lua      Fri May  5 14:55:18 2023
@@ -1,13 +1,35 @@
-$NetBSD: patch-build_premake_extern__libs5.lua,v 1.1 2023/05/04 15:20:52 nikita Exp $
+$NetBSD: patch-build_premake_extern__libs5.lua,v 1.2 2023/05/05 14:55:18 nikita Exp $
 
---- build/premake/extern_libs5.lua.orig        2021-07-27 21:57:08.000000000 +0000
-+++ build/premake/extern_libs5.lua
-@@ -350,7 +350,7 @@ extern_lib_defs = {
+pkgsrc miniupnpc is new enough to have pkg-config files.
+get iconv from libc on FreeBSD and NetBSD.
+
+--- build/premake/extern_libs5.lua.orig        2022-08-21 14:45:49.000000000 +0200
++++ build/premake/extern_libs5.lua     2023-05-05 14:04:01.320479087 +0200
+@@ -372,7 +372,7 @@
                        elseif os.istarget("macosx") then
                                add_default_include_paths("iconv")
                                defines { "LIBICONV_STATIC" }
 -                      elseif os.getversion().description == "FreeBSD" then
-+                      elseif os.getversion().description == "NetBSD" then
++                      elseif os.getversion().description == "NetBSD" or os.getversion().description == "FreeBSD" then
                                -- On FreeBSD you need this flag to tell it to use the BSD libc iconv
                                defines { "LIBICONV_PLUG" }
                        end
+@@ -525,14 +525,13 @@
+                               add_default_links({
+                                       win_names  = { "miniupnpc" },
+                               })
+-                      elseif os.istarget("macosx") then
+-                              pkgconfig.add_links("miniupnpc")
+                       else
++                              pkgconfig.add_links("miniupnpc")
+                               -- Once miniupnpc v2.1 or better becomes near-universal (see above comment),
+                               -- we can use pkg-config for Linux and BSD.
+-                              add_default_links({
+-                                      unix_names = { "miniupnpc" },
+-                              })
++                              --add_default_links({
++                              --      unix_names = { "miniupnpc" },
++                              --})
+                       end
+               end,
+       },
Index: pkgsrc/games/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt
diff -u pkgsrc/games/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt:1.1 pkgsrc/games/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt:1.2
--- pkgsrc/games/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt:1.1 Fri May  5 00:08:13 2023
+++ pkgsrc/games/0ad/patches/patch-libraries_source_nvtt_src_CMakeLists.txt     Fri May  5 14:55:18 2023
@@ -1,19 +1,20 @@
-$NetBSD: patch-libraries_source_nvtt_src_CMakeLists.txt,v 1.1 2023/05/05 00:08:13 nikita Exp $
+$NetBSD: patch-libraries_source_nvtt_src_CMakeLists.txt,v 1.2 2023/05/05 14:55:18 nikita Exp $
 
-Revert patch by upstream.
 
---- libraries/source/nvtt/src/CMakeLists.txt.orig      2023-05-05 00:58:46.017561096 +0200
-+++ libraries/source/nvtt/src/CMakeLists.txt   2023-05-05 01:01:04.794683803 +0200
-@@ -42,12 +42,6 @@
+--- libraries/source/nvtt/src/CMakeLists.txt.orig      2022-09-23 22:36:55.000000000 +0200
++++ libraries/source/nvtt/src/CMakeLists.txt   2023-05-05 13:29:14.769485899 +0200
+@@ -42,11 +42,10 @@
        SET(NVIMAGE_SHARED TRUE)
  ENDIF(NVTT_SHARED)
  
 -SET(CMAKE_SKIP_BUILD_RPATH TRUE)
 -SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
 -SET(CMAKE_INSTALL_RPATH "$ORIGIN")
--SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
++SET(CMAKE_SKIP_BUILD_RPATH FALSE)
++SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
++SET(CMAKE_BUILD_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/0ad")
+ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 -SET(CMAKE_INSTALL_NAME_DIR "@executable_path")
--
+ 
  ADD_SUBDIRECTORY(extern)
  
- ADD_SUBDIRECTORY(src)

Added files:

Index: pkgsrc/games/0ad/patches/patch-build_premake_premake5.lua
diff -u /dev/null pkgsrc/games/0ad/patches/patch-build_premake_premake5.lua:1.1
--- /dev/null   Fri May  5 14:55:18 2023
+++ pkgsrc/games/0ad/patches/patch-build_premake_premake5.lua   Fri May  5 14:55:18 2023
@@ -0,0 +1,14 @@
+$NetBSD: patch-build_premake_premake5.lua,v 1.1 2023/05/05 14:55:18 nikita Exp $
+
+
+--- build/premake/premake5.lua.orig    2023-05-05 11:58:04.687082368 +0200
++++ build/premake/premake5.lua 2023-05-05 12:03:48.476951617 +0200
+@@ -386,7 +386,7 @@
+                       -- To use our local shared libraries, they need to be found in the
+                       -- runtime dynamic linker path. Add their path to -rpath.
+                       if _OPTIONS["libdir"] then
+-                              linkoptions {"-Wl,-rpath," .. _OPTIONS["libdir"] }
++                              linkoptions {"-Wl,-rpath," .. _OPTIONS["libdir"] .. " -Wl,-rpath,@@PREFIXLIB@@"}
+                       else
+                               -- On FreeBSD we need to allow use of $ORIGIN
+                               if os.istarget("bsd") then



Home | Main Index | Thread Index | Old Index