Subject: [PATCH] gnu: gzdoom: Delete files that prohibit commercial redistribution.

From: Tobias Geerinckx-Rice <[email-masked]>
Date: Sun, 22 Sep 2024 02:00:00 +0200

See <https://zdoom.org/wiki/License#Commercial_use>.

* gnu/packages/games.scm (gzdoom)[source]: Delete files in the snippet.

Change-Id: I601bb251e9b690e375f707786bb5789a6a664b92
---

This still needs refinement.  I need to read the source, find out
*why* the wiki page tells us not to redistribute game_support.pk3
commercially.  Maybe there's a way around deleting it entirely.
Without it GZDoom finds not a single WAD, free or not.

 gnu/packages/games.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 8aa828a8a4..c5fc59fd07 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -8068,6 +8068,18 @@ (define-public gzdoom
        (modules '((guix build utils)))
        (snippet
         '(begin
+           ;; Remove files which can't be commercially redistributed according
+           ;; to <https://zdoom.org/wiki/License>.
+           (for-each
+            (lambda (directory)
+              (delete-file-recursively directory)
+              (substitute* "CMakeLists.txt"
+                (((string-append "add_subdirectory\\([[:blank:]]*"
+                                 directory
+                                 "[[:blank:]]*\\)"))
+                 "")))
+            (list "wadsrc_bm"           ;brightmaps.pk3
+                  #;"wadsrc_extra"))    ;game_support.pk3 XXX breaks Freedoom
            ;; Remove some bundled libraries.  XXX There are more, but removing
            ;; them would require, at least, patching the build system.
            (with-directory-excursion "libraries"

base-commit: 2da3c37e7d732f6d2744f70be9fd98858a433b5e
prerequisite-patch-id: 3aa23428693688751bb14a2fbe464f5693ae13d7
prerequisite-patch-id: 3f0ca744a21be95e47c8c9105dfe1e7fd0dc59c7
-- 
2.46.0