guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 105b32739872bc80c46a15b07fe1002f0a678856
Author: bdunahu <[email protected]>
AuthorDate: Tue Jun 9 21:24:12 2026 -0400
gnu: warzone2100: Switch to git-fetch.
*
gnu/packages/patches/warzone2100-pass-vcs-configure-flags-to-autorevision.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/games.scm (warzone2100)[source]<origin>: Apply it.
Switch to git fetch.
Don't delete now unused modules.
<#:configure-flags>: Whitespace changes.
Add “-DVCS_WC_MODIFIED=0”, “-DVCS_MOST_RECENT_COMMIT_DATE=1970-01-01”,
“-DVCS_FULL_HASH=a…a”, “-DVCS_SHORT_HASH=aaaaaa”, “-DVCS_TAG=$version”,
“-DVCS_EXTRA=$version”, “-DVCS_MOST_RECENT_TAGGED_VERSION=$version”.
<#:phases>: Add ‘make-autorevision-cache’.
Signed-off-by: Liliana Marie Prikler <[email protected]>
Merges: guix/guix#8486
---
gnu/local.mk | 1 +
gnu/packages/games.scm | 103 +++++++++------------
...-pass-vcs-configure-flags-to-autorevision.patch | 35 +++++++
3 files changed, 82 insertions(+), 57 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index cc581b5a42..26818b8679 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2648,6 +2648,7 @@ dist_patch_DATA =
\
%D%/packages/patches/vtk-7-python-compat.patch \
%D%/packages/patches/vulkan-tools-wayland-1.24.patch \
%D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch \
+
%D%/packages/patches/warzone2100-pass-vcs-configure-flags-to-autorevision.patch
\
%D%/packages/patches/warzone2100-unbundle-basis-universal.patch \
%D%/packages/patches/warzone2100-unbundle-embedded-json-signature.patch
\
%D%/packages/patches/warzone2100-unbundle-launchinfo.patch \
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 1f389e9163..ccade7d4b2 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -7391,49 +7391,17 @@ fighting over what remains.")
(version "4.7.0")
(source
(origin
- (method url-fetch)
- (uri (string-append "mirror://sourceforge/warzone2100/releases/"
- version "/warzone2100_src.tar.xz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Warzone2100/warzone2100")
+ (commit version)))
+ (file-name (git-file-name name version))
(modules '((guix build utils)))
(snippet
- #~(begin (with-directory-excursion "lib"
- (for-each delete-file-recursively
- '("netplay/3rdparty/miniupnp"
- "sound/3rdparty/opusfile"
- "ivis_opengl/3rdparty/libjpeg-turbo")))
- (with-directory-excursion "data"
- (for-each delete-file-recursively
- '("fonts"
- "base/texpages"
- "terrain_overrides/classic"
- "terrain_overrides/high"
- "music"
- "mods/campaign/reclamation"
- "mods/campaign/fractured-kingdom")))
- (with-directory-excursion "3rdparty"
- (for-each delete-file-recursively
- '("basis_universal"
- "basis_universal_host_build"
- "date"
- "discord-rpc"
- "EmbeddedJSONSignature"
- "expected"
- "fmt"
- "GameNetworkingSockets"
- "glm"
- "inih"
- "launchinfo"
- "libplum"
- "quickjs-wz"
- "re2"
- "readerwriterqueue"
- "SQLiteCpp"
- "utf8proc"
- "utfcpp")))
- (substitute* (list "src/stdinreader.cpp"
- "lib/netplay/netreplay.cpp")
- ;; Trivially unbundles readerwriterqueue.
- (("3rdparty/(readerwriterqueue)" _ f) f))))
+ #~(substitute* (list "src/stdinreader.cpp"
+ "lib/netplay/netreplay.cpp")
+ ;; Trivially unbundles readerwriterqueue.
+ (("3rdparty/(readerwriterqueue)" _ f) f)))
(patches (search-patches "warzone2100-unbundle-basis-universal.patch"
"warzone2100-unbundle-embedded-json-signature.patch"
"warzone2100-unbundle-libs.patch"
@@ -7441,29 +7409,42 @@ fighting over what remains.")
"warzone2100-unbundle-launchinfo.patch"
"warzone2100-unbundle-quickjs-wz.patch"
"warzone2100-unbundle-sqlitecpp.patch"
- "warzone2100-unbundle-utfcpp.patch"))
+ "warzone2100-unbundle-utfcpp.patch"
+ ;; Makes autorevision work with configure
flags.
+
"warzone2100-pass-vcs-configure-flags-to-autorevision.patch"))
(sha256
(base32
- "0dsfgjwrxyzpr5d6114b8ni0i3h2hkm6f2r3ryqs23k8i1dlvvlm"))))
+ "04vdqfmxav0cls3jn5jjpjq514r27kj5pc63pwlsszx00wfz9a4r"))))
(build-system cmake-build-system)
(arguments
(list
;; TODO: Tests seem to be broken, configure.ac is missing.
#:tests? #f
- #:configure-flags #~'("-GNinja"
- "-DWZ_DISTRIBUTOR=GNU Guix"
- "-DWZ_DOWNLOAD_PREBUILT_PACKAGES=off"
- "-DWZ_INCLUDE_VIDEOS=off"
- "-DWZ_FORCE_MINIMAL_OPUSFILE=off"
- "-DENABLE_GNS_NETWORK_BACKEND=off"
- "-DWZ_USE_SYSTEM_LIBJPEG_TURBO=on"
- ;; Do not automatically install
- ;; additional campaigns.
- "-DWZ_BUILTIN_MODS_RECLAMATION=off"
- "-DWZ_BUILTIN_MODS_FRACTUREDKINGDOM=off"
- ;; otherwise, installs a debug
- ;; ELF which fails validate-runpath
- "-DWZ_SKIP_ELF_SEPARATE_DEBUG=on")
+ #:configure-flags
+ #~(list "-GNinja"
+ "-DWZ_DISTRIBUTOR=GNU Guix"
+ "-DWZ_DOWNLOAD_PREBUILT_PACKAGES=off"
+ "-DWZ_INCLUDE_VIDEOS=off"
+ "-DWZ_FORCE_MINIMAL_OPUSFILE=off"
+ "-DENABLE_GNS_NETWORK_BACKEND=off"
+ "-DWZ_USE_SYSTEM_LIBJPEG_TURBO=on"
+ ;; Do not automatically install
+ ;; additional campaigns.
+ "-DWZ_BUILTIN_MODS_RECLAMATION=off"
+ "-DWZ_BUILTIN_MODS_FRACTUREDKINGDOM=off"
+ ;; otherwise, installs a debug
+ ;; ELF which fails validate-runpath
+ "-DWZ_SKIP_ELF_SEPARATE_DEBUG=on"
+ ;; XXX: Autorevision stuff. Passes to the same autorevision
+ ;; in phase 'make-autorevision-cache'. If another is desperately
+ ;; needed to to be defined later, we'll probably know.
+ "-DVCS_WC_MODIFIED=0"
+ "-DVCS_MOST_RECENT_COMMIT_DATE=1970-01-01"
+ (format #f "-DVCS_FULL_HASH=~a" (make-string 40 #\a))
+ (format #f "-DVCS_SHORT_HASH=~a" (make-string 6 #\a))
+ (format #f "-DVCS_TAG=~a" #$version)
+ (format #f "-DVCS_EXTRA=~a" #$version)
+ (format #f "-DVCS_MOST_RECENT_TAGGED_VERSION=~a" #$version))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'unbundle-fonts
@@ -7494,6 +7475,14 @@ fighting over what remains.")
(with-directory-excursion "terrain_overrides"
(copy-recursively classic "classic")
(copy-recursively high "high"))))))
+ (add-before 'build 'make-autorevision-cache
+ (lambda _
+ ;; An autorevision script outputs a header file defining
+ ;; preprocessor variables originating from either git metadata or
+ ;; cmake variables present in this cache file. Missing cache file
+ ;; and no git is an error, so we'll avoid that state.
+ (call-with-output-file "../source/build_tools/autorevision.cache"
+ (const #t))))
(add-after 'install 'install-campaigns
(lambda* (#:key inputs #:allow-other-keys)
(let ((outdir "/share/warzone2100/mods/campaign"))
diff --git
a/gnu/packages/patches/warzone2100-pass-vcs-configure-flags-to-autorevision.patch
b/gnu/packages/patches/warzone2100-pass-vcs-configure-flags-to-autorevision.patch
new file mode 100644
index 0000000000..65473315d3
--- /dev/null
+++
b/gnu/packages/patches/warzone2100-pass-vcs-configure-flags-to-autorevision.patch
@@ -0,0 +1,35 @@
+Passes all configure flags starting with VCS to autorevision.cmake.
+
+Patch by bdunahu <[email protected]>.
+
+diff --git a/build_tools/CMakeLists.txt b/build_tools/CMakeLists.txt
+index ea714977a..07d5742bd 100644
+--- a/build_tools/CMakeLists.txt
++++ b/build_tools/CMakeLists.txt
+@@ -10,6 +10,17 @@ add_custom_target(autorevision ALL
+ )
+ set_property(TARGET autorevision PROPERTY FOLDER "_WZBuildProcessTargets")
+
++get_cmake_property(_cache_vars CACHE_VARIABLES)
++
++set(_autorevision_vcs_args "")
++foreach(_var IN LISTS _cache_vars)
++ # just collect the VCS ones
++ if(_var MATCHES "^VCS_")
++ list(APPEND _autorevision_vcs_args "-D${_var}=${${_var}}")
++ message( STATUS "Collected ${_var}=${${_var}}" )
++ endif()
++endforeach()
++
+ # Autorevision command that will run *every* build
+ set(_autorevision_cache_tarball_src_input
"${CMAKE_CURRENT_SOURCE_DIR}/autorevision.cache")
+ set(_autorevision_cache_file "${CMAKE_CURRENT_BINARY_DIR}/autorevision.cache")
+@@ -24,7 +35,7 @@ add_custom_command(
+ COMMAND ${CMAKE_COMMAND}
-DINPUT_FILE=${_autorevision_cache_tarball_src_input}
-DOUTPUT_FILE=${_autorevision_cache_file} -DSKIP_IF_INPUT_MISSING=ON
-DSKIP_IF_OUTPUT_EXISTS=ON -P ${CMAKE_SOURCE_DIR}/cmake/CopyFileHelper.cmake
+ # Autorevision.cmake
+ # this command must generate: ${CMAKE_CURRENT_BINARY_DIR}/autorevision.h
+- COMMAND ${CMAKE_COMMAND} -DCACHEFILE=${_autorevision_cache_file}
-DOUTPUT_TYPE=h -DOUTPUT_FILE=${_autorevision_h_file} -P
${CMAKE_SOURCE_DIR}/build_tools/autorevision.cmake
++ COMMAND ${CMAKE_COMMAND} -DCACHEFILE=${_autorevision_cache_file}
-DOUTPUT_TYPE=h ${_autorevision_vcs_args} -DOUTPUT_FILE=${_autorevision_h_file}
-P ${CMAKE_SOURCE_DIR}/build_tools/autorevision.cmake
+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+ VERBATIM
+ )