From 803bce3df39ad4f2a744c30f92cca667731eefc1 Mon Sep 17 00:00:00 2001 From: Jacob Sowder Date: Sat, 30 Nov 2024 11:06:39 -0500 Subject: [PATCH] Uncommented the previous code that removes the non-commercially redistributable code from the project before building. --- my-packages/my-games.scm | 77 ++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/my-packages/my-games.scm b/my-packages/my-games.scm index 52a7982..4210769 100644 --- a/my-packages/my-games.scm +++ b/my-packages/my-games.scm @@ -75,48 +75,47 @@ ;; )) (modules '((guix build utils) (ice-9 regex))) - ;; (snippet - ;; '(begin - ;; ;; remove files which mustn't be commercially redistributed. see - ;; ;; , the ‘contribution - ;; ;; guidelines’ at , 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 + (snippet + '(begin + ;; remove files which mustn't be commercially redistributed. see + ;; , the ‘contribution + ;; guidelines’ at , 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?)) + ;; 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?)))) + (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" - ;; (delete-file-recursively "bzip2") - ;; ))) + ;; remove some bundled libraries. xxx there are more, but removing + ;; them would require, at least, patching the build system. + (with-directory-excursion "libraries" + (delete-file-recursively "bzip2")))) )) (arguments (list