Subject: [PATCH 1/2] gnu: retroarch-core-info: Remove non-free core listings.

From: Andrew Wong <[email-masked]>
Date: Wed, 25 Dec 2024 16:39:30 -0500

Change-Id: Ic6f656dac299080eaa097df5375dd23b96966cfb
---
 gnu/packages/emulators.scm | 54 +++++++++++++++++++++++++++++---------
 1 file changed, 42 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index ab3f28cfae..75d924253c 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -1584,22 +1584,52 @@ (define-public retroarch-core-info
     (package
       (name "retroarch-core-info")
       (version (git-version "1.19.0" revision commit))
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                      (url "https://github.com/libretro/libretro-core-info")
-                      (commit commit)))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32
-                  "11xpy3zhy2smp4a70fc0r1b76mvmjyabkaaipifsxm3j25drki5z"))))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/libretro/libretro-core-info")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "11xpy3zhy2smp4a70fc0r1b76mvmjyabkaaipifsxm3j25drki5z"))
+         (modules '((guix build utils)))
+         (snippet '(begin
+                     (for-each delete-file
+                               ;; incompatibly-licensed cores are
+                               ;; removed. When updating check the "license"
+                               ;; line of each file.
+                               '("duckstation_libretro.info"
+                                 "dinothawr_libretro.info"
+                                 "chimerasnes_libretro.info"
+                                 "cannonball_libretro.info"
+                                 "fmsx_libretro.info"
+                                 "fbalpha2012_cps3_libretro.info"
+                                 "fbalpha2012_cps2_libretro.info"
+                                 "fbalpha2012_cps1_libretro.info"
+                                 "mame2003_plus_libretro.info"
+                                 "fbneo_libretro.info"
+                                 "fbalpha2012_neogeo_libretro.info"
+                                 "fbalpha2012_libretro.info"
+                                 "mu_libretro.info"
+                                 "genesis_plus_gx_wide_libretro.info"
+                                 "genesis_plus_gx_libretro.info"
+                                 "opera_libretro.info"
+                                 "snes9x2005_plus_libretro.info"
+                                 "snes9x_libretro.info"
+                                 "px68k_libretro.info"
+                                 "snes9x2005_libretro.info"
+                                 "snes9x2010_libretro.info"
+                                 "snes9x2002_libretro.info"))))))
       (build-system copy-build-system)
       (arguments
-       (list #:install-plan #~'(("." "lib/libretro/"
-                                 #:include-regexp ("\\.info$")))))
+       (list
+        #:install-plan #~'(("." "lib/libretro/"
+                            #:include-regexp ("\\.info$")))))
       (home-page "https://github.com/libretro/libretro-core-info")
       (synopsis "Libretro core info files")
-      (description "This is a versioned snapshot of the files containing
+      (description
+       "This is a versioned snapshot of the files containing
 metadata about each known libretro core.  The snapshot is taken from the
 @url{https://github.com/libretro/libretro-super, libretro-super} repository.")
       (license license:expat))))
-- 
2.46.0