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 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages emulators)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix svn-download)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages algebra)
36 #:use-module (gnu packages assembly)
37 #:use-module (gnu packages audio)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages backup)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages curl)
44 #:use-module (gnu packages elf)
45 #:use-module (gnu packages fonts)
46 #:use-module (gnu packages fontutils)
47 #:use-module (gnu packages freedesktop)
48 #:use-module (gnu packages game-development)
49 #:use-module (gnu packages gcc)
50 #:use-module (gnu packages gettext)
51 #:use-module (gnu packages gl)
52 #:use-module (gnu packages glib)
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages image)
55 #:use-module (gnu packages imagemagick)
56 #:use-module (gnu packages libedit)
57 #:use-module (gnu packages libusb)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages lua)
60 #:use-module (gnu packages maths)
61 #:use-module (gnu packages mp3)
62 #:use-module (gnu packages music)
63 #:use-module (gnu packages ncurses)
64 #:use-module (gnu packages networking)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages pulseaudio)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages qt)
69 #:use-module (gnu packages sdl)
70 #:use-module (gnu packages sphinx)
71 #:use-module (gnu packages sqlite)
72 #:use-module (gnu packages texinfo)
73 #:use-module (gnu packages textutils)
74 #:use-module (gnu packages tls)
75 #:use-module (gnu packages upnp)
76 #:use-module (gnu packages video)
77 #:use-module (gnu packages vulkan)
78 #:use-module (gnu packages wxwidgets)
79 #:use-module (gnu packages xdisorg)
80 #:use-module (gnu packages xiph)
81 #:use-module (gnu packages xml)
82 #:use-module (gnu packages xorg)
83 #:use-module (gnu packages web)
84 #:use-module (guix build-system cmake)
85 #:use-module (guix build-system gnu))
87 (define-public desmume
95 "mirror://sourceforge/desmume/desmume/"
96 version "/desmume-" version ".tar.gz"))
99 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))))
100 (build-system gnu-build-system)
102 ;; Enable support for WiFi and microphone.
103 `(#:configure-flags '("--enable-wifi"
106 `(("pkg-config" ,pkg-config)
107 ("intltool" ,intltool)))
114 (home-page "http://desmume.org/")
115 (synopsis "Nintendo DS emulator")
117 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
118 (license license:gpl2)))
120 ;; Building from recent Git because the official 5.0 release no longer builds.
121 (define-public dolphin-emu
122 (let ((commit "24718c1a389e4f51db974575cd15c372485b92e2")
126 (version (git-version "5.0" revision commit))
131 (url "https://github.com/dolphin-emu/dolphin.git")
133 (file-name (git-file-name name version))
134 (modules '((guix build utils)))
137 ;; Remove external stuff we don't need.
138 (for-each (lambda (dir)
139 (delete-file-recursively
140 (string-append "Externals/" dir)))
141 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
142 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
145 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
149 "1d92rhnw307j3m6swk6bycb8fyc7vw2hfgakd5hpsc4qw65vxfq8"))))
150 (build-system cmake-build-system)
154 (modify-phases %standard-phases
155 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
156 (lambda* (#:key inputs outputs #:allow-other-keys)
158 (string-append (assoc-ref inputs "font-wqy-microhei")
159 "/share/fonts/truetype/wqy-microhei.ttc"))
161 (string-append (assoc-ref inputs "vulkan-loader")
162 "/lib/libvulkan.so")))
164 (invoke "bash" "-c" "g++ -O2 -std=c++11 $(freetype-config \
165 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
166 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
167 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
168 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
169 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
171 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
172 (("libvulkan.so") libvulkan))
175 ;; The FindGTK2 cmake script only checks hardcoded directories for
179 (list (string-append "-DX11_INCLUDE_DIR="
180 (assoc-ref %build-inputs "libx11")
182 (string-append "-DX11_LIBRARIES="
183 (assoc-ref %build-inputs "libx11")
187 `(("pkg-config" ,pkg-config)
188 ("gettext" ,gnu-gettext)))
190 `(("alsa-lib" ,alsa-lib)
196 ("font-wqy-microhei" ,font-wqy-microhei)
197 ("freetype" ,freetype)
203 ("libevdev" ,libevdev)
208 ("libxrandr" ,libxrandr)
210 ("mbedtls-apache" ,mbedtls-apache)
212 ("miniupnpc" ,miniupnpc)
215 ("pulseaudio" ,pulseaudio)
220 ("soundtouch" ,soundtouch)
221 ("vulkan-loader" ,vulkan-loader)
223 (home-page "https://dolphin-emu.org/")
224 (synopsis "Nintendo Wii and GameCube emulator")
226 "Dolphin is an emulator for two Nintendo video game consoles: the
227 GameCube and the Wii. It provides compatibility with all PC controllers,
228 turbo speed, networked multiplayer, and graphical enhancements.")
229 (supported-systems '("x86_64-linux" "aarch64-linux"))
230 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
231 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
233 (define-public dosbox
239 (uri (string-append "https://sourceforge.net/projects/dosbox"
240 "/files/dosbox/" version "/dosbox-"
241 version ".tar.gz/download"))
242 (file-name (string-append name "-" version ".tar.gz"))
245 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
246 (build-system gnu-build-system)
248 `(("autoconf" ,autoconf)
249 ("automake" ,automake)))
254 ("alsa-lib" ,alsa-lib)
257 (home-page "http://www.dosbox.com")
258 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
259 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
260 also emulates CPU:286/386 realmode/protected mode, Directory
261 FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
262 SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
264 (license license:gpl2+)))
266 (define-public emulation-station
267 (let ((commit "646bede3d9ec0acf0ae378415edac136774a66c5"))
269 (name "emulation-station")
272 (method git-fetch) ; no tarball available
274 (url "https://github.com/Aloshi/EmulationStation.git")
275 (commit commit))) ; no version tag
276 (file-name (string-append name "-" version "-checkout"))
279 "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v"))))
280 (build-system cmake-build-system)
282 '(#:tests? #f)) ; no tests
284 `(("alsa-lib" ,alsa-lib)
288 ("freeimage" ,freeimage)
289 ("freetype" ,freetype)
292 (synopsis "Video game console emulator front-end")
293 (description "EmulationStation provides a graphical front-end to a large
294 number of video game console emulators. It features an interface that is
295 usable with any game controller that has at least 4 buttons, theming support,
296 and a game metadata scraper.")
297 (home-page "http://www.emulationstation.org")
298 (license license:expat))))
308 "https://gitlab.com/higan/higan/repository/archive.tar.gz?ref=v"
310 (file-name (string-append name "-" version ".tar.gz"))
312 (base32 "0y42pra0dxzlbkyzcp3r8a39pji2bj3p9fl40425f60af2igr4rw"))
313 (patches (search-patches "higan-remove-march-native-flag.patch"))))
314 (build-system gnu-build-system)
316 `(("pkg-config" ,pkg-config)))
318 `(("alsa-lib" ,alsa-lib)
322 ("gtksourceview-2" ,gtksourceview-2)
326 ("pulseaudio" ,pulseaudio)
330 (let ((build-phase (assoc-ref %standard-phases 'build))
331 (install-phase (assoc-ref %standard-phases 'install)))
332 (modify-phases %standard-phases
333 ;; The higan build system has no configure phase.
335 (add-before 'build 'chdir-to-higan
338 (add-before 'install 'create-/share/applications
339 (lambda* (#:key outputs #:allow-other-keys)
340 (let ((out (assoc-ref outputs "out")))
341 ;; It seems the author forgot to do this in the Makefile.
342 (mkdir-p (string-append out "/share/applications")))))
343 (add-after 'install 'chdir-to-icarus
345 (chdir "../icarus")))
346 (add-after 'chdir-to-icarus 'build-icarus build-phase)
347 (add-after 'build-icarus 'install-icarus install-phase)
348 (add-after 'install-icarus 'wrap-higan-executable
349 (lambda* (#:key inputs outputs #:allow-other-keys)
350 (let* ((out (assoc-ref outputs "out"))
351 (bin (string-append out "/bin"))
352 (higan (string-append bin "/higan"))
353 (higan-original (string-append higan "-original"))
354 (bash (string-append (assoc-ref inputs "bash")
356 (coreutils (assoc-ref inputs "coreutils"))
357 (mkdir (string-append coreutils "/bin/mkdir"))
358 (cp (string-append coreutils "/bin/cp"))
359 (cp-r (string-append cp " -r --no-preserve=mode")))
360 ;; First, have the executable make sure ~/.local/share/higan
361 ;; contains up to date files. Higan insists on looking there
362 ;; for these data files.
363 (rename-file higan higan-original)
364 (with-output-to-file higan
369 ;; higan doesn't respect $XDG_DATA_HOME
370 mkdir " -p ~/.local/share\n"
371 cp-r " " out "/share/higan ~/.local/share\n"
372 "exec " higan-original))))
374 ;; Second, make sure higan will find icarus in PATH.
376 `("PATH" ":" prefix (,bin))))))))
379 (string-append "prefix=" (assoc-ref %outputs "out")))
380 ;; There is no test suite.
382 (home-page "http://byuu.org/emulation/higan/")
383 (synopsis "Nintendo multi-system emulator")
385 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
386 consoles, including the Nintendo Entertainment System (NES/Famicom), Super
387 Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
388 Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
389 Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
390 ;; As noted in these files among more:
391 ;; - icarus/icarus.cpp
392 ;; - higan/emulator/emulator.hpp
393 (license license:gpl3)))
402 (url "https://github.com/mgba-emu/mgba.git")
404 (file-name (git-file-name name version))
407 "0g0xa1mzvan0sl1p5c784j2g5mcw9kd2b7wiahy06gy0c1nmbcnp"))
408 (modules '((guix build utils)))
410 ;; Make sure we don't use the bundled software.
414 (let ((lib-subdir (string-append "src/third-party/" subdir)))
415 (delete-file-recursively lib-subdir)))
416 '("libpng" "lzma" "sqlite3" "zlib"))
418 (build-system cmake-build-system)
420 `(#:tests? #f ;no "test" target
422 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
423 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
424 (native-inputs `(("pkg-config" ,pkg-config)))
425 (inputs `(("ffmpeg" ,ffmpeg)
426 ("imagemagick" ,imagemagick)
429 ("libepoxy" ,libepoxy)
435 ("qtmultimedia" ,qtmultimedia)
440 (home-page "https://mgba.io")
441 (synopsis "Game Boy Advance emulator")
443 "mGBA is an emulator for running Game Boy Advance games. It aims to be
444 faster and more accurate than many existing Game Boy Advance emulators, as
445 well as adding features that other emulators lack. It also supports Game Boy
446 and Game Boy Color games.")
447 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c" is
449 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
451 (define-public mupen64plus-core
453 (name "mupen64plus-core")
459 (url "https://github.com/mupen64plus/mupen64plus-core.git")
461 (file-name (git-file-name name version))
463 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
464 (build-system gnu-build-system)
466 `(("pkg-config" ,pkg-config)
469 `(("freetype" ,freetype)
477 (modify-phases %standard-phases
478 ;; The mupen64plus build system has no configure phase.
480 ;; Makefile is in a subdirectory.
482 'build 'chdir-to-project-directory
484 (chdir "projects/unix")
486 #:make-flags (let ((out (assoc-ref %outputs "out")))
487 (list "all" (string-append "PREFIX=" out)))
488 ;; There are no tests.
490 ;; As per the Makefile (in projects/unix/Makefile):
491 (supported-systems '("i686-linux" "x86_64-linux"))
492 (home-page "https://www.mupen64plus.org/")
493 (synopsis "Nintendo 64 emulator core library")
495 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
496 which is capable of accurately playing many games. This package contains the
498 (license license:gpl2+)))
500 (define-public mupen64plus-audio-sdl
502 (name "mupen64plus-audio-sdl")
508 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
510 (file-name (git-file-name name version))
512 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
513 (build-system gnu-build-system)
515 `(("pkg-config" ,pkg-config)
518 `(("mupen64plus-core" ,mupen64plus-core)
522 (modify-phases %standard-phases
523 ;; The mupen64plus build system has no configure phase.
525 ;; Makefile is in a subdirectory.
527 'build 'cd-to-project-dir
529 (chdir "projects/unix"))))
531 (let ((out (assoc-ref %outputs "out"))
532 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
534 (string-append "PREFIX=" out)
535 (string-append "APIDIR=" m64p "/include/mupen64plus")))
536 ;; There are no tests.
538 (home-page "https://www.mupen64plus.org/")
539 (synopsis "Mupen64Plus SDL input plugin")
541 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
542 which is capable of accurately playing many games. This package contains the
544 (license license:gpl2+)))
546 (define-public mupen64plus-input-sdl
548 (name "mupen64plus-input-sdl")
554 (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
556 (file-name (git-file-name name version))
558 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
559 (build-system gnu-build-system)
563 `(("mupen64plus-core" ,mupen64plus-core)
567 (modify-phases %standard-phases
568 ;; The mupen64plus build system has no configure phase.
570 ;; Makefile is in a subdirectory.
572 'build 'cd-to-project-dir
574 (chdir "projects/unix"))))
576 (let ((out (assoc-ref %outputs "out"))
577 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
579 (string-append "PREFIX=" out)
580 (string-append "APIDIR=" m64p "/include/mupen64plus")))
581 ;; There are no tests.
583 (home-page "https://www.mupen64plus.org/")
584 (synopsis "Mupen64Plus SDL input plugin")
586 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
587 which is capable of accurately playing many games. This package contains the
589 (license license:gpl2+)))
591 (define-public mupen64plus-rsp-hle
593 (name "mupen64plus-rsp-hle")
599 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
601 (file-name (git-file-name name version))
603 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
604 (build-system gnu-build-system)
606 `(("mupen64plus-core" ,mupen64plus-core)))
609 (modify-phases %standard-phases
610 ;; The mupen64plus build system has no configure phase.
612 ;; Makefile is in a subdirectory.
614 'build 'cd-to-project-dir
616 (chdir "projects/unix"))))
618 (let ((out (assoc-ref %outputs "out"))
619 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
621 (string-append "PREFIX=" out)
622 (string-append "APIDIR=" m64p "/include/mupen64plus")))
623 ;; There are no tests.
625 (home-page "https://www.mupen64plus.org/")
626 (synopsis "Mupen64Plus SDL input plugin")
628 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
629 which is capable of accurately playing many games. This package contains the
630 high-level emulation (HLE) RSP processor plugin.")
631 (license license:gpl2+)))
633 (define-public mupen64plus-rsp-z64
635 (name "mupen64plus-rsp-z64")
641 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
643 (file-name (git-file-name name version))
645 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
646 (build-system gnu-build-system)
648 `(("mupen64plus-core" ,mupen64plus-core)))
651 (modify-phases %standard-phases
652 ;; The mupen64plus build system has no configure phase.
654 ;; Makefile is in a subdirectory.
656 'build 'cd-to-project-dir
658 (chdir "projects/unix"))))
660 (let ((out (assoc-ref %outputs "out"))
661 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
663 (string-append "PREFIX=" out)
664 (string-append "APIDIR=" m64p "/include/mupen64plus")))
665 ;; There are no tests.
667 (home-page "https://www.mupen64plus.org/")
668 (synopsis "Mupen64Plus SDL input plugin")
670 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
671 which is capable of accurately playing many games. This package contains the
672 Z64 RSP processor plugin.")
673 (license license:gpl2+)))
675 (define-public mupen64plus-video-arachnoid
677 (name "mupen64plus-video-arachnoid")
683 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
685 (file-name (git-file-name name version))
687 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
688 (build-system gnu-build-system)
690 `(("pkg-config" ,pkg-config)
694 ("mupen64plus-core" ,mupen64plus-core)))
697 (modify-phases %standard-phases
698 ;; The mupen64plus build system has no configure phase.
700 ;; Makefile is in a subdirectory.
702 'build 'cd-to-project-dir
704 (chdir "projects/unix"))))
706 (let ((out (assoc-ref %outputs "out"))
707 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
709 (string-append "PREFIX=" out)
710 (string-append "APIDIR=" m64p "/include/mupen64plus")))
711 ;; There are no tests.
713 (home-page "https://www.mupen64plus.org/")
714 (synopsis "Mupen64Plus Rice Video plugin")
716 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
717 which is capable of accurately playing many games. This package contains the
718 Arachnoid video plugin.")
719 (license license:gpl2+)))
721 (define-public mupen64plus-video-glide64
723 (name "mupen64plus-video-glide64")
729 (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
731 (file-name (git-file-name name version))
733 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
734 (build-system gnu-build-system)
736 `(("pkg-config" ,pkg-config)
740 ("mupen64plus-core" ,mupen64plus-core)
744 (modify-phases %standard-phases
745 ;; The mupen64plus build system has no configure phase.
747 ;; Makefile is in a subdirectory.
749 'build 'cd-to-project-dir
751 (chdir "projects/unix")))
752 ;; XXX Should be unnecessary with the next release.
756 (substitute* "Makefile"
757 (("SDL_CONFIG = (.*)sdl-config" all prefix)
758 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
760 (let ((out (assoc-ref %outputs "out"))
761 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
763 (string-append "PREFIX=" out)
764 (string-append "APIDIR=" m64p "/include/mupen64plus")))
765 ;; There are no tests.
767 (home-page "https://www.mupen64plus.org/")
768 (synopsis "Mupen64Plus Rice Video plugin")
770 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
771 which is capable of accurately playing many games. This package contains the
772 Glide64 video plugin.")
773 (license license:gpl2+)))
775 (define-public mupen64plus-video-glide64mk2
777 (name "mupen64plus-video-glide64mk2")
783 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
785 (file-name (git-file-name name version))
787 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
788 (build-system gnu-build-system)
790 `(("pkg-config" ,pkg-config)
796 ("mupen64plus-core" ,mupen64plus-core)
801 (modify-phases %standard-phases
802 ;; The mupen64plus build system has no configure phase.
804 ;; Makefile is in a subdirectory.
806 'build 'cd-to-project-dir
808 (chdir "projects/unix"))))
810 (let ((out (assoc-ref %outputs "out"))
811 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
813 (string-append "PREFIX=" out)
814 (string-append "APIDIR=" m64p "/include/mupen64plus")))
815 ;; There are no tests.
817 (home-page "https://www.mupen64plus.org/")
818 (synopsis "Mupen64Plus Rice Video plugin")
820 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
821 which is capable of accurately playing many games. This package contains the
822 Glide64MK2 video plugin.")
823 (license license:gpl2+)))
825 (define-public mupen64plus-video-rice
827 (name "mupen64plus-video-rice")
833 (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
835 (file-name (git-file-name name version))
837 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
838 (build-system gnu-build-system)
840 `(("pkg-config" ,pkg-config)
845 ("mupen64plus-core" ,mupen64plus-core)
849 (modify-phases %standard-phases
850 ;; The mupen64plus build system has no configure phase.
852 ;; Makefile is in a subdirectory.
854 'build 'cd-to-project-dir
856 (chdir "projects/unix"))))
858 (let ((out (assoc-ref %outputs "out"))
859 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
861 (string-append "PREFIX=" out)
862 (string-append "APIDIR=" m64p "/include/mupen64plus")))
863 ;; There are no tests.
865 (home-page "https://www.mupen64plus.org/")
866 (synopsis "Mupen64Plus Rice Video plugin")
868 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
869 which is capable of accurately playing many games. This package contains the
871 (license license:gpl2+)))
873 (define-public mupen64plus-video-z64
875 (name "mupen64plus-video-z64")
881 (url "https://github.com/mupen64plus/mupen64plus-video-z64.git")
883 (file-name (git-file-name name version))
885 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
886 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
887 (build-system gnu-build-system)
889 `(("pkg-config" ,pkg-config)
893 ("mupen64plus-core" ,mupen64plus-core)
897 (modify-phases %standard-phases
898 ;; The mupen64plus build system has no configure phase.
900 ;; Makefile is in a subdirectory.
902 'build 'cd-to-project-dir
904 (chdir "projects/unix")))
905 ;; XXX Should be unnecessary with the next release.
909 (substitute* "Makefile"
910 (("SDL_CONFIG = (.*)sdl-config" all prefix)
911 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
913 (let ((out (assoc-ref %outputs "out"))
914 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
916 (string-append "PREFIX=" out)
917 (string-append "APIDIR=" m64p "/include/mupen64plus")))
918 ;; There are no tests.
920 (home-page "https://www.mupen64plus.org/")
921 (synopsis "Mupen64Plus Z64 video plugin")
923 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
924 which is capable of accurately playing many games. This package contains the
926 (license license:gpl2+)))
928 (define-public mupen64plus-ui-console
930 (name "mupen64plus-ui-console")
936 (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
938 (file-name (git-file-name name version))
940 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
941 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
942 (build-system gnu-build-system)
944 `(("pkg-config" ,pkg-config)
948 ;; Mupen64Plus supports a single data directory and a single plugin
949 ;; directory in its configuration, yet we need data and plugin files from
950 ;; a variety of packages. The best way to deal with this is to install
951 ;; all packages from which data and plugin files are needed into one's
952 ;; profile, and point the configuration there. Hence, propagate the most
953 ;; important packages here to save the user from the bother. The patch
954 ;; mupen64plus-ui-console-notice also gives users instructions on what
955 ;; they need to do in order to point the configuration to their profile.
957 `(("mupen64plus-core" ,mupen64plus-core)
958 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
959 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
960 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
961 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
962 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
963 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
966 (modify-phases %standard-phases
967 ;; The mupen64plus build system has no configure phase.
969 ;; Makefile is in a subdirectory.
971 'build 'cd-to-project-dir
973 (chdir "projects/unix"))))
975 (let ((out (assoc-ref %outputs "out"))
976 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
978 (string-append "PREFIX=" out)
979 (string-append "APIDIR=" m64p "/include/mupen64plus")
980 ;; Trailing slash matters here.
981 (string-append "COREDIR=" m64p "/lib/")))
982 ;; There are no tests.
984 (home-page "https://www.mupen64plus.org/")
985 (synopsis "Mupen64Plus command line user interface")
987 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
988 which is capable of accurately playing many games. This package contains the
989 command line user interface. Installing this package is the easiest way
990 towards a working Mupen64Plus for casual users.")
991 (license license:gpl2+)))
993 (define-public nestopia-ue
1001 (url "https://github.com/rdanbrook/nestopia.git")
1003 (file-name (git-file-name name version))
1005 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1006 (modules '((guix build utils)))
1009 ;; We don't need libretro for the GNU/Linux build.
1010 (delete-file-recursively "libretro")
1012 (build-system cmake-build-system)
1014 `(("pkg-config" ,pkg-config)))
1018 ("libarchive" ,libarchive)
1019 ("libepoxy" ,libepoxy)
1024 (modify-phases %standard-phases
1025 ;; This fixes the file chooser crash that happens with GTK 3.
1026 (add-after 'install 'wrap-program
1027 (lambda* (#:key inputs outputs #:allow-other-keys)
1028 (let* ((out (assoc-ref outputs "out"))
1029 (nestopia (string-append out "/bin/nestopia"))
1030 (gtk (assoc-ref inputs "gtk+"))
1031 (gtk-share (string-append gtk "/share")))
1032 (wrap-program nestopia
1033 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1034 ;; There are no tests.
1036 (home-page "http://0ldsk00l.ca/nestopia/")
1037 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1039 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1040 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1041 emulation community. It provides highly accurate emulation.")
1042 (license license:gpl2+)))
1044 (define-public retroarch
1052 (url "https://github.com/libretro/RetroArch.git")
1053 (commit (string-append "v" version))))
1054 (file-name (git-file-name name version))
1056 (base32 "0xxd9nhqiclpkdd9crymvba37fl0xs5mikwhya68nfzcgar7w480"))))
1057 (build-system gnu-build-system)
1059 `(#:tests? #f ; no tests
1061 (modify-phases %standard-phases
1063 (lambda* (#:key inputs outputs #:allow-other-keys)
1064 (let* ((out (assoc-ref outputs "out"))
1065 (etc (string-append out "/etc"))
1066 (vulkan (assoc-ref inputs "vulkan-loader"))
1067 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1068 ;; Hard-code the path to libvulkan.so.
1069 (substitute* "gfx/common/vulkan_common.c"
1070 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1071 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1072 (("/usr/local/share/wayland-protocols")
1073 (string-append wayland-protocols "/share/wayland-protocols")))
1074 (substitute* "qb/qb.libs.sh"
1075 (("/bin/true") (which "true")))
1077 (substitute* '("libretro-common/file/archive_file_zlib.c"
1078 "libretro-common/streams/trans_stream_zlib.c")
1079 (("<compat/zlib.h>") "<zlib.h>"))
1080 ;; The configure script does not yet accept the extra arguments
1081 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1084 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1086 '("--enable-neon" "--enable-floathard")
1088 (string-append "--prefix=" out)
1089 (string-append "--global-config-dir=" etc))))))))
1091 `(("alsa-lib" ,alsa-lib)
1093 ("freetype" ,freetype)
1094 ("libxinerama" ,libxinerama)
1095 ("libxkbcommon" ,libxkbcommon)
1096 ("libxml2" ,libxml2)
1097 ("libxrandr" ,libxrandr)
1101 ("pulseaudio" ,pulseaudio)
1106 ("vulkan-loader" ,vulkan-loader)
1107 ("wayland" ,wayland)
1110 `(("pkg-config" ,pkg-config)
1111 ("wayland-protocols" ,wayland-protocols)
1113 (home-page "https://www.libretro.com/")
1114 (synopsis "Reference frontend for the libretro API")
1116 "Libretro is a simple but powerful development interface that allows for
1117 the easy creation of emulators, games and multimedia applications that can plug
1118 straight into any libretro-compatible frontend. RetroArch is the official
1119 reference frontend for the libretro API, currently used by most as a modular
1120 multi-system game/emulator system.")
1121 (license license:gpl3+)))
1123 (define-public scummvm
1130 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1131 "/scummvm-" version ".tar.xz"))
1134 "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
1135 (build-system gnu-build-system)
1137 `(#:tests? #f ;require "git"
1138 #:configure-flags (list "--enable-release") ;for optimizations
1140 (modify-phases %standard-phases
1142 ;; configure does not work followed by both "SHELL=..." and
1143 ;; "CONFIG_SHELL=..."; set environment variables instead
1144 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1145 (let* ((out (assoc-ref outputs "out"))
1146 (bash (which "bash"))
1147 (flags `(,(string-append "--prefix=" out)
1148 ,@configure-flags)))
1149 (setenv "SHELL" bash)
1150 (setenv "CONFIG_SHELL" bash)
1151 (apply invoke "./configure" flags)))))))
1153 `(("pkg-config" ,pkg-config)))
1155 `(("alsa-lib" ,alsa-lib)
1157 ("fluidsynth" ,fluidsynth)
1158 ("freetype" ,freetype)
1160 ("libjpeg-turbo" ,libjpeg-turbo)
1162 ("libmpeg2" ,libmpeg2)
1165 ("libtheora" ,libtheora)
1166 ("libvorbis" ,libvorbis)
1170 (home-page "https://www.scummvm.org/")
1171 (synopsis "Engine for several graphical adventure games")
1172 (description "ScummVM is a program which allows you to run certain
1173 classic graphical point-and-click adventure games, provided you
1174 already have their data files. The clever part about this: ScummVM
1175 just replaces the executables shipped with the games, allowing you to
1176 play them on systems for which they were never designed!")
1177 (license license:gpl2+)))
1187 (url "https://github.com/mamedev/mame.git")
1188 (commit (apply string-append "mame" (string-split version #\.)))))
1189 (file-name (git-file-name name version))
1192 "0p3zcb9l624dsy2gyv23ppp1k1iwd1vrg8cbn5v4fx1s44mx7f5c"))
1194 ;; FIXME: Remove once 0.213 is out. Applied upstream as
1195 ;; 0b5b13cf1e28550b49c387dec93f9801f029e313.
1196 (search-patches "mame-rapidjson-fix.patch"))
1197 (modules '((guix build utils)))
1199 ;; Remove bundled libraries.
1201 (with-directory-excursion "3rdparty"
1202 (for-each delete-file-recursively
1203 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1204 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1205 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1207 (build-system gnu-build-system)
1211 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1212 (string-append "SDL_INI_PATH="
1213 (assoc-ref %outputs "out")
1216 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1217 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1218 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1219 #:tests? #f ;no test in regular release
1221 (modify-phases %standard-phases
1223 (add-after 'build 'build-documentation
1224 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1226 ;; Upstream does not provide an installation phase.
1227 (lambda* (#:key outputs #:allow-other-keys)
1228 (let* ((out (assoc-ref outputs "out"))
1229 (share (string-append out "/share/mame")))
1231 (for-each (lambda (dir)
1232 (copy-recursively dir (string-append share "/" dir)))
1233 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1234 "plugins" "samples"))
1235 (let ((keymaps (string-append share "/keymaps")))
1236 (for-each (lambda (file) (install-file file keymaps))
1237 (find-files "keymaps" ".*LINUX\\.map")))
1238 (let ((fonts (string-append share "/fonts")))
1239 (install-file "uismall.bdf" fonts))
1240 (when (file-exists? "mame64")
1241 (rename-file "mame64" "mame"))
1242 (install-file "mame" (string-append out "/bin")))
1244 (add-after 'install 'install-documentation
1245 (lambda* (#:key outputs #:allow-other-keys)
1246 (let* ((out (assoc-ref outputs "out"))
1247 (man (string-append out "/share/man/man1"))
1248 (info (string-append out "/share/info")))
1249 (install-file "docs/build/man/MAME.1" man)
1250 (install-file "docs/build/texinfo/MAME.info" info))
1252 (add-after 'install 'install-ini-file
1253 ;; Generate an ini file so as to set some directories (e.g., roms)
1254 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1256 ;; XXX: We need to insert absolute references to the store. It can
1257 ;; be an issue if they leak into user's home directory, e.g., with
1258 ;; "mame -createconfig" and the package is later GC'ed.
1259 (lambda* (#:key outputs #:allow-other-keys)
1260 (let* ((out (assoc-ref outputs "out"))
1261 (share (string-append out "/share/mame"))
1262 (ini (string-append share "/ini")))
1263 (with-output-to-file (string-append ini "/mame.ini")
1266 "inipath $HOME/.mame;~a/ini~@
1267 homepath $HOME/mame~@
1268 rompath $HOME/mame/roms~@
1269 samplepath $HOME/mame/samples;~a/samples~@
1270 cheatpath $HOME/mame/cheat~@
1271 artpath $HOME/mame/artwork;~a/artwork~@
1272 crosshairpath $HOME/mame/crosshair~@
1273 snapshot_directory $HOME/mame/snapshots~@
1275 fontpath $HOME/mame/fonts;~a/fonts~@
1276 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1278 pluginspath $HOME/mame/plugins;~a/plugins~@
1279 languagepath ~a/language~@
1280 cfg_directory $HOME/.mame/cfg~@
1281 nvram_directory $HOME/.mame/nvram~@
1282 input_directory $HOME/.mame/inp~@
1283 state_directory $HOME/.mame/sta~@
1284 diff_directory $HOME/.mame/diff~@
1285 comment_directory $HOME/.mame/comments~%"
1286 share share share share share share share share
1288 (with-output-to-file (string-append ini "/ui.ini")
1291 "historypath $HOME/mame/history~@
1292 categorypath $HOME/mame/folders~@
1293 cabinets_directory $HOME/mame/cabinets~@
1294 cpanels_directory $HOME/mame/cpanel~@
1295 pcbs_directory $HOME/mame/pcb~@
1296 flyers_directory $HOME/mame/flyers~@
1297 titles_directory $HOME/mame/titles~@
1298 ends_directory $HOME/mame/ends~@
1299 marquees_directory $HOME/mame/marquees~@
1300 artwork_preview_directory $HOME/mame/artpreview~@
1301 bosses_directory $HOME/mame/bosses~@
1302 logos_directory $HOME/mame/logo~@
1303 scores_directory $HOME/mame/scores~@
1304 versus_directory $HOME/mame/versus~@
1305 gameover_directory $HOME/mame/gameover~@
1306 howto_directory $HOME/mame/howto~@
1307 select_directory $HOME/mame/select~@
1308 icons_directory $HOME/mame/icons~@
1309 covers_directory $HOME/mame/covers~@
1310 ui_path $HOME/.mame/ui~%")))
1312 (add-after 'install 'install-desktop-file
1313 (lambda* (#:key outputs #:allow-other-keys)
1314 (let* ((out (assoc-ref outputs "out"))
1315 (desktop (string-append out "/share/applications"))
1316 (executable (string-append out "/bin/mame")))
1318 (with-output-to-file (string-append desktop "/mame.desktop")
1323 Comment=Multi-purpose emulation framework~@
1328 Categories=Game;Emulator;~@
1329 Keywords=Game;Emulator;Arcade;~%"
1333 `(("pkg-config" ,pkg-config)
1334 ("sphinx" ,python-sphinx)
1335 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1336 ("texinfo" ,texinfo)))
1338 `(("alsa-lib" ,alsa-lib)
1342 ("fontconfig" ,fontconfig)
1344 ("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
1346 ("libxinerama" ,libxinerama)
1348 ("portaudio" ,portaudio)
1349 ("portmidi" ,portmidi)
1350 ("pugixml" ,pugixml)
1351 ("python-wrapper" ,python-wrapper)
1353 ("rapidjson" ,rapidjson)
1354 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1356 ("utf8proc" ,utf8proc)
1358 (home-page "http://mamedev.org/")
1359 (synopsis "Multi-purpose emulation framework")
1360 (description "MAME's purpose is to preserve decades of software
1361 history. As electronic technology continues to rush forward, MAME
1362 prevents this important @emph{vintage} software from being lost and
1363 forgotten. This is achieved by documenting the hardware and how it
1364 functions. The source code to MAME serves as this documentation.")
1365 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1366 ;; However, over 90% of the files are under Expat license. Also, artwork,
1367 ;; keymaps, languages and samples are under CC0.
1368 (license (list license:gpl2+ license:expat license:cc0))))