;;; Copyright © 2015, 2018 David Thompson <dthompson2@worcester.edu>
;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2017, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
;;;
;;; This file is part of GNU Guix.
;;;
#:use-module (guix svn-download)
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
+ #:use-module (gnu packages assembly)
#:use-module (gnu packages audio)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages backup)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
- #:use-module (gnu packages databases)
+ #:use-module (gnu packages elf)
#:use-module (gnu packages fonts)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages game-development)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
#:use-module (gnu packages libedit)
#:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages lua)
+ #:use-module (gnu packages maths)
+ #:use-module (gnu packages mp3)
+ #:use-module (gnu packages music)
#:use-module (gnu packages ncurses)
+ #:use-module (gnu packages networking)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
#:use-module (gnu packages sdl)
+ #:use-module (gnu packages sqlite)
+ #:use-module (gnu packages texinfo)
+ #:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
#:use-module (gnu packages upnp)
#:use-module (gnu packages video)
#:use-module (gnu packages xiph)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
+ #:use-module (gnu packages web)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu))
;; Building from recent Git because the official 5.0 release no longer builds.
(define-public dolphin-emu
- (let ((commit "d04b179111f8d863f360839474cb82c766f762b8")
- (revision "0"))
+ (let ((commit "2c57e709d0f9e4010a4415de4192de887e37f187")
+ (revision "5"))
(package
(name "dolphin-emu")
(version (git-version "5.0" revision commit))
(for-each (lambda (dir)
(delete-file-recursively
(string-append "Externals/" dir)))
- '("LZO" "OpenAL" "Qt" "SFML" "SOIL" "curl" "ffmpeg"
+ '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
"gettext" "hidapi" "libpng" "libusb" "mbedtls"
- "miniupnpc" "wxWidgets3" "zlib"))
+ "miniupnpc" "zlib"))
;; Clean up source.
(for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
#t))
(sha256
(base32
- "0g725wmhlim73zrhi47wmr1bmplpy4b7sbimd5pm8xpfhj5nm10l"))))
+ "0aszfdfvs7yg4bmrd3qxwsiz7hx3mrj29f4aw86bz7h9j7hkh57f"))))
(build-system cmake-build-system)
(arguments
'(#:tests? #f
- ;; The FindGTK2 cmake script only checks hardcoded directories for
- ;; glib/gtk headers.
-
#:phases
(modify-phases %standard-phases
+ (add-before 'configure 'fixgcc7
+ (lambda _
+ (unsetenv "C_INCLUDE_PATH")
+ (unsetenv "CPLUS_INCLUDE_PATH")
+ #t))
(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"))
(libvulkan
- (string-append (assoc-ref inputs "vulkan-icd-loader")
+ (string-append (assoc-ref inputs "vulkan-loader")
"/lib/libvulkan.so")))
(chdir "docs")
(invoke "bash" "-c" "g++ -O2 -std=c++11 $(freetype-config \
(("libvulkan.so") libvulkan))
#t))))
+ ;; The FindGTK2 cmake script only checks hardcoded directories for
+ ;; glib/gtk headers.
+
#:configure-flags
- (list (string-append "-DGTK2_GDKCONFIG_INCLUDE_DIR="
- (assoc-ref %build-inputs "gtk+")
- "/lib/gtk-2.0/include")
- (string-append "-DGTK2_GLIBCONFIG_INCLUDE_DIR="
- (assoc-ref %build-inputs "glib")
- "/lib/glib-2.0/include")
- (string-append "-DX11_INCLUDE_DIR="
+ (list (string-append "-DX11_INCLUDE_DIR="
(assoc-ref %build-inputs "libx11")
"/include")
(string-append "-DX11_LIBRARIES="
"-DX11_FOUND=1")))
(native-inputs
`(("pkg-config" ,pkg-config)
+ ("gcc" ,gcc-7) ; Building with gcc@5 doesn't work anymore.
("gettext" ,gnu-gettext)))
(inputs
`(("alsa-lib" ,alsa-lib)
("mesa" ,mesa)
("miniupnpc" ,miniupnpc)
("openal" ,openal)
+ ("pugixml" ,pugixml)
("pulseaudio" ,pulseaudio)
("qtbase" ,qtbase)
("sdl2" ,sdl2)
("sfml" ,sfml)
("soil" ,soil)
("soundtouch" ,soundtouch)
- ("vulkan-icd-loader" ,vulkan-icd-loader)
- ("wxwidgets" ,wxwidgets-gtk2-3.1)
+ ("vulkan-loader" ,vulkan-loader)
("zlib" ,zlib)))
(home-page "https://dolphin-emu.org/")
(synopsis "Nintendo Wii and GameCube emulator")
(define-public dosbox
(package
(name "dosbox")
- (version "0.74.svn3947")
+ (version "0.74-2")
(source (origin
- (method svn-fetch)
- (uri (svn-reference
- (url "http://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk/")
- (revision 3947)))
- (file-name (string-append name "-" version "-checkout"))
- ;; Use SVN head, since the last release (2010) is incompatible
- ;; with GCC 4.8+ (see
- ;; <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=624976>).
+ (method url-fetch)
+ (uri (string-append "https://sourceforge.net/projects/dosbox"
+ "/files/dosbox/" version "/dosbox-"
+ version ".tar.gz/download"))
+ (file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "1p918j6090d1nkvgq7ifvmn506zrdmyi32y7p3ms40d5ssqjg8fj"))))
+ "1ksp1b5szi0vy4x55rm3j1y9wq5mlslpy8llpg87rpdyjlsk0xvh"))))
(build-system gnu-build-system)
(arguments
`(#:phases (modify-phases %standard-phases
(add-after
'unpack 'autogen.sh
(lambda _
- (zero? (system* "sh" "autogen.sh")))))))
+ (invoke "sh" "autogen.sh"))))))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)))
(define-public mgba
(package
(name "mgba")
- (version "0.6.3")
+ (version "0.7.1")
(source (origin
- (method url-fetch)
- (uri (string-append "https://github.com/mgba-emu/mgba/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mgba-emu/mgba.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
(base32
- "16hgs6r5iym3lp2cjcnv9955333976yc5sgy2kkxlsi005n91j1m"))
+ "0q0yg2zna7gjbvpaswyykbg3lr9k3c8l8fydqa407xrgq77lahq4"))
(modules '((guix build utils)))
(snippet
;; Make sure we don't use the bundled software.
- '(for-each
- (lambda (subdir)
- (let ((lib-subdir (string-append "src/third-party/" subdir)))
- (delete-file-recursively lib-subdir)))
- '("libpng" "lzma" "sqlite3" "zlib")))))
+ '(begin
+ (for-each
+ (lambda (subdir)
+ (let ((lib-subdir (string-append "src/third-party/" subdir)))
+ (delete-file-recursively lib-subdir)))
+ '("libpng" "lzma" "sqlite3" "zlib"))
+ #t))))
(build-system cmake-build-system)
(arguments
`(#:tests? #f ;no "test" target
#:configure-flags
(list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
- "-DUSE_LIBZIP=OFF" ;use "zlib" instead
- (string-append "-DCMAKE_INSTALL_LIBDIR="
- (assoc-ref %outputs "out") "/lib"))))
+ "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
(native-inputs `(("pkg-config" ,pkg-config)))
(inputs `(("ffmpeg" ,ffmpeg)
("imagemagick" ,imagemagick)
("libedit" ,libedit)
+ ("libelf" ,libelf)
("libepoxy" ,libepoxy)
("libpng" ,libpng)
("mesa" ,mesa)
(version "2.5")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-audio-sdl/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "0ss6w92n2rpfnazhg9lbq0nvs3fqx93nliz3k3wjxdlx4dpi7h3a"))))
+ (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
(version "2.5")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-input-sdl/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "11sj5dbalp2nrlmki34vy7wy28vc175pnnkdk65p8599hnyq37ri"))))
+ (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
(build-system gnu-build-system)
(native-inputs
`(("which" ,which)))
(version "2.5")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-rsp-hle/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "15h7mgz6xd2zjzm6l3f96sbs8kwr3xvbwzgikhnka79m6c69hsxv"))))
+ (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
(build-system gnu-build-system)
(inputs
`(("mupen64plus-core" ,mupen64plus-core)))
(version "2.0.0")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-rsp-z64/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "10jz1w2dhx5slhyk4m8mdqlpsd6cshchslr1fckb2ayzb1ls3ghi"))))
+ (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
(build-system gnu-build-system)
(inputs
`(("mupen64plus-core" ,mupen64plus-core)))
(version "2.0.0")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-video-arachnoid/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "0jjwf144rihznm4lnqbhgigxw664v3v32wy94adaa6imk8z6gslh"))))
+ (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
(version "2.0.0")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-video-glide64/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "1rm55dbf6xgsq1blbzs6swa2ajv0qkn38acbljj346abnk6s3dla"))))
+ (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
(version "2.5")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-video-glide64mk2/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "1ihl4q293d6svba26b4mhapjcdg12p90gibz79b4mx423jlcxxj9"))))
+ (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
(version "2.5")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-video-rice/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "0rd2scjmh285w61aj3mgx71whg5rqrjbry3cdgicczrnyvf8wdvk"))))
+ (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
version ".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
- (base32 "1x7wsjs5gx2iwx20p4cjcbf696zsjlh31qxmghwv0ifrq8x58s1b"))))
+ (base32 "1x7wsjs5gx2iwx20p4cjcbf696zsjlh31qxmghwv0ifrq8x58s1b"))
+ (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
(version "2.5")
(source
(origin
- (method url-fetch)
- (uri (string-append
- "https://github.com/mupen64plus/mupen64plus-ui-console/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32 "04qkpd8ic7xsgnqz7spl00wxdygf79m7d1k8rabbygjk5lg6p8z2"))
+ (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
(patches (search-patches "mupen64plus-ui-console-notice.patch"))))
(build-system gnu-build-system)
(native-inputs
(define-public nestopia-ue
(package
(name "nestopia-ue")
- (version "1.47")
+ (version "1.48")
(source (origin
(method url-fetch)
(uri (string-append
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "1dzrrjmvyqks64q5l5pfly80jb6qcsbj5b3dm40fijd5xnpbapci"))
+ "184y05z4k4a4m4022niy625kan0rklh8gcxyynxli1fss2sjjrpv"))
(modules '((guix build utils)))
(snippet
'(begin
;; We don't need libretro for the GNU/Linux build.
(delete-file-recursively "libretro")
- ;; Use system zlib.
- (delete-file-recursively "source/zlib")
- (substitute* "source/core/NstZlib.cpp"
- (("#include \"../zlib/zlib.h\"") "#include <zlib.h>"))))))
- (build-system gnu-build-system)
+ #t))))
+ (build-system cmake-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("ao" ,ao)
- ("glu" ,glu)
("gtk+" ,gtk+)
("libarchive" ,libarchive)
- ("mesa" ,mesa)
+ ("libepoxy" ,libepoxy)
("sdl2" ,sdl2)
("zlib" ,zlib)))
(arguments
'(#:phases
(modify-phases %standard-phases
- ;; The Nestopia build system consists solely of a Makefile.
- (delete 'configure)
- (add-before 'build 'remove-xdg-desktop-menu-call
- (lambda _
- (substitute* "Makefile"
- (("xdg-desktop-menu install .*") ""))))
- (add-before 'build 'remove-gdkwayland-include
- (lambda _
- (substitute* "source/unix/gtkui/gtkui.h"
- (("#include <gdk/gdkwayland\\.h>") "")))))
- #:make-flags (let ((out (assoc-ref %outputs "out")))
- (list "CC=gcc" "CXX=g++" (string-append "PREFIX=" out)))
+ ;; This fixes the file chooser crash that happens with GTK 3.
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (nestopia (string-append out "/bin/nestopia"))
+ (gtk (assoc-ref inputs "gtk+"))
+ (gtk-share (string-append gtk "/share")))
+ (wrap-program nestopia
+ `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
;; There are no tests.
#:tests? #f))
(home-page "http://0ldsk00l.ca/nestopia/")
(define-public retroarch
(package
(name "retroarch")
- (version "1.7.1")
+ (version "1.7.6")
(source
(origin
- (method url-fetch)
- (uri (string-append "https://github.com/libretro/RetroArch/archive/v"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/libretro/RetroArch.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
(sha256
- (base32 "1wykv0w0kdlh7lh0k1ig0lpk5vh4c7r19jlfa9103jmjlryrq679"))))
+ (base32 "122c6cqax92qk2mhm9ywnwhw3qkv8f1ybma9gal5w6i2gsmp0s0s"))))
(build-system gnu-build-system)
(arguments
- '(#:tests? #f ; no tests
+ `(#:tests? #f ; no tests
#:phases
(modify-phases %standard-phases
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(etc (string-append out "/etc"))
- (vulkan (assoc-ref inputs "vulkan-icd-loader")))
+ (vulkan (assoc-ref inputs "vulkan-loader"))
+ (wayland-protocols (assoc-ref inputs "wayland-protocols")))
;; Hard-code the path to libvulkan.so.
(substitute* "gfx/common/vulkan_common.c"
(("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
+ (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
+ (("/usr/local/share/wayland-protocols")
+ (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"
+ "network/httpserver/httpserver.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.
- (zero? (system*
- "./configure"
- (string-append "--prefix=" out)
- (string-append "--global-config-dir=" etc)))))))))
+ (invoke
+ "./configure"
+ ,@(if (string-prefix? "armhf" (or (%current-target-system)
+ (%current-system)))
+ '("--enable-neon" "--enable-floathard")
+ '())
+ (string-append "--prefix=" out)
+ (string-append "--global-config-dir=" etc))))))))
(inputs
`(("alsa-lib" ,alsa-lib)
("ffmpeg" ,ffmpeg)
("libxinerama" ,libxinerama)
("libxkbcommon" ,libxkbcommon)
("libxml2" ,libxml2)
+ ("libxrandr" ,libxrandr)
("libxv" ,libxv)
("mesa" ,mesa)
("openal" ,openal)
("pulseaudio" ,pulseaudio)
("python" ,python)
+ ("qtbase" ,qtbase)
("sdl" ,sdl2)
("udev" ,eudev)
- ("vulkan-icd-loader" ,vulkan-icd-loader)
+ ("vulkan-loader" ,vulkan-loader)
("wayland" ,wayland)
("zlib" ,zlib)))
(native-inputs
`(("pkg-config" ,pkg-config)
+ ("wayland-protocols" ,wayland-protocols)
("which" ,which)))
(home-page "https://www.libretro.com/")
(synopsis "Reference frontend for the libretro API")
reference frontend for the libretro API, currently used by most as a modular
multi-system game/emulator system.")
(license license:gpl3+)))
+
+(define-public scummvm
+ (package
+ (name "scummvm")
+ (version "2.0.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
+ "/scummvm-" version ".tar.xz"))
+ (sha256
+ (base32
+ "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ;require "git"
+ #:configure-flags (list "--enable-release") ;for optimizations
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ ;; configure does not work followed by both "SHELL=..." and
+ ;; "CONFIG_SHELL=..."; set environment variables instead
+ (lambda* (#:key outputs configure-flags #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bash (which "bash"))
+ (flags `(,(string-append "--prefix=" out)
+ ,@configure-flags)))
+ (setenv "SHELL" bash)
+ (setenv "CONFIG_SHELL" bash)
+ (apply invoke "./configure" flags)))))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)
+ ("faad2" ,faad2)
+ ("fluidsynth" ,fluidsynth)
+ ("freetype" ,freetype)
+ ("libflac" ,flac)
+ ("libjpeg-turbo" ,libjpeg-turbo)
+ ("libmad" ,libmad)
+ ("libmpeg2" ,libmpeg2)
+ ("libogg" ,libogg)
+ ("libpng" ,libpng)
+ ("libtheora" ,libtheora)
+ ("libvorbis" ,libvorbis)
+ ("nasm" ,nasm)
+ ("sdl2" ,sdl2)
+ ("zlib" ,zlib)))
+ (home-page "https://www.scummvm.org/")
+ (synopsis "Engine for several graphical adventure games")
+ (description "ScummVM is a program which allows you to run certain
+classic graphical point-and-click adventure games, provided you
+already have their data files. The clever part about this: ScummVM
+just replaces the executables shipped with the games, allowing you to
+play them on systems for which they were never designed!")
+ (license license:gpl2+)))
+
+(define-public mame
+ (package
+ (name "mame")
+ (version "0.208")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mamedev/mame.git")
+ (commit (apply string-append "mame" (string-split version #\.)))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "14j7n4haggqsph0nw69d79z3y9lrdc7rzs2sl1kzggfnd37nh81s"))
+ (modules '((guix build utils)))
+ (snippet
+ ;; Remove bundled libraries.
+ '(begin
+ (with-directory-excursion "3rdparty"
+ (for-each delete-file-recursively
+ '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
+ "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
+ "SDL2-override" "sqlite3" "utf8proc" "zlib")))
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (cons*
+ (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
+ (string-append "SDL_INI_PATH="
+ (assoc-ref %outputs "out")
+ "/share/mame/ini")
+ (map (lambda (lib)
+ (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
+ '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
+ "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
+ #:tests? #f ;no test in regular release
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'build 'build-documentation
+ (lambda _ (invoke "make" "-C" "docs" "man" "info")))
+ (replace 'install
+ ;; Upstream does not provide an installation phase.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (share (string-append out "/share/mame")))
+ ;; Install data.
+ (for-each (lambda (dir)
+ (copy-recursively dir (string-append share "/" dir)))
+ '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
+ "plugins" "samples"))
+ (let ((keymaps (string-append share "/keymaps")))
+ (for-each (lambda (file) (install-file file keymaps))
+ (find-files "keymaps" ".*LINUX\\.map")))
+ (let ((fonts (string-append share "/fonts")))
+ (install-file "uismall.bdf" fonts))
+ (when (file-exists? "mame64")
+ (rename-file "mame64" "mame"))
+ (install-file "mame" (string-append out "/bin")))
+ #t))
+ (add-after 'install 'install-documentation
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (man (string-append out "/share/man/man1"))
+ (info (string-append out "/share/info")))
+ (install-file "docs/build/man/MAME.1" man)
+ (install-file "docs/build/texinfo/MAME.info" info))
+ #t))
+ (add-after 'install 'install-ini-file
+ ;; Generate an ini file so as to set some directories (e.g., roms)
+ ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
+ ;;
+ ;; XXX: We need to insert absolute references to the store. It can
+ ;; be an issue if they leak into user's home directory, e.g., with
+ ;; "mame -createconfig" and the package is later GC'ed.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (share (string-append out "/share/mame"))
+ (ini (string-append share "/ini")))
+ (with-output-to-file (string-append ini "/mame.ini")
+ (lambda _
+ (format #t
+ "inipath $HOME/.mame;~a/ini~@
+ homepath $HOME/mame~@
+ rompath $HOME/mame/roms~@
+ samplepath $HOME/mame/samples;~a/samples~@
+ cheatpath $HOME/mame/cheat~@
+ artpath $HOME/mame/artwork;~a/artwork~@
+ crosshairpath $HOME/mame/crosshair~@
+ snapshot_directory $HOME/mame/snapshots~@
+ hashpath ~a/hash~@
+ fontpath $HOME/mame/fonts;~a/fonts~@
+ ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
+ bgfx_path ~a/bgfx~@
+ pluginspath $HOME/mame/plugins;~a/plugins~@
+ languagepath ~a/language~@
+ cfg_directory $HOME/.mame/cfg~@
+ nvram_directory $HOME/.mame/nvram~@
+ input_directory $HOME/.mame/inp~@
+ state_directory $HOME/.mame/sta~@
+ diff_directory $HOME/.mame/diff~@
+ comment_directory $HOME/.mame/comments~%"
+ share share share share share share share share
+ share)))
+ (with-output-to-file (string-append ini "/ui.ini")
+ (lambda _
+ (format #t
+ "historypath $HOME/mame/history~@
+ categorypath $HOME/mame/folders~@
+ cabinets_directory $HOME/mame/cabinets~@
+ cpanels_directory $HOME/mame/cpanel~@
+ pcbs_directory $HOME/mame/pcb~@
+ flyers_directory $HOME/mame/flyers~@
+ titles_directory $HOME/mame/titles~@
+ ends_directory $HOME/mame/ends~@
+ marquees_directory $HOME/mame/marquees~@
+ artwork_preview_directory $HOME/mame/artpreview~@
+ bosses_directory $HOME/mame/bosses~@
+ logos_directory $HOME/mame/logo~@
+ scores_directory $HOME/mame/scores~@
+ versus_directory $HOME/mame/versus~@
+ gameover_directory $HOME/mame/gameover~@
+ howto_directory $HOME/mame/howto~@
+ select_directory $HOME/mame/select~@
+ icons_directory $HOME/mame/icons~@
+ covers_directory $HOME/mame/covers~@
+ ui_path $HOME/.mame/ui~%")))
+ #t)))
+ (add-after 'install 'install-desktop-file
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (desktop (string-append out "/share/applications"))
+ (executable (string-append out "/bin/mame")))
+ (mkdir-p desktop)
+ (with-output-to-file (string-append desktop "/mame.desktop")
+ (lambda _
+ (format #t
+ "[Desktop Entry]~@
+ Name=mame~@
+ Comment=Multi-purpose emulation framework~@
+ Exec=~a~@
+ TryExec=~@*~a~@
+ Terminal=false~@
+ Type=Application~@
+ Categories=Game;Emulator;~@
+ Keywords=Game;Emulator;Arcade;~%"
+ executable)))
+ #t))))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("sphinx" ,python-sphinx)
+ ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
+ ("texinfo" ,texinfo)))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)
+ ("asio" ,asio)
+ ("expat" ,expat)
+ ("flac" ,flac)
+ ("fontconfig" ,fontconfig)
+ ("glm" ,glm)
+ ("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
+ ("libxinerama" ,libxinerama)
+ ("lua" ,lua)
+ ("portaudio" ,portaudio)
+ ("portmidi" ,portmidi)
+ ("pugixml" ,pugixml)
+ ("python-wrapper" ,python-wrapper)
+ ("qtbase" ,qtbase)
+ ("rapidjson" ,rapidjson)
+ ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
+ ("sqlite" ,sqlite)
+ ("utf8proc" ,utf8proc)
+ ("zlib" ,zlib)))
+ (home-page "http://mamedev.org/")
+ (synopsis "Multi-purpose emulation framework")
+ (description "MAME's purpose is to preserve decades of software
+history. As electronic technology continues to rush forward, MAME
+prevents this important @emph{vintage} software from being lost and
+forgotten. This is achieved by documenting the hardware and how it
+functions. The source code to MAME serves as this documentation.")
+ ;; The MAME project as a whole is distributed under the terms of GPL2+.
+ ;; However, over 90% of the files are under Expat license. Also, artwork,
+ ;; keymaps, languages and samples are under CC0.
+ (license (list license:gpl2+ license:expat license:cc0))))