~ruther/guix-local

b8024fa1ade69a4f97990f0e3379eef01dfd40c2 — Andrew Wong 1 year, 4 months ago c445975
gnu: Add woof-doom.

* gnu/packages/patches/woof-doom-unbundle-spng-miniz.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/games.scm (woof-doom): New variable.

Change-Id: I77cfa0fd2f2a20d6eee5d0339b9673899bb0ecad
Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
3 files changed, 90 insertions(+), 0 deletions(-)

M gnu/local.mk
M gnu/packages/games.scm
A gnu/packages/patches/woof-doom-unbundle-spng-miniz.patch
M gnu/local.mk => gnu/local.mk +1 -0
@@ 2411,6 2411,7 @@ dist_patch_DATA =						\
  %D%/packages/patches/wmctrl-64-fix.patch			\
  %D%/packages/patches/wmfire-dont-inline-draw-fire.patch	\
  %D%/packages/patches/wmfire-update-for-new-gdk-versions.patch	\
  %D%/packages/patches/woof-doom-unbundle-spng-miniz.patch	\
  %D%/packages/patches/wordnet-CVE-2008-2149.patch			\
  %D%/packages/patches/wordnet-CVE-2008-3908-pt1.patch			\
  %D%/packages/patches/wordnet-CVE-2008-3908-pt2.patch			\

M gnu/packages/games.scm => gnu/packages/games.scm +63 -0
@@ 88,6 88,7 @@
;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2023-2025 Adam Faiz <adam.faiz@disroot.org>
;;; Copyright © 2025 Andrew Wong <wongandj@icloud.com>
;;;
;;; This file is part of GNU Guix.
;;;


@@ 8999,6 9000,68 @@ entirely config file, savegame, netplay and demo compatible with the
original.")
    (home-page "https://www.chocolate-doom.org/wiki/index.php/Crispy_Doom")))

(define-public woof-doom
  (package
    (name "woof-doom")
    (version "15.2.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/fabiangreffrath/woof")
             (commit (string-append "woof_" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "04c7hm4jnr9aiz6w4520zww6b7j86qv9xaf87hdv48cjc9sp2ljk"))
       (modules '((guix build utils)))
       (snippet '(begin
                   (with-directory-excursion "third-party"
                     (delete-file-recursively "miniz")
                     (delete-file-recursively "yyjson")
                     (delete-file-recursively "spng"))
                   (delete-file-recursively "win32")
                   (substitute* (find-files "src" ".")
                     (("miniz.h") "miniz/miniz.h"))))
       (patches (search-patches "woof-doom-unbundle-spng-miniz.patch"))))
    (build-system cmake-build-system)
    (arguments
     (list
      #:tests? #f)) ;'demotest' requires internet access.
    (native-inputs (list python))
    (inputs (list libebur128
                  libsndfile
                  libxmp
                  miniz
                  openal
                  sdl2
                  sdl2-net
                  spng
                  yyjson
                  fluidsynth))
    (home-page "https://github.com/fabiangreffrath/woof")
    (synopsis "MBF-style Doom source port targeted at modern systems")
    (description
     "Woof! is a continuation of the MBF lineage of Doom source ports, with
modern features such as dynamic resolution scaling, uncapped framerates,
adjustable field of view, 3D audio with HRTF and 7.1 surround sound
support, and modern gamepad features including rumble, gyro, and flick
stick support.  Supports the new MBF21 format, as well as the MUSINFO,
UMAPINFO, DEHEXTRA, and DSDHacked specifictions.")
    (license
     ;; See README.md
     (list (license:non-copyleft
            "https://bitbucket.org/jpommier/pffft/src/master/pffft.h"
            "FFTPACK license")
           license:bsd-2
           license:bsd-3
           license:cc-by3.0
           license:cc0
           license:expat
           license:gpl2
           license:gpl3+
           license:public-domain
           license:gpl2+))))

(define xonotic-data
  (package
    (name "xonotic-data")

A gnu/packages/patches/woof-doom-unbundle-spng-miniz.patch => gnu/packages/patches/woof-doom-unbundle-spng-miniz.patch +26 -0
@@ 0,0 1,26 @@
Unbundle spng, miniz
*** a/third-party/CMakeLists.txt
--- b/third-party/CMakeLists.txt
@@ -4,20 +4,13 @@
 target_woof_settings(md5)
 target_include_directories(md5 INTERFACE md5)
 
-add_library(miniz STATIC miniz/miniz.c)
-target_woof_settings(miniz)
-target_compile_definitions(miniz PRIVATE MINIZ_NO_TIME)
-target_include_directories(miniz INTERFACE miniz)
+find_package(miniz)
 
 add_library(pffft STATIC pffft/pffft.c)
 target_woof_settings(pffft)
 target_include_directories(pffft INTERFACE pffft)
 
-add_library(spng STATIC spng/spng.c)
-target_woof_settings(spng)
-target_compile_definitions(spng PRIVATE SPNG_USE_MINIZ INTERFACE SPNG_STATIC)
-target_include_directories(spng INTERFACE spng)
-target_link_libraries(spng miniz)
+find_package(spng)
 
 if(NOT yyjson_FOUND)
     add_library(yyjson STATIC yyjson/yyjson.c)