gnu: mame: Update to 0.220.
[jackhill/guix/guix.git] / gnu / packages / emulators.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
4 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
5 ;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2018 David Thompson <dthompson2@worcester.edu>
7 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
8 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2017, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10 ;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
12 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
13 ;;; Copyright © 2019 David Wilson <david@daviwil.com>
14 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
15 ;;;
16 ;;; This file is part of GNU Guix.
17 ;;;
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
22 ;;;
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
27 ;;;
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30
31 (define-module (gnu packages emulators)
32 #:use-module (ice-9 match)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix svn-download)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages algebra)
40 #:use-module (gnu packages assembly)
41 #:use-module (gnu packages audio)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages backup)
46 #:use-module (gnu packages cdrom)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages elf)
50 #:use-module (gnu packages fonts)
51 #:use-module (gnu packages fontutils)
52 #:use-module (gnu packages freedesktop)
53 #:use-module (gnu packages game-development)
54 #:use-module (gnu packages gcc)
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages image)
60 #:use-module (gnu packages imagemagick)
61 #:use-module (gnu packages libedit)
62 #:use-module (gnu packages libusb)
63 #:use-module (gnu packages linux)
64 #:use-module (gnu packages lua)
65 #:use-module (gnu packages maths)
66 #:use-module (gnu packages mp3)
67 #:use-module (gnu packages music)
68 #:use-module (gnu packages ncurses)
69 #:use-module (gnu packages networking)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages pulseaudio)
72 #:use-module (gnu packages python)
73 #:use-module (gnu packages qt)
74 #:use-module (gnu packages sdl)
75 #:use-module (gnu packages sphinx)
76 #:use-module (gnu packages sqlite)
77 #:use-module (gnu packages texinfo)
78 #:use-module (gnu packages textutils)
79 #:use-module (gnu packages tls)
80 #:use-module (gnu packages upnp)
81 #:use-module (gnu packages video)
82 #:use-module (gnu packages vulkan)
83 #:use-module (gnu packages wxwidgets)
84 #:use-module (gnu packages xdisorg)
85 #:use-module (gnu packages xiph)
86 #:use-module (gnu packages xml)
87 #:use-module (gnu packages xorg)
88 #:use-module (gnu packages web)
89 #:use-module (guix build-system cmake)
90 #:use-module (guix build-system glib-or-gtk)
91 #:use-module (guix build-system gnu))
92
93 (define-public desmume
94 (package
95 (name "desmume")
96 (version "0.9.11")
97 (source
98 (origin
99 (method url-fetch)
100 (uri (string-append
101 "mirror://sourceforge/desmume/desmume/"
102 version "/desmume-" version ".tar.gz"))
103 (sha256
104 (base32
105 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))
106 (patches (search-patches "desmume-gcc6-fixes.patch"
107 "desmume-gcc7-fixes.patch"))))
108 (build-system gnu-build-system)
109 (arguments
110 ;; Enable support for WiFi and microphone.
111 `(#:configure-flags '("--enable-wifi"
112 "--enable-openal")))
113 (native-inputs
114 `(("pkg-config" ,pkg-config)
115 ("intltool" ,intltool)))
116 (inputs
117 `(("zlib" ,zlib)
118 ("sdl" ,sdl)
119 ("glib" ,glib)
120 ("gtk+" ,gtk+-2)
121 ("glu" ,glu)))
122 (home-page "http://desmume.org/")
123 (synopsis "Nintendo DS emulator")
124 (description
125 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
126 (license license:gpl2)))
127
128 ;; Building from recent Git because the official 5.0 release no longer builds.
129 (define-public dolphin-emu
130 (let ((commit "a9745400ec5cea7e55d94955afbdc44d1a4982d1")
131 (revision "7"))
132 (package
133 (name "dolphin-emu")
134 (version (git-version "5.0" revision commit))
135 (source
136 (origin
137 (method git-fetch)
138 (uri (git-reference
139 (url "https://github.com/dolphin-emu/dolphin.git")
140 (commit commit)))
141 (file-name (git-file-name name version))
142 (modules '((guix build utils)))
143 (snippet
144 '(begin
145 ;; Remove external stuff we don't need.
146 (for-each (lambda (dir)
147 (delete-file-recursively
148 (string-append "Externals/" dir)))
149 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
150 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
151 "miniupnpc" "MoltenVK" "zlib"))
152 ;; Clean up source.
153 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
154 #t))
155 (sha256
156 (base32
157 "0ic08ii4vlqlmk2wkfc99jiy6nji2wfq56r7slj23wgvhznnaabk"))))
158 (build-system cmake-build-system)
159 (arguments
160 '(#:tests? #f
161 #:phases
162 (modify-phases %standard-phases
163 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
164 (lambda* (#:key inputs outputs #:allow-other-keys)
165 (let ((fontfile
166 (string-append (assoc-ref inputs "font-wqy-microhei")
167 "/share/fonts/truetype/wqy-microhei.ttc"))
168 (libvulkan
169 (string-append (assoc-ref inputs "vulkan-loader")
170 "/lib/libvulkan.so")))
171 (chdir "docs")
172 (invoke "bash" "-c" "g++ -O2 $(freetype-config \
173 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
174 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
175 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
176 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
177 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
178 (chdir "..")
179 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
180 (("\"vulkan\", 1") (string-append "\"vulkan\"")))
181 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
182 (("\"vulkan\"") (string-append "\"" libvulkan "\"")))
183 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
184 (("Common::DynamicLibrary::GetVersionedFilename") ""))
185 #t))))
186
187 ;; The FindGTK2 cmake script only checks hardcoded directories for
188 ;; glib/gtk headers.
189
190 #:configure-flags
191 (list (string-append "-DX11_INCLUDE_DIR="
192 (assoc-ref %build-inputs "libx11")
193 "/include")
194 (string-append "-DX11_LIBRARIES="
195 (assoc-ref %build-inputs "libx11")
196 "/lib/libX11.so")
197 "-DX11_FOUND=1")))
198 (native-inputs
199 `(("pkg-config" ,pkg-config)
200 ("gettext" ,gettext-minimal)))
201 (inputs
202 `(("alsa-lib" ,alsa-lib)
203 ("ao" ,ao)
204 ("bluez" ,bluez)
205 ("curl" ,curl)
206 ("eudev" ,eudev)
207 ("ffmpeg" ,ffmpeg)
208 ("font-wqy-microhei" ,font-wqy-microhei)
209 ("freetype" ,freetype)
210 ("glew" ,glew)
211 ("glib" ,glib)
212 ("glu" ,glu)
213 ("gtk+" ,gtk+-2)
214 ("hidapi" ,hidapi)
215 ("libevdev" ,libevdev)
216 ("libpng" ,libpng)
217 ("libusb" ,libusb)
218 ("libx11" ,libx11)
219 ("libxi" ,libxi)
220 ("libxrandr" ,libxrandr)
221 ("lzo" ,lzo)
222 ("mbedtls-apache" ,mbedtls-apache)
223 ("mesa" ,mesa)
224 ("miniupnpc" ,miniupnpc)
225 ("openal" ,openal)
226 ("pugixml" ,pugixml)
227 ("pulseaudio" ,pulseaudio)
228 ("qtbase" ,qtbase)
229 ("sdl2" ,sdl2)
230 ("sfml" ,sfml)
231 ("soil" ,soil)
232 ("soundtouch" ,soundtouch)
233 ("vulkan-loader" ,vulkan-loader)
234 ("zlib" ,zlib)))
235 (home-page "https://dolphin-emu.org/")
236 (synopsis "Nintendo Wii and GameCube emulator")
237 (description
238 "Dolphin is an emulator for two Nintendo video game consoles: the
239 GameCube and the Wii. It provides compatibility with all PC controllers,
240 turbo speed, networked multiplayer, and graphical enhancements.")
241 (supported-systems '("x86_64-linux" "aarch64-linux"))
242 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
243 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
244
245 (define-public dosbox
246 (package
247 (name "dosbox")
248 (version "0.74-3")
249 (source (origin
250 (method url-fetch)
251 (uri (string-append "https://sourceforge.net/projects/dosbox"
252 "/files/dosbox/" version "/dosbox-"
253 version ".tar.gz/download"))
254 (file-name (string-append name "-" version ".tar.gz"))
255 (sha256
256 (base32
257 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
258 (build-system gnu-build-system)
259 (native-inputs
260 `(("autoconf" ,autoconf)
261 ("automake" ,automake)))
262 (inputs
263 `(("sdl" ,sdl)
264 ("libpng" ,libpng)
265 ("zlib" ,zlib)
266 ("alsa-lib" ,alsa-lib)
267 ("glu" ,glu)
268 ("mesa" ,mesa)))
269 (home-page "https://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
275 older games.")
276 (license license:gpl2+)))
277
278 (define-public emulation-station
279 ;; No release for a long time, new commits fix build issues
280 (let ((commit "9cc42adff67946175d2b7e25c6ae69cc374e98a0")
281 (revision "1"))
282 (package
283 (name "emulation-station")
284 (version (git-version "2.0.1" revision commit))
285 (source (origin
286 (method git-fetch) ; no tarball available
287 (uri (git-reference
288 (url "https://github.com/Aloshi/EmulationStation.git")
289 (commit commit))) ; no version tag
290 (file-name (git-file-name name version))
291 (sha256
292 (base32
293 "1cva0ns650v17lfn8in095zci6lc43d23f1x3mlzc41qfqa6mbd1"))))
294 (build-system cmake-build-system)
295 (arguments
296 '(#:tests? #f)) ; no tests
297 (inputs
298 `(("alsa-lib" ,alsa-lib)
299 ("boost" ,boost)
300 ("curl" ,curl)
301 ("eigin" ,eigen)
302 ("freeimage" ,freeimage)
303 ("freetype" ,freetype)
304 ("mesa" ,mesa)
305 ("sdl2" ,sdl2)))
306 (synopsis "Video game console emulator front-end")
307 (description "EmulationStation provides a graphical front-end to a large
308 number of video game console emulators. It features an interface that is
309 usable with any game controller that has at least 4 buttons, theming support,
310 and a game metadata scraper.")
311 (home-page "https://emulationstation.org")
312 (license license:expat))))
313
314 ;; Note: higan v107 has been released, but as explained by the dialog that
315 ;; appears after starting the new version, it's an experimental release. The
316 ;; author recommends v106 for general use.
317 ;;
318 ;; When updating to v107 (or probably beyond), sdl will have to be replaced
319 ;; with sdl2, and libxrandr will need to be added to inputs. The patch
320 ;; `higan-remove-march-native-flag.patch' will not be necessary, since the flag
321 ;; is now being added only for `platform=local', which is not the default.
322 (define-public higan
323 (package
324 (name "higan")
325 (version "106")
326 (source
327 (origin
328 (method git-fetch)
329 (uri (git-reference
330 (url "https://github.com/byuu/higan/")
331 (commit (string-append "v" version))))
332 (file-name (git-file-name name version))
333 (sha256
334 (base32 "1mxivf8124vz4hl0b0xa1yqv0z9m3i12v9psmbpqkprrbq0wbgn1"))
335 (patches (search-patches "higan-remove-march-native-flag.patch"))))
336 (build-system gnu-build-system)
337 (native-inputs
338 `(("pkg-config" ,pkg-config)))
339 (inputs
340 `(("alsa-lib" ,alsa-lib)
341 ("ao" ,ao)
342 ("eudev" ,eudev)
343 ("gtk+" ,gtk+-2)
344 ("gtksourceview-2" ,gtksourceview-2)
345 ("libxv" ,libxv)
346 ("mesa" ,mesa)
347 ("openal" ,openal)
348 ("pulseaudio" ,pulseaudio)
349 ("sdl" ,sdl)))
350 (arguments
351 '(#:phases
352 (let ((build-phase (assoc-ref %standard-phases 'build))
353 (install-phase (assoc-ref %standard-phases 'install)))
354 (modify-phases %standard-phases
355 ;; The higan build system has no configure phase.
356 (delete 'configure)
357 (add-before 'build 'chdir-to-higan
358 (lambda _
359 (chdir "higan")
360 #t))
361 (add-before 'install 'create-/share/applications
362 (lambda* (#:key outputs #:allow-other-keys)
363 (let ((out (assoc-ref outputs "out")))
364 ;; It seems the author forgot to do this in the Makefile.
365 (mkdir-p (string-append out "/share/applications"))
366 #t)))
367 (add-after 'install 'chdir-to-icarus
368 (lambda _
369 (chdir "../icarus")
370 #t))
371 (add-after 'chdir-to-icarus 'build-icarus build-phase)
372 (add-after 'build-icarus 'install-icarus install-phase)
373 (add-after 'install-icarus 'wrap-higan-executable
374 (lambda* (#:key inputs outputs #:allow-other-keys)
375 (let* ((out (assoc-ref outputs "out"))
376 (bin (string-append out "/bin"))
377 (higan (string-append bin "/higan"))
378 (higan-original (string-append higan "-original"))
379 (bash (string-append (assoc-ref inputs "bash")
380 "/bin/bash"))
381 (coreutils (assoc-ref inputs "coreutils"))
382 (mkdir (string-append coreutils "/bin/mkdir"))
383 (cp (string-append coreutils "/bin/cp"))
384 (cp-r (string-append cp " -r --no-preserve=mode")))
385 ;; First, have the executable make sure ~/.local/share/higan
386 ;; contains up to date files. Higan insists on looking there
387 ;; for these data files.
388 (rename-file higan higan-original)
389 (with-output-to-file higan
390 (lambda ()
391 (display
392 (string-append
393 "#!" bash "\n"
394 ;; higan doesn't respect $XDG_DATA_HOME
395 mkdir " -p ~/.local/share\n"
396 cp-r " " out "/share/higan ~/.local/share\n"
397 "exec " higan-original))))
398 (chmod higan #o555)
399 ;; Second, make sure higan will find icarus in PATH.
400 (wrap-program higan
401 `("PATH" ":" prefix (,bin)))
402 #t)))))
403 #:make-flags
404 (list "compiler=g++"
405 (string-append "prefix=" (assoc-ref %outputs "out")))
406 ;; There is no test suite.
407 #:tests? #f))
408 (home-page "https://byuu.org/higan")
409 (synopsis "Nintendo multi-system emulator")
410 (description
411 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
412 consoles, including the Nintendo Entertainment System (NES/Famicom), Super
413 Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
414 Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
415 Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
416 ;; As noted in these files among more:
417 ;; - icarus/icarus.cpp
418 ;; - higan/emulator/emulator.hpp
419 (license license:gpl3)))
420
421 (define-public mgba
422 (package
423 (name "mgba")
424 (version "0.8.1")
425 (source
426 (origin
427 (method git-fetch)
428 (uri (git-reference
429 (url "https://github.com/mgba-emu/mgba.git")
430 (commit version)))
431 (file-name (git-file-name name version))
432 (sha256
433 (base32 "1if82mfaak3696w5d5yshynpzywrxgvg3ifdfi2rwlpvq1gpd429"))
434 (modules '((guix build utils)))
435 (snippet
436 ;; Make sure we don't use the bundled software.
437 '(begin
438 (for-each
439 (lambda (subdir)
440 (let ((lib-subdir (string-append "src/third-party/" subdir)))
441 (delete-file-recursively lib-subdir)))
442 '("libpng" "lzma" "sqlite3" "zlib"))
443 #t))))
444 (build-system cmake-build-system)
445 (arguments
446 `(#:tests? #f ;no "test" target
447 #:configure-flags
448 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
449 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
450 (native-inputs `(("pkg-config" ,pkg-config)
451 ("qttools" ,qttools)))
452 (inputs `(("ffmpeg" ,ffmpeg)
453 ("imagemagick" ,imagemagick)
454 ("libedit" ,libedit)
455 ("libelf" ,libelf)
456 ("libepoxy" ,libepoxy)
457 ("libpng" ,libpng)
458 ("mesa" ,mesa)
459 ("minizip" ,minizip)
460 ("ncurses" ,ncurses)
461 ("qtbase" ,qtbase)
462 ("qtmultimedia" ,qtmultimedia)
463 ("sdl2" ,sdl2)
464 ("sqlite" ,sqlite)
465 ("zlib" ,zlib)))
466 (home-page "https://mgba.io")
467 (synopsis "Game Boy Advance emulator")
468 (description
469 "mGBA is an emulator for running Game Boy Advance games. It aims to be
470 faster and more accurate than many existing Game Boy Advance emulators, as
471 well as adding features that other emulators lack. It also supports Game Boy
472 and Game Boy Color games.")
473 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+, "inih.c" is
474 ;; BSD-3, and "discord-rpc" is Expat.
475 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3 license:expat))))
476
477 (define-public sameboy
478 (package
479 (name "sameboy")
480 (version "0.12.3")
481 (source
482 (origin
483 (method git-fetch)
484 (uri (git-reference
485 (url "https://github.com/LIJI32/SameBoy.git")
486 (commit (string-append "v" version))))
487 (file-name (git-file-name name version))
488 (sha256
489 (base32 "0m5rv2x8qck1kr43xq186pp4kaiay7gd1x775n9qrljcd7z4x6fs"))))
490 (build-system gnu-build-system)
491 (native-inputs
492 `(("rgbds" ,rgbds)
493 ("gcc" ,gcc-9)
494 ("pkg-config" ,pkg-config)))
495 (inputs
496 `(("sdl2" ,sdl2)))
497 (arguments
498 `(#:tests? #f ; There are no tests
499 #:make-flags `("CC=gcc" "CONF=release"
500 ,(string-append "DATA_DIR="
501 (assoc-ref %outputs "out")
502 "/share/sameboy/"))
503 #:phases
504 (modify-phases %standard-phases
505 (delete 'configure)
506 (replace 'install
507 (lambda* (#:key outputs #:allow-other-keys)
508 (let* ((out (assoc-ref outputs "out"))
509 (bin (string-append out "/bin"))
510 (data (string-append out "/share/sameboy/")))
511 (with-directory-excursion "build/bin/SDL"
512 (install-file "sameboy" bin)
513 (delete-file "sameboy")
514 (copy-recursively "." data))
515 #t))))))
516 (home-page "https://sameboy.github.io/")
517 (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
518 (description "SameBoy is a user friendly Game Boy, Game Boy Color
519 and Super Game Boy emulator. SameBoy is accurate and includes a wide
520 range of debugging features. It has all the features one would expect
521 from an emulator---from save states to scaling filters.")
522 (license license:expat)))
523
524 (define-public mupen64plus-core
525 (package
526 (name "mupen64plus-core")
527 (version "2.5")
528 (source
529 (origin
530 (method git-fetch)
531 (uri (git-reference
532 (url "https://github.com/mupen64plus/mupen64plus-core.git")
533 (commit version)))
534 (file-name (git-file-name name version))
535 (sha256
536 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
537 (build-system gnu-build-system)
538 (native-inputs
539 `(("pkg-config" ,pkg-config)
540 ("which" ,which)))
541 (inputs
542 `(("freetype" ,freetype)
543 ("glu" ,glu)
544 ("libpng" ,libpng)
545 ("mesa" ,mesa)
546 ("sdl2" ,sdl2)
547 ("zlib" ,zlib)))
548 (arguments
549 '(#:phases
550 (modify-phases %standard-phases
551 ;; The mupen64plus build system has no configure phase.
552 (delete 'configure)
553 ;; Makefile is in a subdirectory.
554 (add-before
555 'build 'chdir-to-project-directory
556 (lambda _
557 (chdir "projects/unix")
558 #t)))
559 #:make-flags (let ((out (assoc-ref %outputs "out")))
560 (list "all" (string-append "PREFIX=" out)))
561 ;; There are no tests.
562 #:tests? #f))
563 ;; As per the Makefile (in projects/unix/Makefile):
564 (supported-systems '("i686-linux" "x86_64-linux"))
565 (home-page "https://www.mupen64plus.org/")
566 (synopsis "Nintendo 64 emulator core library")
567 (description
568 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
569 which is capable of accurately playing many games. This package contains the
570 core library.")
571 (license license:gpl2+)))
572
573 (define-public mupen64plus-audio-sdl
574 (package
575 (name "mupen64plus-audio-sdl")
576 (version "2.5")
577 (source
578 (origin
579 (method git-fetch)
580 (uri (git-reference
581 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
582 (commit version)))
583 (file-name (git-file-name name version))
584 (sha256
585 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
586 (build-system gnu-build-system)
587 (native-inputs
588 `(("pkg-config" ,pkg-config)
589 ("which" ,which)))
590 (inputs
591 `(("mupen64plus-core" ,mupen64plus-core)
592 ("sdl2" ,sdl2)))
593 (arguments
594 '(#:phases
595 (modify-phases %standard-phases
596 ;; The mupen64plus build system has no configure phase.
597 (delete 'configure)
598 ;; Makefile is in a subdirectory.
599 (add-before
600 'build 'cd-to-project-dir
601 (lambda _
602 (chdir "projects/unix"))))
603 #:make-flags
604 (let ((out (assoc-ref %outputs "out"))
605 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
606 (list "all"
607 (string-append "PREFIX=" out)
608 (string-append "APIDIR=" m64p "/include/mupen64plus")))
609 ;; There are no tests.
610 #:tests? #f))
611 (home-page "https://www.mupen64plus.org/")
612 (synopsis "Mupen64Plus SDL input plugin")
613 (description
614 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
615 which is capable of accurately playing many games. This package contains the
616 SDL audio plugin.")
617 (license license:gpl2+)))
618
619 (define-public mupen64plus-input-sdl
620 (package
621 (name "mupen64plus-input-sdl")
622 (version "2.5")
623 (source
624 (origin
625 (method git-fetch)
626 (uri (git-reference
627 (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
628 (commit version)))
629 (file-name (git-file-name name version))
630 (sha256
631 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
632 (build-system gnu-build-system)
633 (native-inputs
634 `(("which" ,which)))
635 (inputs
636 `(("mupen64plus-core" ,mupen64plus-core)
637 ("sdl2" ,sdl2)))
638 (arguments
639 '(#:phases
640 (modify-phases %standard-phases
641 ;; The mupen64plus build system has no configure phase.
642 (delete 'configure)
643 ;; Makefile is in a subdirectory.
644 (add-before
645 'build 'cd-to-project-dir
646 (lambda _
647 (chdir "projects/unix"))))
648 #:make-flags
649 (let ((out (assoc-ref %outputs "out"))
650 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
651 (list "all"
652 (string-append "PREFIX=" out)
653 (string-append "APIDIR=" m64p "/include/mupen64plus")))
654 ;; There are no tests.
655 #:tests? #f))
656 (home-page "https://www.mupen64plus.org/")
657 (synopsis "Mupen64Plus SDL input plugin")
658 (description
659 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
660 which is capable of accurately playing many games. This package contains the
661 SDL input plugin.")
662 (license license:gpl2+)))
663
664 (define-public mupen64plus-rsp-hle
665 (package
666 (name "mupen64plus-rsp-hle")
667 (version "2.5")
668 (source
669 (origin
670 (method git-fetch)
671 (uri (git-reference
672 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
673 (commit version)))
674 (file-name (git-file-name name version))
675 (sha256
676 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
677 (build-system gnu-build-system)
678 (inputs
679 `(("mupen64plus-core" ,mupen64plus-core)))
680 (arguments
681 '(#:phases
682 (modify-phases %standard-phases
683 ;; The mupen64plus build system has no configure phase.
684 (delete 'configure)
685 ;; Makefile is in a subdirectory.
686 (add-before
687 'build 'cd-to-project-dir
688 (lambda _
689 (chdir "projects/unix"))))
690 #:make-flags
691 (let ((out (assoc-ref %outputs "out"))
692 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
693 (list "all"
694 (string-append "PREFIX=" out)
695 (string-append "APIDIR=" m64p "/include/mupen64plus")))
696 ;; There are no tests.
697 #:tests? #f))
698 (home-page "https://www.mupen64plus.org/")
699 (synopsis "Mupen64Plus SDL input plugin")
700 (description
701 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
702 which is capable of accurately playing many games. This package contains the
703 high-level emulation (HLE) RSP processor plugin.")
704 (license license:gpl2+)))
705
706 (define-public mupen64plus-rsp-z64
707 (package
708 (name "mupen64plus-rsp-z64")
709 (version "2.0.0")
710 (source
711 (origin
712 (method git-fetch)
713 (uri (git-reference
714 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
715 (commit version)))
716 (file-name (git-file-name name version))
717 (sha256
718 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
719 (build-system gnu-build-system)
720 (inputs
721 `(("mupen64plus-core" ,mupen64plus-core)))
722 (arguments
723 '(#:phases
724 (modify-phases %standard-phases
725 ;; The mupen64plus build system has no configure phase.
726 (delete 'configure)
727 ;; Makefile is in a subdirectory.
728 (add-before
729 'build 'cd-to-project-dir
730 (lambda _
731 (chdir "projects/unix"))))
732 #:make-flags
733 (let ((out (assoc-ref %outputs "out"))
734 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
735 (list "all"
736 (string-append "PREFIX=" out)
737 (string-append "APIDIR=" m64p "/include/mupen64plus")))
738 ;; There are no tests.
739 #:tests? #f))
740 (home-page "https://www.mupen64plus.org/")
741 (synopsis "Mupen64Plus SDL input plugin")
742 (description
743 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
744 which is capable of accurately playing many games. This package contains the
745 Z64 RSP processor plugin.")
746 (license license:gpl2+)))
747
748 (define-public mupen64plus-video-arachnoid
749 (package
750 (name "mupen64plus-video-arachnoid")
751 (version "2.0.0")
752 (source
753 (origin
754 (method git-fetch)
755 (uri (git-reference
756 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
757 (commit version)))
758 (file-name (git-file-name name version))
759 (sha256
760 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
761 (build-system gnu-build-system)
762 (native-inputs
763 `(("pkg-config" ,pkg-config)
764 ("which" ,which)))
765 (inputs
766 `(("mesa" ,mesa)
767 ("mupen64plus-core" ,mupen64plus-core)))
768 (arguments
769 '(#:phases
770 (modify-phases %standard-phases
771 ;; The mupen64plus build system has no configure phase.
772 (delete 'configure)
773 ;; Makefile is in a subdirectory.
774 (add-before
775 'build 'cd-to-project-dir
776 (lambda _
777 (chdir "projects/unix"))))
778 #:make-flags
779 (let ((out (assoc-ref %outputs "out"))
780 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
781 (list "all"
782 (string-append "PREFIX=" out)
783 (string-append "APIDIR=" m64p "/include/mupen64plus")))
784 ;; There are no tests.
785 #:tests? #f))
786 (home-page "https://www.mupen64plus.org/")
787 (synopsis "Mupen64Plus Rice Video plugin")
788 (description
789 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
790 which is capable of accurately playing many games. This package contains the
791 Arachnoid video plugin.")
792 (license license:gpl2+)))
793
794 (define-public mupen64plus-video-glide64
795 (package
796 (name "mupen64plus-video-glide64")
797 (version "2.0.0")
798 (source
799 (origin
800 (method git-fetch)
801 (uri (git-reference
802 (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
803 (commit version)))
804 (file-name (git-file-name name version))
805 (sha256
806 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
807 (build-system gnu-build-system)
808 (native-inputs
809 `(("pkg-config" ,pkg-config)
810 ("which" ,which)))
811 (inputs
812 `(("mesa" ,mesa)
813 ("mupen64plus-core" ,mupen64plus-core)
814 ("sdl2" ,sdl2)))
815 (arguments
816 '(#:phases
817 (modify-phases %standard-phases
818 ;; The mupen64plus build system has no configure phase.
819 (delete 'configure)
820 ;; Makefile is in a subdirectory.
821 (add-before
822 'build 'cd-to-project-dir
823 (lambda _
824 (chdir "projects/unix")))
825 ;; XXX Should be unnecessary with the next release.
826 (add-before
827 'build 'use-sdl2
828 (lambda _
829 (substitute* "Makefile"
830 (("SDL_CONFIG = (.*)sdl-config" all prefix)
831 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
832 #:make-flags
833 (let ((out (assoc-ref %outputs "out"))
834 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
835 (list "all"
836 (string-append "PREFIX=" out)
837 (string-append "APIDIR=" m64p "/include/mupen64plus")))
838 ;; There are no tests.
839 #:tests? #f))
840 (home-page "https://www.mupen64plus.org/")
841 (synopsis "Mupen64Plus Rice Video plugin")
842 (description
843 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
844 which is capable of accurately playing many games. This package contains the
845 Glide64 video plugin.")
846 (license license:gpl2+)))
847
848 (define-public mupen64plus-video-glide64mk2
849 (package
850 (name "mupen64plus-video-glide64mk2")
851 (version "2.5")
852 (source
853 (origin
854 (method git-fetch)
855 (uri (git-reference
856 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
857 (commit version)))
858 (file-name (git-file-name name version))
859 (sha256
860 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
861 (build-system gnu-build-system)
862 (native-inputs
863 `(("pkg-config" ,pkg-config)
864 ("which" ,which)))
865 (inputs
866 `(("boost" ,boost)
867 ("libpng" ,libpng)
868 ("mesa" ,mesa)
869 ("mupen64plus-core" ,mupen64plus-core)
870 ("sdl2" ,sdl2)
871 ("zlib" ,zlib)))
872 (arguments
873 '(#:phases
874 (modify-phases %standard-phases
875 ;; The mupen64plus build system has no configure phase.
876 (delete 'configure)
877 ;; Makefile is in a subdirectory.
878 (add-before
879 'build 'cd-to-project-dir
880 (lambda _
881 (chdir "projects/unix"))))
882 #:make-flags
883 (let ((out (assoc-ref %outputs "out"))
884 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
885 (list "all"
886 (string-append "PREFIX=" out)
887 (string-append "APIDIR=" m64p "/include/mupen64plus")))
888 ;; There are no tests.
889 #:tests? #f))
890 (home-page "https://www.mupen64plus.org/")
891 (synopsis "Mupen64Plus Rice Video plugin")
892 (description
893 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
894 which is capable of accurately playing many games. This package contains the
895 Glide64MK2 video plugin.")
896 (license license:gpl2+)))
897
898 (define-public mupen64plus-video-rice
899 (package
900 (name "mupen64plus-video-rice")
901 (version "2.5")
902 (source
903 (origin
904 (method git-fetch)
905 (uri (git-reference
906 (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
907 (commit version)))
908 (file-name (git-file-name name version))
909 (sha256
910 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
911 (build-system gnu-build-system)
912 (native-inputs
913 `(("pkg-config" ,pkg-config)
914 ("which" ,which)))
915 (inputs
916 `(("libpng" ,libpng)
917 ("mesa" ,mesa)
918 ("mupen64plus-core" ,mupen64plus-core)
919 ("sdl2" ,sdl2)))
920 (arguments
921 '(#:phases
922 (modify-phases %standard-phases
923 ;; The mupen64plus build system has no configure phase.
924 (delete 'configure)
925 ;; Makefile is in a subdirectory.
926 (add-before
927 'build 'cd-to-project-dir
928 (lambda _
929 (chdir "projects/unix"))))
930 #:make-flags
931 (let ((out (assoc-ref %outputs "out"))
932 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
933 (list "all"
934 (string-append "PREFIX=" out)
935 (string-append "APIDIR=" m64p "/include/mupen64plus")))
936 ;; There are no tests.
937 #:tests? #f))
938 (home-page "https://www.mupen64plus.org/")
939 (synopsis "Mupen64Plus Rice Video plugin")
940 (description
941 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
942 which is capable of accurately playing many games. This package contains the
943 Rice Video plugin.")
944 (license license:gpl2+)))
945
946 (define-public mupen64plus-video-z64
947 (package
948 (name "mupen64plus-video-z64")
949 (version "2.0.0")
950 (source
951 (origin
952 (method git-fetch)
953 (uri (git-reference
954 (url "https://github.com/mupen64plus/mupen64plus-video-z64.git")
955 (commit version)))
956 (file-name (git-file-name name version))
957 (sha256
958 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
959 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
960 (build-system gnu-build-system)
961 (native-inputs
962 `(("pkg-config" ,pkg-config)
963 ("which" ,which)))
964 (inputs
965 `(("glew" ,glew)
966 ("mupen64plus-core" ,mupen64plus-core)
967 ("sdl2" ,sdl2)))
968 (arguments
969 '(#:phases
970 (modify-phases %standard-phases
971 ;; The mupen64plus build system has no configure phase.
972 (delete 'configure)
973 ;; Makefile is in a subdirectory.
974 (add-before
975 'build 'cd-to-project-dir
976 (lambda _
977 (chdir "projects/unix")))
978 ;; XXX Should be unnecessary with the next release.
979 (add-before
980 'build 'use-sdl2
981 (lambda _
982 (substitute* "Makefile"
983 (("SDL_CONFIG = (.*)sdl-config" all prefix)
984 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
985 #:make-flags
986 (let ((out (assoc-ref %outputs "out"))
987 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
988 (list "all"
989 (string-append "PREFIX=" out)
990 (string-append "APIDIR=" m64p "/include/mupen64plus")))
991 ;; There are no tests.
992 #:tests? #f))
993 (home-page "https://www.mupen64plus.org/")
994 (synopsis "Mupen64Plus Z64 video plugin")
995 (description
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 Z64 video plugin.")
999 (license license:gpl2+)))
1000
1001 (define-public mupen64plus-ui-console
1002 (package
1003 (name "mupen64plus-ui-console")
1004 (version "2.5")
1005 (source
1006 (origin
1007 (method git-fetch)
1008 (uri (git-reference
1009 (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
1010 (commit version)))
1011 (file-name (git-file-name name version))
1012 (sha256
1013 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
1014 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
1015 (build-system gnu-build-system)
1016 (native-inputs
1017 `(("pkg-config" ,pkg-config)
1018 ("which" ,which)))
1019 (inputs
1020 `(("sdl2" ,sdl2)))
1021 ;; Mupen64Plus supports a single data directory and a single plugin
1022 ;; directory in its configuration, yet we need data and plugin files from
1023 ;; a variety of packages. The best way to deal with this is to install
1024 ;; all packages from which data and plugin files are needed into one's
1025 ;; profile, and point the configuration there. Hence, propagate the most
1026 ;; important packages here to save the user from the bother. The patch
1027 ;; mupen64plus-ui-console-notice also gives users instructions on what
1028 ;; they need to do in order to point the configuration to their profile.
1029 (propagated-inputs
1030 `(("mupen64plus-core" ,mupen64plus-core)
1031 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
1032 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
1033 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
1034 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
1035 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
1036 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
1037 (arguments
1038 '(#:phases
1039 (modify-phases %standard-phases
1040 ;; The mupen64plus build system has no configure phase.
1041 (delete 'configure)
1042 ;; Makefile is in a subdirectory.
1043 (add-before
1044 'build 'cd-to-project-dir
1045 (lambda _
1046 (chdir "projects/unix"))))
1047 #:make-flags
1048 (let ((out (assoc-ref %outputs "out"))
1049 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1050 (list "all"
1051 (string-append "PREFIX=" out)
1052 (string-append "APIDIR=" m64p "/include/mupen64plus")
1053 ;; Trailing slash matters here.
1054 (string-append "COREDIR=" m64p "/lib/")))
1055 ;; There are no tests.
1056 #:tests? #f))
1057 (home-page "https://www.mupen64plus.org/")
1058 (synopsis "Mupen64Plus command line user interface")
1059 (description
1060 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1061 which is capable of accurately playing many games. This package contains the
1062 command line user interface. Installing this package is the easiest way
1063 towards a working Mupen64Plus for casual users.")
1064 (license license:gpl2+)))
1065
1066 (define-public nestopia-ue
1067 (package
1068 (name "nestopia-ue")
1069 (version "1.48")
1070 (source
1071 (origin
1072 (method git-fetch)
1073 (uri (git-reference
1074 (url "https://github.com/rdanbrook/nestopia.git")
1075 (commit version)))
1076 (file-name (git-file-name name version))
1077 (sha256
1078 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1079 (modules '((guix build utils)))
1080 (snippet
1081 '(begin
1082 ;; We don't need libretro for the GNU/Linux build.
1083 (delete-file-recursively "libretro")
1084 #t))))
1085 (build-system cmake-build-system)
1086 (native-inputs
1087 `(("pkg-config" ,pkg-config)))
1088 (inputs
1089 `(("ao" ,ao)
1090 ("gtk+" ,gtk+)
1091 ("libarchive" ,libarchive)
1092 ("libepoxy" ,libepoxy)
1093 ("sdl2" ,sdl2)
1094 ("zlib" ,zlib)))
1095 (arguments
1096 '(#:phases
1097 (modify-phases %standard-phases
1098 ;; This fixes the file chooser crash that happens with GTK 3.
1099 (add-after 'install 'wrap-program
1100 (lambda* (#:key inputs outputs #:allow-other-keys)
1101 (let* ((out (assoc-ref outputs "out"))
1102 (nestopia (string-append out "/bin/nestopia"))
1103 (gtk (assoc-ref inputs "gtk+"))
1104 (gtk-share (string-append gtk "/share")))
1105 (wrap-program nestopia
1106 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1107 ;; There are no tests.
1108 #:tests? #f))
1109 (home-page "http://0ldsk00l.ca/nestopia/")
1110 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1111 (description
1112 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1113 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1114 emulation community. It provides highly accurate emulation.")
1115 (license license:gpl2+)))
1116
1117 (define-public retroarch
1118 (package
1119 (name "retroarch")
1120 (version "1.8.1")
1121 (source
1122 (origin
1123 (method git-fetch)
1124 (uri (git-reference
1125 (url "https://github.com/libretro/RetroArch.git")
1126 (commit (string-append "v" version))))
1127 (file-name (git-file-name name version))
1128 (sha256
1129 (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))
1130 (patches
1131 (search-patches "retroarch-disable-online-updater.patch"))
1132 (modules '((guix build utils)))
1133 (snippet
1134 '(begin
1135 ;; Don't suggest using the Online Updater if available: it never
1136 ;; is. This disables translation of this particular message.
1137 (substitute* (find-files "menu/drivers" "\\.c$")
1138 (("msg_hash_to_str\\(MSG_MISSING_ASSETS\\)")
1139 "\"Warning: Missing assets, go get some\""))
1140 #t))))
1141 (build-system gnu-build-system)
1142 (arguments
1143 `(#:tests? #f ; no tests
1144 #:phases
1145 (modify-phases %standard-phases
1146 (replace 'configure
1147 (lambda* (#:key inputs outputs #:allow-other-keys)
1148 (let* ((out (assoc-ref outputs "out"))
1149 (etc (string-append out "/etc"))
1150 (vulkan (assoc-ref inputs "vulkan-loader"))
1151 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1152 ;; Hard-code some store file names.
1153 (substitute* "gfx/common/vulkan_common.c"
1154 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1155 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1156 (("/usr/local/share/wayland-protocols")
1157 (string-append wayland-protocols "/share/wayland-protocols")))
1158 (substitute* "qb/qb.libs.sh"
1159 (("/bin/true") (which "true")))
1160
1161 ;; Use shared zlib.
1162 (substitute* '("libretro-common/file/archive_file_zlib.c"
1163 "libretro-common/streams/trans_stream_zlib.c")
1164 (("<compat/zlib.h>") "<zlib.h>"))
1165
1166 ;; The configure script does not yet accept the extra arguments
1167 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1168 (invoke
1169 "./configure"
1170 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1171 (%current-system)))
1172 '("--enable-neon" "--enable-floathard")
1173 '())
1174 (string-append "--prefix=" out)
1175 (string-append "--global-config-dir=" etc)
1176 "--disable-builtinminiupnpc")))))))
1177 (inputs
1178 `(("alsa-lib" ,alsa-lib)
1179 ("ffmpeg" ,ffmpeg)
1180 ("freetype" ,freetype)
1181 ("libxinerama" ,libxinerama)
1182 ("libxkbcommon" ,libxkbcommon)
1183 ("libxml2" ,libxml2)
1184 ("libxrandr" ,libxrandr)
1185 ("libxv" ,libxv)
1186 ("mesa" ,mesa)
1187 ("miniupnpc" ,miniupnpc)
1188 ("openal" ,openal)
1189 ("pulseaudio" ,pulseaudio)
1190 ("python" ,python)
1191 ("qtbase" ,qtbase)
1192 ("sdl" ,sdl2)
1193 ("udev" ,eudev)
1194 ("vulkan-loader" ,vulkan-loader)
1195 ("wayland" ,wayland)
1196 ("zlib" ,zlib)))
1197 (native-inputs
1198 `(("pkg-config" ,pkg-config)
1199 ("wayland-protocols" ,wayland-protocols)
1200 ("which" ,which)))
1201 (home-page "https://www.libretro.com/")
1202 (synopsis "Reference frontend for the libretro API")
1203 (description
1204 "Libretro is a simple but powerful development interface that allows for
1205 the easy creation of emulators, games and multimedia applications that can plug
1206 straight into any libretro-compatible frontend. RetroArch is the official
1207 reference frontend for the libretro API, currently used by most as a modular
1208 multi-system game/emulator system.")
1209 (license license:gpl3+)))
1210
1211 (define-public scummvm
1212 (package
1213 (name "scummvm")
1214 (version "2.1.1")
1215 (source
1216 (origin
1217 (method url-fetch)
1218 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1219 "/scummvm-" version ".tar.xz"))
1220 (sha256
1221 (base32 "1a6waf1ybp91nwva8g650cljlfb1di4l0jv13vg6yfgkas9pclsp"))))
1222 (build-system gnu-build-system)
1223 (arguments
1224 `(#:tests? #f ;require "git"
1225 #:configure-flags (list "--enable-release") ;for optimizations
1226 #:phases
1227 (modify-phases %standard-phases
1228 (add-after 'unpack 'fix-build
1229 ;; XXX: The following works around a build failure introduced when
1230 ;; Fluidsynth was updated to version 2.1. It has been applied
1231 ;; upstream as 68758a879e0c8ecc0d40962516d4e808aa4e15e5 and can be
1232 ;; removed once this commit makes it into a release.
1233 (lambda _
1234 (substitute* "audio/softsynth/fluidsynth.cpp"
1235 (("#include <fluidsynth.h>") "")
1236 (("#include \"common/scummsys.h\"") "#include \"config.h\"")
1237 (("#include \"common/config-manager.h\"" line)
1238 (string-append "#include <fluidsynth.h>\n"
1239 "#include \"common/scummsys.h\"\n"
1240 line)))
1241 #t))
1242 (replace 'configure
1243 ;; configure does not work followed by both "SHELL=..." and
1244 ;; "CONFIG_SHELL=..."; set environment variables instead
1245 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1246 (let* ((out (assoc-ref outputs "out"))
1247 (bash (which "bash"))
1248 (flags `(,(string-append "--prefix=" out)
1249 ,@configure-flags)))
1250 (setenv "SHELL" bash)
1251 (setenv "CONFIG_SHELL" bash)
1252 (apply invoke "./configure" flags)))))))
1253 (native-inputs
1254 `(("nasm" ,nasm)
1255 ("pkg-config" ,pkg-config)))
1256 (inputs
1257 `(("alsa-lib" ,alsa-lib)
1258 ("faad2" ,faad2)
1259 ("fluidsynth" ,fluidsynth)
1260 ("freetype" ,freetype)
1261 ("liba52" ,liba52)
1262 ("libflac" ,flac)
1263 ("libjpeg-turbo" ,libjpeg-turbo)
1264 ("libmad" ,libmad)
1265 ("libmpeg2" ,libmpeg2)
1266 ("libogg" ,libogg)
1267 ("libpng" ,libpng)
1268 ("libtheora" ,libtheora)
1269 ("libvorbis" ,libvorbis)
1270 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
1271 ("zlib" ,zlib)))
1272 (home-page "https://www.scummvm.org/")
1273 (synopsis "Engine for several graphical adventure games")
1274 (description "ScummVM is a program which allows you to run certain
1275 classic graphical point-and-click adventure games, provided you
1276 already have their data files. The clever part about this: ScummVM
1277 just replaces the executables shipped with the games, allowing you to
1278 play them on systems for which they were never designed!")
1279 (license license:gpl2+)))
1280
1281 (define-public mame
1282 (package
1283 (name "mame")
1284 (version "0.220")
1285 (source
1286 (origin
1287 (method git-fetch)
1288 (uri (git-reference
1289 (url "https://github.com/mamedev/mame.git")
1290 (commit (apply string-append "mame" (string-split version #\.)))))
1291 (file-name (git-file-name name version))
1292 (sha256
1293 (base32 "0x3yr195zi7xjr21p1c2l8c0vhg0a0af0mpz4i1w7q7r9krvcvz4"))
1294 (modules '((guix build utils)))
1295 (snippet
1296 ;; Remove bundled libraries.
1297 '(begin
1298 (with-directory-excursion "3rdparty"
1299 (for-each delete-file-recursively
1300 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1301 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1302 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1303 #t))))
1304 (build-system gnu-build-system)
1305 (arguments
1306 `(#:make-flags
1307 (cons*
1308 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1309 "NOWERROR=1"
1310 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1311 (string-append "SDL_INI_PATH="
1312 (assoc-ref %outputs "out")
1313 "/share/mame/ini")
1314 (map (lambda (lib)
1315 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1316 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1317 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1318 #:tests? #f ;no test in regular release
1319 #:phases
1320 (modify-phases %standard-phases
1321 (delete 'configure)
1322 (add-after 'build 'build-documentation
1323 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1324 (replace 'install
1325 ;; Upstream does not provide an installation phase.
1326 (lambda* (#:key outputs #:allow-other-keys)
1327 (let* ((out (assoc-ref outputs "out"))
1328 (share (string-append out "/share/mame")))
1329 ;; Install data.
1330 (for-each (lambda (dir)
1331 (copy-recursively dir (string-append share "/" dir)))
1332 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1333 "plugins" "samples"))
1334 (let ((keymaps (string-append share "/keymaps")))
1335 (for-each (lambda (file) (install-file file keymaps))
1336 (find-files "keymaps" ".*LINUX\\.map")))
1337 (let ((fonts (string-append share "/fonts")))
1338 (install-file "uismall.bdf" fonts))
1339 (when (file-exists? "mame64")
1340 (rename-file "mame64" "mame"))
1341 (install-file "mame" (string-append out "/bin")))
1342 #t))
1343 (add-after 'install 'install-documentation
1344 (lambda* (#:key outputs #:allow-other-keys)
1345 (let* ((out (assoc-ref outputs "out"))
1346 (man (string-append out "/share/man/man1"))
1347 (info (string-append out "/share/info")))
1348 (install-file "docs/build/man/MAME.1" man)
1349 (install-file "docs/build/texinfo/MAME.info" info))
1350 #t))
1351 (add-after 'install 'install-ini-file
1352 ;; Generate an ini file so as to set some directories (e.g., roms)
1353 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1354 ;;
1355 ;; XXX: We need to insert absolute references to the store. It can
1356 ;; be an issue if they leak into user's home directory, e.g., with
1357 ;; "mame -createconfig" and the package is later GC'ed.
1358 (lambda* (#:key outputs #:allow-other-keys)
1359 (let* ((out (assoc-ref outputs "out"))
1360 (share (string-append out "/share/mame"))
1361 (ini (string-append share "/ini")))
1362 (with-output-to-file (string-append ini "/mame.ini")
1363 (lambda _
1364 (format #t
1365 "inipath $HOME/.mame;~a/ini~@
1366 homepath $HOME/mame~@
1367 rompath $HOME/mame/roms~@
1368 samplepath $HOME/mame/samples;~a/samples~@
1369 cheatpath $HOME/mame/cheat~@
1370 artpath $HOME/mame/artwork;~a/artwork~@
1371 crosshairpath $HOME/mame/crosshair~@
1372 snapshot_directory $HOME/mame/snapshots~@
1373 hashpath ~a/hash~@
1374 fontpath $HOME/mame/fonts;~a/fonts~@
1375 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1376 bgfx_path ~a/bgfx~@
1377 pluginspath $HOME/mame/plugins;~a/plugins~@
1378 languagepath ~a/language~@
1379 cfg_directory $HOME/.mame/cfg~@
1380 nvram_directory $HOME/.mame/nvram~@
1381 input_directory $HOME/.mame/inp~@
1382 state_directory $HOME/.mame/sta~@
1383 diff_directory $HOME/.mame/diff~@
1384 comment_directory $HOME/.mame/comments~%"
1385 share share share share share share share share
1386 share)))
1387 (with-output-to-file (string-append ini "/ui.ini")
1388 (lambda _
1389 (format #t
1390 "historypath $HOME/mame/history~@
1391 categorypath $HOME/mame/folders~@
1392 cabinets_directory $HOME/mame/cabinets~@
1393 cpanels_directory $HOME/mame/cpanel~@
1394 pcbs_directory $HOME/mame/pcb~@
1395 flyers_directory $HOME/mame/flyers~@
1396 titles_directory $HOME/mame/titles~@
1397 ends_directory $HOME/mame/ends~@
1398 marquees_directory $HOME/mame/marquees~@
1399 artwork_preview_directory $HOME/mame/artpreview~@
1400 bosses_directory $HOME/mame/bosses~@
1401 logos_directory $HOME/mame/logo~@
1402 scores_directory $HOME/mame/scores~@
1403 versus_directory $HOME/mame/versus~@
1404 gameover_directory $HOME/mame/gameover~@
1405 howto_directory $HOME/mame/howto~@
1406 select_directory $HOME/mame/select~@
1407 icons_directory $HOME/mame/icons~@
1408 covers_directory $HOME/mame/covers~@
1409 ui_path $HOME/.mame/ui~%")))
1410 #t)))
1411 (add-after 'install 'install-desktop-file
1412 (lambda* (#:key outputs #:allow-other-keys)
1413 (let* ((out (assoc-ref outputs "out"))
1414 (desktop (string-append out "/share/applications"))
1415 (executable (string-append out "/bin/mame")))
1416 (mkdir-p desktop)
1417 (with-output-to-file (string-append desktop "/mame.desktop")
1418 (lambda _
1419 (format #t
1420 "[Desktop Entry]~@
1421 Name=mame~@
1422 Comment=Multi-purpose emulation framework~@
1423 Exec=~a~@
1424 TryExec=~@*~a~@
1425 Terminal=false~@
1426 Type=Application~@
1427 Categories=Game;Emulator;~@
1428 Keywords=Game;Emulator;Arcade;~%"
1429 executable)))
1430 #t))))))
1431 (native-inputs
1432 `(("pkg-config" ,pkg-config)
1433 ("sphinx" ,python-sphinx)
1434 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1435 ("texinfo" ,texinfo)))
1436 (inputs
1437 `(("alsa-lib" ,alsa-lib)
1438 ("asio" ,asio)
1439 ("expat" ,expat)
1440 ("flac" ,flac)
1441 ("fontconfig" ,fontconfig)
1442 ("glm" ,glm)
1443 ("libjpeg" ,libjpeg-turbo)
1444 ("libxi" ,libxi)
1445 ("libxinerama" ,libxinerama)
1446 ("lua" ,lua)
1447 ("portaudio" ,portaudio)
1448 ("portmidi" ,portmidi)
1449 ("pugixml" ,pugixml)
1450 ("python-wrapper" ,python-wrapper)
1451 ("qtbase" ,qtbase)
1452 ("rapidjson" ,rapidjson)
1453 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1454 ("sqlite" ,sqlite)
1455 ("utf8proc" ,utf8proc)
1456 ("zlib" ,zlib)))
1457 (home-page "https://www.mamedev.org")
1458 (synopsis "Multi-purpose emulation framework")
1459 (description "MAME's purpose is to preserve decades of software
1460 history. As electronic technology continues to rush forward, MAME
1461 prevents this important @emph{vintage} software from being lost and
1462 forgotten. This is achieved by documenting the hardware and how it
1463 functions. The source code to MAME serves as this documentation.")
1464 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1465 ;; However, over 90% of the files are under Expat license. Also, artwork,
1466 ;; keymaps, languages and samples are under CC0.
1467 (license (list license:gpl2+ license:expat license:cc0))))
1468
1469 (define-public gnome-arcade
1470 (package
1471 (name "gnome-arcade")
1472 (version "0.218.2")
1473 (source
1474 (origin
1475 (method git-fetch)
1476 (uri (git-reference
1477 (url "https://github.com/strippato/gnome-arcade")
1478 (commit (string-append "v." version))))
1479 (file-name (git-file-name name version))
1480 (sha256
1481 (base32
1482 "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
1483 (build-system cmake-build-system)
1484 (arguments
1485 `(#:tests? #f ; No tests.
1486 #:configure-flags (list
1487 (string-append "-DMAME_BIN=\""
1488 (assoc-ref %build-inputs "mame")
1489 "/bin/mame\"")
1490 (string-append "-DAPP_RES=\""
1491 (assoc-ref %outputs "out")
1492 "/share/gnome-arcade/\""))
1493 #:phases
1494 (modify-phases %standard-phases
1495 (add-before 'build 'fix-paths
1496 (lambda* (#:key outputs #:allow-other-keys)
1497 (let ((out (assoc-ref outputs "out")))
1498 (pk 'cwd (getcwd))
1499 (substitute* "../source/src/config.c"
1500 (("/usr/share") (string-append out "/share"))))
1501 #t))
1502 (replace 'install
1503 (lambda* (#:key outputs #:allow-other-keys)
1504 (let* ((out (assoc-ref outputs "out"))
1505 (bin (string-append out "/bin"))
1506 (rom (string-append out "/share/gnome-arcade/data/rom"))
1507 (tile (string-append out "/share/gnome-arcade/data/tile")))
1508 (mkdir-p bin)
1509 (install-file "../gnome-arcade" bin)
1510 (copy-recursively "../source/res"
1511 (string-append out "/share/gnome-arcade/res"))
1512 (mkdir-p rom)
1513 (install-file "../source/data/rom/ROM.TXT" rom)
1514 (mkdir-p tile)
1515 (install-file "../source/data/tile/TILE.TXT" tile))
1516 #t)))))
1517 (native-inputs
1518 `(("pkg-config" ,pkg-config)))
1519 (inputs
1520 `(("mame" ,mame)
1521 ("gtk" ,gtk+)
1522 ("libevdev" ,libevdev)
1523 ("libvlc" ,vlc)
1524 ("libarchive" ,libarchive)))
1525 (home-page "https://github.com/strippato/gnome-arcade")
1526 (synopsis "Minimal MAME frontend")
1527 (description
1528 "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
1529 emulator.")
1530 (license license:gpl3+)))
1531
1532 (define-public pcsxr
1533 ;; No release since 2017.
1534 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1535 (package
1536 (name "pcsxr")
1537 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1538 (version "1.9.95")
1539 (source
1540 (origin
1541 (method git-fetch)
1542 (uri (git-reference
1543 (url "https://github.com/pcsxr/PCSX-Reloaded")
1544 (commit commit)))
1545 (sha256
1546 (base32
1547 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1548 (file-name (git-file-name name commit))))
1549 (build-system cmake-build-system)
1550 (arguments
1551 `(#:tests? #f ;no "test" target
1552 #:configure-flags
1553 (list "-DSND_BACKEND=pulse"
1554 "-DENABLE_CCDDA='ON'"
1555 "-DUSE_LIBARCHIVE='ON'"
1556 "-DUSE_LIBCDIO='ON'")
1557 #:phases
1558 (modify-phases %standard-phases
1559 (add-after 'unpack 'cd-subdir
1560 (lambda _ (chdir "pcsxr") #t))
1561 (add-before 'configure 'fix-cdio-lookup
1562 (lambda* (#:key inputs #:allow-other-keys)
1563 (substitute* "cmake/FindCdio.cmake"
1564 (("/usr/include/cdio")
1565 (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
1566 #t))
1567 (add-after 'install 'wrap-program
1568 (lambda* (#:key inputs outputs #:allow-other-keys)
1569 (wrap-program (string-append (assoc-ref outputs "out")
1570 "/bin/pcsxr")
1571 ;; For GtkFileChooserDialog.
1572 `("GSETTINGS_SCHEMA_DIR" =
1573 (,(string-append (assoc-ref inputs "gtk+")
1574 "/share/glib-2.0/schemas"))))
1575 #t)))))
1576 (native-inputs
1577 `(("pkg-config" ,pkg-config)
1578 ("intltool" ,intltool)
1579 ("glib" ,glib "bin")))
1580 (inputs
1581 `(("libcdio" ,libcdio)
1582 ("sdl2" ,sdl2)
1583 ("gtk+" ,gtk+)
1584 ("ffmpeg" ,ffmpeg)
1585 ("libxv" ,libxv)
1586 ("libarchive" ,libarchive)
1587 ("pulseaudio" ,pulseaudio)))
1588 (home-page "https://archive.codeplex.com/?p=pcsxr")
1589 (synopsis "PlayStation emulator")
1590 (description
1591 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1592 improvements.")
1593 (license license:gpl2+))))
1594
1595 (define-public gens-gs
1596 (package
1597 (name "gens-gs")
1598 (version "7")
1599 (source
1600 (origin
1601 (method url-fetch)
1602 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1603 version ".tar.gz"))
1604 (sha256
1605 (base32
1606 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1607 (build-system glib-or-gtk-build-system)
1608 (arguments
1609 `(#:system "i686-linux"
1610 #:phases
1611 (modify-phases %standard-phases
1612 (add-after 'unpack 'fix-CFLAGS
1613 (lambda* _
1614 ;; Remove GTK API deprecation flags that cause build errors.
1615 (substitute* "configure"
1616 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1617 #t)))))
1618 (native-inputs
1619 `(("pkg-config" ,pkg-config)
1620 ("nasm" ,nasm)))
1621 (inputs
1622 `(("sdl" ,sdl)
1623 ("gtk" ,gtk+-2)))
1624 (home-page "https://segaretro.org/Gens/GS")
1625 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1626 (description
1627 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1628 derived from Gens. Project goals include clean source code, combined features
1629 from various forks of Gens, and improved platform portability.")
1630 (supported-systems '("i686-linux" "x86_64-linux"))
1631 (license license:gpl2+)))