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