diff options
author | Tobias Geerinckx-Rice <me@tobias.gr> | 2024-09-15 02:00:00 +0200 |
---|---|---|
committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2024-09-29 02:00:00 +0200 |
commit | 09fcc5093f5d142e48b509a330715ad63b066b45 (patch) | |
tree | 5ceaab6798b0cc51f3d6ac82e56fd76587f6b8e2 /gnu/packages | |
parent | b20c3a4b9a2cc610999935b082cc8f4250962550 (diff) | |
download | guix-09fcc5093f5d142e48b509a330715ad63b066b45.tar guix-09fcc5093f5d142e48b509a330715ad63b066b45.tar.gz |
gnu: gzdoom: Delete files that might prevent commercial distribution.
* gnu/packages/games.scm (gzdoom)[source]: Delete files in the snippet.
Change-Id: I601bb251e9b690e375f707786bb5789a6a664b92
Diffstat (limited to 'gnu/packages')
-rw-r--r-- | gnu/packages/games.scm | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index acfe84d819..3206cc9b6c 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -8107,9 +8107,45 @@ You can save humanity and get programming skills!") (base32 "0i4hyg72z84fc6ca2ic9q82q5cbgrbd7bynl3kpkypxvyasq08wz")) (patches (search-patches "gzdoom-search-in-installed-share.patch" "gzdoom-find-system-libgme.patch")) - (modules '((guix build utils))) + (modules '((guix build utils) + (ice-9 regex))) (snippet '(begin + ;; Remove files which mustn't be commercially redistributed. See + ;; <https://zdoom.org/wiki/License#Commercial_use>, the ‘Contribution + ;; Guidelines’ at <https://github.com/ZDoom>, and Guix issue #73435. + (for-each + (lambda (directory) + (delete-file-recursively directory) + (substitute* "CMakeLists.txt" + (((string-append "add_subdirectory\\([[:blank:]]*" + directory + "[[:blank:]]*\\)")) + ""))) + '( ;; "wadsrc_extra" ;game_support.pk3 + "wadsrc_bm")) ;brightmaps.pk3 + + ;; Removing game_support.pk3 entirely would break Freedoom & remove + ;; users' ability to play commercial games, despite owning (only) the + ;; non-functional data. That can't be right. Out of an abundance of + ;; caution, remove anything from the PK3 that could conceivably be + ;; derived from copyrightable data that's not freely redistributable. + (display "Keeping only the following game_support.pk3 files:\n") + (let* ((regexps (list "/font\\.inf$" + "/harmony/.*\\.(txt|zs)$" + "/(iwadinfo|mapinfo|sprofs)\\.txt$" + "\\.z$")) + (regexp* (format #f "(~{~a~^|~})" regexps)) + (regexp (make-regexp regexp* regexp/icase))) + (define (keep-file? file stat) + (let ((keep? (regexp-exec regexp file))) + (when keep? + (format #t " ~a~%" file)) + keep?)) + + (for-each delete-file (find-files "wadsrc_extra/static" + (negate keep-file?)))) + ;; Remove some bundled libraries. XXX There are more, but removing ;; them would require, at least, patching the build system. (with-directory-excursion "libraries" |