gnu: Add external-program.
[jackhill/guix/guix.git] / gnu / packages / emulators.scm
index 8095d3c..ffcdc65 100644 (file)
@@ -11,6 +11,7 @@
 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2019 David Wilson <david@daviwil.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -457,6 +458,52 @@ and Game Boy Color games.")
     ;; BSD-3.
     (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
 
+(define-public sameboy
+  (package
+    (name "sameboy")
+    (version "0.12.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/LIJI32/SameBoy.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0m5rv2x8qck1kr43xq186pp4kaiay7gd1x775n9qrljcd7z4x6fs"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("rgbds" ,rgbds)
+       ("gcc" ,gcc-9)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("sdl2" ,sdl2)))
+    (arguments
+     `(#:tests? #f                      ; There are no tests
+       #:make-flags `("CC=gcc" "CONF=release"
+                      ,(string-append "DATA_DIR="
+                                      (assoc-ref %outputs "out")
+                                      "/share/sameboy/"))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (data (string-append out "/share/sameboy/")))
+               (with-directory-excursion "build/bin/SDL"
+                 (install-file "sameboy" bin)
+                 (delete-file "sameboy")
+                 (copy-recursively "." data))))))))
+    (home-page "https://sameboy.github.io/")
+    (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
+    (description "SameBoy is a user friendly Game Boy, Game Boy Color
+and Super Game Boy emulator.  SameBoy is accurate and includes a wide
+range of debugging features.  It has all the features one would expect
+from an emulator---from save states to scaling filters.")
+    (license license:expat)))
+
 (define-public mupen64plus-core
   (package
     (name "mupen64plus-core")
@@ -1053,7 +1100,7 @@ emulation community.  It provides highly accurate emulation.")
 (define-public retroarch
   (package
     (name "retroarch")
-    (version "1.7.8.4")
+    (version "1.8.1")
     (source
      (origin
        (method git-fetch)
@@ -1062,7 +1109,18 @@ emulation community.  It provides highly accurate emulation.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1i3i23xwvmck8k2fpalr49np7xjzfg507243mybqrljawlnbxvph"))))
+        (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))
+       (patches
+        (search-patches "retroarch-disable-online-updater.patch"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Don't suggest using the Online Updater if available: it never
+           ;; is.  This disables translation of this particular message.
+           (substitute* (find-files "menu/drivers" "\\.c$")
+             (("msg_hash_to_str\\(MSG_MISSING_ASSETS\\)")
+              "\"Warning: Missing assets, go get some\""))
+           #t))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f                      ; no tests
@@ -1074,7 +1132,7 @@ emulation community.  It provides highly accurate emulation.")
                     (etc (string-append out "/etc"))
                     (vulkan (assoc-ref inputs "vulkan-loader"))
                     (wayland-protocols (assoc-ref inputs "wayland-protocols")))
-               ;; Hard-code the path to libvulkan.so.
+               ;; Hard-code some store file names.
                (substitute* "gfx/common/vulkan_common.c"
                  (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
                (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
@@ -1082,10 +1140,12 @@ emulation community.  It provides highly accurate emulation.")
                  (string-append wayland-protocols "/share/wayland-protocols")))
                (substitute* "qb/qb.libs.sh"
                  (("/bin/true") (which "true")))
+
                ;; Use shared zlib.
                (substitute* '("libretro-common/file/archive_file_zlib.c"
                               "libretro-common/streams/trans_stream_zlib.c")
                  (("<compat/zlib.h>") "<zlib.h>"))
+
                ;; The configure script does not yet accept the extra arguments
                ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
                (invoke
@@ -1095,7 +1155,8 @@ emulation community.  It provides highly accurate emulation.")
                        '("--enable-neon" "--enable-floathard")
                        '())
                  (string-append "--prefix=" out)
-                 (string-append "--global-config-dir=" etc))))))))
+                 (string-append "--global-config-dir=" etc)
+                 "--disable-builtinminiupnpc")))))))
     (inputs
      `(("alsa-lib" ,alsa-lib)
        ("ffmpeg" ,ffmpeg)
@@ -1106,6 +1167,7 @@ emulation community.  It provides highly accurate emulation.")
        ("libxrandr" ,libxrandr)
        ("libxv" ,libxv)
        ("mesa" ,mesa)
+       ("miniupnpc" ,miniupnpc)
        ("openal" ,openal)
        ("pulseaudio" ,pulseaudio)
        ("python" ,python)
@@ -1132,7 +1194,7 @@ multi-system game/emulator system.")
 (define-public scummvm
   (package
     (name "scummvm")
-    (version "2.0.0")
+    (version "2.1.0")
     (source
      (origin
        (method url-fetch)
@@ -1140,13 +1202,27 @@ multi-system game/emulator system.")
                            "/scummvm-" version ".tar.xz"))
        (sha256
         (base32
-         "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
+         "09zp2mxmida6sz5vrr5bzyv8c3yjvq2xqmpmcllbadhmd9cwcl3b"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f                      ;require "git"
+     `(#:tests? #f                                 ;require "git"
        #:configure-flags (list "--enable-release") ;for optimizations
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'fix-build
+           ;; XXX: The following works around a build failure introduced when
+           ;; Fluidsynth was updated to version 2.1.  It has been applied
+           ;; upstream as 68758a879e0c8ecc0d40962516d4e808aa4e15e5 and can be
+           ;; removed once ScummVM 2.1.1+ is out.
+           (lambda _
+             (substitute* "audio/softsynth/fluidsynth.cpp"
+               (("#include <fluidsynth.h>") "")
+               (("#include \"common/scummsys.h\"") "#include \"config.h\"")
+               (("#include \"common/config-manager.h\"" line)
+                (string-append "#include <fluidsynth.h>\n"
+                               "#include \"common/scummsys.h\"\n"
+                               line)))
+             #t))
          (replace 'configure
            ;; configure does not work followed by both "SHELL=..." and
            ;; "CONFIG_SHELL=..."; set environment variables instead
@@ -1165,6 +1241,7 @@ multi-system game/emulator system.")
        ("faad2" ,faad2)
        ("fluidsynth" ,fluidsynth)
        ("freetype" ,freetype)
+       ("liba52" ,liba52)
        ("libflac" ,flac)
        ("libjpeg-turbo" ,libjpeg-turbo)
        ("libmad" ,libmad)
@@ -1174,7 +1251,7 @@ multi-system game/emulator system.")
        ("libtheora" ,libtheora)
        ("libvorbis" ,libvorbis)
        ("nasm" ,nasm)
-       ("sdl2" ,sdl2)
+       ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
        ("zlib" ,zlib)))
     (home-page "https://www.scummvm.org/")
     (synopsis "Engine for several graphical adventure games")
@@ -1188,7 +1265,7 @@ play them on systems for which they were never designed!")
 (define-public mame
   (package
     (name "mame")
-    (version "0.214")
+    (version "0.217")
     (source
      (origin
        (method git-fetch)
@@ -1198,7 +1275,7 @@ play them on systems for which they were never designed!")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "129yk3ybcviscy2xk1mkkzxm4h4nh5p6ndfgqbmcx547p1s6hbja"))
+         "03h4d0d8lh6djjff3zqhjm14klc9n129yzwygdqppz0f43w97cmw"))
        (modules '((guix build utils)))
        (snippet
         ;; Remove bundled libraries.
@@ -1213,6 +1290,8 @@ play them on systems for which they were never designed!")
     (arguments
      `(#:make-flags
        (cons*
+        ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
+        "NOWERROR=1"
         (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
         (string-append "SDL_INI_PATH="
                        (assoc-ref %outputs "out")