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 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2017, 2018 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 databases)
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 texinfo)
71 #:use-module (gnu packages textutils)
72 #:use-module (gnu packages tls)
73 #:use-module (gnu packages upnp)
74 #:use-module (gnu packages video)
75 #:use-module (gnu packages vulkan)
76 #:use-module (gnu packages wxwidgets)
77 #:use-module (gnu packages xdisorg)
78 #:use-module (gnu packages xiph)
79 #:use-module (gnu packages xml)
80 #:use-module (gnu packages xorg)
81 #:use-module (gnu packages web)
82 #:use-module (guix build-system cmake)
83 #:use-module (guix build-system gnu))
85 (define-public desmume
93 "mirror://sourceforge/desmume/desmume/"
94 version "/desmume-" version ".tar.gz"))
97 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))))
98 (build-system gnu-build-system)
100 ;; Enable support for WiFi and microphone.
101 `(#:configure-flags '("--enable-wifi"
104 `(("pkg-config" ,pkg-config)
105 ("intltool" ,intltool)))
112 (home-page "http://desmume.org/")
113 (synopsis "Nintendo DS emulator")
115 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
116 (license license:gpl2)))
118 ;; Building from recent Git because the official 5.0 release no longer builds.
119 (define-public dolphin-emu
120 (let ((commit "806c1ee8f0ed824008185212bfab2658d400b576")
124 (version (git-version "5.0" revision commit))
129 (url "https://github.com/dolphin-emu/dolphin.git")
131 (file-name (git-file-name name version))
132 (modules '((guix build utils)))
135 ;; Remove external stuff we don't need.
136 (for-each (lambda (dir)
137 (delete-file-recursively
138 (string-append "Externals/" dir)))
139 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
140 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
143 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
147 "1sdc7rh6z7gjx4kxg18jrv7srfpx1vgf936zg5y43radnlscrh1j"))))
148 (build-system cmake-build-system)
152 (modify-phases %standard-phases
153 (add-before 'configure 'fixgcc7
155 (unsetenv "C_INCLUDE_PATH")
156 (unsetenv "CPLUS_INCLUDE_PATH")))
157 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
158 (lambda* (#:key inputs outputs #:allow-other-keys)
160 (string-append (assoc-ref inputs "font-wqy-microhei")
161 "/share/fonts/truetype/wqy-microhei.ttc"))
163 (string-append (assoc-ref inputs "vulkan-loader")
164 "/lib/libvulkan.so")))
166 (invoke "bash" "-c" "g++ -O2 -std=c++11 $(freetype-config \
167 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
168 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
169 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
170 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
171 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
173 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
174 (("libvulkan.so") libvulkan))
177 ;; The FindGTK2 cmake script only checks hardcoded directories for
181 (list (string-append "-DX11_INCLUDE_DIR="
182 (assoc-ref %build-inputs "libx11")
184 (string-append "-DX11_LIBRARIES="
185 (assoc-ref %build-inputs "libx11")
189 `(("pkg-config" ,pkg-config)
190 ("gcc" ,gcc-7) ; Building with gcc@5 doesn't work anymore.
191 ("gettext" ,gnu-gettext)))
193 `(("alsa-lib" ,alsa-lib)
198 ("ffmpeg" ,ffmpeg-3.4)
199 ("font-wqy-microhei" ,font-wqy-microhei)
200 ("freetype" ,freetype)
206 ("libevdev" ,libevdev)
211 ("libxrandr" ,libxrandr)
213 ("mbedtls-apache" ,mbedtls-apache)
215 ("miniupnpc" ,miniupnpc)
218 ("pulseaudio" ,pulseaudio)
223 ("soundtouch" ,soundtouch)
224 ("vulkan-loader" ,vulkan-loader)
226 (home-page "https://dolphin-emu.org/")
227 (synopsis "Nintendo Wii and GameCube emulator")
229 "Dolphin is an emulator for two Nintendo video game consoles: the
230 GameCube and the Wii. It provides compatibility with all PC controllers,
231 turbo speed, networked multiplayer, and graphical enhancements.")
232 (supported-systems '("x86_64-linux" "aarch64-linux"))
233 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
234 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
236 (define-public dosbox
239 (version "0.74.svn3947")
243 (url "http://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk/")
245 (file-name (string-append name "-" version "-checkout"))
246 ;; Use SVN head, since the last release (2010) is incompatible
247 ;; with GCC 4.8+ (see
248 ;; <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=624976>).
251 "1p918j6090d1nkvgq7ifvmn506zrdmyi32y7p3ms40d5ssqjg8fj"))))
252 (build-system gnu-build-system)
254 `(#:phases (modify-phases %standard-phases
258 (zero? (system* "sh" "autogen.sh")))))))
260 `(("autoconf" ,autoconf)
261 ("automake" ,automake)))
266 ("alsa-lib" ,alsa-lib)
269 (home-page "http://www.dosbox.com")
270 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
271 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
272 also emulates CPU:286/386 realmode/protected mode, Directory
273 FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
274 SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
276 (license license:gpl2+)))
278 (define-public emulation-station
279 (let ((commit "646bede3d9ec0acf0ae378415edac136774a66c5"))
281 (name "emulation-station")
284 (method git-fetch) ; no tarball available
286 (url "https://github.com/Aloshi/EmulationStation.git")
287 (commit commit))) ; no version tag
288 (file-name (string-append name "-" version "-checkout"))
291 "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v"))))
292 (build-system cmake-build-system)
294 '(#:tests? #f)) ; no tests
296 `(("alsa-lib" ,alsa-lib)
300 ("freeimage" ,freeimage)
301 ("freetype" ,freetype)
304 (synopsis "Video game console emulator front-end")
305 (description "EmulationStation provides a graphical front-end to a large
306 number of video game console emulators. It features an interface that is
307 usable with any game controller that has at least 4 buttons, theming support,
308 and a game metadata scraper.")
309 (home-page "http://www.emulationstation.org")
310 (license license:expat))))
320 "https://gitlab.com/higan/higan/repository/archive.tar.gz?ref=v"
322 (file-name (string-append name "-" version ".tar.gz"))
324 (base32 "0y42pra0dxzlbkyzcp3r8a39pji2bj3p9fl40425f60af2igr4rw"))
325 (patches (search-patches "higan-remove-march-native-flag.patch"))))
326 (build-system gnu-build-system)
328 `(("pkg-config" ,pkg-config)))
330 `(("alsa-lib" ,alsa-lib)
334 ("gtksourceview-2" ,gtksourceview-2)
338 ("pulseaudio" ,pulseaudio)
342 (let ((build-phase (assoc-ref %standard-phases 'build))
343 (install-phase (assoc-ref %standard-phases 'install)))
344 (modify-phases %standard-phases
345 ;; The higan build system has no configure phase.
347 (add-before 'build 'chdir-to-higan
350 (add-before 'install 'create-/share/applications
351 (lambda* (#:key outputs #:allow-other-keys)
352 (let ((out (assoc-ref outputs "out")))
353 ;; It seems the author forgot to do this in the Makefile.
354 (mkdir-p (string-append out "/share/applications")))))
355 (add-after 'install 'chdir-to-icarus
357 (chdir "../icarus")))
358 (add-after 'chdir-to-icarus 'build-icarus build-phase)
359 (add-after 'build-icarus 'install-icarus install-phase)
360 (add-after 'install-icarus 'wrap-higan-executable
361 (lambda* (#:key inputs outputs #:allow-other-keys)
362 (let* ((out (assoc-ref outputs "out"))
363 (bin (string-append out "/bin"))
364 (higan (string-append bin "/higan"))
365 (higan-original (string-append higan "-original"))
366 (bash (string-append (assoc-ref inputs "bash")
368 (coreutils (assoc-ref inputs "coreutils"))
369 (mkdir (string-append coreutils "/bin/mkdir"))
370 (cp (string-append coreutils "/bin/cp"))
371 (cp-r (string-append cp " -r --no-preserve=mode")))
372 ;; First, have the executable make sure ~/.local/share/higan
373 ;; contains up to date files. Higan insists on looking there
374 ;; for these data files.
375 (rename-file higan higan-original)
376 (with-output-to-file higan
381 ;; higan doesn't respect $XDG_DATA_HOME
382 mkdir " -p ~/.local/share\n"
383 cp-r " " out "/share/higan ~/.local/share\n"
384 "exec " higan-original))))
386 ;; Second, make sure higan will find icarus in PATH.
388 `("PATH" ":" prefix (,bin))))))))
391 (string-append "prefix=" (assoc-ref %outputs "out")))
392 ;; There is no test suite.
394 (home-page "http://byuu.org/emulation/higan/")
395 (synopsis "Nintendo multi-system emulator")
397 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
398 consoles, including the Nintendo Entertainment System (NES/Famicom), Super
399 Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
400 Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
401 Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
402 ;; As noted in these files among more:
403 ;; - icarus/icarus.cpp
404 ;; - higan/emulator/emulator.hpp
405 (license license:gpl3)))
413 (uri (string-append "https://github.com/mgba-emu/mgba/archive/"
415 (file-name (string-append name "-" version ".tar.gz"))
418 "16hgs6r5iym3lp2cjcnv9955333976yc5sgy2kkxlsi005n91j1m"))
419 (modules '((guix build utils)))
421 ;; Make sure we don't use the bundled software.
425 (let ((lib-subdir (string-append "src/third-party/" subdir)))
426 (delete-file-recursively lib-subdir)))
427 '("libpng" "lzma" "sqlite3" "zlib"))
429 (build-system cmake-build-system)
431 `(#:tests? #f ;no "test" target
433 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
434 "-DUSE_LIBZIP=OFF" ;use "zlib" instead
435 (string-append "-DCMAKE_INSTALL_LIBDIR="
436 (assoc-ref %outputs "out") "/lib"))))
437 (native-inputs `(("pkg-config" ,pkg-config)))
438 (inputs `(("ffmpeg" ,ffmpeg)
439 ("imagemagick" ,imagemagick)
441 ("libepoxy" ,libepoxy)
447 ("qtmultimedia" ,qtmultimedia)
452 (home-page "https://mgba.io")
453 (synopsis "Game Boy Advance emulator")
455 "mGBA is an emulator for running Game Boy Advance games. It aims to be
456 faster and more accurate than many existing Game Boy Advance emulators, as
457 well as adding features that other emulators lack. It also supports Game Boy
458 and Game Boy Color games.")
459 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c" is
461 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
463 (define-public mupen64plus-core
465 (name "mupen64plus-core")
471 "https://github.com/mupen64plus/mupen64plus-core/archive/"
473 (file-name (string-append name "-" version ".tar.gz"))
475 (base32 "0dg2hksm5qni2hcha93k7n4fqr92888p946f7phb0ndschzfh9kk"))))
476 (build-system gnu-build-system)
478 `(("pkg-config" ,pkg-config)
481 `(("freetype" ,freetype)
489 (modify-phases %standard-phases
490 ;; The mupen64plus build system has no configure phase.
492 ;; Makefile is in a subdirectory.
494 'build 'cd-to-project-dir
496 (chdir "projects/unix"))))
497 #:make-flags (let ((out (assoc-ref %outputs "out")))
498 (list "all" (string-append "PREFIX=" out)))
499 ;; There are no tests.
501 ;; As per the Makefile (in projects/unix/Makefile):
502 (supported-systems '("i686-linux" "x86_64-linux"))
503 (home-page "http://www.mupen64plus.org/")
504 (synopsis "Nintendo 64 emulator core library")
506 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
507 which is capable of accurately playing many games. This package contains the
509 (license license:gpl2+)))
511 (define-public mupen64plus-audio-sdl
513 (name "mupen64plus-audio-sdl")
519 "https://github.com/mupen64plus/mupen64plus-audio-sdl/archive/"
521 (file-name (string-append name "-" version ".tar.gz"))
523 (base32 "0ss6w92n2rpfnazhg9lbq0nvs3fqx93nliz3k3wjxdlx4dpi7h3a"))))
524 (build-system gnu-build-system)
526 `(("pkg-config" ,pkg-config)
529 `(("mupen64plus-core" ,mupen64plus-core)
533 (modify-phases %standard-phases
534 ;; The mupen64plus build system has no configure phase.
536 ;; Makefile is in a subdirectory.
538 'build 'cd-to-project-dir
540 (chdir "projects/unix"))))
542 (let ((out (assoc-ref %outputs "out"))
543 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
545 (string-append "PREFIX=" out)
546 (string-append "APIDIR=" m64p "/include/mupen64plus")))
547 ;; There are no tests.
549 (home-page "http://www.mupen64plus.org/")
550 (synopsis "Mupen64Plus SDL input plugin")
552 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
553 which is capable of accurately playing many games. This package contains the
555 (license license:gpl2+)))
557 (define-public mupen64plus-input-sdl
559 (name "mupen64plus-input-sdl")
565 "https://github.com/mupen64plus/mupen64plus-input-sdl/archive/"
567 (file-name (string-append name "-" version ".tar.gz"))
569 (base32 "11sj5dbalp2nrlmki34vy7wy28vc175pnnkdk65p8599hnyq37ri"))))
570 (build-system gnu-build-system)
574 `(("mupen64plus-core" ,mupen64plus-core)
578 (modify-phases %standard-phases
579 ;; The mupen64plus build system has no configure phase.
581 ;; Makefile is in a subdirectory.
583 'build 'cd-to-project-dir
585 (chdir "projects/unix"))))
587 (let ((out (assoc-ref %outputs "out"))
588 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
590 (string-append "PREFIX=" out)
591 (string-append "APIDIR=" m64p "/include/mupen64plus")))
592 ;; There are no tests.
594 (home-page "http://www.mupen64plus.org/")
595 (synopsis "Mupen64Plus SDL input plugin")
597 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
598 which is capable of accurately playing many games. This package contains the
600 (license license:gpl2+)))
602 (define-public mupen64plus-rsp-hle
604 (name "mupen64plus-rsp-hle")
610 "https://github.com/mupen64plus/mupen64plus-rsp-hle/archive/"
612 (file-name (string-append name "-" version ".tar.gz"))
614 (base32 "15h7mgz6xd2zjzm6l3f96sbs8kwr3xvbwzgikhnka79m6c69hsxv"))))
615 (build-system gnu-build-system)
617 `(("mupen64plus-core" ,mupen64plus-core)))
620 (modify-phases %standard-phases
621 ;; The mupen64plus build system has no configure phase.
623 ;; Makefile is in a subdirectory.
625 'build 'cd-to-project-dir
627 (chdir "projects/unix"))))
629 (let ((out (assoc-ref %outputs "out"))
630 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
632 (string-append "PREFIX=" out)
633 (string-append "APIDIR=" m64p "/include/mupen64plus")))
634 ;; There are no tests.
636 (home-page "http://www.mupen64plus.org/")
637 (synopsis "Mupen64Plus SDL input plugin")
639 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
640 which is capable of accurately playing many games. This package contains the
641 high-level emulation (HLE) RSP processor plugin.")
642 (license license:gpl2+)))
644 (define-public mupen64plus-rsp-z64
646 (name "mupen64plus-rsp-z64")
652 "https://github.com/mupen64plus/mupen64plus-rsp-z64/archive/"
654 (file-name (string-append name "-" version ".tar.gz"))
656 (base32 "10jz1w2dhx5slhyk4m8mdqlpsd6cshchslr1fckb2ayzb1ls3ghi"))))
657 (build-system gnu-build-system)
659 `(("mupen64plus-core" ,mupen64plus-core)))
662 (modify-phases %standard-phases
663 ;; The mupen64plus build system has no configure phase.
665 ;; Makefile is in a subdirectory.
667 'build 'cd-to-project-dir
669 (chdir "projects/unix"))))
671 (let ((out (assoc-ref %outputs "out"))
672 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
674 (string-append "PREFIX=" out)
675 (string-append "APIDIR=" m64p "/include/mupen64plus")))
676 ;; There are no tests.
678 (home-page "http://www.mupen64plus.org/")
679 (synopsis "Mupen64Plus SDL input plugin")
681 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
682 which is capable of accurately playing many games. This package contains the
683 Z64 RSP processor plugin.")
684 (license license:gpl2+)))
686 (define-public mupen64plus-video-arachnoid
688 (name "mupen64plus-video-arachnoid")
694 "https://github.com/mupen64plus/mupen64plus-video-arachnoid/archive/"
696 (file-name (string-append name "-" version ".tar.gz"))
698 (base32 "0jjwf144rihznm4lnqbhgigxw664v3v32wy94adaa6imk8z6gslh"))))
699 (build-system gnu-build-system)
701 `(("pkg-config" ,pkg-config)
705 ("mupen64plus-core" ,mupen64plus-core)))
708 (modify-phases %standard-phases
709 ;; The mupen64plus build system has no configure phase.
711 ;; Makefile is in a subdirectory.
713 'build 'cd-to-project-dir
715 (chdir "projects/unix"))))
717 (let ((out (assoc-ref %outputs "out"))
718 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
720 (string-append "PREFIX=" out)
721 (string-append "APIDIR=" m64p "/include/mupen64plus")))
722 ;; There are no tests.
724 (home-page "http://www.mupen64plus.org/")
725 (synopsis "Mupen64Plus Rice Video plugin")
727 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
728 which is capable of accurately playing many games. This package contains the
729 Arachnoid video plugin.")
730 (license license:gpl2+)))
732 (define-public mupen64plus-video-glide64
734 (name "mupen64plus-video-glide64")
740 "https://github.com/mupen64plus/mupen64plus-video-glide64/archive/"
742 (file-name (string-append name "-" version ".tar.gz"))
744 (base32 "1rm55dbf6xgsq1blbzs6swa2ajv0qkn38acbljj346abnk6s3dla"))))
745 (build-system gnu-build-system)
747 `(("pkg-config" ,pkg-config)
751 ("mupen64plus-core" ,mupen64plus-core)
755 (modify-phases %standard-phases
756 ;; The mupen64plus build system has no configure phase.
758 ;; Makefile is in a subdirectory.
760 'build 'cd-to-project-dir
762 (chdir "projects/unix")))
763 ;; XXX Should be unnecessary with the next release.
767 (substitute* "Makefile"
768 (("SDL_CONFIG = (.*)sdl-config" all prefix)
769 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
771 (let ((out (assoc-ref %outputs "out"))
772 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
774 (string-append "PREFIX=" out)
775 (string-append "APIDIR=" m64p "/include/mupen64plus")))
776 ;; There are no tests.
778 (home-page "http://www.mupen64plus.org/")
779 (synopsis "Mupen64Plus Rice Video plugin")
781 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
782 which is capable of accurately playing many games. This package contains the
783 Glide64 video plugin.")
784 (license license:gpl2+)))
786 (define-public mupen64plus-video-glide64mk2
788 (name "mupen64plus-video-glide64mk2")
794 "https://github.com/mupen64plus/mupen64plus-video-glide64mk2/archive/"
796 (file-name (string-append name "-" version ".tar.gz"))
798 (base32 "1ihl4q293d6svba26b4mhapjcdg12p90gibz79b4mx423jlcxxj9"))))
799 (build-system gnu-build-system)
801 `(("pkg-config" ,pkg-config)
807 ("mupen64plus-core" ,mupen64plus-core)
812 (modify-phases %standard-phases
813 ;; The mupen64plus build system has no configure phase.
815 ;; Makefile is in a subdirectory.
817 'build 'cd-to-project-dir
819 (chdir "projects/unix"))))
821 (let ((out (assoc-ref %outputs "out"))
822 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
824 (string-append "PREFIX=" out)
825 (string-append "APIDIR=" m64p "/include/mupen64plus")))
826 ;; There are no tests.
828 (home-page "http://www.mupen64plus.org/")
829 (synopsis "Mupen64Plus Rice Video plugin")
831 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
832 which is capable of accurately playing many games. This package contains the
833 Glide64MK2 video plugin.")
834 (license license:gpl2+)))
836 (define-public mupen64plus-video-rice
838 (name "mupen64plus-video-rice")
844 "https://github.com/mupen64plus/mupen64plus-video-rice/archive/"
846 (file-name (string-append name "-" version ".tar.gz"))
848 (base32 "0rd2scjmh285w61aj3mgx71whg5rqrjbry3cdgicczrnyvf8wdvk"))))
849 (build-system gnu-build-system)
851 `(("pkg-config" ,pkg-config)
856 ("mupen64plus-core" ,mupen64plus-core)
860 (modify-phases %standard-phases
861 ;; The mupen64plus build system has no configure phase.
863 ;; Makefile is in a subdirectory.
865 'build 'cd-to-project-dir
867 (chdir "projects/unix"))))
869 (let ((out (assoc-ref %outputs "out"))
870 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
872 (string-append "PREFIX=" out)
873 (string-append "APIDIR=" m64p "/include/mupen64plus")))
874 ;; There are no tests.
876 (home-page "http://www.mupen64plus.org/")
877 (synopsis "Mupen64Plus Rice Video plugin")
879 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
880 which is capable of accurately playing many games. This package contains the
882 (license license:gpl2+)))
884 (define-public mupen64plus-video-z64
886 (name "mupen64plus-video-z64")
892 "https://github.com/mupen64plus/mupen64plus-video-z64/archive/"
894 (file-name (string-append name "-" version ".tar.gz"))
896 (base32 "1x7wsjs5gx2iwx20p4cjcbf696zsjlh31qxmghwv0ifrq8x58s1b"))
897 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
898 (build-system gnu-build-system)
900 `(("pkg-config" ,pkg-config)
904 ("mupen64plus-core" ,mupen64plus-core)
908 (modify-phases %standard-phases
909 ;; The mupen64plus build system has no configure phase.
911 ;; Makefile is in a subdirectory.
913 'build 'cd-to-project-dir
915 (chdir "projects/unix")))
916 ;; XXX Should be unnecessary with the next release.
920 (substitute* "Makefile"
921 (("SDL_CONFIG = (.*)sdl-config" all prefix)
922 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
924 (let ((out (assoc-ref %outputs "out"))
925 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
927 (string-append "PREFIX=" out)
928 (string-append "APIDIR=" m64p "/include/mupen64plus")))
929 ;; There are no tests.
931 (home-page "http://www.mupen64plus.org/")
932 (synopsis "Mupen64Plus Z64 video plugin")
934 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
935 which is capable of accurately playing many games. This package contains the
937 (license license:gpl2+)))
939 (define-public mupen64plus-ui-console
941 (name "mupen64plus-ui-console")
947 "https://github.com/mupen64plus/mupen64plus-ui-console/archive/"
949 (file-name (string-append name "-" version ".tar.gz"))
951 (base32 "04qkpd8ic7xsgnqz7spl00wxdygf79m7d1k8rabbygjk5lg6p8z2"))
952 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
953 (build-system gnu-build-system)
955 `(("pkg-config" ,pkg-config)
959 ;; Mupen64Plus supports a single data directory and a single plugin
960 ;; directory in its configuration, yet we need data and plugin files from
961 ;; a variety of packages. The best way to deal with this is to install
962 ;; all packages from which data and plugin files are needed into one's
963 ;; profile, and point the configuration there. Hence, propagate the most
964 ;; important packages here to save the user from the bother. The patch
965 ;; mupen64plus-ui-console-notice also gives users instructions on what
966 ;; they need to do in order to point the configuration to their profile.
968 `(("mupen64plus-core" ,mupen64plus-core)
969 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
970 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
971 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
972 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
973 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
974 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
977 (modify-phases %standard-phases
978 ;; The mupen64plus build system has no configure phase.
980 ;; Makefile is in a subdirectory.
982 'build 'cd-to-project-dir
984 (chdir "projects/unix"))))
986 (let ((out (assoc-ref %outputs "out"))
987 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
989 (string-append "PREFIX=" out)
990 (string-append "APIDIR=" m64p "/include/mupen64plus")
991 ;; Trailing slash matters here.
992 (string-append "COREDIR=" m64p "/lib/")))
993 ;; There are no tests.
995 (home-page "http://www.mupen64plus.org/")
996 (synopsis "Mupen64Plus SDL input plugin")
998 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
999 which is capable of accurately playing many games. This package contains the
1000 command line user interface. Installing this package is the easiest way
1001 towards a working Mupen64Plus for casual users.")
1002 (license license:gpl2+)))
1004 (define-public nestopia-ue
1006 (name "nestopia-ue")
1011 "https://github.com/rdanbrook/nestopia/archive/"
1013 (file-name (string-append name "-" version ".tar.gz"))
1016 "184y05z4k4a4m4022niy625kan0rklh8gcxyynxli1fss2sjjrpv"))
1017 (modules '((guix build utils)))
1020 ;; We don't need libretro for the GNU/Linux build.
1021 (delete-file-recursively "libretro")
1023 (build-system cmake-build-system)
1025 `(("pkg-config" ,pkg-config)))
1029 ("libarchive" ,libarchive)
1030 ("libepoxy" ,libepoxy)
1035 (modify-phases %standard-phases
1036 ;; This fixes the file chooser crash that happens with GTK 3.
1037 (add-after 'install 'wrap-program
1038 (lambda* (#:key inputs outputs #:allow-other-keys)
1039 (let* ((out (assoc-ref outputs "out"))
1040 (nestopia (string-append out "/bin/nestopia"))
1041 (gtk (assoc-ref inputs "gtk+"))
1042 (gtk-share (string-append gtk "/share")))
1043 (wrap-program nestopia
1044 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1045 ;; There are no tests.
1047 (home-page "http://0ldsk00l.ca/nestopia/")
1048 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1050 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1051 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1052 emulation community. It provides highly accurate emulation.")
1053 (license license:gpl2+)))
1055 (define-public retroarch
1062 (uri (string-append "https://github.com/libretro/RetroArch/archive/v"
1064 (file-name (string-append name "-" version ".tar.gz"))
1066 (base32 "1si78dbwbsq4i0r42q94nmlpaxdyqch113nxavdprf4vc1224356"))))
1067 (build-system gnu-build-system)
1069 '(#:tests? #f ; no tests
1071 (modify-phases %standard-phases
1073 (lambda* (#:key inputs outputs #:allow-other-keys)
1074 (let* ((out (assoc-ref outputs "out"))
1075 (etc (string-append out "/etc"))
1076 (vulkan (assoc-ref inputs "vulkan-loader")))
1077 ;; Hard-code the path to libvulkan.so.
1078 (substitute* "gfx/common/vulkan_common.c"
1079 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1080 (substitute* "qb/qb.libs.sh"
1081 (("/bin/true") (which "true")))
1082 ;; The configure script does not yet accept the extra arguments
1083 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1086 (string-append "--prefix=" out)
1087 (string-append "--global-config-dir=" etc)))))))))
1089 `(("alsa-lib" ,alsa-lib)
1091 ("freetype" ,freetype)
1092 ("libxinerama" ,libxinerama)
1093 ("libxkbcommon" ,libxkbcommon)
1094 ("libxml2" ,libxml2)
1098 ("pulseaudio" ,pulseaudio)
1103 ("vulkan-loader" ,vulkan-loader)
1104 ("wayland" ,wayland)
1107 `(("pkg-config" ,pkg-config)
1109 (home-page "https://www.libretro.com/")
1110 (synopsis "Reference frontend for the libretro API")
1112 "Libretro is a simple but powerful development interface that allows for
1113 the easy creation of emulators, games and multimedia applications that can plug
1114 straight into any libretro-compatible frontend. RetroArch is the official
1115 reference frontend for the libretro API, currently used by most as a modular
1116 multi-system game/emulator system.")
1117 (license license:gpl3+)))
1119 (define-public scummvm
1126 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1127 "/scummvm-" version ".tar.xz"))
1130 "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
1131 (build-system gnu-build-system)
1133 `(#:tests? #f ;require "git"
1134 #:configure-flags (list "--enable-release") ;for optimizations
1136 (modify-phases %standard-phases
1138 ;; configure does not work followed by both "SHELL=..." and
1139 ;; "CONFIG_SHELL=..."; set environment variables instead
1140 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1141 (let* ((out (assoc-ref outputs "out"))
1142 (bash (which "bash"))
1143 (flags `(,(string-append "--prefix=" out)
1144 ,@configure-flags)))
1145 (setenv "SHELL" bash)
1146 (setenv "CONFIG_SHELL" bash)
1147 (apply invoke "./configure" flags)))))))
1149 `(("pkg-config" ,pkg-config)))
1151 `(("alsa-lib" ,alsa-lib)
1153 ("fluidsynth" ,fluidsynth)
1154 ("freetype" ,freetype)
1156 ("libjpeg-turbo" ,libjpeg-turbo)
1158 ("libmpeg2" ,libmpeg2)
1161 ("libtheora" ,libtheora)
1162 ("libvorbis" ,libvorbis)
1166 (home-page "https://www.scummvm.org/")
1167 (synopsis "Engine for several graphical adventure games")
1168 (description "ScummVM is a program which allows you to run certain
1169 classic graphical point-and-click adventure games, provided you
1170 already have their data files. The clever part about this: ScummVM
1171 just replaces the executables shipped with the games, allowing you to
1172 play them on systems for which they were never designed!")
1173 (license license:gpl2+)))
1183 (url "https://github.com/mamedev/mame.git")
1184 (commit (apply string-append "mame" (string-split version #\.)))))
1185 (file-name (git-file-name name version))
1188 "0ddw8635hdm21lgpf13k1vhfywy3460rwciv93vrqmpkq2dvpmib"))
1189 (modules '((guix build utils)))
1191 ;; Remove bundled libraries.
1193 (with-directory-excursion "3rdparty"
1194 (for-each delete-file-recursively
1195 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1196 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1197 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1199 (build-system gnu-build-system)
1203 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1204 (string-append "SDL_INI_PATH="
1205 (assoc-ref %outputs "out")
1208 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1209 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1210 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1211 #:tests? #f ;no test in regular release
1213 (modify-phases %standard-phases
1214 ;; Add missing include lines for "fmin" and "ceil" functions.
1215 ;; Reported upstream. Will be fixed in 0.201.
1216 (add-after 'unpack 'add-missing-include
1218 (substitute* "src/devices/cpu/mips/mips3.cpp"
1219 (("#include \"ps2vu.h\"" all)
1220 (string-append all "\n#include <cmath>")))
1221 (substitute* "src/devices/cpu/mips/ps2vif1.cpp"
1222 (("#include \"ps2vif1.h\"" all)
1223 (string-append all "\n#include <cmath>")))
1226 (add-after 'build 'build-documentation
1227 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1229 ;; Upstream does not provide an installation phase.
1230 (lambda* (#:key outputs #:allow-other-keys)
1231 (let* ((out (assoc-ref outputs "out"))
1232 (share (string-append out "/share/mame")))
1234 (for-each (lambda (dir)
1235 (copy-recursively dir (string-append share "/" dir)))
1236 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1237 "plugins" "samples"))
1238 (let ((keymaps (string-append share "/keymaps")))
1239 (for-each (lambda (file) (install-file file keymaps))
1240 (find-files "keymaps" ".*LINUX\\.map")))
1241 (let ((fonts (string-append share "/fonts")))
1242 (install-file "uismall.bdf" fonts))
1243 (when (file-exists? "mame64")
1244 (rename-file "mame64" "mame"))
1245 (install-file "mame" (string-append out "/bin")))
1247 (add-after 'install 'install-documentation
1248 (lambda* (#:key outputs #:allow-other-keys)
1249 (let* ((out (assoc-ref outputs "out"))
1250 (man (string-append out "/share/man/man1"))
1251 (info (string-append out "/share/info")))
1252 (install-file "docs/build/man/MAME.1" man)
1253 (install-file "docs/build/texinfo/MAME.info" info))
1255 (add-after 'install 'install-ini-file
1256 ;; Generate an ini file so as to set some directories (e.g., roms)
1257 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1259 ;; XXX: We need to insert absolute references to the store. It can
1260 ;; be an issue if they leak into user's home directory, e.g., with
1261 ;; "mame -createconfig" and the package is later GC'ed.
1262 (lambda* (#:key outputs #:allow-other-keys)
1263 (let* ((out (assoc-ref outputs "out"))
1264 (share (string-append out "/share/mame"))
1265 (ini (string-append share "/ini")))
1266 (with-output-to-file (string-append ini "/mame.ini")
1269 "inipath $HOME/.mame;~a/ini~@
1270 homepath $HOME/mame~@
1271 rompath $HOME/mame/roms~@
1272 samplepath $HOME/mame/samples;~a/samples~@
1273 cheatpath $HOME/mame/cheat~@
1274 artpath $HOME/mame/artwork;~a/artwork~@
1275 crosshairpath $HOME/mame/crosshair~@
1276 snapshot_directory $HOME/mame/snapshots~@
1278 fontpath $HOME/mame/fonts;~a/fonts~@
1279 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1281 pluginspath $HOME/mame/plugins;~a/plugins~@
1282 languagepath ~a/language~@
1283 cfg_directory $HOME/.mame/cfg~@
1284 nvram_directory $HOME/.mame/nvram~@
1285 input_directory $HOME/.mame/inp~@
1286 state_directory $HOME/.mame/sta~@
1287 diff_directory $HOME/.mame/diff~@
1288 comment_directory $HOME/.mame/comments~%"
1289 share share share share share share share share
1291 (with-output-to-file (string-append ini "/ui.ini")
1294 "historypath $HOME/mame/history~@
1295 categorypath $HOME/mame/folders~@
1296 cabinets_directory $HOME/mame/cabinets~@
1297 cpanels_directory $HOME/mame/cpanel~@
1298 pcbs_directory $HOME/mame/pcb~@
1299 flyers_directory $HOME/mame/flyers~@
1300 titles_directory $HOME/mame/titles~@
1301 ends_directory $HOME/mame/ends~@
1302 marquees_directory $HOME/mame/marquees~@
1303 artwork_preview_directory $HOME/mame/artpreview~@
1304 bosses_directory $HOME/mame/bosses~@
1305 logos_directory $HOME/mame/logo~@
1306 scores_directory $HOME/mame/scores~@
1307 versus_directory $HOME/mame/versus~@
1308 gameover_directory $HOME/mame/gameover~@
1309 howto_directory $HOME/mame/howto~@
1310 select_directory $HOME/mame/select~@
1311 icons_directory $HOME/mame/icons~@
1312 covers_directory $HOME/mame/covers~@
1313 ui_path $HOME/.mame/ui~%")))
1315 (add-after 'install 'install-desktop-file
1316 (lambda* (#:key outputs #:allow-other-keys)
1317 (let* ((out (assoc-ref outputs "out"))
1318 (desktop (string-append out "/share/applications"))
1319 (executable (string-append out "/bin/mame")))
1321 (with-output-to-file (string-append desktop "/mame.desktop")
1326 Comment=Multi-purpose emulation framework~@
1331 Categories=Game;Emulator;~@
1332 Keywords=Game;Emulator;Arcade;~%"
1336 `(("pkg-config" ,pkg-config)
1337 ("pugixml" ,pugixml)
1338 ("python-sphinx" ,python-sphinx)
1339 ("texinfo" ,texinfo)))
1341 `(("alsa-lib" ,alsa-lib)
1345 ("fontconfig" ,fontconfig)
1347 ("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
1348 ("libxinerama" ,libxinerama)
1350 ("portaudio" ,portaudio)
1351 ("portmidi" ,portmidi)
1352 ("python-wrapper" ,python-wrapper)
1354 ("rapidjson" ,rapidjson)
1355 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1357 ("utf8proc" ,utf8proc)
1359 (home-page "http://mamedev.org/")
1360 (synopsis "Multi-purpose emulation framework")
1361 (description "MAME's purpose is to preserve decades of software
1362 history. As electronic technology continues to rush forward, MAME
1363 prevents this important @emph{vintage} software from being lost and
1364 forgotten. This is achieved by documenting the hardware and how it
1365 functions. The source code to MAME serves as this documentation.")
1366 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1367 ;; However, over 90% of the files are under Expat license. Also, artwork,
1368 ;; keymaps, languages and samples are under CC0.
1369 (license (list license:gpl2+ license:expat license:cc0))))