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 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 emulation-station
283 ;; No release for a long time, new commits fix build issues
284 (let ((commit "9cc42adff67946175d2b7e25c6ae69cc374e98a0")
287 (name "emulation-station")
288 (version (git-version "2.0.1" revision commit))
290 (method git-fetch) ; no tarball available
292 (url "https://github.com/Aloshi/EmulationStation")
293 (commit commit))) ; no version tag
294 (file-name (git-file-name name version))
297 "1cva0ns650v17lfn8in095zci6lc43d23f1x3mlzc41qfqa6mbd1"))))
298 (build-system cmake-build-system)
300 '(#:tests? #f)) ; no tests
302 `(("alsa-lib" ,alsa-lib)
306 ("freeimage" ,freeimage)
307 ("freetype" ,freetype)
310 (synopsis "Video game console emulator front-end")
311 (description "EmulationStation provides a graphical front-end to a large
312 number of video game console emulators. It features an interface that is
313 usable with any game controller that has at least 4 buttons, theming support,
314 and a game metadata scraper.")
315 (home-page "https://emulationstation.org")
316 (license license:expat))))
326 (url "https://github.com/higan-emu/higan")
327 (commit (string-append "v" version))))
328 (file-name (git-file-name name version))
330 (base32 "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2"))))
331 (build-system gnu-build-system)
333 `(("pkg-config" ,pkg-config)))
335 `(("alsa-lib" ,alsa-lib)
339 ("gtksourceview-2" ,gtksourceview-2)
340 ("libxrandr" ,libxrandr)
344 ("pulseaudio" ,pulseaudio)
348 (let ((build-phase (assoc-ref %standard-phases 'build))
349 (install-phase (assoc-ref %standard-phases 'install)))
350 (modify-phases %standard-phases
351 ;; The higan build system has no configure phase.
353 (add-before 'build 'chdir-to-higan
357 (add-before 'install 'create-/share/applications
358 (lambda* (#:key outputs #:allow-other-keys)
359 (let ((out (assoc-ref outputs "out")))
360 ;; It seems the author forgot to do this in the Makefile.
361 (mkdir-p (string-append out "/share/applications"))
363 (add-after 'install 'chdir-to-icarus
367 (add-after 'chdir-to-icarus 'build-icarus build-phase)
368 (add-after 'build-icarus 'install-icarus install-phase)
369 (add-after 'install-icarus 'wrap-higan-executable
370 (lambda* (#:key inputs outputs #:allow-other-keys)
371 (let* ((out (assoc-ref outputs "out"))
372 (bin (string-append out "/bin"))
373 (higan (string-append bin "/higan"))
374 (higan-original (string-append higan "-original"))
375 (bash (string-append (assoc-ref inputs "bash")
377 (coreutils (assoc-ref inputs "coreutils"))
378 (mkdir (string-append coreutils "/bin/mkdir"))
379 (cp (string-append coreutils "/bin/cp"))
380 (cp-r (string-append cp " -r --no-preserve=mode")))
381 ;; First, have the executable make sure ~/.local/share/higan
382 ;; contains up to date files. Higan insists on looking there
383 ;; for these data files.
384 (rename-file higan higan-original)
385 (with-output-to-file higan
390 ;; higan doesn't respect $XDG_DATA_HOME
391 mkdir " -p ~/.local/share\n"
392 cp-r " " out "/share/higan ~/.local/share\n"
393 "exec " higan-original))))
395 ;; Second, make sure higan will find icarus in PATH.
397 `("PATH" ":" prefix (,bin)))
401 (string-append "prefix=" (assoc-ref %outputs "out")))
402 ;; There is no test suite.
404 (home-page "https://github.com/higan-emu/higan/")
405 (synopsis "Multi-system emulator")
407 "higan is a multi-system emulator with an uncompromising focus on
408 accuracy and code readability.
410 It currently emulates the following systems: Famicom, Famicom Disk System,
411 Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
412 Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive, Mega
413 CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket, Neo Geo
414 Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge
416 (license license:gpl3+)))
418 (define-public mednafen
425 (uri (string-append "https://mednafen.github.io/releases/files/"
426 "mednafen-" version ".tar.xz"))
428 (base32 "03zplcfvmnnv7grhacmr1zy789pb2wda36wylmzmar23g0zqbsix"))))
429 (build-system gnu-build-system)
433 ;; "--with-external-mpcdec"
434 "--with-external-lzo")))
436 `(("pkg-config" ,pkg-config)))
439 ;; ("libmpcdec" ,libmpcdec) FIXME: not recognized.
440 ("libsndfile" ,libsndfile)
444 (home-page "https://mednafen.github.io/")
445 (synopsis "Multi-system emulator utilizing OpenGL and SDL")
447 "Mednafen is a portable, utilizing OpenGL and SDL, argument-driven
448 multi-system emulator. Mednafen has the ability to remap hotkey functions and
449 virtual system inputs to a keyboard, a joystick, or both simultaneously. Save
450 states are supported, as is real-time game rewinding. Screen snapshots may be
451 taken, in the PNG file format, at the press of a button. Mednafen can record
452 audiovisual movies in the QuickTime file format, with several different
453 lossless codecs supported.
455 The following systems are supported:
460 @item Neo Geo Pocket (Color)
462 @item GameBoy (Color)
463 @item GameBoy Advance
464 @item Nintendo Entertainment System
465 @item Super Nintendo Entertainment System/Super Famicom
467 @item PC Engine/TurboGrafx 16 (CD)
471 @item Sega Genesis/Megadrive
472 @item Sega Master System
473 @item Sega Saturn (experimental, x86_64 only)
474 @item Sony PlayStation
476 ;; Main license is GPL2+. Some parts are BSD-3.
477 (license (list license:gpl2+ license:bsd-3))))
487 (url "https://github.com/mgba-emu/mgba")
489 (file-name (git-file-name name version))
491 (base32 "0dlwhn3hrpaqnl5hjs53y8j2i16idxrg3gy688gcwrc9z1a6bkn2"))
492 (modules '((guix build utils)))
494 ;; Make sure we don't use the bundled software.
498 (let ((lib-subdir (string-append "src/third-party/" subdir)))
499 (delete-file-recursively lib-subdir)))
500 '("libpng" "lzma" "sqlite3" "zlib"))
502 (build-system cmake-build-system)
504 `(#:tests? #f ;no "test" target
506 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
507 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
508 (native-inputs `(("pkg-config" ,pkg-config)
509 ("qttools" ,qttools)))
510 (inputs `(("ffmpeg" ,ffmpeg)
511 ("imagemagick" ,imagemagick)
514 ("libepoxy" ,libepoxy)
520 ("qtmultimedia" ,qtmultimedia)
524 (home-page "https://mgba.io")
525 (synopsis "Game Boy Advance emulator")
527 "mGBA is an emulator for running Game Boy Advance games. It aims to be
528 faster and more accurate than many existing Game Boy Advance emulators, as
529 well as adding features that other emulators lack. It also supports Game Boy
530 and Game Boy Color games.")
531 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+, "inih.c" is
532 ;; BSD-3, and "discord-rpc" is Expat.
533 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3 license:expat))))
535 (define-public sameboy
543 (url "https://github.com/LIJI32/SameBoy")
544 (commit (string-append "v" version))))
545 (file-name (git-file-name name version))
547 (base32 "1mv5a7p6plz0359l3z9g232rgaq2h3yby5949ps0s88cxj94w9qm"))))
548 (build-system gnu-build-system)
552 ("pkg-config" ,pkg-config)))
556 `(#:tests? #f ; There are no tests
557 #:make-flags `("CC=gcc" "NATIVE_CC=gcc" "CONF=release"
558 ,(string-append "DATA_DIR="
559 (assoc-ref %outputs "out")
562 (modify-phases %standard-phases
565 (lambda* (#:key outputs #:allow-other-keys)
566 (let* ((out (assoc-ref outputs "out"))
567 (bin (string-append out "/bin"))
568 (data (string-append out "/share/sameboy/")))
569 (with-directory-excursion "build/bin/SDL"
570 (install-file "sameboy" bin)
571 (delete-file "sameboy")
572 (copy-recursively "." data))
574 (home-page "https://sameboy.github.io/")
575 (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
576 (description "SameBoy is a user friendly Game Boy, Game Boy Color
577 and Super Game Boy emulator. SameBoy is accurate and includes a wide
578 range of debugging features. It has all the features one would expect
579 from an emulator---from save states to scaling filters.")
580 (license license:expat)))
582 (define-public mupen64plus-core
584 (name "mupen64plus-core")
590 (url "https://github.com/mupen64plus/mupen64plus-core")
592 (file-name (git-file-name name version))
594 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
595 (build-system gnu-build-system)
597 `(("pkg-config" ,pkg-config)
600 `(("freetype" ,freetype)
608 (modify-phases %standard-phases
609 ;; The mupen64plus build system has no configure phase.
611 ;; Makefile is in a subdirectory.
613 'build 'chdir-to-project-directory
615 (chdir "projects/unix")
617 #:make-flags (let ((out (assoc-ref %outputs "out")))
618 (list "all" (string-append "PREFIX=" out)))
619 ;; There are no tests.
621 ;; As per the Makefile (in projects/unix/Makefile):
622 (supported-systems '("i686-linux" "x86_64-linux"))
623 (home-page "https://www.mupen64plus.org/")
624 (synopsis "Nintendo 64 emulator core library")
626 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
627 which is capable of accurately playing many games. This package contains the
629 (license license:gpl2+)))
631 (define-public mupen64plus-audio-sdl
633 (name "mupen64plus-audio-sdl")
639 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl")
641 (file-name (git-file-name name version))
643 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
644 (build-system gnu-build-system)
646 `(("pkg-config" ,pkg-config)
649 `(("mupen64plus-core" ,mupen64plus-core)
653 (modify-phases %standard-phases
654 ;; The mupen64plus build system has no configure phase.
656 ;; Makefile is in a subdirectory.
658 'build 'cd-to-project-dir
660 (chdir "projects/unix"))))
662 (let ((out (assoc-ref %outputs "out"))
663 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
665 (string-append "PREFIX=" out)
666 (string-append "APIDIR=" m64p "/include/mupen64plus")))
667 ;; There are no tests.
669 (home-page "https://www.mupen64plus.org/")
670 (synopsis "Mupen64Plus SDL input plugin")
672 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
673 which is capable of accurately playing many games. This package contains the
675 (license license:gpl2+)))
677 (define-public mupen64plus-input-sdl
679 (name "mupen64plus-input-sdl")
685 (url "https://github.com/mupen64plus/mupen64plus-input-sdl")
687 (file-name (git-file-name name version))
689 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
690 (build-system gnu-build-system)
694 `(("mupen64plus-core" ,mupen64plus-core)
698 (modify-phases %standard-phases
699 ;; The mupen64plus build system has no configure phase.
701 ;; Makefile is in a subdirectory.
703 'build 'cd-to-project-dir
705 (chdir "projects/unix"))))
707 (let ((out (assoc-ref %outputs "out"))
708 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
710 (string-append "PREFIX=" out)
711 (string-append "APIDIR=" m64p "/include/mupen64plus")))
712 ;; There are no tests.
714 (home-page "https://www.mupen64plus.org/")
715 (synopsis "Mupen64Plus SDL input plugin")
717 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
718 which is capable of accurately playing many games. This package contains the
720 (license license:gpl2+)))
722 (define-public mupen64plus-rsp-hle
724 (name "mupen64plus-rsp-hle")
730 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle")
732 (file-name (git-file-name name version))
734 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
735 (build-system gnu-build-system)
737 `(("mupen64plus-core" ,mupen64plus-core)))
740 (modify-phases %standard-phases
741 ;; The mupen64plus build system has no configure phase.
743 ;; Makefile is in a subdirectory.
745 'build 'cd-to-project-dir
747 (chdir "projects/unix"))))
749 (let ((out (assoc-ref %outputs "out"))
750 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
752 (string-append "PREFIX=" out)
753 (string-append "APIDIR=" m64p "/include/mupen64plus")))
754 ;; There are no tests.
756 (home-page "https://www.mupen64plus.org/")
757 (synopsis "Mupen64Plus SDL input plugin")
759 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
760 which is capable of accurately playing many games. This package contains the
761 high-level emulation (HLE) RSP processor plugin.")
762 (license license:gpl2+)))
764 (define-public mupen64plus-rsp-z64
766 (name "mupen64plus-rsp-z64")
772 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64")
774 (file-name (git-file-name name version))
776 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
777 (build-system gnu-build-system)
779 `(("mupen64plus-core" ,mupen64plus-core)))
782 (modify-phases %standard-phases
783 ;; The mupen64plus build system has no configure phase.
785 ;; Makefile is in a subdirectory.
787 'build 'cd-to-project-dir
789 (chdir "projects/unix"))))
791 (let ((out (assoc-ref %outputs "out"))
792 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
794 (string-append "PREFIX=" out)
795 (string-append "APIDIR=" m64p "/include/mupen64plus")))
796 ;; There are no tests.
798 (home-page "https://www.mupen64plus.org/")
799 (synopsis "Mupen64Plus SDL input plugin")
801 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
802 which is capable of accurately playing many games. This package contains the
803 Z64 RSP processor plugin.")
804 (license license:gpl2+)))
806 (define-public mupen64plus-video-arachnoid
808 (name "mupen64plus-video-arachnoid")
814 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid")
816 (file-name (git-file-name name version))
818 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
819 (build-system gnu-build-system)
821 `(("pkg-config" ,pkg-config)
825 ("mupen64plus-core" ,mupen64plus-core)))
828 (modify-phases %standard-phases
829 ;; The mupen64plus build system has no configure phase.
831 ;; Makefile is in a subdirectory.
833 'build 'cd-to-project-dir
835 (chdir "projects/unix"))))
837 (let ((out (assoc-ref %outputs "out"))
838 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
840 (string-append "PREFIX=" out)
841 (string-append "APIDIR=" m64p "/include/mupen64plus")))
842 ;; There are no tests.
844 (home-page "https://www.mupen64plus.org/")
845 (synopsis "Mupen64Plus Rice Video plugin")
847 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
848 which is capable of accurately playing many games. This package contains the
849 Arachnoid video plugin.")
850 (license license:gpl2+)))
852 (define-public mupen64plus-video-glide64
854 (name "mupen64plus-video-glide64")
860 (url "https://github.com/mupen64plus/mupen64plus-video-glide64")
862 (file-name (git-file-name name version))
864 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
865 (build-system gnu-build-system)
867 `(("pkg-config" ,pkg-config)
871 ("mupen64plus-core" ,mupen64plus-core)
875 (modify-phases %standard-phases
876 ;; The mupen64plus build system has no configure phase.
878 ;; Makefile is in a subdirectory.
880 'build 'cd-to-project-dir
882 (chdir "projects/unix")))
883 ;; XXX Should be unnecessary with the next release.
887 (substitute* "Makefile"
888 (("SDL_CONFIG = (.*)sdl-config" all prefix)
889 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
891 (let ((out (assoc-ref %outputs "out"))
892 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
894 (string-append "PREFIX=" out)
895 (string-append "APIDIR=" m64p "/include/mupen64plus")))
896 ;; There are no tests.
898 (home-page "https://www.mupen64plus.org/")
899 (synopsis "Mupen64Plus Rice Video plugin")
901 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
902 which is capable of accurately playing many games. This package contains the
903 Glide64 video plugin.")
904 (license license:gpl2+)))
906 (define-public mupen64plus-video-glide64mk2
908 (name "mupen64plus-video-glide64mk2")
914 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2")
916 (file-name (git-file-name name version))
918 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
919 (build-system gnu-build-system)
921 `(("pkg-config" ,pkg-config)
927 ("mupen64plus-core" ,mupen64plus-core)
932 (modify-phases %standard-phases
933 ;; The mupen64plus build system has no configure phase.
935 ;; Makefile is in a subdirectory.
937 'build 'cd-to-project-dir
939 (chdir "projects/unix"))))
941 (let ((out (assoc-ref %outputs "out"))
942 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
944 (string-append "PREFIX=" out)
945 (string-append "APIDIR=" m64p "/include/mupen64plus")))
946 ;; There are no tests.
948 (home-page "https://www.mupen64plus.org/")
949 (synopsis "Mupen64Plus Rice Video plugin")
951 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
952 which is capable of accurately playing many games. This package contains the
953 Glide64MK2 video plugin.")
954 (license license:gpl2+)))
956 (define-public mupen64plus-video-rice
958 (name "mupen64plus-video-rice")
964 (url "https://github.com/mupen64plus/mupen64plus-video-rice")
966 (file-name (git-file-name name version))
968 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
969 (build-system gnu-build-system)
971 `(("pkg-config" ,pkg-config)
976 ("mupen64plus-core" ,mupen64plus-core)
980 (modify-phases %standard-phases
981 ;; The mupen64plus build system has no configure phase.
983 ;; Makefile is in a subdirectory.
985 'build 'cd-to-project-dir
987 (chdir "projects/unix"))))
989 (let ((out (assoc-ref %outputs "out"))
990 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
992 (string-append "PREFIX=" out)
993 (string-append "APIDIR=" m64p "/include/mupen64plus")))
994 ;; There are no tests.
996 (home-page "https://www.mupen64plus.org/")
997 (synopsis "Mupen64Plus Rice Video plugin")
999 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1000 which is capable of accurately playing many games. This package contains the
1001 Rice Video plugin.")
1002 (license license:gpl2+)))
1004 (define-public mupen64plus-video-z64
1006 (name "mupen64plus-video-z64")
1012 (url "https://github.com/mupen64plus/mupen64plus-video-z64")
1014 (file-name (git-file-name name version))
1016 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
1017 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
1018 (build-system gnu-build-system)
1020 `(("pkg-config" ,pkg-config)
1024 ("mupen64plus-core" ,mupen64plus-core)
1028 (modify-phases %standard-phases
1029 ;; The mupen64plus build system has no configure phase.
1031 ;; Makefile is in a subdirectory.
1033 'build 'cd-to-project-dir
1035 (chdir "projects/unix")))
1036 ;; XXX Should be unnecessary with the next release.
1040 (substitute* "Makefile"
1041 (("SDL_CONFIG = (.*)sdl-config" all prefix)
1042 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
1044 (let ((out (assoc-ref %outputs "out"))
1045 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1047 (string-append "PREFIX=" out)
1048 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1049 ;; There are no tests.
1051 (home-page "https://www.mupen64plus.org/")
1052 (synopsis "Mupen64Plus Z64 video plugin")
1054 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1055 which is capable of accurately playing many games. This package contains the
1057 (license license:gpl2+)))
1059 (define-public mupen64plus-ui-console
1061 (name "mupen64plus-ui-console")
1067 (url "https://github.com/mupen64plus/mupen64plus-ui-console")
1069 (file-name (git-file-name name version))
1071 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
1072 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
1073 (build-system gnu-build-system)
1075 `(("pkg-config" ,pkg-config)
1079 ;; Mupen64Plus supports a single data directory and a single plugin
1080 ;; directory in its configuration, yet we need data and plugin files from
1081 ;; a variety of packages. The best way to deal with this is to install
1082 ;; all packages from which data and plugin files are needed into one's
1083 ;; profile, and point the configuration there. Hence, propagate the most
1084 ;; important packages here to save the user from the bother. The patch
1085 ;; mupen64plus-ui-console-notice also gives users instructions on what
1086 ;; they need to do in order to point the configuration to their profile.
1088 `(("mupen64plus-core" ,mupen64plus-core)
1089 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
1090 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
1091 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
1092 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
1093 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
1094 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
1097 (modify-phases %standard-phases
1098 ;; The mupen64plus build system has no configure phase.
1100 ;; Makefile is in a subdirectory.
1102 'build 'cd-to-project-dir
1104 (chdir "projects/unix"))))
1106 (let ((out (assoc-ref %outputs "out"))
1107 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1109 (string-append "PREFIX=" out)
1110 (string-append "APIDIR=" m64p "/include/mupen64plus")
1111 ;; Trailing slash matters here.
1112 (string-append "COREDIR=" m64p "/lib/")))
1113 ;; There are no tests.
1115 (home-page "https://www.mupen64plus.org/")
1116 (synopsis "Mupen64Plus command line user interface")
1118 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1119 which is capable of accurately playing many games. This package contains the
1120 command line user interface. Installing this package is the easiest way
1121 towards a working Mupen64Plus for casual users.")
1122 (license license:gpl2+)))
1124 (define-public nestopia-ue
1126 (name "nestopia-ue")
1132 (url "https://github.com/rdanbrook/nestopia")
1134 (file-name (git-file-name name version))
1136 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1137 (modules '((guix build utils)))
1140 ;; We don't need libretro for the GNU/Linux build.
1141 (delete-file-recursively "libretro")
1143 (build-system cmake-build-system)
1145 `(("pkg-config" ,pkg-config)))
1149 ("libarchive" ,libarchive)
1150 ("libepoxy" ,libepoxy)
1155 (modify-phases %standard-phases
1156 ;; This fixes the file chooser crash that happens with GTK 3.
1157 (add-after 'install 'wrap-program
1158 (lambda* (#:key inputs outputs #:allow-other-keys)
1159 (let* ((out (assoc-ref outputs "out"))
1160 (nestopia (string-append out "/bin/nestopia"))
1161 (gtk (assoc-ref inputs "gtk+"))
1162 (gtk-share (string-append gtk "/share")))
1163 (wrap-program nestopia
1164 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1165 ;; There are no tests.
1167 (home-page "http://0ldsk00l.ca/nestopia/")
1168 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1170 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1171 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1172 emulation community. It provides highly accurate emulation.")
1173 (license license:gpl2+)))
1175 (define-public retroarch
1183 (url "https://github.com/libretro/RetroArch")
1184 (commit (string-append "v" version))))
1185 (file-name (git-file-name name version))
1187 (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))
1189 (search-patches "retroarch-disable-online-updater.patch"))
1190 (modules '((guix build utils)))
1193 ;; Don't suggest using the Online Updater if available: it never
1194 ;; is. This disables translation of this particular message.
1195 (substitute* (find-files "menu/drivers" "\\.c$")
1196 (("msg_hash_to_str\\(MSG_MISSING_ASSETS\\)")
1197 "\"Warning: Missing assets, go get some\""))
1199 (build-system gnu-build-system)
1201 `(#:tests? #f ; no tests
1203 (modify-phases %standard-phases
1205 (lambda* (#:key inputs outputs #:allow-other-keys)
1206 (let* ((out (assoc-ref outputs "out"))
1207 (etc (string-append out "/etc"))
1208 (vulkan (assoc-ref inputs "vulkan-loader"))
1209 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1210 ;; Hard-code some store file names.
1211 (substitute* "gfx/common/vulkan_common.c"
1212 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1213 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1214 (("/usr/local/share/wayland-protocols")
1215 (string-append wayland-protocols "/share/wayland-protocols")))
1216 (substitute* "qb/qb.libs.sh"
1217 (("/bin/true") (which "true")))
1220 (substitute* '("libretro-common/file/archive_file_zlib.c"
1221 "libretro-common/streams/trans_stream_zlib.c")
1222 (("<compat/zlib.h>") "<zlib.h>"))
1224 ;; The configure script does not yet accept the extra arguments
1225 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1228 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1230 '("--enable-neon" "--enable-floathard")
1232 (string-append "--prefix=" out)
1233 (string-append "--global-config-dir=" etc)
1234 "--disable-builtinminiupnpc")))))))
1236 `(("alsa-lib" ,alsa-lib)
1238 ("freetype" ,freetype)
1239 ("libxinerama" ,libxinerama)
1240 ("libxkbcommon" ,libxkbcommon)
1241 ("libxml2" ,libxml2)
1242 ("libxrandr" ,libxrandr)
1245 ("miniupnpc" ,miniupnpc)
1247 ("pulseaudio" ,pulseaudio)
1252 ("vulkan-loader" ,vulkan-loader)
1253 ("wayland" ,wayland)
1256 `(("pkg-config" ,pkg-config)
1257 ("wayland-protocols" ,wayland-protocols)
1259 (home-page "https://www.libretro.com/")
1260 (synopsis "Reference frontend for the libretro API")
1262 "Libretro is a simple but powerful development interface that allows for
1263 the easy creation of emulators, games and multimedia applications that can plug
1264 straight into any libretro-compatible frontend. RetroArch is the official
1265 reference frontend for the libretro API, currently used by most as a modular
1266 multi-system game/emulator system.")
1267 (license license:gpl3+)))
1269 (define-public scummvm
1276 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1277 "/scummvm-" version ".tar.xz"))
1279 (base32 "1c4fz1nfg0nqnqx9iipayhzcsiqdmfxm2i95nw9dbhshhsdnrhf4"))))
1280 (build-system gnu-build-system)
1282 `(#:tests? #f ;require "git"
1283 #:configure-flags (list "--enable-release") ;for optimizations
1285 (modify-phases %standard-phases
1286 (add-after 'unpack 'fix-build
1287 ;; XXX: The following works around a build failure introduced when
1288 ;; Fluidsynth was updated to version 2.1. It has been applied
1289 ;; upstream as 68758a879e0c8ecc0d40962516d4e808aa4e15e5 and can be
1290 ;; removed once this commit makes it into a release.
1292 (substitute* "audio/softsynth/fluidsynth.cpp"
1293 (("#include <fluidsynth.h>") "")
1294 (("#include \"common/scummsys.h\"") "#include \"config.h\"")
1295 (("#include \"common/config-manager.h\"" line)
1296 (string-append "#include <fluidsynth.h>\n"
1297 "#include \"common/scummsys.h\"\n"
1301 ;; configure does not work followed by both "SHELL=..." and
1302 ;; "CONFIG_SHELL=..."; set environment variables instead
1303 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1304 (let* ((out (assoc-ref outputs "out"))
1305 (bash (which "bash"))
1306 (flags `(,(string-append "--prefix=" out)
1307 ,@configure-flags)))
1308 (setenv "SHELL" bash)
1309 (setenv "CONFIG_SHELL" bash)
1310 (apply invoke "./configure" flags)))))))
1313 ("pkg-config" ,pkg-config)))
1315 `(("alsa-lib" ,alsa-lib)
1317 ("fluidsynth" ,fluidsynth)
1318 ("freetype" ,freetype)
1321 ("libjpeg-turbo" ,libjpeg-turbo)
1323 ("libmpeg2" ,libmpeg2)
1326 ("libtheora" ,libtheora)
1327 ("libvorbis" ,libvorbis)
1328 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
1330 (home-page "https://www.scummvm.org/")
1331 (synopsis "Engine for several graphical adventure games")
1332 (description "ScummVM is a program which allows you to run certain
1333 classic graphical point-and-click adventure games, provided you
1334 already have their data files. The clever part about this: ScummVM
1335 just replaces the executables shipped with the games, allowing you to
1336 play them on systems for which they were never designed!")
1337 (license license:gpl2+)))
1347 (url "https://github.com/mamedev/mame")
1348 (commit (apply string-append "mame" (string-split version #\.)))))
1349 (file-name (git-file-name name version))
1351 (base32 "1bfnwfxsnmza4s77ca0cyx4b290dwadkbbc2lyd7xa0yqrh7vvlx"))
1352 (modules '((guix build utils)))
1354 ;; Remove bundled libraries.
1356 (with-directory-excursion "3rdparty"
1357 (for-each delete-file-recursively
1358 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1359 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1360 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1362 (build-system gnu-build-system)
1366 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1368 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1369 (string-append "SDL_INI_PATH="
1370 (assoc-ref %outputs "out")
1373 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1374 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1375 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1376 #:tests? #f ;no test in regular release
1378 (modify-phases %standard-phases
1380 (add-after 'build 'build-documentation
1381 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1383 ;; Upstream does not provide an installation phase.
1384 (lambda* (#:key outputs #:allow-other-keys)
1385 (let* ((out (assoc-ref outputs "out"))
1386 (share (string-append out "/share/mame")))
1388 (for-each (lambda (dir)
1389 (copy-recursively dir (string-append share "/" dir)))
1390 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1391 "plugins" "samples"))
1392 (let ((keymaps (string-append share "/keymaps")))
1393 (for-each (lambda (file) (install-file file keymaps))
1394 (find-files "keymaps" ".*LINUX\\.map")))
1395 (let ((fonts (string-append share "/fonts")))
1396 (install-file "uismall.bdf" fonts))
1397 (when (file-exists? "mame64")
1398 (rename-file "mame64" "mame"))
1399 (install-file "mame" (string-append out "/bin")))
1401 (add-after 'install 'install-documentation
1402 (lambda* (#:key outputs #:allow-other-keys)
1403 (let* ((out (assoc-ref outputs "out"))
1404 (man (string-append out "/share/man/man1"))
1405 (info (string-append out "/share/info")))
1406 (install-file "docs/build/man/MAME.1" man)
1407 (install-file "docs/build/texinfo/MAME.info" info))
1409 (add-after 'install 'install-ini-file
1410 ;; Generate an ini file so as to set some directories (e.g., roms)
1411 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1413 ;; XXX: We need to insert absolute references to the store. It can
1414 ;; be an issue if they leak into user's home directory, e.g., with
1415 ;; "mame -createconfig" and the package is later GC'ed.
1416 (lambda* (#:key outputs #:allow-other-keys)
1417 (let* ((out (assoc-ref outputs "out"))
1418 (share (string-append out "/share/mame"))
1419 (ini (string-append share "/ini")))
1420 (with-output-to-file (string-append ini "/mame.ini")
1423 "inipath $HOME/.mame;~a/ini~@
1424 homepath $HOME/mame~@
1425 rompath $HOME/mame/roms~@
1426 samplepath $HOME/mame/samples;~a/samples~@
1427 cheatpath $HOME/mame/cheat~@
1428 artpath $HOME/mame/artwork;~a/artwork~@
1429 crosshairpath $HOME/mame/crosshair~@
1430 snapshot_directory $HOME/mame/snapshots~@
1432 fontpath $HOME/mame/fonts;~a/fonts~@
1433 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1435 pluginspath $HOME/mame/plugins;~a/plugins~@
1436 languagepath ~a/language~@
1437 cfg_directory $HOME/.mame/cfg~@
1438 nvram_directory $HOME/.mame/nvram~@
1439 input_directory $HOME/.mame/inp~@
1440 state_directory $HOME/.mame/sta~@
1441 diff_directory $HOME/.mame/diff~@
1442 comment_directory $HOME/.mame/comments~%"
1443 share share share share share share share share
1445 (with-output-to-file (string-append ini "/ui.ini")
1448 "historypath $HOME/mame/history~@
1449 categorypath $HOME/mame/folders~@
1450 cabinets_directory $HOME/mame/cabinets~@
1451 cpanels_directory $HOME/mame/cpanel~@
1452 pcbs_directory $HOME/mame/pcb~@
1453 flyers_directory $HOME/mame/flyers~@
1454 titles_directory $HOME/mame/titles~@
1455 ends_directory $HOME/mame/ends~@
1456 marquees_directory $HOME/mame/marquees~@
1457 artwork_preview_directory $HOME/mame/artpreview~@
1458 bosses_directory $HOME/mame/bosses~@
1459 logos_directory $HOME/mame/logo~@
1460 scores_directory $HOME/mame/scores~@
1461 versus_directory $HOME/mame/versus~@
1462 gameover_directory $HOME/mame/gameover~@
1463 howto_directory $HOME/mame/howto~@
1464 select_directory $HOME/mame/select~@
1465 icons_directory $HOME/mame/icons~@
1466 covers_directory $HOME/mame/covers~@
1467 ui_path $HOME/.mame/ui~%")))
1469 (add-after 'install 'install-desktop-file
1470 (lambda* (#:key outputs #:allow-other-keys)
1471 (let* ((out (assoc-ref outputs "out"))
1472 (desktop (string-append out "/share/applications"))
1473 (executable (string-append out "/bin/mame")))
1475 (with-output-to-file (string-append desktop "/mame.desktop")
1480 Comment=Multi-purpose emulation framework~@
1485 Categories=Game;Emulator;~@
1486 Keywords=Game;Emulator;Arcade;~%"
1490 `(("pkg-config" ,pkg-config)
1491 ("sphinx" ,python-sphinx)
1492 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1493 ("texinfo" ,texinfo)))
1495 `(("alsa-lib" ,alsa-lib)
1499 ("fontconfig" ,fontconfig)
1501 ("libjpeg" ,libjpeg-turbo)
1503 ("libxinerama" ,libxinerama)
1505 ("portaudio" ,portaudio)
1506 ("portmidi" ,portmidi)
1507 ("pugixml" ,pugixml)
1508 ("python-wrapper" ,python-wrapper)
1510 ("rapidjson" ,rapidjson)
1511 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1513 ("utf8proc" ,utf8proc)
1515 (home-page "https://www.mamedev.org")
1516 (synopsis "Multi-purpose emulation framework")
1517 (description "MAME's purpose is to preserve decades of software
1518 history. As electronic technology continues to rush forward, MAME
1519 prevents this important @emph{vintage} software from being lost and
1520 forgotten. This is achieved by documenting the hardware and how it
1521 functions. The source code to MAME serves as this documentation.")
1522 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1523 ;; However, over 90% of the files are under Expat license. Also, artwork,
1524 ;; keymaps, languages and samples are under CC0.
1525 (license (list license:gpl2+ license:expat license:cc0))))
1527 (define-public gnome-arcade
1529 (name "gnome-arcade")
1535 (url "https://github.com/strippato/gnome-arcade")
1536 (commit (string-append "v." version))))
1537 (file-name (git-file-name name version))
1540 "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
1541 (build-system cmake-build-system)
1543 `(#:tests? #f ; No tests.
1544 #:configure-flags (list
1545 (string-append "-DMAME_BIN=\""
1546 (assoc-ref %build-inputs "mame")
1548 (string-append "-DAPP_RES=\""
1549 (assoc-ref %outputs "out")
1550 "/share/gnome-arcade/\""))
1552 (modify-phases %standard-phases
1553 (add-before 'build 'fix-paths
1554 (lambda* (#:key outputs #:allow-other-keys)
1555 (let ((out (assoc-ref outputs "out")))
1557 (substitute* "../source/src/config.c"
1558 (("/usr/share") (string-append out "/share"))))
1561 (lambda* (#:key outputs #:allow-other-keys)
1562 (let* ((out (assoc-ref outputs "out"))
1563 (bin (string-append out "/bin"))
1564 (rom (string-append out "/share/gnome-arcade/data/rom"))
1565 (tile (string-append out "/share/gnome-arcade/data/tile")))
1567 (install-file "../gnome-arcade" bin)
1568 (copy-recursively "../source/res"
1569 (string-append out "/share/gnome-arcade/res"))
1571 (install-file "../source/data/rom/ROM.TXT" rom)
1573 (install-file "../source/data/tile/TILE.TXT" tile))
1576 `(("pkg-config" ,pkg-config)))
1580 ("libevdev" ,libevdev)
1582 ("libarchive" ,libarchive)))
1583 (home-page "https://github.com/strippato/gnome-arcade")
1584 (synopsis "Minimal MAME frontend")
1586 "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
1588 (license license:gpl3+)))
1590 (define-public pcsxr
1591 ;; No release since 2017.
1592 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1595 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1601 (url "https://github.com/pcsxr/PCSX-Reloaded")
1605 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1606 (file-name (git-file-name name commit))))
1607 (build-system cmake-build-system)
1609 `(#:tests? #f ;no "test" target
1611 (list "-DSND_BACKEND=pulse"
1612 "-DENABLE_CCDDA='ON'"
1613 "-DUSE_LIBARCHIVE='ON'"
1614 "-DUSE_LIBCDIO='ON'")
1616 (modify-phases %standard-phases
1617 (add-after 'unpack 'cd-subdir
1618 (lambda _ (chdir "pcsxr") #t))
1619 (add-before 'configure 'fix-cdio-lookup
1620 (lambda* (#:key inputs #:allow-other-keys)
1621 (substitute* "cmake/FindCdio.cmake"
1622 (("/usr/include/cdio")
1623 (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
1625 (add-after 'install 'wrap-program
1626 (lambda* (#:key inputs outputs #:allow-other-keys)
1627 (wrap-program (string-append (assoc-ref outputs "out")
1629 ;; For GtkFileChooserDialog.
1630 `("GSETTINGS_SCHEMA_DIR" =
1631 (,(string-append (assoc-ref inputs "gtk+")
1632 "/share/glib-2.0/schemas"))))
1635 `(("pkg-config" ,pkg-config)
1636 ("intltool" ,intltool)
1637 ("glib" ,glib "bin")))
1639 `(("libcdio" ,libcdio)
1644 ("libarchive" ,libarchive)
1645 ("pulseaudio" ,pulseaudio)))
1646 (home-page "https://archive.codeplex.com/?p=pcsxr")
1647 (synopsis "PlayStation emulator")
1649 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1651 (license license:gpl2+))))
1653 (define-public gens-gs
1660 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1664 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1665 (build-system glib-or-gtk-build-system)
1667 `(#:system "i686-linux"
1669 (modify-phases %standard-phases
1670 (add-after 'unpack 'fix-CFLAGS
1672 ;; Remove GTK API deprecation flags that cause build errors.
1673 (substitute* "configure"
1674 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1677 `(("pkg-config" ,pkg-config)
1682 (home-page "https://segaretro.org/Gens/GS")
1683 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1685 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1686 derived from Gens. Project goals include clean source code, combined features
1687 from various forks of Gens, and improved platform portability.")
1688 (supported-systems '("i686-linux" "x86_64-linux"))
1689 (license license:gpl2+)))
1691 (define-public bsnes
1699 (url "https://github.com/bsnes-emu/bsnes")
1700 (commit (string-append "v" version))))
1701 (file-name (git-file-name name version))
1704 "0j054x38fwai61vj36sc04r3zkzay5acq2cgd9zqv5hs51s36g5b"))))
1705 (build-system gnu-build-system)
1707 `(#:make-flags (list "-C" "bsnes"
1708 (string-append "prefix=" (assoc-ref %outputs "out")))
1709 #:tests? #f ; No tests.
1710 #:phases (modify-phases %standard-phases
1711 (delete 'configure))))
1713 `(("pkg-config" ,pkg-config)))
1715 `(("alsa-lib" ,alsa-lib)
1719 ("gtksourceview-2" ,gtksourceview-2)
1720 ("libxrandr" ,libxrandr)
1723 ("pulseaudio" ,pulseaudio)
1725 (home-page "https://bsnes.dev/")
1726 (synopsis "Emulator for the Super Nintendo / Super Famicom systems")
1728 "bsnes is a Super Nintendo / Super Famicom emulator that focuses on
1729 performance, features, and ease of use.")
1730 (license license:gpl3)))
1732 ;; python-pwntools requires a -rc release of unicorn
1733 (define-public unicorn
1736 (if (member (%current-system) '("x86_64-linux" "i686-linux"))
1741 (version "1.0.2-rc4")
1742 ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
1747 (url "https://github.com/unicorn-engine/unicorn")
1749 (file-name (git-file-name name version))
1752 "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy"))))
1753 (outputs '("out" "python"))
1754 ;; The main library is not written in Python, but the build process has
1755 ;; little in common with any defined build system, so we might as well
1756 ;; build on top of python-build-system and make use of all
1757 ;; the Python-specific phases that can be reused.
1758 (build-system python-build-system)
1760 `(#:modules ((srfi srfi-26)
1761 (guix build python-build-system)
1764 (modify-phases %standard-phases
1765 (add-after 'unpack 'install-bindings-to-python-output
1766 (lambda* (#:key outputs #:allow-other-keys)
1767 ;; python-build-system will build the bindings and install them to
1768 ;; the "out" output, so change the build-internal names of the
1771 ;; TODO: remove this once #40469 lands, through the core-updates
1772 ;; holding zone, on master.
1773 (set-car! (assoc "out" outputs) "lib")
1774 (set-car! (assoc "python" outputs) "out")
1776 (add-before 'build 'build-library
1777 (lambda* (#:key inputs #:allow-other-keys)
1779 "-j" (number->string (parallel-job-count))
1782 (add-after 'build-library 'install-library
1783 (lambda* (#:key outputs #:allow-other-keys)
1784 (invoke "make" "install"
1788 (assoc-ref outputs "lib")))))
1789 (add-before 'build 'prepare-bindings
1790 (lambda* (#:key outputs #:allow-other-keys)
1791 (chdir "bindings/python")
1792 ;; Set this environment variable so that the Python bindings
1793 ;; don't build their own copy of the shared object, but use
1794 ;; a dummy value such that the bindings test suite uses the
1795 ;; same mechanism for loading the library as any other user.
1796 (setenv "LIBUNICORN_PATH" "1")
1797 (substitute* "unicorn/unicorn.py"
1798 (("_path_list = \\[.*")
1801 (assoc-ref outputs "lib")
1802 ;; eat the rest of the list
1805 (add-before 'check 'check-library
1806 (lambda* (#:key outputs #:allow-other-keys)
1809 (with-directory-excursion
1810 (string-append "../../tests/" suite)
1811 (invoke "make" "test" "CC=gcc"
1813 '("AS=i686-unknown-linux-gnu-as"
1814 "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
1815 '("unit" "regress"))
1817 (add-after 'install 'install-samples
1818 (lambda* (#:key outputs #:allow-other-keys)
1819 (let* ((python-samples (find-files "." "sample_.*"))
1820 (c-samples (find-files "../../samples" ".*\\.c"))
1822 (string-append (assoc-ref outputs "out")
1823 "/share/doc/unicorn/samples"))
1825 (string-append (assoc-ref outputs "lib")
1826 "/share/doc/unicorn/samples")))
1827 (for-each (cut install-file <> c-docdir) c-samples)
1828 (for-each (cut install-file <> python-docdir) python-samples)
1831 ;; NOTE: cross-binutils needs to be wrapped with unless-x86, as otherwise
1832 ;; the linker provided by the package will be used, circumventing the ld-wrapper.
1834 `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
1836 ("hexdump-for-tests" ,util-linux)))
1837 (home-page "http://www.unicorn-engine.org")
1838 (synopsis "Unicorn CPU emulator framework")
1840 "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
1841 framework based on QEMU.")
1842 (license license:gpl2+))))
1844 (define-public ppsspp
1852 (url "https://github.com/hrydgard/ppsspp")
1853 (commit (string-append "v" version))))
1855 (base32 "02yx1w0ygclnmdl0imsvgj24lkzi55wvxkf47q617j0jgrqhy8yl"))
1856 (file-name (git-file-name name version))
1858 (search-patches "ppsspp-disable-upgrade-and-gold.patch"))
1859 (modules '((guix build utils)))
1862 ;; The following is quite a heavy-handed way of unbundling PPSSPP.
1863 ;; There are still a number of external sources, that we don't
1864 ;; remove here. Some may be packaged, others are not.
1865 ;; First, we patch existing sources to include the right headers.
1866 (substitute* (append (list "ext/native/thin3d/vulkan_utils.cpp"
1867 "ext/native/thin3d/thin3d_vulkan.cpp")
1868 (find-files "Common" ".*\\.(h|cpp)")
1869 (find-files "Core" ".*\\.(h|cpp)")
1870 (find-files "GPU" ".*\\.(h|cpp)")
1871 (find-files "SDL" ".*\\.(h|cpp)")
1872 (find-files "UI" ".*\\.(h|cpp)"))
1873 ;; These headers are all hard-coded in the original source.
1874 (("ext/cityhash/") "")
1875 (("ext/glslang/") "")
1876 (("ext/SPIRV-Cross/") "spirv_cross/")
1877 (("ext/vulkan/") "vulkan/")
1878 (("ext/xxhash.h") "xxhash.h")
1879 ;; These definitions do not actually exist in the Vulkan headers,
1880 ;; but PPSSPP defines them in ext/vulkan.
1881 (("VK_FORMAT_BEGIN_RANGE") "VK_FORMAT_UNDEFINED")
1882 (("VK_FORMAT_END_RANGE") "VK_FORMAT_ASTC_12x12_SRGB_BLOCK"))
1883 ;; Next, we patch CMakeLists.
1884 (substitute* "CMakeLists.txt"
1885 ;; Drop unnecessary includes and targets.
1886 (("include_directories\\(ext/glslang\\)") "")
1887 (("include_directories\\(ext/xxhash\\)") "")
1888 (("include_directories\\(ext/cityhash\\)") "")
1889 (("set_target_properties\\(cityhash .*\\)") "")
1890 ;; Fix linking to GLEW.
1891 (("TARGET Ext::GLEW") "true")
1892 (("target_link_libraries\\(native Ext::GLEW\\)")
1893 "find_package(GLEW)\ntarget_link_libraries(native GLEW::GLEW)")
1894 (("Ext::Snappy") "snappy")
1895 ;; Don't search for cityhash/xxhash, we already have them.
1896 (("add_library\\((city|xx)hash STATIC") "if()\nendif(")
1897 (("ext/xxhash\\.[ch]") "")
1898 (("ext/native/ext/cityhash/.*\\.(cpp|h)") "")
1899 ;; Link all of spirv-cross.
1900 (("spirv-cross-glsl" all)
1902 " spirv-cross-core spirv-cross-cpp"
1903 " spirv-cross-reflect spirv-cross-util")))
1904 (substitute* "ext/CMakeLists.txt"
1905 (("add_subdirectory\\(glew\\)") "")
1906 (("add_subdirectory\\(glslang\\)") "")
1907 (("add_subdirectory\\(snappy\\)") "")
1908 (("add_subdirectory\\(SPIRV-Cross-build\\)") ""))
1909 ;; Finally, we can delete the bundled sources.
1910 (for-each delete-file-recursively
1913 "ext/glslang" "ext/glslang-build"
1914 "ext/native/ext/cityhash"
1915 "ext/native/ext/libpng17"
1916 "ext/native/ext/libzip"
1918 "ext/SPIRV-Cross" "ext/SPIRV-Cross-build"
1923 ;; Since we are not including git as an input, PPSSPP is confused
1924 ;; about its version. Let's fix that here.
1925 (substitute* "git-version.cmake"
1926 (("unknown") ,version))))))
1927 (build-system cmake-build-system)
1929 `(("pkg-config" ,pkg-config)
1930 ("python" ,python)))
1932 `(("cityhash" ,cityhash)
1935 ("glslang" ,glslang)
1941 ("spirv-cross" ,spirv-cross)
1942 ("vulkan-headers" ,vulkan-headers)
1943 ("vulkan-loader" ,vulkan-loader)
1946 ;; TODO: unbundle armips.
1947 ("armips-source" ,(package-source armips))
1949 ,(let ((commit "d184ba2b607a03435be579406b816c90add334e6"))
1953 (url "https://github.com/hrydgard/ppsspp-lang")
1956 (base32 "0s003x6247nx09qd6a1jz1l2hsk5d6k1zmh8mg3m6hjjhvbvd9j9"))
1957 (file-name (git-file-name "ppsspp-lang" commit)))))
1959 ,(let ((commit "328b839c7243e7f733f9eae88d059485e3d808e7"))
1963 (url "https://github.com/hrydgard/pspautotests")
1966 (base32 "1gj1kr5ijxrqwvz7c41phskjr70ndp8iz0gr8c3xxsd8p9z5gdvm"))
1967 (file-name (git-file-name "pspautotests" commit)))))))
1969 `(#:out-of-source? #f
1970 #:configure-flags (list "-DUSE_DISCORD=OFF"
1971 "-DUSE_SYSTEM_FFMPEG=ON"
1972 "-DUSE_SYSTEM_LIBZIP=ON"
1974 "-DUNITTEST=ON" "-DHEADLESS=ON")
1976 (modify-phases %standard-phases
1977 (add-after 'unpack 'add-external-sources
1978 (lambda* (#:key inputs #:allow-other-keys)
1979 ;; TODO: unbundle armips.
1980 (copy-recursively (assoc-ref inputs "armips-source")
1982 ;; Some tests are externalised, so we add them here.
1983 (copy-recursively (assoc-ref inputs "tests")
1985 ;; i18n is externalised, so we add it here.
1986 (copy-recursively (assoc-ref inputs "lang")
1992 (lambda (t) (invoke "./unitTest" t))
1993 '("Arm64Emitter" "ArmEmitter" "X64Emitter" "VertexJit" "Asin"
1994 "SinCos" "VFPUSinCos" "MathUtil" "Parsers" "Jit"
1995 "MatrixTranspose" "ParseLBN" "QuickTexHash" "CLZ" "MemMap"))
1996 (invoke "python3" "test.py" "-g")
1999 (lambda* (#:key inputs outputs #:allow-other-keys)
2000 (let* ((out (assoc-ref outputs "out"))
2001 (bin/ppsspp (string-append out "/bin/ppsspp"))
2002 (share (string-append out "/share/ppsspp")))
2003 (copy-recursively "icons/hicolor"
2004 (string-append out "/share/icons/hicolor"))
2005 (install-file "PPSSPPSDL" share)
2006 (copy-recursively "assets" (string-append share "/assets"))
2008 (make-desktop-entry-file
2009 (string-append out "/share/applications/ppsspp.desktop")
2011 #:exec (string-append share "/PPSSPPSDL")
2013 (mkdir-p (string-append out "/bin"))
2014 (with-output-to-file bin/ppsspp
2016 (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\""
2017 (which "sh") share)))
2018 (chmod bin/ppsspp #o755)
2020 (home-page "https://www.ppsspp.org/")
2021 (synopsis "PSP emulator")
2023 "PPSSPP is a ``high-level'' emulator simulating the PSP operating
2025 (license license:gpl2+)))