1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
4 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
5 ;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2018 David Thompson <dthompson2@worcester.edu>
7 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
8 ;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2017, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10 ;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
12 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
13 ;;; Copyright © 2019 David Wilson <david@daviwil.com>
14 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages emulators)
32 #:use-module (ice-9 match)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix svn-download)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages algebra)
40 #:use-module (gnu packages assembly)
41 #:use-module (gnu packages audio)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages backup)
46 #:use-module (gnu packages cdrom)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages cross-base)
50 #:use-module (gnu packages curl)
51 #:use-module (gnu packages digest)
52 #:use-module (gnu packages elf)
53 #:use-module (gnu packages fonts)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages freedesktop)
56 #:use-module (gnu packages game-development)
57 #:use-module (gnu packages gcc)
58 #:use-module (gnu packages gettext)
59 #:use-module (gnu packages gl)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages image)
63 #:use-module (gnu packages imagemagick)
64 #:use-module (gnu packages libedit)
65 #:use-module (gnu packages libusb)
66 #:use-module (gnu packages linux)
67 #:use-module (gnu packages lua)
68 #:use-module (gnu packages maths)
69 #:use-module (gnu packages mp3)
70 #:use-module (gnu packages music)
71 #:use-module (gnu packages ncurses)
72 #:use-module (gnu packages networking)
73 #:use-module (gnu packages pkg-config)
74 #:use-module (gnu packages pulseaudio)
75 #:use-module (gnu packages python)
76 #:use-module (gnu packages qt)
77 #:use-module (gnu packages sdl)
78 #:use-module (gnu packages sphinx)
79 #:use-module (gnu packages sqlite)
80 #:use-module (gnu packages texinfo)
81 #:use-module (gnu packages textutils)
82 #:use-module (gnu packages tls)
83 #:use-module (gnu packages upnp)
84 #:use-module (gnu packages video)
85 #:use-module (gnu packages vulkan)
86 #:use-module (gnu packages wxwidgets)
87 #:use-module (gnu packages xdisorg)
88 #:use-module (gnu packages xiph)
89 #:use-module (gnu packages xml)
90 #:use-module (gnu packages xorg)
91 #:use-module (gnu packages web)
92 #:use-module (guix build-system cmake)
93 #:use-module (guix build-system glib-or-gtk)
94 #:use-module (guix build-system gnu)
95 #:use-module (guix build-system python))
97 (define-public desmume
105 "mirror://sourceforge/desmume/desmume/"
106 version "/desmume-" version ".tar.gz"))
109 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))
110 (patches (search-patches "desmume-gcc6-fixes.patch"
111 "desmume-gcc7-fixes.patch"))))
112 (build-system gnu-build-system)
114 ;; Enable support for WiFi and microphone.
115 `(#:configure-flags '("--enable-wifi"
118 `(("pkg-config" ,pkg-config)
119 ("intltool" ,intltool)))
126 (home-page "http://desmume.org/")
127 (synopsis "Nintendo DS emulator")
129 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
130 (license license:gpl2)))
132 ;; Building from recent Git because the official 5.0 release no longer builds.
133 (define-public dolphin-emu
134 (let ((commit "a9745400ec5cea7e55d94955afbdc44d1a4982d1")
138 (version (git-version "5.0" revision commit))
143 (url "https://github.com/dolphin-emu/dolphin")
145 (file-name (git-file-name name version))
146 (modules '((guix build utils)))
149 ;; Remove external stuff we don't need.
150 (for-each (lambda (dir)
151 (delete-file-recursively
152 (string-append "Externals/" dir)))
153 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
154 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
155 "miniupnpc" "MoltenVK" "zlib"))
157 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
161 "0ic08ii4vlqlmk2wkfc99jiy6nji2wfq56r7slj23wgvhznnaabk"))))
162 (build-system cmake-build-system)
166 (modify-phases %standard-phases
167 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
168 (lambda* (#:key inputs outputs #:allow-other-keys)
170 (string-append (assoc-ref inputs "font-wqy-microhei")
171 "/share/fonts/truetype/wqy-microhei.ttc"))
173 (string-append (assoc-ref inputs "vulkan-loader")
174 "/lib/libvulkan.so")))
176 (invoke "bash" "-c" "g++ -O2 $(freetype-config \
177 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
178 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
179 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
180 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
181 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
183 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
184 (("\"vulkan\", 1") (string-append "\"vulkan\"")))
185 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
186 (("\"vulkan\"") (string-append "\"" libvulkan "\"")))
187 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
188 (("Common::DynamicLibrary::GetVersionedFilename") ""))
191 ;; The FindGTK2 cmake script only checks hardcoded directories for
195 (list (string-append "-DX11_INCLUDE_DIR="
196 (assoc-ref %build-inputs "libx11")
198 (string-append "-DX11_LIBRARIES="
199 (assoc-ref %build-inputs "libx11")
203 `(("pkg-config" ,pkg-config)
204 ("gettext" ,gettext-minimal)))
206 `(("alsa-lib" ,alsa-lib)
212 ("font-wqy-microhei" ,font-wqy-microhei)
213 ("freetype" ,freetype)
219 ("libevdev" ,libevdev)
224 ("libxrandr" ,libxrandr)
226 ("mbedtls-apache" ,mbedtls-apache)
228 ("miniupnpc" ,miniupnpc)
231 ("pulseaudio" ,pulseaudio)
236 ("soundtouch" ,soundtouch)
237 ("vulkan-loader" ,vulkan-loader)
239 (home-page "https://dolphin-emu.org/")
240 (synopsis "Nintendo Wii and GameCube emulator")
242 "Dolphin is an emulator for two Nintendo video game consoles: the
243 GameCube and the Wii. It provides compatibility with all PC controllers,
244 turbo speed, networked multiplayer, and graphical enhancements.")
245 (supported-systems '("x86_64-linux" "aarch64-linux"))
246 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
247 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
249 (define-public dosbox
255 (uri (string-append "https://sourceforge.net/projects/dosbox"
256 "/files/dosbox/" version "/dosbox-"
257 version ".tar.gz/download"))
258 (file-name (string-append name "-" version ".tar.gz"))
261 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
262 (build-system gnu-build-system)
264 `(("autoconf" ,autoconf)
265 ("automake" ,automake)))
270 ("alsa-lib" ,alsa-lib)
273 (home-page "https://www.dosbox.com")
274 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
275 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
276 also emulates CPU:286/386 realmode/protected mode, Directory
277 FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
278 SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
280 (license license:gpl2+)))
282 (define-public qtmips
289 (url "https://github.com/cvut/QtMips")
290 (commit (string-append "v" version))))
291 (file-name (git-file-name name version))
294 "1khvwgqz4h6q6mhbbq0yx43ajz8gx9wmwzs8784vmfrglndbxgax"))))
295 (build-system cmake-build-system)
298 (modify-phases %standard-phases
300 (lambda* (#:key outputs #:allow-other-keys)
302 (string-append "PREFIX=" (assoc-ref outputs "out"))
305 (lambda* (#:key tests? #:allow-other-keys)
306 (substitute* "tests/test.sh"
307 (("qtchooser.*") ""))
308 (substitute* '("tests/cpu_trap/test.sh"
309 "tests/registers/test.sh")
310 (("sub-qtmips_cli") "qtmips_cli"))
312 (invoke "tests/run-all.sh")
315 ;; There is no install target.
316 (lambda* (#:key outputs #:allow-other-keys)
317 (let* ((out (assoc-ref outputs "out"))
318 (bin (string-append out "/bin"))
319 (apps (string-append out "/share/applications"))
320 (icons (string-append out "/share/icons/hicolor")))
321 (install-file "qtmips_gui/qtmips_gui" bin)
322 (install-file "qtmips_cli/qtmips_cli" bin)
323 (install-file "data/qtmips.desktop" apps)
324 (install-file "data/icons/qtmips_gui.svg"
325 (string-append icons "/scalable/apps"))
326 (install-file "data/icons/qtmips_gui.png"
327 (string-append icons "/48x48/apps"))
329 #:tests? #f)) ; test suite wants mips toolchain
331 `(("elfutils" ,elfutils)
333 (home-page "https://github.com/cvut/QtMips")
334 (synopsis "MIPS CPU emulator")
335 (description "This package contains a MIPS CPU emulator. The simulator
336 accepts ELF statically linked executables compiled for 32-bit big-endian
337 MIPS target, targeting mips-linux-gnu or mips-elf.")
338 (license license:gpl2+))) ; License file says GPL3
340 (define-public emulation-station
341 ;; No release for a long time, new commits fix build issues
342 (let ((commit "9cc42adff67946175d2b7e25c6ae69cc374e98a0")
345 (name "emulation-station")
346 (version (git-version "2.0.1" revision commit))
348 (method git-fetch) ; no tarball available
350 (url "https://github.com/Aloshi/EmulationStation")
351 (commit commit))) ; no version tag
352 (file-name (git-file-name name version))
355 "1cva0ns650v17lfn8in095zci6lc43d23f1x3mlzc41qfqa6mbd1"))))
356 (build-system cmake-build-system)
358 '(#:tests? #f)) ; no tests
360 `(("alsa-lib" ,alsa-lib)
364 ("freeimage" ,freeimage)
365 ("freetype" ,freetype)
368 (synopsis "Video game console emulator front-end")
369 (description "EmulationStation provides a graphical front-end to a large
370 number of video game console emulators. It features an interface that is
371 usable with any game controller that has at least 4 buttons, theming support,
372 and a game metadata scraper.")
373 (home-page "https://emulationstation.org")
374 (license license:expat))))
384 (url "https://github.com/higan-emu/higan")
385 (commit (string-append "v" version))))
386 (file-name (git-file-name name version))
388 (base32 "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2"))))
389 (build-system gnu-build-system)
391 `(("pkg-config" ,pkg-config)))
393 `(("alsa-lib" ,alsa-lib)
397 ("gtksourceview-2" ,gtksourceview-2)
398 ("libxrandr" ,libxrandr)
402 ("pulseaudio" ,pulseaudio)
406 (let ((build-phase (assoc-ref %standard-phases 'build))
407 (install-phase (assoc-ref %standard-phases 'install)))
408 (modify-phases %standard-phases
409 ;; The higan build system has no configure phase.
411 (add-before 'build 'chdir-to-higan
415 (add-before 'install 'create-/share/applications
416 (lambda* (#:key outputs #:allow-other-keys)
417 (let ((out (assoc-ref outputs "out")))
418 ;; It seems the author forgot to do this in the Makefile.
419 (mkdir-p (string-append out "/share/applications"))
421 (add-after 'install 'chdir-to-icarus
425 (add-after 'chdir-to-icarus 'build-icarus build-phase)
426 (add-after 'build-icarus 'install-icarus install-phase)
427 (add-after 'install-icarus 'wrap-higan-executable
428 (lambda* (#:key inputs outputs #:allow-other-keys)
429 (let* ((out (assoc-ref outputs "out"))
430 (bin (string-append out "/bin"))
431 (higan (string-append bin "/higan"))
432 (higan-original (string-append higan "-original"))
433 (bash (string-append (assoc-ref inputs "bash")
435 (coreutils (assoc-ref inputs "coreutils"))
436 (mkdir (string-append coreutils "/bin/mkdir"))
437 (cp (string-append coreutils "/bin/cp"))
438 (cp-r (string-append cp " -r --no-preserve=mode")))
439 ;; First, have the executable make sure ~/.local/share/higan
440 ;; contains up to date files. Higan insists on looking there
441 ;; for these data files.
442 (rename-file higan higan-original)
443 (with-output-to-file higan
448 ;; higan doesn't respect $XDG_DATA_HOME
449 mkdir " -p ~/.local/share\n"
450 cp-r " " out "/share/higan ~/.local/share\n"
451 "exec " higan-original))))
453 ;; Second, make sure higan will find icarus in PATH.
455 `("PATH" ":" prefix (,bin)))
459 (string-append "prefix=" (assoc-ref %outputs "out")))
460 ;; There is no test suite.
462 (home-page "https://github.com/higan-emu/higan/")
463 (synopsis "Multi-system emulator")
465 "higan is a multi-system emulator with an uncompromising focus on
466 accuracy and code readability.
468 It currently emulates the following systems: Famicom, Famicom Disk System,
469 Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
470 Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive, Mega
471 CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket, Neo Geo
472 Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge
474 (license license:gpl3+)))
476 (define-public mednafen
483 (uri (string-append "https://mednafen.github.io/releases/files/"
484 "mednafen-" version ".tar.xz"))
486 (base32 "03zplcfvmnnv7grhacmr1zy789pb2wda36wylmzmar23g0zqbsix"))))
487 (build-system gnu-build-system)
491 ;; "--with-external-mpcdec"
492 "--with-external-lzo")))
494 `(("pkg-config" ,pkg-config)))
497 ;; ("libmpcdec" ,libmpcdec) FIXME: not recognized.
498 ("libsndfile" ,libsndfile)
502 (home-page "https://mednafen.github.io/")
503 (synopsis "Multi-system emulator utilizing OpenGL and SDL")
505 "Mednafen is a portable, utilizing OpenGL and SDL, argument-driven
506 multi-system emulator. Mednafen has the ability to remap hotkey functions and
507 virtual system inputs to a keyboard, a joystick, or both simultaneously. Save
508 states are supported, as is real-time game rewinding. Screen snapshots may be
509 taken, in the PNG file format, at the press of a button. Mednafen can record
510 audiovisual movies in the QuickTime file format, with several different
511 lossless codecs supported.
513 The following systems are supported:
518 @item Neo Geo Pocket (Color)
520 @item GameBoy (Color)
521 @item GameBoy Advance
522 @item Nintendo Entertainment System
523 @item Super Nintendo Entertainment System/Super Famicom
525 @item PC Engine/TurboGrafx 16 (CD)
529 @item Sega Genesis/Megadrive
530 @item Sega Master System
531 @item Sega Saturn (experimental, x86_64 only)
532 @item Sony PlayStation
534 ;; Main license is GPL2+. Some parts are BSD-3.
535 (license (list license:gpl2+ license:bsd-3))))
545 (url "https://github.com/mgba-emu/mgba")
547 (file-name (git-file-name name version))
549 (base32 "0rwlfjdr0rzbq4kaplvwsgyb8xq6nrzxss2c8xrgw9hqw3ymx4s3"))
550 (modules '((guix build utils)))
552 ;; Make sure we don't use the bundled software.
556 (let ((lib-subdir (string-append "src/third-party/" subdir)))
557 (delete-file-recursively lib-subdir)))
558 '("libpng" "lzma" "sqlite3" "zlib"))
560 (build-system cmake-build-system)
562 `(#:tests? #f ;no "test" target
564 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
565 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
566 (native-inputs `(("pkg-config" ,pkg-config)
567 ("qttools" ,qttools)))
568 (inputs `(("ffmpeg" ,ffmpeg)
569 ("imagemagick" ,imagemagick)
572 ("libepoxy" ,libepoxy)
578 ("qtmultimedia" ,qtmultimedia)
582 (home-page "https://mgba.io")
583 (synopsis "Game Boy Advance emulator")
585 "mGBA is an emulator for running Game Boy Advance games. It aims to be
586 faster and more accurate than many existing Game Boy Advance emulators, as
587 well as adding features that other emulators lack. It also supports Game Boy
588 and Game Boy Color games.")
589 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+, "inih.c" is
590 ;; BSD-3, and "discord-rpc" is Expat.
591 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3 license:expat))))
593 (define-public sameboy
601 (url "https://github.com/LIJI32/SameBoy")
602 (commit (string-append "v" version))))
603 (file-name (git-file-name name version))
605 (base32 "04w8lybi7ssnax37ka4qw7pmcm7cgnmk90p9m73zbyp5chgpqqzc"))))
606 (build-system gnu-build-system)
610 ("pkg-config" ,pkg-config)))
614 `(#:tests? #f ; There are no tests
615 #:make-flags `("CC=gcc" "NATIVE_CC=gcc" "CONF=release"
616 ,(string-append "DATA_DIR="
617 (assoc-ref %outputs "out")
620 (modify-phases %standard-phases
623 (lambda* (#:key outputs #:allow-other-keys)
624 (let* ((out (assoc-ref outputs "out"))
625 (bin (string-append out "/bin"))
626 (data (string-append out "/share/sameboy/")))
627 (with-directory-excursion "build/bin/SDL"
628 (install-file "sameboy" bin)
629 (delete-file "sameboy")
630 (copy-recursively "." data))
632 (home-page "https://sameboy.github.io/")
633 (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
634 (description "SameBoy is a user friendly Game Boy, Game Boy Color
635 and Super Game Boy emulator. SameBoy is accurate and includes a wide
636 range of debugging features. It has all the features one would expect
637 from an emulator---from save states to scaling filters.")
638 (license license:expat)))
640 (define-public mupen64plus-core
642 (name "mupen64plus-core")
648 (url "https://github.com/mupen64plus/mupen64plus-core")
650 (file-name (git-file-name name version))
652 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
653 (build-system gnu-build-system)
655 `(("pkg-config" ,pkg-config)
658 `(("freetype" ,freetype)
666 (modify-phases %standard-phases
667 ;; The mupen64plus build system has no configure phase.
669 ;; Makefile is in a subdirectory.
671 'build 'chdir-to-project-directory
673 (chdir "projects/unix")
675 #:make-flags (let ((out (assoc-ref %outputs "out")))
676 (list "all" (string-append "PREFIX=" out)))
677 ;; There are no tests.
679 ;; As per the Makefile (in projects/unix/Makefile):
680 (supported-systems '("i686-linux" "x86_64-linux"))
681 (home-page "https://www.mupen64plus.org/")
682 (synopsis "Nintendo 64 emulator core library")
684 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
685 which is capable of accurately playing many games. This package contains the
687 (license license:gpl2+)))
689 (define-public mupen64plus-audio-sdl
691 (name "mupen64plus-audio-sdl")
697 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl")
699 (file-name (git-file-name name version))
701 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
702 (build-system gnu-build-system)
704 `(("pkg-config" ,pkg-config)
707 `(("mupen64plus-core" ,mupen64plus-core)
711 (modify-phases %standard-phases
712 ;; The mupen64plus build system has no configure phase.
714 ;; Makefile is in a subdirectory.
716 'build 'cd-to-project-dir
718 (chdir "projects/unix"))))
720 (let ((out (assoc-ref %outputs "out"))
721 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
723 (string-append "PREFIX=" out)
724 (string-append "APIDIR=" m64p "/include/mupen64plus")))
725 ;; There are no tests.
727 (home-page "https://www.mupen64plus.org/")
728 (synopsis "Mupen64Plus SDL input plugin")
730 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
731 which is capable of accurately playing many games. This package contains the
733 (license license:gpl2+)))
735 (define-public mupen64plus-input-sdl
737 (name "mupen64plus-input-sdl")
743 (url "https://github.com/mupen64plus/mupen64plus-input-sdl")
745 (file-name (git-file-name name version))
747 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
748 (build-system gnu-build-system)
752 `(("mupen64plus-core" ,mupen64plus-core)
756 (modify-phases %standard-phases
757 ;; The mupen64plus build system has no configure phase.
759 ;; Makefile is in a subdirectory.
761 'build 'cd-to-project-dir
763 (chdir "projects/unix"))))
765 (let ((out (assoc-ref %outputs "out"))
766 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
768 (string-append "PREFIX=" out)
769 (string-append "APIDIR=" m64p "/include/mupen64plus")))
770 ;; There are no tests.
772 (home-page "https://www.mupen64plus.org/")
773 (synopsis "Mupen64Plus SDL input plugin")
775 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
776 which is capable of accurately playing many games. This package contains the
778 (license license:gpl2+)))
780 (define-public mupen64plus-rsp-hle
782 (name "mupen64plus-rsp-hle")
788 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle")
790 (file-name (git-file-name name version))
792 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
793 (build-system gnu-build-system)
795 `(("mupen64plus-core" ,mupen64plus-core)))
798 (modify-phases %standard-phases
799 ;; The mupen64plus build system has no configure phase.
801 ;; Makefile is in a subdirectory.
803 'build 'cd-to-project-dir
805 (chdir "projects/unix"))))
807 (let ((out (assoc-ref %outputs "out"))
808 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
810 (string-append "PREFIX=" out)
811 (string-append "APIDIR=" m64p "/include/mupen64plus")))
812 ;; There are no tests.
814 (home-page "https://www.mupen64plus.org/")
815 (synopsis "Mupen64Plus SDL input plugin")
817 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
818 which is capable of accurately playing many games. This package contains the
819 high-level emulation (HLE) RSP processor plugin.")
820 (license license:gpl2+)))
822 (define-public mupen64plus-rsp-z64
824 (name "mupen64plus-rsp-z64")
830 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64")
832 (file-name (git-file-name name version))
834 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
835 (build-system gnu-build-system)
837 `(("mupen64plus-core" ,mupen64plus-core)))
840 (modify-phases %standard-phases
841 ;; The mupen64plus build system has no configure phase.
843 ;; Makefile is in a subdirectory.
845 'build 'cd-to-project-dir
847 (chdir "projects/unix"))))
849 (let ((out (assoc-ref %outputs "out"))
850 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
852 (string-append "PREFIX=" out)
853 (string-append "APIDIR=" m64p "/include/mupen64plus")))
854 ;; There are no tests.
856 (home-page "https://www.mupen64plus.org/")
857 (synopsis "Mupen64Plus SDL input plugin")
859 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
860 which is capable of accurately playing many games. This package contains the
861 Z64 RSP processor plugin.")
862 (license license:gpl2+)))
864 (define-public mupen64plus-video-arachnoid
866 (name "mupen64plus-video-arachnoid")
872 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid")
874 (file-name (git-file-name name version))
876 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
877 (build-system gnu-build-system)
879 `(("pkg-config" ,pkg-config)
883 ("mupen64plus-core" ,mupen64plus-core)))
886 (modify-phases %standard-phases
887 ;; The mupen64plus build system has no configure phase.
889 ;; Makefile is in a subdirectory.
891 'build 'cd-to-project-dir
893 (chdir "projects/unix"))))
895 (let ((out (assoc-ref %outputs "out"))
896 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
898 (string-append "PREFIX=" out)
899 (string-append "APIDIR=" m64p "/include/mupen64plus")))
900 ;; There are no tests.
902 (home-page "https://www.mupen64plus.org/")
903 (synopsis "Mupen64Plus Rice Video plugin")
905 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
906 which is capable of accurately playing many games. This package contains the
907 Arachnoid video plugin.")
908 (license license:gpl2+)))
910 (define-public mupen64plus-video-glide64
912 (name "mupen64plus-video-glide64")
918 (url "https://github.com/mupen64plus/mupen64plus-video-glide64")
920 (file-name (git-file-name name version))
922 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
923 (build-system gnu-build-system)
925 `(("pkg-config" ,pkg-config)
929 ("mupen64plus-core" ,mupen64plus-core)
933 (modify-phases %standard-phases
934 ;; The mupen64plus build system has no configure phase.
936 ;; Makefile is in a subdirectory.
938 'build 'cd-to-project-dir
940 (chdir "projects/unix")))
941 ;; XXX Should be unnecessary with the next release.
945 (substitute* "Makefile"
946 (("SDL_CONFIG = (.*)sdl-config" all prefix)
947 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
949 (let ((out (assoc-ref %outputs "out"))
950 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
952 (string-append "PREFIX=" out)
953 (string-append "APIDIR=" m64p "/include/mupen64plus")))
954 ;; There are no tests.
956 (home-page "https://www.mupen64plus.org/")
957 (synopsis "Mupen64Plus Rice Video plugin")
959 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
960 which is capable of accurately playing many games. This package contains the
961 Glide64 video plugin.")
962 (license license:gpl2+)))
964 (define-public mupen64plus-video-glide64mk2
966 (name "mupen64plus-video-glide64mk2")
972 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2")
974 (file-name (git-file-name name version))
976 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
977 (build-system gnu-build-system)
979 `(("pkg-config" ,pkg-config)
985 ("mupen64plus-core" ,mupen64plus-core)
990 (modify-phases %standard-phases
991 ;; The mupen64plus build system has no configure phase.
993 ;; Makefile is in a subdirectory.
995 'build 'cd-to-project-dir
997 (chdir "projects/unix"))))
999 (let ((out (assoc-ref %outputs "out"))
1000 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1002 (string-append "PREFIX=" out)
1003 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1004 ;; There are no tests.
1006 (home-page "https://www.mupen64plus.org/")
1007 (synopsis "Mupen64Plus Rice Video plugin")
1009 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1010 which is capable of accurately playing many games. This package contains the
1011 Glide64MK2 video plugin.")
1012 (license license:gpl2+)))
1014 (define-public mupen64plus-video-rice
1016 (name "mupen64plus-video-rice")
1022 (url "https://github.com/mupen64plus/mupen64plus-video-rice")
1024 (file-name (git-file-name name version))
1026 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
1027 (build-system gnu-build-system)
1029 `(("pkg-config" ,pkg-config)
1032 `(("libpng" ,libpng)
1034 ("mupen64plus-core" ,mupen64plus-core)
1038 (modify-phases %standard-phases
1039 ;; The mupen64plus build system has no configure phase.
1041 ;; Makefile is in a subdirectory.
1043 'build 'cd-to-project-dir
1045 (chdir "projects/unix"))))
1047 (let ((out (assoc-ref %outputs "out"))
1048 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1050 (string-append "PREFIX=" out)
1051 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1052 ;; There are no tests.
1054 (home-page "https://www.mupen64plus.org/")
1055 (synopsis "Mupen64Plus Rice Video plugin")
1057 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1058 which is capable of accurately playing many games. This package contains the
1059 Rice Video plugin.")
1060 (license license:gpl2+)))
1062 (define-public mupen64plus-video-z64
1064 (name "mupen64plus-video-z64")
1070 (url "https://github.com/mupen64plus/mupen64plus-video-z64")
1072 (file-name (git-file-name name version))
1074 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
1075 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
1076 (build-system gnu-build-system)
1078 `(("pkg-config" ,pkg-config)
1082 ("mupen64plus-core" ,mupen64plus-core)
1086 (modify-phases %standard-phases
1087 ;; The mupen64plus build system has no configure phase.
1089 ;; Makefile is in a subdirectory.
1091 'build 'cd-to-project-dir
1093 (chdir "projects/unix")))
1094 ;; XXX Should be unnecessary with the next release.
1098 (substitute* "Makefile"
1099 (("SDL_CONFIG = (.*)sdl-config" all prefix)
1100 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
1102 (let ((out (assoc-ref %outputs "out"))
1103 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1105 (string-append "PREFIX=" out)
1106 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1107 ;; There are no tests.
1109 (home-page "https://www.mupen64plus.org/")
1110 (synopsis "Mupen64Plus Z64 video plugin")
1112 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1113 which is capable of accurately playing many games. This package contains the
1115 (license license:gpl2+)))
1117 (define-public mupen64plus-ui-console
1119 (name "mupen64plus-ui-console")
1125 (url "https://github.com/mupen64plus/mupen64plus-ui-console")
1127 (file-name (git-file-name name version))
1129 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
1130 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
1131 (build-system gnu-build-system)
1133 `(("pkg-config" ,pkg-config)
1137 ;; Mupen64Plus supports a single data directory and a single plugin
1138 ;; directory in its configuration, yet we need data and plugin files from
1139 ;; a variety of packages. The best way to deal with this is to install
1140 ;; all packages from which data and plugin files are needed into one's
1141 ;; profile, and point the configuration there. Hence, propagate the most
1142 ;; important packages here to save the user from the bother. The patch
1143 ;; mupen64plus-ui-console-notice also gives users instructions on what
1144 ;; they need to do in order to point the configuration to their profile.
1146 `(("mupen64plus-core" ,mupen64plus-core)
1147 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
1148 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
1149 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
1150 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
1151 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
1152 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
1155 (modify-phases %standard-phases
1156 ;; The mupen64plus build system has no configure phase.
1158 ;; Makefile is in a subdirectory.
1160 'build 'cd-to-project-dir
1162 (chdir "projects/unix"))))
1164 (let ((out (assoc-ref %outputs "out"))
1165 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1167 (string-append "PREFIX=" out)
1168 (string-append "APIDIR=" m64p "/include/mupen64plus")
1169 ;; Trailing slash matters here.
1170 (string-append "COREDIR=" m64p "/lib/")))
1171 ;; There are no tests.
1173 (home-page "https://www.mupen64plus.org/")
1174 (synopsis "Mupen64Plus command line user interface")
1176 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1177 which is capable of accurately playing many games. This package contains the
1178 command line user interface. Installing this package is the easiest way
1179 towards a working Mupen64Plus for casual users.")
1180 (license license:gpl2+)))
1182 (define-public nestopia-ue
1184 (name "nestopia-ue")
1190 (url "https://github.com/rdanbrook/nestopia")
1192 (file-name (git-file-name name version))
1194 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1195 (modules '((guix build utils)))
1198 ;; We don't need libretro for the GNU/Linux build.
1199 (delete-file-recursively "libretro")
1201 (build-system cmake-build-system)
1203 `(("pkg-config" ,pkg-config)))
1207 ("libarchive" ,libarchive)
1208 ("libepoxy" ,libepoxy)
1213 (modify-phases %standard-phases
1214 ;; This fixes the file chooser crash that happens with GTK 3.
1215 (add-after 'install 'wrap-program
1216 (lambda* (#:key inputs outputs #:allow-other-keys)
1217 (let* ((out (assoc-ref outputs "out"))
1218 (nestopia (string-append out "/bin/nestopia"))
1219 (gtk (assoc-ref inputs "gtk+"))
1220 (gtk-share (string-append gtk "/share")))
1221 (wrap-program nestopia
1222 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1223 ;; There are no tests.
1225 (home-page "http://0ldsk00l.ca/nestopia/")
1226 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1228 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1229 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1230 emulation community. It provides highly accurate emulation.")
1231 (license license:gpl2+)))
1233 (define-public retroarch
1241 (url "https://github.com/libretro/RetroArch")
1242 (commit (string-append "v" version))))
1243 (file-name (git-file-name name version))
1245 (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))
1247 (search-patches "retroarch-disable-online-updater.patch"))
1248 (modules '((guix build utils)))
1251 ;; Don't suggest using the Online Updater if available: it never
1252 ;; is. This disables translation of this particular message.
1253 (substitute* (find-files "menu/drivers" "\\.c$")
1254 (("msg_hash_to_str\\(MSG_MISSING_ASSETS\\)")
1255 "\"Warning: Missing assets, go get some\""))
1257 (build-system gnu-build-system)
1259 `(#:tests? #f ; no tests
1261 (modify-phases %standard-phases
1263 (lambda* (#:key inputs outputs #:allow-other-keys)
1264 (let* ((out (assoc-ref outputs "out"))
1265 (etc (string-append out "/etc"))
1266 (vulkan (assoc-ref inputs "vulkan-loader"))
1267 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1268 ;; Hard-code some store file names.
1269 (substitute* "gfx/common/vulkan_common.c"
1270 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1271 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1272 (("/usr/local/share/wayland-protocols")
1273 (string-append wayland-protocols "/share/wayland-protocols")))
1274 (substitute* "qb/qb.libs.sh"
1275 (("/bin/true") (which "true")))
1278 (substitute* '("libretro-common/file/archive_file_zlib.c"
1279 "libretro-common/streams/trans_stream_zlib.c")
1280 (("<compat/zlib.h>") "<zlib.h>"))
1282 ;; The configure script does not yet accept the extra arguments
1283 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1286 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1288 '("--enable-neon" "--enable-floathard")
1290 (string-append "--prefix=" out)
1291 (string-append "--global-config-dir=" etc)
1292 "--disable-builtinminiupnpc")))))))
1294 `(("alsa-lib" ,alsa-lib)
1296 ("freetype" ,freetype)
1297 ("libxinerama" ,libxinerama)
1298 ("libxkbcommon" ,libxkbcommon)
1299 ("libxml2" ,libxml2)
1300 ("libxrandr" ,libxrandr)
1303 ("miniupnpc" ,miniupnpc)
1305 ("pulseaudio" ,pulseaudio)
1310 ("vulkan-loader" ,vulkan-loader)
1311 ("wayland" ,wayland)
1314 `(("pkg-config" ,pkg-config)
1315 ("wayland-protocols" ,wayland-protocols)
1317 (home-page "https://www.libretro.com/")
1318 (synopsis "Reference frontend for the libretro API")
1320 "Libretro is a simple but powerful development interface that allows for
1321 the easy creation of emulators, games and multimedia applications that can plug
1322 straight into any libretro-compatible frontend. RetroArch is the official
1323 reference frontend for the libretro API, currently used by most as a modular
1324 multi-system game/emulator system.")
1325 (license license:gpl3+)))
1327 (define-public scummvm
1334 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1335 "/scummvm-" version ".tar.xz"))
1337 (base32 "1c4fz1nfg0nqnqx9iipayhzcsiqdmfxm2i95nw9dbhshhsdnrhf4"))))
1338 (build-system gnu-build-system)
1340 `(#:tests? #f ;require "git"
1341 #:configure-flags (list "--enable-release") ;for optimizations
1343 (modify-phases %standard-phases
1344 (add-after 'unpack 'fix-build
1345 ;; XXX: The following works around a build failure introduced when
1346 ;; Fluidsynth was updated to version 2.1. It has been applied
1347 ;; upstream as 68758a879e0c8ecc0d40962516d4e808aa4e15e5 and can be
1348 ;; removed once this commit makes it into a release.
1350 (substitute* "audio/softsynth/fluidsynth.cpp"
1351 (("#include <fluidsynth.h>") "")
1352 (("#include \"common/scummsys.h\"") "#include \"config.h\"")
1353 (("#include \"common/config-manager.h\"" line)
1354 (string-append "#include <fluidsynth.h>\n"
1355 "#include \"common/scummsys.h\"\n"
1359 ;; configure does not work followed by both "SHELL=..." and
1360 ;; "CONFIG_SHELL=..."; set environment variables instead
1361 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1362 (let* ((out (assoc-ref outputs "out"))
1363 (bash (which "bash"))
1364 (flags `(,(string-append "--prefix=" out)
1365 ,@configure-flags)))
1366 (setenv "SHELL" bash)
1367 (setenv "CONFIG_SHELL" bash)
1368 (apply invoke "./configure" flags)))))))
1371 ("pkg-config" ,pkg-config)))
1373 `(("alsa-lib" ,alsa-lib)
1375 ("fluidsynth" ,fluidsynth)
1376 ("freetype" ,freetype)
1379 ("libjpeg-turbo" ,libjpeg-turbo)
1381 ("libmpeg2" ,libmpeg2)
1384 ("libtheora" ,libtheora)
1385 ("libvorbis" ,libvorbis)
1386 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
1388 (home-page "https://www.scummvm.org/")
1389 (synopsis "Engine for several graphical adventure games")
1390 (description "ScummVM is a program which allows you to run certain
1391 classic graphical point-and-click adventure games, provided you
1392 already have their data files. The clever part about this: ScummVM
1393 just replaces the executables shipped with the games, allowing you to
1394 play them on systems for which they were never designed!")
1395 (license license:gpl2+)))
1405 (url "https://github.com/mamedev/mame")
1406 (commit (apply string-append "mame" (string-split version #\.)))))
1407 (file-name (git-file-name name version))
1409 (base32 "0dpg4hz2f1wlp0rmk5c5xq57fy0sblh97z3l66p814wkgzap4bhx"))
1410 (modules '((guix build utils)))
1412 ;; Remove bundled libraries.
1414 (with-directory-excursion "3rdparty"
1415 (for-each delete-file-recursively
1416 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1417 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1418 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1420 (build-system gnu-build-system)
1424 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1426 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1427 (string-append "SDL_INI_PATH="
1428 (assoc-ref %outputs "out")
1431 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1432 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1433 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1434 #:tests? #f ;no test in regular release
1436 (modify-phases %standard-phases
1438 (add-after 'build 'build-documentation
1439 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1441 ;; Upstream does not provide an installation phase.
1442 (lambda* (#:key outputs #:allow-other-keys)
1443 (let* ((out (assoc-ref outputs "out"))
1444 (share (string-append out "/share/mame")))
1446 (for-each (lambda (dir)
1447 (copy-recursively dir (string-append share "/" dir)))
1448 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1449 "plugins" "samples"))
1450 (let ((keymaps (string-append share "/keymaps")))
1451 (for-each (lambda (file) (install-file file keymaps))
1452 (find-files "keymaps" ".*LINUX\\.map")))
1453 (let ((fonts (string-append share "/fonts")))
1454 (install-file "uismall.bdf" fonts))
1455 (when (file-exists? "mame64")
1456 (rename-file "mame64" "mame"))
1457 (install-file "mame" (string-append out "/bin")))
1459 (add-after 'install 'install-documentation
1460 (lambda* (#:key outputs #:allow-other-keys)
1461 (let* ((out (assoc-ref outputs "out"))
1462 (man (string-append out "/share/man/man1"))
1463 (info (string-append out "/share/info")))
1464 (install-file "docs/build/man/MAME.1" man)
1465 (install-file "docs/build/texinfo/MAME.info" info))
1467 (add-after 'install 'install-ini-file
1468 ;; Generate an ini file so as to set some directories (e.g., roms)
1469 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1471 ;; XXX: We need to insert absolute references to the store. It can
1472 ;; be an issue if they leak into user's home directory, e.g., with
1473 ;; "mame -createconfig" and the package is later GC'ed.
1474 (lambda* (#:key outputs #:allow-other-keys)
1475 (let* ((out (assoc-ref outputs "out"))
1476 (share (string-append out "/share/mame"))
1477 (ini (string-append share "/ini")))
1478 (with-output-to-file (string-append ini "/mame.ini")
1481 "inipath $HOME/.mame;~a/ini~@
1482 homepath $HOME/mame~@
1483 rompath $HOME/mame/roms~@
1484 samplepath $HOME/mame/samples;~a/samples~@
1485 cheatpath $HOME/mame/cheat~@
1486 artpath $HOME/mame/artwork;~a/artwork~@
1487 crosshairpath $HOME/mame/crosshair~@
1488 snapshot_directory $HOME/mame/snapshots~@
1490 fontpath $HOME/mame/fonts;~a/fonts~@
1491 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1493 pluginspath $HOME/mame/plugins;~a/plugins~@
1494 languagepath ~a/language~@
1495 cfg_directory $HOME/.mame/cfg~@
1496 nvram_directory $HOME/.mame/nvram~@
1497 input_directory $HOME/.mame/inp~@
1498 state_directory $HOME/.mame/sta~@
1499 diff_directory $HOME/.mame/diff~@
1500 comment_directory $HOME/.mame/comments~%"
1501 share share share share share share share share
1503 (with-output-to-file (string-append ini "/ui.ini")
1506 "historypath $HOME/mame/history~@
1507 categorypath $HOME/mame/folders~@
1508 cabinets_directory $HOME/mame/cabinets~@
1509 cpanels_directory $HOME/mame/cpanel~@
1510 pcbs_directory $HOME/mame/pcb~@
1511 flyers_directory $HOME/mame/flyers~@
1512 titles_directory $HOME/mame/titles~@
1513 ends_directory $HOME/mame/ends~@
1514 marquees_directory $HOME/mame/marquees~@
1515 artwork_preview_directory $HOME/mame/artpreview~@
1516 bosses_directory $HOME/mame/bosses~@
1517 logos_directory $HOME/mame/logo~@
1518 scores_directory $HOME/mame/scores~@
1519 versus_directory $HOME/mame/versus~@
1520 gameover_directory $HOME/mame/gameover~@
1521 howto_directory $HOME/mame/howto~@
1522 select_directory $HOME/mame/select~@
1523 icons_directory $HOME/mame/icons~@
1524 covers_directory $HOME/mame/covers~@
1525 ui_path $HOME/.mame/ui~%")))
1527 (add-after 'install 'install-desktop-file
1528 (lambda* (#:key outputs #:allow-other-keys)
1529 (let* ((out (assoc-ref outputs "out"))
1530 (desktop (string-append out "/share/applications"))
1531 (executable (string-append out "/bin/mame")))
1533 (with-output-to-file (string-append desktop "/mame.desktop")
1538 Comment=Multi-purpose emulation framework~@
1543 Categories=Game;Emulator;~@
1544 Keywords=Game;Emulator;Arcade;~%"
1548 `(("pkg-config" ,pkg-config)
1549 ("sphinx" ,python-sphinx)
1550 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1551 ("texinfo" ,texinfo)))
1553 `(("alsa-lib" ,alsa-lib)
1557 ("fontconfig" ,fontconfig)
1559 ("libjpeg" ,libjpeg-turbo)
1561 ("libxinerama" ,libxinerama)
1563 ("portaudio" ,portaudio)
1564 ("portmidi" ,portmidi)
1565 ("pugixml" ,pugixml)
1566 ("python-wrapper" ,python-wrapper)
1568 ("rapidjson" ,rapidjson)
1569 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1571 ("utf8proc" ,utf8proc)
1573 (home-page "https://www.mamedev.org")
1574 (synopsis "Multi-purpose emulation framework")
1575 (description "MAME's purpose is to preserve decades of software
1576 history. As electronic technology continues to rush forward, MAME
1577 prevents this important @emph{vintage} software from being lost and
1578 forgotten. This is achieved by documenting the hardware and how it
1579 functions. The source code to MAME serves as this documentation.")
1580 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1581 ;; However, over 90% of the files are under Expat license. Also, artwork,
1582 ;; keymaps, languages and samples are under CC0.
1583 (license (list license:gpl2+ license:expat license:cc0))))
1585 (define-public gnome-arcade
1587 (name "gnome-arcade")
1593 (url "https://github.com/strippato/gnome-arcade")
1594 (commit (string-append "v." version))))
1595 (file-name (git-file-name name version))
1598 "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
1599 (build-system cmake-build-system)
1601 `(#:tests? #f ; No tests.
1602 #:configure-flags (list
1603 (string-append "-DMAME_BIN=\""
1604 (assoc-ref %build-inputs "mame")
1606 (string-append "-DAPP_RES=\""
1607 (assoc-ref %outputs "out")
1608 "/share/gnome-arcade/\""))
1610 (modify-phases %standard-phases
1611 (add-before 'build 'fix-paths
1612 (lambda* (#:key outputs #:allow-other-keys)
1613 (let ((out (assoc-ref outputs "out")))
1615 (substitute* "../source/src/config.c"
1616 (("/usr/share") (string-append out "/share"))))
1619 (lambda* (#:key outputs #:allow-other-keys)
1620 (let* ((out (assoc-ref outputs "out"))
1621 (bin (string-append out "/bin"))
1622 (rom (string-append out "/share/gnome-arcade/data/rom"))
1623 (tile (string-append out "/share/gnome-arcade/data/tile")))
1625 (install-file "../gnome-arcade" bin)
1626 (copy-recursively "../source/res"
1627 (string-append out "/share/gnome-arcade/res"))
1629 (install-file "../source/data/rom/ROM.TXT" rom)
1631 (install-file "../source/data/tile/TILE.TXT" tile))
1634 `(("pkg-config" ,pkg-config)))
1638 ("libevdev" ,libevdev)
1640 ("libarchive" ,libarchive)))
1641 (home-page "https://github.com/strippato/gnome-arcade")
1642 (synopsis "Minimal MAME frontend")
1644 "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
1646 (license license:gpl3+)))
1648 (define-public pcsxr
1649 ;; No release since 2017.
1650 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1653 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1659 (url "https://github.com/pcsxr/PCSX-Reloaded")
1663 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1664 (file-name (git-file-name name commit))))
1665 (build-system cmake-build-system)
1667 `(#:tests? #f ;no "test" target
1669 (list "-DSND_BACKEND=pulse"
1670 "-DENABLE_CCDDA='ON'"
1671 "-DUSE_LIBARCHIVE='ON'"
1672 "-DUSE_LIBCDIO='ON'")
1674 (modify-phases %standard-phases
1675 (add-after 'unpack 'cd-subdir
1676 (lambda _ (chdir "pcsxr") #t))
1677 (add-before 'configure 'fix-cdio-lookup
1678 (lambda* (#:key inputs #:allow-other-keys)
1679 (substitute* "cmake/FindCdio.cmake"
1680 (("/usr/include/cdio")
1681 (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
1683 (add-after 'install 'wrap-program
1684 (lambda* (#:key inputs outputs #:allow-other-keys)
1685 (wrap-program (string-append (assoc-ref outputs "out")
1687 ;; For GtkFileChooserDialog.
1688 `("GSETTINGS_SCHEMA_DIR" =
1689 (,(string-append (assoc-ref inputs "gtk+")
1690 "/share/glib-2.0/schemas"))))
1693 `(("pkg-config" ,pkg-config)
1694 ("intltool" ,intltool)
1695 ("glib" ,glib "bin")))
1697 `(("libcdio" ,libcdio)
1702 ("libarchive" ,libarchive)
1703 ("pulseaudio" ,pulseaudio)))
1704 (home-page "https://archive.codeplex.com/?p=pcsxr")
1705 (synopsis "PlayStation emulator")
1707 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1709 (license license:gpl2+))))
1711 (define-public gens-gs
1718 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1722 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1723 (build-system glib-or-gtk-build-system)
1725 `(#:system "i686-linux"
1727 (modify-phases %standard-phases
1728 (add-after 'unpack 'fix-CFLAGS
1730 ;; Remove GTK API deprecation flags that cause build errors.
1731 (substitute* "configure"
1732 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1735 `(("pkg-config" ,pkg-config)
1740 (home-page "https://segaretro.org/Gens/GS")
1741 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1743 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1744 derived from Gens. Project goals include clean source code, combined features
1745 from various forks of Gens, and improved platform portability.")
1746 (supported-systems '("i686-linux" "x86_64-linux"))
1747 (license license:gpl2+)))
1749 (define-public bsnes
1757 (url "https://github.com/bsnes-emu/bsnes")
1758 (commit (string-append "v" version))))
1759 (file-name (git-file-name name version))
1762 "0j054x38fwai61vj36sc04r3zkzay5acq2cgd9zqv5hs51s36g5b"))))
1763 (build-system gnu-build-system)
1765 `(#:make-flags (list "-C" "bsnes"
1766 (string-append "prefix=" (assoc-ref %outputs "out")))
1767 #:tests? #f ; No tests.
1768 #:phases (modify-phases %standard-phases
1769 (delete 'configure))))
1771 `(("pkg-config" ,pkg-config)))
1773 `(("alsa-lib" ,alsa-lib)
1777 ("gtksourceview-2" ,gtksourceview-2)
1778 ("libxrandr" ,libxrandr)
1781 ("pulseaudio" ,pulseaudio)
1783 (home-page "https://bsnes.dev/")
1784 (synopsis "Emulator for the Super Nintendo / Super Famicom systems")
1786 "bsnes is a Super Nintendo / Super Famicom emulator that focuses on
1787 performance, features, and ease of use.")
1788 (license license:gpl3)))
1790 ;; python-pwntools requires a -rc release of unicorn
1791 (define-public unicorn
1794 (if (member (%current-system) '("x86_64-linux" "i686-linux"))
1799 (version "1.0.2-rc4")
1800 ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
1805 (url "https://github.com/unicorn-engine/unicorn")
1807 (file-name (git-file-name name version))
1810 "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy"))))
1811 (outputs '("out" "python"))
1812 ;; The main library is not written in Python, but the build process has
1813 ;; little in common with any defined build system, so we might as well
1814 ;; build on top of python-build-system and make use of all
1815 ;; the Python-specific phases that can be reused.
1816 (build-system python-build-system)
1818 `(#:modules ((srfi srfi-26)
1819 (guix build python-build-system)
1822 (modify-phases %standard-phases
1823 (add-after 'unpack 'install-bindings-to-python-output
1824 (lambda* (#:key outputs #:allow-other-keys)
1825 ;; python-build-system will build the bindings and install them to
1826 ;; the "out" output, so change the build-internal names of the
1829 ;; TODO: remove this once #40469 lands, through the core-updates
1830 ;; holding zone, on master.
1831 (set-car! (assoc "out" outputs) "lib")
1832 (set-car! (assoc "python" outputs) "out")
1834 (add-before 'build 'build-library
1835 (lambda* (#:key inputs #:allow-other-keys)
1837 "-j" (number->string (parallel-job-count))
1840 (add-after 'build-library 'install-library
1841 (lambda* (#:key outputs #:allow-other-keys)
1842 (invoke "make" "install"
1846 (assoc-ref outputs "lib")))))
1847 (add-before 'build 'prepare-bindings
1848 (lambda* (#:key outputs #:allow-other-keys)
1849 (chdir "bindings/python")
1850 ;; Set this environment variable so that the Python bindings
1851 ;; don't build their own copy of the shared object, but use
1852 ;; a dummy value such that the bindings test suite uses the
1853 ;; same mechanism for loading the library as any other user.
1854 (setenv "LIBUNICORN_PATH" "1")
1855 (substitute* "unicorn/unicorn.py"
1856 (("_path_list = \\[.*")
1859 (assoc-ref outputs "lib")
1860 ;; eat the rest of the list
1863 (add-before 'check 'check-library
1864 (lambda* (#:key outputs #:allow-other-keys)
1867 (with-directory-excursion
1868 (string-append "../../tests/" suite)
1869 (invoke "make" "test" "CC=gcc"
1871 '("AS=i686-unknown-linux-gnu-as"
1872 "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
1873 '("unit" "regress"))
1875 (add-after 'install 'install-samples
1876 (lambda* (#:key outputs #:allow-other-keys)
1877 (let* ((python-samples (find-files "." "sample_.*"))
1878 (c-samples (find-files "../../samples" ".*\\.c"))
1880 (string-append (assoc-ref outputs "out")
1881 "/share/doc/unicorn/samples"))
1883 (string-append (assoc-ref outputs "lib")
1884 "/share/doc/unicorn/samples")))
1885 (for-each (cut install-file <> c-docdir) c-samples)
1886 (for-each (cut install-file <> python-docdir) python-samples)
1889 ;; NOTE: cross-binutils needs to be wrapped with unless-x86, as otherwise
1890 ;; the linker provided by the package will be used, circumventing the ld-wrapper.
1892 `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
1894 ("hexdump-for-tests" ,util-linux)))
1895 (home-page "http://www.unicorn-engine.org")
1896 (synopsis "Unicorn CPU emulator framework")
1898 "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
1899 framework based on QEMU.")
1900 (license license:gpl2+))))
1902 (define-public ppsspp
1910 (url "https://github.com/hrydgard/ppsspp")
1911 (commit (string-append "v" version))))
1913 (base32 "02yx1w0ygclnmdl0imsvgj24lkzi55wvxkf47q617j0jgrqhy8yl"))
1914 (file-name (git-file-name name version))
1916 (search-patches "ppsspp-disable-upgrade-and-gold.patch"))
1917 (modules '((guix build utils)))
1920 ;; The following is quite a heavy-handed way of unbundling PPSSPP.
1921 ;; There are still a number of external sources, that we don't
1922 ;; remove here. Some may be packaged, others are not.
1923 ;; First, we patch existing sources to include the right headers.
1924 (substitute* (append (list "ext/native/thin3d/vulkan_utils.cpp"
1925 "ext/native/thin3d/thin3d_vulkan.cpp")
1926 (find-files "Common" ".*\\.(h|cpp)")
1927 (find-files "Core" ".*\\.(h|cpp)")
1928 (find-files "GPU" ".*\\.(h|cpp)")
1929 (find-files "SDL" ".*\\.(h|cpp)")
1930 (find-files "UI" ".*\\.(h|cpp)"))
1931 ;; These headers are all hard-coded in the original source.
1932 (("ext/cityhash/") "")
1933 (("ext/glslang/") "")
1934 (("ext/SPIRV-Cross/") "spirv_cross/")
1935 (("ext/vulkan/") "vulkan/")
1936 (("ext/xxhash.h") "xxhash.h")
1937 ;; These definitions do not actually exist in the Vulkan headers,
1938 ;; but PPSSPP defines them in ext/vulkan.
1939 (("VK_FORMAT_BEGIN_RANGE") "VK_FORMAT_UNDEFINED")
1940 (("VK_FORMAT_END_RANGE") "VK_FORMAT_ASTC_12x12_SRGB_BLOCK"))
1941 ;; Next, we patch CMakeLists.
1942 (substitute* "CMakeLists.txt"
1943 ;; Drop unnecessary includes and targets.
1944 (("include_directories\\(ext/glslang\\)") "")
1945 (("include_directories\\(ext/xxhash\\)") "")
1946 (("include_directories\\(ext/cityhash\\)") "")
1947 (("set_target_properties\\(cityhash .*\\)") "")
1948 ;; Fix linking to GLEW.
1949 (("TARGET Ext::GLEW") "true")
1950 (("target_link_libraries\\(native Ext::GLEW\\)")
1951 "find_package(GLEW)\ntarget_link_libraries(native GLEW::GLEW)")
1952 (("Ext::Snappy") "snappy")
1953 ;; Don't search for cityhash/xxhash, we already have them.
1954 (("add_library\\((city|xx)hash STATIC") "if()\nendif(")
1955 (("ext/xxhash\\.[ch]") "")
1956 (("ext/native/ext/cityhash/.*\\.(cpp|h)") "")
1957 ;; Link all of spirv-cross.
1958 (("spirv-cross-glsl" all)
1960 " spirv-cross-core spirv-cross-cpp"
1961 " spirv-cross-reflect spirv-cross-util")))
1962 (substitute* "ext/CMakeLists.txt"
1963 (("add_subdirectory\\(glew\\)") "")
1964 (("add_subdirectory\\(glslang\\)") "")
1965 (("add_subdirectory\\(snappy\\)") "")
1966 (("add_subdirectory\\(SPIRV-Cross-build\\)") ""))
1967 ;; Finally, we can delete the bundled sources.
1968 (for-each delete-file-recursively
1971 "ext/glslang" "ext/glslang-build"
1972 "ext/native/ext/cityhash"
1973 "ext/native/ext/libpng17"
1974 "ext/native/ext/libzip"
1976 "ext/SPIRV-Cross" "ext/SPIRV-Cross-build"
1981 ;; Since we are not including git as an input, PPSSPP is confused
1982 ;; about its version. Let's fix that here.
1983 (substitute* "git-version.cmake"
1984 (("unknown") ,version))))))
1985 (build-system cmake-build-system)
1987 `(("pkg-config" ,pkg-config)
1988 ("python" ,python)))
1990 `(("cityhash" ,cityhash)
1993 ("glslang" ,glslang)
1999 ("spirv-cross" ,spirv-cross)
2000 ("vulkan-headers" ,vulkan-headers)
2001 ("vulkan-loader" ,vulkan-loader)
2004 ;; TODO: unbundle armips.
2005 ("armips-source" ,(package-source armips))
2007 ,(let ((commit "d184ba2b607a03435be579406b816c90add334e6"))
2011 (url "https://github.com/hrydgard/ppsspp-lang")
2014 (base32 "0s003x6247nx09qd6a1jz1l2hsk5d6k1zmh8mg3m6hjjhvbvd9j9"))
2015 (file-name (git-file-name "ppsspp-lang" commit)))))
2017 ,(let ((commit "328b839c7243e7f733f9eae88d059485e3d808e7"))
2021 (url "https://github.com/hrydgard/pspautotests")
2024 (base32 "1gj1kr5ijxrqwvz7c41phskjr70ndp8iz0gr8c3xxsd8p9z5gdvm"))
2025 (file-name (git-file-name "pspautotests" commit)))))))
2027 `(#:out-of-source? #f
2028 #:configure-flags (list "-DUSE_DISCORD=OFF"
2029 "-DUSE_SYSTEM_FFMPEG=ON"
2030 "-DUSE_SYSTEM_LIBZIP=ON"
2032 "-DUNITTEST=ON" "-DHEADLESS=ON")
2034 (modify-phases %standard-phases
2035 (add-after 'unpack 'add-external-sources
2036 (lambda* (#:key inputs #:allow-other-keys)
2037 ;; TODO: unbundle armips.
2038 (copy-recursively (assoc-ref inputs "armips-source")
2040 ;; Some tests are externalised, so we add them here.
2041 (copy-recursively (assoc-ref inputs "tests")
2043 ;; i18n is externalised, so we add it here.
2044 (copy-recursively (assoc-ref inputs "lang")
2050 (lambda (t) (invoke "./unitTest" t))
2051 '("Arm64Emitter" "ArmEmitter" "X64Emitter" "VertexJit" "Asin"
2052 "SinCos" "VFPUSinCos" "MathUtil" "Parsers" "Jit"
2053 "MatrixTranspose" "ParseLBN" "QuickTexHash" "CLZ" "MemMap"))
2054 (invoke "python3" "test.py" "-g")
2057 (lambda* (#:key inputs outputs #:allow-other-keys)
2058 (let* ((out (assoc-ref outputs "out"))
2059 (bin/ppsspp (string-append out "/bin/ppsspp"))
2060 (share (string-append out "/share/ppsspp")))
2061 (copy-recursively "icons/hicolor"
2062 (string-append out "/share/icons/hicolor"))
2063 (install-file "PPSSPPSDL" share)
2064 (copy-recursively "assets" (string-append share "/assets"))
2066 (make-desktop-entry-file
2067 (string-append out "/share/applications/ppsspp.desktop")
2069 #:exec (string-append share "/PPSSPPSDL")
2071 (mkdir-p (string-append out "/bin"))
2072 (with-output-to-file bin/ppsspp
2074 (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\""
2075 (which "sh") share)))
2076 (chmod bin/ppsspp #o755)
2078 (home-page "https://www.ppsspp.org/")
2079 (synopsis "PSP emulator")
2081 "PPSSPP is a ``high-level'' emulator simulating the PSP operating
2083 (license license:gpl2+)))