summary refs log tree commit diff
path: root/gnu/packages/emulators.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/emulators.scm')
-rw-r--r--gnu/packages/emulators.scm53
1 files changed, 22 insertions, 31 deletions
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index d2964be25d..0ed8596a7e 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -16,6 +16,7 @@
 ;;; Copyright © 2021 Felipe Balbi <balbi@kernel.org>
 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -186,7 +187,10 @@ SuperCPU.")
          (add-after 'unpack 'fix-source
            (lambda _
              (substitute* (find-files "." ".*\\.[ch]")
-               (("\"zlib/zlib.h\"") "<zlib.h>"))))
+               (("\"zlib/zlib.h\"") "<zlib.h>"))
+             (substitute* "Makefile"
+               (("CFLAGS:=-std=gnu99" all)
+                (string-append all " -fcommon")))))
          (delete 'configure)
          (replace 'install
            (lambda* args
@@ -286,11 +290,10 @@ console.")
            (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let ((fontfile
-                      (string-append (assoc-ref inputs "font-wqy-microhei")
-                                     "/share/fonts/truetype/wqy-microhei.ttc"))
+                      (search-input-file inputs
+                                         "/share/fonts/truetype/wqy-microhei.ttc"))
                      (libvulkan
-                      (string-append (assoc-ref inputs "vulkan-loader")
-                                     "/lib/libvulkan.so")))
+                      (search-input-file inputs "/lib/libvulkan.so")))
                  (chdir "docs")
                  (invoke "bash" "-c" "g++ -O2 $(freetype-config \
 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
@@ -412,7 +415,7 @@ older games.")
         (base32 "07jwmmm1bhfxavlhl854cj8l5iy5hqx5hpwkkjbcwqg7yh9jfs2x"))))
     (build-system meson-build-system)
     (arguments
-     `(#:meson ,meson-0.55 #:configure-flags
+     `(#:configure-flags
        ;; These both try to git clone subprojects.
        (list "-Dunit_tests=disabled"     ; gtest
              "-Duse_mt32emu=false")))    ; mt32emu
@@ -605,8 +608,7 @@ and a game metadata scraper.")
                       (bin (string-append out "/bin"))
                       (higan (string-append bin "/higan"))
                       (higan-original (string-append higan "-original"))
-                      (bash (string-append (assoc-ref inputs "bash")
-                                           "/bin/bash"))
+                      (bash (search-input-file inputs "/bin/bash"))
                       (coreutils (assoc-ref inputs "coreutils"))
                       (mkdir (string-append coreutils "/bin/mkdir"))
                       (cp (string-append coreutils "/bin/cp"))
@@ -840,13 +842,14 @@ from an emulator---from save states to scaling filters.")
      '(#:phases
        (modify-phases %standard-phases
          ;; The mupen64plus build system has no configure phase.
-         (delete 'configure)
+         (replace 'configure
+           (lambda _
+             (substitute* "projects/unix/Makefile"
+               (("\\$\\(CFLAGS\\)")
+                "$(CFLAGS) -fcommon"))))
          ;; Makefile is in a subdirectory.
-         (add-before
-          'build 'chdir-to-project-directory
-          (lambda _
-            (chdir "projects/unix")
-            #t)))
+         (add-before 'build 'chdir-to-project-directory
+           (lambda _ (chdir "projects/unix"))))
        #:make-flags (let ((out (assoc-ref %outputs "out")))
                       (list "all" (string-append "PREFIX=" out)))
        ;; There are no tests.
@@ -2027,8 +2030,7 @@ emulator.")
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* "cmake/FindCdio.cmake"
                  (("/usr/include/cdio")
-                  (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
-               #t))
+                  (search-input-directory inputs "/include/cdio")))))
            (add-after 'install 'wrap-program
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (wrap-program (string-append (assoc-ref outputs "out")
@@ -2171,17 +2173,6 @@ performance, features, and ease of use.")
                     (guix build utils))
          #:phases
          (modify-phases %standard-phases
-           (add-after 'unpack 'install-bindings-to-python-output
-             (lambda* (#:key outputs #:allow-other-keys)
-               ;; python-build-system will build the bindings and install them to
-               ;; the "out" output, so change the build-internal names of the
-               ;; outputs.
-               ;;
-               ;; TODO: remove this once #40469 lands, through the core-updates
-               ;; holding zone, on master.
-               (set-car! (assoc "out" outputs) "lib")
-               (set-car! (assoc "python" outputs) "out")
-               #t))
            (add-before 'build 'build-library
              (lambda* (#:key inputs #:allow-other-keys)
                (invoke "make"
@@ -2194,7 +2185,7 @@ performance, features, and ease of use.")
                        "UNICORN_STATIC=no"
                        (string-append
                         "PREFIX="
-                        (assoc-ref outputs "lib")))))
+                        (assoc-ref outputs "out")))))
            (add-before 'build 'prepare-bindings
              (lambda* (#:key outputs #:allow-other-keys)
                (chdir "bindings/python")
@@ -2207,7 +2198,7 @@ performance, features, and ease of use.")
                  (("_path_list = \\[.*")
                   (string-append
                    "_path_list = [\""
-                   (assoc-ref outputs "lib")
+                   (assoc-ref outputs "out")
                    ;; eat the rest of the list
                    "/lib\"] + 0*[")))
                #t))
@@ -2228,10 +2219,10 @@ performance, features, and ease of use.")
                (let* ((python-samples (find-files "." "sample_.*"))
                       (c-samples (find-files "../../samples" ".*\\.c"))
                       (python-docdir
-                        (string-append (assoc-ref outputs "out")
+                        (string-append (assoc-ref outputs "python")
                                        "/share/doc/unicorn/samples"))
                       (c-docdir
-                        (string-append (assoc-ref outputs "lib")
+                        (string-append (assoc-ref outputs "out")
                                        "/share/doc/unicorn/samples")))
                  (for-each (cut install-file <> c-docdir) c-samples)
                  (for-each (cut install-file <> python-docdir) python-samples)