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 fonts)
45 #:use-module (gnu packages fontutils)
46 #:use-module (gnu packages freedesktop)
47 #:use-module (gnu packages game-development)
48 #:use-module (gnu packages gcc)
49 #:use-module (gnu packages gettext)
50 #:use-module (gnu packages gl)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages gtk)
53 #:use-module (gnu packages image)
54 #:use-module (gnu packages imagemagick)
55 #:use-module (gnu packages libedit)
56 #:use-module (gnu packages libusb)
57 #:use-module (gnu packages linux)
58 #:use-module (gnu packages lua)
59 #:use-module (gnu packages maths)
60 #:use-module (gnu packages mp3)
61 #:use-module (gnu packages music)
62 #:use-module (gnu packages ncurses)
63 #:use-module (gnu packages networking)
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages pulseaudio)
66 #:use-module (gnu packages python)
67 #:use-module (gnu packages python-xyz)
68 #:use-module (gnu packages qt)
69 #:use-module (gnu packages sdl)
70 #:use-module (gnu packages sqlite)
71 #:use-module (gnu packages texinfo)
72 #:use-module (gnu packages textutils)
73 #:use-module (gnu packages tls)
74 #:use-module (gnu packages upnp)
75 #:use-module (gnu packages video)
76 #:use-module (gnu packages vulkan)
77 #:use-module (gnu packages wxwidgets)
78 #:use-module (gnu packages xdisorg)
79 #:use-module (gnu packages xiph)
80 #:use-module (gnu packages xml)
81 #:use-module (gnu packages xorg)
82 #:use-module (gnu packages web)
83 #:use-module (guix build-system cmake)
84 #:use-module (guix build-system gnu))
86 (define-public desmume
94 "mirror://sourceforge/desmume/desmume/"
95 version "/desmume-" version ".tar.gz"))
98 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))))
99 (build-system gnu-build-system)
101 ;; Enable support for WiFi and microphone.
102 `(#:configure-flags '("--enable-wifi"
105 `(("pkg-config" ,pkg-config)
106 ("intltool" ,intltool)))
113 (home-page "http://desmume.org/")
114 (synopsis "Nintendo DS emulator")
116 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
117 (license license:gpl2)))
119 ;; Building from recent Git because the official 5.0 release no longer builds.
120 (define-public dolphin-emu
121 (let ((commit "2c57e709d0f9e4010a4415de4192de887e37f187")
125 (version (git-version "5.0" revision commit))
130 (url "https://github.com/dolphin-emu/dolphin.git")
132 (file-name (git-file-name name version))
133 (modules '((guix build utils)))
136 ;; Remove external stuff we don't need.
137 (for-each (lambda (dir)
138 (delete-file-recursively
139 (string-append "Externals/" dir)))
140 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
141 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
144 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
148 "0aszfdfvs7yg4bmrd3qxwsiz7hx3mrj29f4aw86bz7h9j7hkh57f"))))
149 (build-system cmake-build-system)
153 (modify-phases %standard-phases
154 (add-before 'configure 'fixgcc7
156 (unsetenv "C_INCLUDE_PATH")
157 (unsetenv "CPLUS_INCLUDE_PATH")
159 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
160 (lambda* (#:key inputs outputs #:allow-other-keys)
162 (string-append (assoc-ref inputs "font-wqy-microhei")
163 "/share/fonts/truetype/wqy-microhei.ttc"))
165 (string-append (assoc-ref inputs "vulkan-loader")
166 "/lib/libvulkan.so")))
168 (invoke "bash" "-c" "g++ -O2 -std=c++11 $(freetype-config \
169 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
170 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
171 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
172 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
173 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
175 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
176 (("libvulkan.so") libvulkan))
179 ;; The FindGTK2 cmake script only checks hardcoded directories for
183 (list (string-append "-DX11_INCLUDE_DIR="
184 (assoc-ref %build-inputs "libx11")
186 (string-append "-DX11_LIBRARIES="
187 (assoc-ref %build-inputs "libx11")
191 `(("pkg-config" ,pkg-config)
192 ("gcc" ,gcc-7) ; Building with gcc@5 doesn't work anymore.
193 ("gettext" ,gnu-gettext)))
195 `(("alsa-lib" ,alsa-lib)
201 ("font-wqy-microhei" ,font-wqy-microhei)
202 ("freetype" ,freetype)
208 ("libevdev" ,libevdev)
213 ("libxrandr" ,libxrandr)
215 ("mbedtls-apache" ,mbedtls-apache)
217 ("miniupnpc" ,miniupnpc)
220 ("pulseaudio" ,pulseaudio)
225 ("soundtouch" ,soundtouch)
226 ("vulkan-loader" ,vulkan-loader)
228 (home-page "https://dolphin-emu.org/")
229 (synopsis "Nintendo Wii and GameCube emulator")
231 "Dolphin is an emulator for two Nintendo video game consoles: the
232 GameCube and the Wii. It provides compatibility with all PC controllers,
233 turbo speed, networked multiplayer, and graphical enhancements.")
234 (supported-systems '("x86_64-linux" "aarch64-linux"))
235 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
236 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
238 (define-public dosbox
244 (uri (string-append "https://sourceforge.net/projects/dosbox"
245 "/files/dosbox/" version "/dosbox-"
246 version ".tar.gz/download"))
247 (file-name (string-append name "-" version ".tar.gz"))
250 "1ksp1b5szi0vy4x55rm3j1y9wq5mlslpy8llpg87rpdyjlsk0xvh"))))
251 (build-system gnu-build-system)
253 `(#:phases (modify-phases %standard-phases
257 (invoke "sh" "autogen.sh"))))))
259 `(("autoconf" ,autoconf)
260 ("automake" ,automake)))
265 ("alsa-lib" ,alsa-lib)
268 (home-page "http://www.dosbox.com")
269 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
270 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
271 also emulates CPU:286/386 realmode/protected mode, Directory
272 FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
273 SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
275 (license license:gpl2+)))
277 (define-public emulation-station
278 (let ((commit "646bede3d9ec0acf0ae378415edac136774a66c5"))
280 (name "emulation-station")
283 (method git-fetch) ; no tarball available
285 (url "https://github.com/Aloshi/EmulationStation.git")
286 (commit commit))) ; no version tag
287 (file-name (string-append name "-" version "-checkout"))
290 "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v"))))
291 (build-system cmake-build-system)
293 '(#:tests? #f)) ; no tests
295 `(("alsa-lib" ,alsa-lib)
299 ("freeimage" ,freeimage)
300 ("freetype" ,freetype)
303 (synopsis "Video game console emulator front-end")
304 (description "EmulationStation provides a graphical front-end to a large
305 number of video game console emulators. It features an interface that is
306 usable with any game controller that has at least 4 buttons, theming support,
307 and a game metadata scraper.")
308 (home-page "http://www.emulationstation.org")
309 (license license:expat))))
319 "https://gitlab.com/higan/higan/repository/archive.tar.gz?ref=v"
321 (file-name (string-append name "-" version ".tar.gz"))
323 (base32 "0y42pra0dxzlbkyzcp3r8a39pji2bj3p9fl40425f60af2igr4rw"))
324 (patches (search-patches "higan-remove-march-native-flag.patch"))))
325 (build-system gnu-build-system)
327 `(("pkg-config" ,pkg-config)))
329 `(("alsa-lib" ,alsa-lib)
333 ("gtksourceview-2" ,gtksourceview-2)
337 ("pulseaudio" ,pulseaudio)
341 (let ((build-phase (assoc-ref %standard-phases 'build))
342 (install-phase (assoc-ref %standard-phases 'install)))
343 (modify-phases %standard-phases
344 ;; The higan build system has no configure phase.
346 (add-before 'build 'chdir-to-higan
349 (add-before 'install 'create-/share/applications
350 (lambda* (#:key outputs #:allow-other-keys)
351 (let ((out (assoc-ref outputs "out")))
352 ;; It seems the author forgot to do this in the Makefile.
353 (mkdir-p (string-append out "/share/applications")))))
354 (add-after 'install 'chdir-to-icarus
356 (chdir "../icarus")))
357 (add-after 'chdir-to-icarus 'build-icarus build-phase)
358 (add-after 'build-icarus 'install-icarus install-phase)
359 (add-after 'install-icarus 'wrap-higan-executable
360 (lambda* (#:key inputs outputs #:allow-other-keys)
361 (let* ((out (assoc-ref outputs "out"))
362 (bin (string-append out "/bin"))
363 (higan (string-append bin "/higan"))
364 (higan-original (string-append higan "-original"))
365 (bash (string-append (assoc-ref inputs "bash")
367 (coreutils (assoc-ref inputs "coreutils"))
368 (mkdir (string-append coreutils "/bin/mkdir"))
369 (cp (string-append coreutils "/bin/cp"))
370 (cp-r (string-append cp " -r --no-preserve=mode")))
371 ;; First, have the executable make sure ~/.local/share/higan
372 ;; contains up to date files. Higan insists on looking there
373 ;; for these data files.
374 (rename-file higan higan-original)
375 (with-output-to-file higan
380 ;; higan doesn't respect $XDG_DATA_HOME
381 mkdir " -p ~/.local/share\n"
382 cp-r " " out "/share/higan ~/.local/share\n"
383 "exec " higan-original))))
385 ;; Second, make sure higan will find icarus in PATH.
387 `("PATH" ":" prefix (,bin))))))))
390 (string-append "prefix=" (assoc-ref %outputs "out")))
391 ;; There is no test suite.
393 (home-page "http://byuu.org/emulation/higan/")
394 (synopsis "Nintendo multi-system emulator")
396 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
397 consoles, including the Nintendo Entertainment System (NES/Famicom), Super
398 Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
399 Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
400 Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
401 ;; As noted in these files among more:
402 ;; - icarus/icarus.cpp
403 ;; - higan/emulator/emulator.hpp
404 (license license:gpl3)))
413 (url "https://github.com/mgba-emu/mgba.git")
415 (file-name (git-file-name name version))
418 "0s4dl4pi8rxqahvzxnh37xdgsfax36cn5wlh1srdcmabwsrfpb3w"))
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 (native-inputs `(("pkg-config" ,pkg-config)))
436 (inputs `(("ffmpeg" ,ffmpeg)
437 ("imagemagick" ,imagemagick)
439 ("libepoxy" ,libepoxy)
445 ("qtmultimedia" ,qtmultimedia)
450 (home-page "https://mgba.io")
451 (synopsis "Game Boy Advance emulator")
453 "mGBA is an emulator for running Game Boy Advance games. It aims to be
454 faster and more accurate than many existing Game Boy Advance emulators, as
455 well as adding features that other emulators lack. It also supports Game Boy
456 and Game Boy Color games.")
457 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c" is
459 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
461 (define-public mupen64plus-core
463 (name "mupen64plus-core")
469 "https://github.com/mupen64plus/mupen64plus-core/archive/"
471 (file-name (string-append name "-" version ".tar.gz"))
473 (base32 "0dg2hksm5qni2hcha93k7n4fqr92888p946f7phb0ndschzfh9kk"))))
474 (build-system gnu-build-system)
476 `(("pkg-config" ,pkg-config)
479 `(("freetype" ,freetype)
487 (modify-phases %standard-phases
488 ;; The mupen64plus build system has no configure phase.
490 ;; Makefile is in a subdirectory.
492 'build 'cd-to-project-dir
494 (chdir "projects/unix"))))
495 #:make-flags (let ((out (assoc-ref %outputs "out")))
496 (list "all" (string-append "PREFIX=" out)))
497 ;; There are no tests.
499 ;; As per the Makefile (in projects/unix/Makefile):
500 (supported-systems '("i686-linux" "x86_64-linux"))
501 (home-page "http://www.mupen64plus.org/")
502 (synopsis "Nintendo 64 emulator core library")
504 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
505 which is capable of accurately playing many games. This package contains the
507 (license license:gpl2+)))
509 (define-public mupen64plus-audio-sdl
511 (name "mupen64plus-audio-sdl")
517 "https://github.com/mupen64plus/mupen64plus-audio-sdl/archive/"
519 (file-name (string-append name "-" version ".tar.gz"))
521 (base32 "0ss6w92n2rpfnazhg9lbq0nvs3fqx93nliz3k3wjxdlx4dpi7h3a"))))
522 (build-system gnu-build-system)
524 `(("pkg-config" ,pkg-config)
527 `(("mupen64plus-core" ,mupen64plus-core)
531 (modify-phases %standard-phases
532 ;; The mupen64plus build system has no configure phase.
534 ;; Makefile is in a subdirectory.
536 'build 'cd-to-project-dir
538 (chdir "projects/unix"))))
540 (let ((out (assoc-ref %outputs "out"))
541 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
543 (string-append "PREFIX=" out)
544 (string-append "APIDIR=" m64p "/include/mupen64plus")))
545 ;; There are no tests.
547 (home-page "http://www.mupen64plus.org/")
548 (synopsis "Mupen64Plus SDL input plugin")
550 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
551 which is capable of accurately playing many games. This package contains the
553 (license license:gpl2+)))
555 (define-public mupen64plus-input-sdl
557 (name "mupen64plus-input-sdl")
563 "https://github.com/mupen64plus/mupen64plus-input-sdl/archive/"
565 (file-name (string-append name "-" version ".tar.gz"))
567 (base32 "11sj5dbalp2nrlmki34vy7wy28vc175pnnkdk65p8599hnyq37ri"))))
568 (build-system gnu-build-system)
572 `(("mupen64plus-core" ,mupen64plus-core)
576 (modify-phases %standard-phases
577 ;; The mupen64plus build system has no configure phase.
579 ;; Makefile is in a subdirectory.
581 'build 'cd-to-project-dir
583 (chdir "projects/unix"))))
585 (let ((out (assoc-ref %outputs "out"))
586 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
588 (string-append "PREFIX=" out)
589 (string-append "APIDIR=" m64p "/include/mupen64plus")))
590 ;; There are no tests.
592 (home-page "http://www.mupen64plus.org/")
593 (synopsis "Mupen64Plus SDL input plugin")
595 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
596 which is capable of accurately playing many games. This package contains the
598 (license license:gpl2+)))
600 (define-public mupen64plus-rsp-hle
602 (name "mupen64plus-rsp-hle")
608 "https://github.com/mupen64plus/mupen64plus-rsp-hle/archive/"
610 (file-name (string-append name "-" version ".tar.gz"))
612 (base32 "15h7mgz6xd2zjzm6l3f96sbs8kwr3xvbwzgikhnka79m6c69hsxv"))))
613 (build-system gnu-build-system)
615 `(("mupen64plus-core" ,mupen64plus-core)))
618 (modify-phases %standard-phases
619 ;; The mupen64plus build system has no configure phase.
621 ;; Makefile is in a subdirectory.
623 'build 'cd-to-project-dir
625 (chdir "projects/unix"))))
627 (let ((out (assoc-ref %outputs "out"))
628 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
630 (string-append "PREFIX=" out)
631 (string-append "APIDIR=" m64p "/include/mupen64plus")))
632 ;; There are no tests.
634 (home-page "http://www.mupen64plus.org/")
635 (synopsis "Mupen64Plus SDL input plugin")
637 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
638 which is capable of accurately playing many games. This package contains the
639 high-level emulation (HLE) RSP processor plugin.")
640 (license license:gpl2+)))
642 (define-public mupen64plus-rsp-z64
644 (name "mupen64plus-rsp-z64")
650 "https://github.com/mupen64plus/mupen64plus-rsp-z64/archive/"
652 (file-name (string-append name "-" version ".tar.gz"))
654 (base32 "10jz1w2dhx5slhyk4m8mdqlpsd6cshchslr1fckb2ayzb1ls3ghi"))))
655 (build-system gnu-build-system)
657 `(("mupen64plus-core" ,mupen64plus-core)))
660 (modify-phases %standard-phases
661 ;; The mupen64plus build system has no configure phase.
663 ;; Makefile is in a subdirectory.
665 'build 'cd-to-project-dir
667 (chdir "projects/unix"))))
669 (let ((out (assoc-ref %outputs "out"))
670 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
672 (string-append "PREFIX=" out)
673 (string-append "APIDIR=" m64p "/include/mupen64plus")))
674 ;; There are no tests.
676 (home-page "http://www.mupen64plus.org/")
677 (synopsis "Mupen64Plus SDL input plugin")
679 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
680 which is capable of accurately playing many games. This package contains the
681 Z64 RSP processor plugin.")
682 (license license:gpl2+)))
684 (define-public mupen64plus-video-arachnoid
686 (name "mupen64plus-video-arachnoid")
692 "https://github.com/mupen64plus/mupen64plus-video-arachnoid/archive/"
694 (file-name (string-append name "-" version ".tar.gz"))
696 (base32 "0jjwf144rihznm4lnqbhgigxw664v3v32wy94adaa6imk8z6gslh"))))
697 (build-system gnu-build-system)
699 `(("pkg-config" ,pkg-config)
703 ("mupen64plus-core" ,mupen64plus-core)))
706 (modify-phases %standard-phases
707 ;; The mupen64plus build system has no configure phase.
709 ;; Makefile is in a subdirectory.
711 'build 'cd-to-project-dir
713 (chdir "projects/unix"))))
715 (let ((out (assoc-ref %outputs "out"))
716 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
718 (string-append "PREFIX=" out)
719 (string-append "APIDIR=" m64p "/include/mupen64plus")))
720 ;; There are no tests.
722 (home-page "http://www.mupen64plus.org/")
723 (synopsis "Mupen64Plus Rice Video plugin")
725 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
726 which is capable of accurately playing many games. This package contains the
727 Arachnoid video plugin.")
728 (license license:gpl2+)))
730 (define-public mupen64plus-video-glide64
732 (name "mupen64plus-video-glide64")
738 "https://github.com/mupen64plus/mupen64plus-video-glide64/archive/"
740 (file-name (string-append name "-" version ".tar.gz"))
742 (base32 "1rm55dbf6xgsq1blbzs6swa2ajv0qkn38acbljj346abnk6s3dla"))))
743 (build-system gnu-build-system)
745 `(("pkg-config" ,pkg-config)
749 ("mupen64plus-core" ,mupen64plus-core)
753 (modify-phases %standard-phases
754 ;; The mupen64plus build system has no configure phase.
756 ;; Makefile is in a subdirectory.
758 'build 'cd-to-project-dir
760 (chdir "projects/unix")))
761 ;; XXX Should be unnecessary with the next release.
765 (substitute* "Makefile"
766 (("SDL_CONFIG = (.*)sdl-config" all prefix)
767 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
769 (let ((out (assoc-ref %outputs "out"))
770 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
772 (string-append "PREFIX=" out)
773 (string-append "APIDIR=" m64p "/include/mupen64plus")))
774 ;; There are no tests.
776 (home-page "http://www.mupen64plus.org/")
777 (synopsis "Mupen64Plus Rice Video plugin")
779 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
780 which is capable of accurately playing many games. This package contains the
781 Glide64 video plugin.")
782 (license license:gpl2+)))
784 (define-public mupen64plus-video-glide64mk2
786 (name "mupen64plus-video-glide64mk2")
792 "https://github.com/mupen64plus/mupen64plus-video-glide64mk2/archive/"
794 (file-name (string-append name "-" version ".tar.gz"))
796 (base32 "1ihl4q293d6svba26b4mhapjcdg12p90gibz79b4mx423jlcxxj9"))))
797 (build-system gnu-build-system)
799 `(("pkg-config" ,pkg-config)
805 ("mupen64plus-core" ,mupen64plus-core)
810 (modify-phases %standard-phases
811 ;; The mupen64plus build system has no configure phase.
813 ;; Makefile is in a subdirectory.
815 'build 'cd-to-project-dir
817 (chdir "projects/unix"))))
819 (let ((out (assoc-ref %outputs "out"))
820 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
822 (string-append "PREFIX=" out)
823 (string-append "APIDIR=" m64p "/include/mupen64plus")))
824 ;; There are no tests.
826 (home-page "http://www.mupen64plus.org/")
827 (synopsis "Mupen64Plus Rice Video plugin")
829 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
830 which is capable of accurately playing many games. This package contains the
831 Glide64MK2 video plugin.")
832 (license license:gpl2+)))
834 (define-public mupen64plus-video-rice
836 (name "mupen64plus-video-rice")
842 "https://github.com/mupen64plus/mupen64plus-video-rice/archive/"
844 (file-name (string-append name "-" version ".tar.gz"))
846 (base32 "0rd2scjmh285w61aj3mgx71whg5rqrjbry3cdgicczrnyvf8wdvk"))))
847 (build-system gnu-build-system)
849 `(("pkg-config" ,pkg-config)
854 ("mupen64plus-core" ,mupen64plus-core)
858 (modify-phases %standard-phases
859 ;; The mupen64plus build system has no configure phase.
861 ;; Makefile is in a subdirectory.
863 'build 'cd-to-project-dir
865 (chdir "projects/unix"))))
867 (let ((out (assoc-ref %outputs "out"))
868 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
870 (string-append "PREFIX=" out)
871 (string-append "APIDIR=" m64p "/include/mupen64plus")))
872 ;; There are no tests.
874 (home-page "http://www.mupen64plus.org/")
875 (synopsis "Mupen64Plus Rice Video plugin")
877 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
878 which is capable of accurately playing many games. This package contains the
880 (license license:gpl2+)))
882 (define-public mupen64plus-video-z64
884 (name "mupen64plus-video-z64")
890 "https://github.com/mupen64plus/mupen64plus-video-z64/archive/"
892 (file-name (string-append name "-" version ".tar.gz"))
894 (base32 "1x7wsjs5gx2iwx20p4cjcbf696zsjlh31qxmghwv0ifrq8x58s1b"))
895 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
896 (build-system gnu-build-system)
898 `(("pkg-config" ,pkg-config)
902 ("mupen64plus-core" ,mupen64plus-core)
906 (modify-phases %standard-phases
907 ;; The mupen64plus build system has no configure phase.
909 ;; Makefile is in a subdirectory.
911 'build 'cd-to-project-dir
913 (chdir "projects/unix")))
914 ;; XXX Should be unnecessary with the next release.
918 (substitute* "Makefile"
919 (("SDL_CONFIG = (.*)sdl-config" all prefix)
920 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
922 (let ((out (assoc-ref %outputs "out"))
923 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
925 (string-append "PREFIX=" out)
926 (string-append "APIDIR=" m64p "/include/mupen64plus")))
927 ;; There are no tests.
929 (home-page "http://www.mupen64plus.org/")
930 (synopsis "Mupen64Plus Z64 video plugin")
932 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
933 which is capable of accurately playing many games. This package contains the
935 (license license:gpl2+)))
937 (define-public mupen64plus-ui-console
939 (name "mupen64plus-ui-console")
945 "https://github.com/mupen64plus/mupen64plus-ui-console/archive/"
947 (file-name (string-append name "-" version ".tar.gz"))
949 (base32 "04qkpd8ic7xsgnqz7spl00wxdygf79m7d1k8rabbygjk5lg6p8z2"))
950 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
951 (build-system gnu-build-system)
953 `(("pkg-config" ,pkg-config)
957 ;; Mupen64Plus supports a single data directory and a single plugin
958 ;; directory in its configuration, yet we need data and plugin files from
959 ;; a variety of packages. The best way to deal with this is to install
960 ;; all packages from which data and plugin files are needed into one's
961 ;; profile, and point the configuration there. Hence, propagate the most
962 ;; important packages here to save the user from the bother. The patch
963 ;; mupen64plus-ui-console-notice also gives users instructions on what
964 ;; they need to do in order to point the configuration to their profile.
966 `(("mupen64plus-core" ,mupen64plus-core)
967 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
968 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
969 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
970 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
971 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
972 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
975 (modify-phases %standard-phases
976 ;; The mupen64plus build system has no configure phase.
978 ;; Makefile is in a subdirectory.
980 'build 'cd-to-project-dir
982 (chdir "projects/unix"))))
984 (let ((out (assoc-ref %outputs "out"))
985 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
987 (string-append "PREFIX=" out)
988 (string-append "APIDIR=" m64p "/include/mupen64plus")
989 ;; Trailing slash matters here.
990 (string-append "COREDIR=" m64p "/lib/")))
991 ;; There are no tests.
993 (home-page "http://www.mupen64plus.org/")
994 (synopsis "Mupen64Plus SDL input plugin")
996 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
997 which is capable of accurately playing many games. This package contains the
998 command line user interface. Installing this package is the easiest way
999 towards a working Mupen64Plus for casual users.")
1000 (license license:gpl2+)))
1002 (define-public nestopia-ue
1004 (name "nestopia-ue")
1009 "https://github.com/rdanbrook/nestopia/archive/"
1011 (file-name (string-append name "-" version ".tar.gz"))
1014 "184y05z4k4a4m4022niy625kan0rklh8gcxyynxli1fss2sjjrpv"))
1015 (modules '((guix build utils)))
1018 ;; We don't need libretro for the GNU/Linux build.
1019 (delete-file-recursively "libretro")
1021 (build-system cmake-build-system)
1023 `(("pkg-config" ,pkg-config)))
1027 ("libarchive" ,libarchive)
1028 ("libepoxy" ,libepoxy)
1033 (modify-phases %standard-phases
1034 ;; This fixes the file chooser crash that happens with GTK 3.
1035 (add-after 'install 'wrap-program
1036 (lambda* (#:key inputs outputs #:allow-other-keys)
1037 (let* ((out (assoc-ref outputs "out"))
1038 (nestopia (string-append out "/bin/nestopia"))
1039 (gtk (assoc-ref inputs "gtk+"))
1040 (gtk-share (string-append gtk "/share")))
1041 (wrap-program nestopia
1042 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1043 ;; There are no tests.
1045 (home-page "http://0ldsk00l.ca/nestopia/")
1046 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1048 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1049 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1050 emulation community. It provides highly accurate emulation.")
1051 (license license:gpl2+)))
1053 (define-public retroarch
1061 (url "https://github.com/libretro/RetroArch.git")
1062 (commit (string-append "v" version))))
1063 (file-name (git-file-name name version))
1065 (base32 "122c6cqax92qk2mhm9ywnwhw3qkv8f1ybma9gal5w6i2gsmp0s0s"))))
1066 (build-system gnu-build-system)
1068 `(#:tests? #f ; no tests
1070 (modify-phases %standard-phases
1072 (lambda* (#:key inputs outputs #:allow-other-keys)
1073 (let* ((out (assoc-ref outputs "out"))
1074 (etc (string-append out "/etc"))
1075 (vulkan (assoc-ref inputs "vulkan-loader"))
1076 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
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* "gfx/common/wayland/generate_wayland_protos.sh"
1081 (("/usr/local/share/wayland-protocols")
1082 (string-append wayland-protocols "/share/wayland-protocols")))
1083 (substitute* "qb/qb.libs.sh"
1084 (("/bin/true") (which "true")))
1086 (substitute* '("libretro-common/file/archive_file_zlib.c"
1087 "libretro-common/streams/trans_stream_zlib.c"
1088 "network/httpserver/httpserver.c")
1089 (("<compat/zlib.h>") "<zlib.h>"))
1090 ;; The configure script does not yet accept the extra arguments
1091 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1094 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1096 '("--enable-neon" "--enable-floathard")
1098 (string-append "--prefix=" out)
1099 (string-append "--global-config-dir=" etc))))))))
1101 `(("alsa-lib" ,alsa-lib)
1103 ("freetype" ,freetype)
1104 ("libxinerama" ,libxinerama)
1105 ("libxkbcommon" ,libxkbcommon)
1106 ("libxml2" ,libxml2)
1107 ("libxrandr" ,libxrandr)
1111 ("pulseaudio" ,pulseaudio)
1116 ("vulkan-loader" ,vulkan-loader)
1117 ("wayland" ,wayland)
1120 `(("pkg-config" ,pkg-config)
1121 ("wayland-protocols" ,wayland-protocols)
1123 (home-page "https://www.libretro.com/")
1124 (synopsis "Reference frontend for the libretro API")
1126 "Libretro is a simple but powerful development interface that allows for
1127 the easy creation of emulators, games and multimedia applications that can plug
1128 straight into any libretro-compatible frontend. RetroArch is the official
1129 reference frontend for the libretro API, currently used by most as a modular
1130 multi-system game/emulator system.")
1131 (license license:gpl3+)))
1133 (define-public scummvm
1140 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1141 "/scummvm-" version ".tar.xz"))
1144 "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
1145 (build-system gnu-build-system)
1147 `(#:tests? #f ;require "git"
1148 #:configure-flags (list "--enable-release") ;for optimizations
1150 (modify-phases %standard-phases
1152 ;; configure does not work followed by both "SHELL=..." and
1153 ;; "CONFIG_SHELL=..."; set environment variables instead
1154 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1155 (let* ((out (assoc-ref outputs "out"))
1156 (bash (which "bash"))
1157 (flags `(,(string-append "--prefix=" out)
1158 ,@configure-flags)))
1159 (setenv "SHELL" bash)
1160 (setenv "CONFIG_SHELL" bash)
1161 (apply invoke "./configure" flags)))))))
1163 `(("pkg-config" ,pkg-config)))
1165 `(("alsa-lib" ,alsa-lib)
1167 ("fluidsynth" ,fluidsynth)
1168 ("freetype" ,freetype)
1170 ("libjpeg-turbo" ,libjpeg-turbo)
1172 ("libmpeg2" ,libmpeg2)
1175 ("libtheora" ,libtheora)
1176 ("libvorbis" ,libvorbis)
1180 (home-page "https://www.scummvm.org/")
1181 (synopsis "Engine for several graphical adventure games")
1182 (description "ScummVM is a program which allows you to run certain
1183 classic graphical point-and-click adventure games, provided you
1184 already have their data files. The clever part about this: ScummVM
1185 just replaces the executables shipped with the games, allowing you to
1186 play them on systems for which they were never designed!")
1187 (license license:gpl2+)))
1197 (url "https://github.com/mamedev/mame.git")
1198 (commit (apply string-append "mame" (string-split version #\.)))))
1199 (file-name (git-file-name name version))
1202 "0i01h5ars1yd96ndmzhk47931hf261m8frqz1ha7s2gy52f0q86y"))
1203 (modules '((guix build utils)))
1205 ;; Remove bundled libraries.
1207 (with-directory-excursion "3rdparty"
1208 (for-each delete-file-recursively
1209 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1210 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1211 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1213 (build-system gnu-build-system)
1217 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1218 (string-append "SDL_INI_PATH="
1219 (assoc-ref %outputs "out")
1222 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1223 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1224 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1225 #:tests? #f ;no test in regular release
1227 (modify-phases %standard-phases
1229 (add-after 'build 'build-documentation
1230 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1232 ;; Upstream does not provide an installation phase.
1233 (lambda* (#:key outputs #:allow-other-keys)
1234 (let* ((out (assoc-ref outputs "out"))
1235 (share (string-append out "/share/mame")))
1237 (for-each (lambda (dir)
1238 (copy-recursively dir (string-append share "/" dir)))
1239 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1240 "plugins" "samples"))
1241 (let ((keymaps (string-append share "/keymaps")))
1242 (for-each (lambda (file) (install-file file keymaps))
1243 (find-files "keymaps" ".*LINUX\\.map")))
1244 (let ((fonts (string-append share "/fonts")))
1245 (install-file "uismall.bdf" fonts))
1246 (when (file-exists? "mame64")
1247 (rename-file "mame64" "mame"))
1248 (install-file "mame" (string-append out "/bin")))
1250 (add-after 'install 'install-documentation
1251 (lambda* (#:key outputs #:allow-other-keys)
1252 (let* ((out (assoc-ref outputs "out"))
1253 (man (string-append out "/share/man/man1"))
1254 (info (string-append out "/share/info")))
1255 (install-file "docs/build/man/MAME.1" man)
1256 (install-file "docs/build/texinfo/MAME.info" info))
1258 (add-after 'install 'install-ini-file
1259 ;; Generate an ini file so as to set some directories (e.g., roms)
1260 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1262 ;; XXX: We need to insert absolute references to the store. It can
1263 ;; be an issue if they leak into user's home directory, e.g., with
1264 ;; "mame -createconfig" and the package is later GC'ed.
1265 (lambda* (#:key outputs #:allow-other-keys)
1266 (let* ((out (assoc-ref outputs "out"))
1267 (share (string-append out "/share/mame"))
1268 (ini (string-append share "/ini")))
1269 (with-output-to-file (string-append ini "/mame.ini")
1272 "inipath $HOME/.mame;~a/ini~@
1273 homepath $HOME/mame~@
1274 rompath $HOME/mame/roms~@
1275 samplepath $HOME/mame/samples;~a/samples~@
1276 cheatpath $HOME/mame/cheat~@
1277 artpath $HOME/mame/artwork;~a/artwork~@
1278 crosshairpath $HOME/mame/crosshair~@
1279 snapshot_directory $HOME/mame/snapshots~@
1281 fontpath $HOME/mame/fonts;~a/fonts~@
1282 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1284 pluginspath $HOME/mame/plugins;~a/plugins~@
1285 languagepath ~a/language~@
1286 cfg_directory $HOME/.mame/cfg~@
1287 nvram_directory $HOME/.mame/nvram~@
1288 input_directory $HOME/.mame/inp~@
1289 state_directory $HOME/.mame/sta~@
1290 diff_directory $HOME/.mame/diff~@
1291 comment_directory $HOME/.mame/comments~%"
1292 share share share share share share share share
1294 (with-output-to-file (string-append ini "/ui.ini")
1297 "historypath $HOME/mame/history~@
1298 categorypath $HOME/mame/folders~@
1299 cabinets_directory $HOME/mame/cabinets~@
1300 cpanels_directory $HOME/mame/cpanel~@
1301 pcbs_directory $HOME/mame/pcb~@
1302 flyers_directory $HOME/mame/flyers~@
1303 titles_directory $HOME/mame/titles~@
1304 ends_directory $HOME/mame/ends~@
1305 marquees_directory $HOME/mame/marquees~@
1306 artwork_preview_directory $HOME/mame/artpreview~@
1307 bosses_directory $HOME/mame/bosses~@
1308 logos_directory $HOME/mame/logo~@
1309 scores_directory $HOME/mame/scores~@
1310 versus_directory $HOME/mame/versus~@
1311 gameover_directory $HOME/mame/gameover~@
1312 howto_directory $HOME/mame/howto~@
1313 select_directory $HOME/mame/select~@
1314 icons_directory $HOME/mame/icons~@
1315 covers_directory $HOME/mame/covers~@
1316 ui_path $HOME/.mame/ui~%")))
1318 (add-after 'install 'install-desktop-file
1319 (lambda* (#:key outputs #:allow-other-keys)
1320 (let* ((out (assoc-ref outputs "out"))
1321 (desktop (string-append out "/share/applications"))
1322 (executable (string-append out "/bin/mame")))
1324 (with-output-to-file (string-append desktop "/mame.desktop")
1329 Comment=Multi-purpose emulation framework~@
1334 Categories=Game;Emulator;~@
1335 Keywords=Game;Emulator;Arcade;~%"
1339 `(("pkg-config" ,pkg-config)
1340 ("pugixml" ,pugixml)
1341 ("python-sphinx" ,python-sphinx)
1342 ("texinfo" ,texinfo)))
1344 `(("alsa-lib" ,alsa-lib)
1348 ("fontconfig" ,fontconfig)
1350 ("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
1351 ("libxinerama" ,libxinerama)
1353 ("portaudio" ,portaudio)
1354 ("portmidi" ,portmidi)
1355 ("python-wrapper" ,python-wrapper)
1357 ("rapidjson" ,rapidjson)
1358 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1360 ("utf8proc" ,utf8proc)
1362 (home-page "http://mamedev.org/")
1363 (synopsis "Multi-purpose emulation framework")
1364 (description "MAME's purpose is to preserve decades of software
1365 history. As electronic technology continues to rush forward, MAME
1366 prevents this important @emph{vintage} software from being lost and
1367 forgotten. This is achieved by documenting the hardware and how it
1368 functions. The source code to MAME serves as this documentation.")
1369 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1370 ;; However, over 90% of the files are under Expat license. Also, artwork,
1371 ;; keymaps, languages and samples are under CC0.
1372 (license (list license:gpl2+ license:expat license:cc0))))