Merge branch 'master' into staging
[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 (define-public higan
315 (package
316 (name "higan")
317 (version "110")
318 (source
319 (origin
320 (method git-fetch)
321 (uri (git-reference
322 (url "https://github.com/higan-emu/higan.git")
323 (commit (string-append "v" version))))
324 (file-name (git-file-name name version))
325 (sha256
326 (base32 "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2"))))
327 (build-system gnu-build-system)
328 (native-inputs
329 `(("pkg-config" ,pkg-config)))
330 (inputs
331 `(("alsa-lib" ,alsa-lib)
332 ("ao" ,ao)
333 ("eudev" ,eudev)
334 ("gtk+" ,gtk+-2)
335 ("gtksourceview-2" ,gtksourceview-2)
336 ("libxrandr" ,libxrandr)
337 ("libxv" ,libxv)
338 ("mesa" ,mesa)
339 ("openal" ,openal)
340 ("pulseaudio" ,pulseaudio)
341 ("sdl2" ,sdl2)))
342 (arguments
343 '(#:phases
344 (let ((build-phase (assoc-ref %standard-phases 'build))
345 (install-phase (assoc-ref %standard-phases 'install)))
346 (modify-phases %standard-phases
347 ;; The higan build system has no configure phase.
348 (delete 'configure)
349 (add-before 'build 'chdir-to-higan
350 (lambda _
351 (chdir "higan")
352 #t))
353 (add-before 'install 'create-/share/applications
354 (lambda* (#:key outputs #:allow-other-keys)
355 (let ((out (assoc-ref outputs "out")))
356 ;; It seems the author forgot to do this in the Makefile.
357 (mkdir-p (string-append out "/share/applications"))
358 #t)))
359 (add-after 'install 'chdir-to-icarus
360 (lambda _
361 (chdir "../icarus")
362 #t))
363 (add-after 'chdir-to-icarus 'build-icarus build-phase)
364 (add-after 'build-icarus 'install-icarus install-phase)
365 (add-after 'install-icarus 'wrap-higan-executable
366 (lambda* (#:key inputs outputs #:allow-other-keys)
367 (let* ((out (assoc-ref outputs "out"))
368 (bin (string-append out "/bin"))
369 (higan (string-append bin "/higan"))
370 (higan-original (string-append higan "-original"))
371 (bash (string-append (assoc-ref inputs "bash")
372 "/bin/bash"))
373 (coreutils (assoc-ref inputs "coreutils"))
374 (mkdir (string-append coreutils "/bin/mkdir"))
375 (cp (string-append coreutils "/bin/cp"))
376 (cp-r (string-append cp " -r --no-preserve=mode")))
377 ;; First, have the executable make sure ~/.local/share/higan
378 ;; contains up to date files. Higan insists on looking there
379 ;; for these data files.
380 (rename-file higan higan-original)
381 (with-output-to-file higan
382 (lambda ()
383 (display
384 (string-append
385 "#!" bash "\n"
386 ;; higan doesn't respect $XDG_DATA_HOME
387 mkdir " -p ~/.local/share\n"
388 cp-r " " out "/share/higan ~/.local/share\n"
389 "exec " higan-original))))
390 (chmod higan #o555)
391 ;; Second, make sure higan will find icarus in PATH.
392 (wrap-program higan
393 `("PATH" ":" prefix (,bin)))
394 #t)))))
395 #:make-flags
396 (list "compiler=g++"
397 (string-append "prefix=" (assoc-ref %outputs "out")))
398 ;; There is no test suite.
399 #:tests? #f))
400 (home-page "https://github.com/higan-emu/higan/")
401 (synopsis "Multi-system emulator")
402 (description
403 "higan is a multi-system emulator with an uncompromising focus on
404 accuracy and code readability.
405
406 It currently emulates the following systems: Famicom, Famicom Disk System,
407 Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
408 Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive, Mega
409 CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket, Neo Geo
410 Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge
411 V2.")
412 (license license:gpl3+)))
413
414 (define-public mgba
415 (package
416 (name "mgba")
417 (version "0.8.1")
418 (source
419 (origin
420 (method git-fetch)
421 (uri (git-reference
422 (url "https://github.com/mgba-emu/mgba.git")
423 (commit version)))
424 (file-name (git-file-name name version))
425 (sha256
426 (base32 "1if82mfaak3696w5d5yshynpzywrxgvg3ifdfi2rwlpvq1gpd429"))
427 (modules '((guix build utils)))
428 (snippet
429 ;; Make sure we don't use the bundled software.
430 '(begin
431 (for-each
432 (lambda (subdir)
433 (let ((lib-subdir (string-append "src/third-party/" subdir)))
434 (delete-file-recursively lib-subdir)))
435 '("libpng" "lzma" "sqlite3" "zlib"))
436 #t))))
437 (build-system cmake-build-system)
438 (arguments
439 `(#:tests? #f ;no "test" target
440 #:configure-flags
441 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
442 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
443 (native-inputs `(("pkg-config" ,pkg-config)
444 ("qttools" ,qttools)))
445 (inputs `(("ffmpeg" ,ffmpeg)
446 ("imagemagick" ,imagemagick)
447 ("libedit" ,libedit)
448 ("libelf" ,libelf)
449 ("libepoxy" ,libepoxy)
450 ("libpng" ,libpng)
451 ("mesa" ,mesa)
452 ("minizip" ,minizip)
453 ("ncurses" ,ncurses)
454 ("qtbase" ,qtbase)
455 ("qtmultimedia" ,qtmultimedia)
456 ("sdl2" ,sdl2)
457 ("sqlite" ,sqlite)
458 ("zlib" ,zlib)))
459 (home-page "https://mgba.io")
460 (synopsis "Game Boy Advance emulator")
461 (description
462 "mGBA is an emulator for running Game Boy Advance games. It aims to be
463 faster and more accurate than many existing Game Boy Advance emulators, as
464 well as adding features that other emulators lack. It also supports Game Boy
465 and Game Boy Color games.")
466 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+, "inih.c" is
467 ;; BSD-3, and "discord-rpc" is Expat.
468 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3 license:expat))))
469
470 (define-public sameboy
471 (package
472 (name "sameboy")
473 (version "0.12.3")
474 (source
475 (origin
476 (method git-fetch)
477 (uri (git-reference
478 (url "https://github.com/LIJI32/SameBoy.git")
479 (commit (string-append "v" version))))
480 (file-name (git-file-name name version))
481 (sha256
482 (base32 "0m5rv2x8qck1kr43xq186pp4kaiay7gd1x775n9qrljcd7z4x6fs"))))
483 (build-system gnu-build-system)
484 (native-inputs
485 `(("rgbds" ,rgbds)
486 ("gcc" ,gcc-9)
487 ("pkg-config" ,pkg-config)))
488 (inputs
489 `(("sdl2" ,sdl2)))
490 (arguments
491 `(#:tests? #f ; There are no tests
492 #:make-flags `("CC=gcc" "CONF=release"
493 ,(string-append "DATA_DIR="
494 (assoc-ref %outputs "out")
495 "/share/sameboy/"))
496 #:phases
497 (modify-phases %standard-phases
498 (delete 'configure)
499 (replace 'install
500 (lambda* (#:key outputs #:allow-other-keys)
501 (let* ((out (assoc-ref outputs "out"))
502 (bin (string-append out "/bin"))
503 (data (string-append out "/share/sameboy/")))
504 (with-directory-excursion "build/bin/SDL"
505 (install-file "sameboy" bin)
506 (delete-file "sameboy")
507 (copy-recursively "." data))
508 #t))))))
509 (home-page "https://sameboy.github.io/")
510 (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
511 (description "SameBoy is a user friendly Game Boy, Game Boy Color
512 and Super Game Boy emulator. SameBoy is accurate and includes a wide
513 range of debugging features. It has all the features one would expect
514 from an emulator---from save states to scaling filters.")
515 (license license:expat)))
516
517 (define-public mupen64plus-core
518 (package
519 (name "mupen64plus-core")
520 (version "2.5")
521 (source
522 (origin
523 (method git-fetch)
524 (uri (git-reference
525 (url "https://github.com/mupen64plus/mupen64plus-core.git")
526 (commit version)))
527 (file-name (git-file-name name version))
528 (sha256
529 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
530 (build-system gnu-build-system)
531 (native-inputs
532 `(("pkg-config" ,pkg-config)
533 ("which" ,which)))
534 (inputs
535 `(("freetype" ,freetype)
536 ("glu" ,glu)
537 ("libpng" ,libpng)
538 ("mesa" ,mesa)
539 ("sdl2" ,sdl2)
540 ("zlib" ,zlib)))
541 (arguments
542 '(#:phases
543 (modify-phases %standard-phases
544 ;; The mupen64plus build system has no configure phase.
545 (delete 'configure)
546 ;; Makefile is in a subdirectory.
547 (add-before
548 'build 'chdir-to-project-directory
549 (lambda _
550 (chdir "projects/unix")
551 #t)))
552 #:make-flags (let ((out (assoc-ref %outputs "out")))
553 (list "all" (string-append "PREFIX=" out)))
554 ;; There are no tests.
555 #:tests? #f))
556 ;; As per the Makefile (in projects/unix/Makefile):
557 (supported-systems '("i686-linux" "x86_64-linux"))
558 (home-page "https://www.mupen64plus.org/")
559 (synopsis "Nintendo 64 emulator core library")
560 (description
561 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
562 which is capable of accurately playing many games. This package contains the
563 core library.")
564 (license license:gpl2+)))
565
566 (define-public mupen64plus-audio-sdl
567 (package
568 (name "mupen64plus-audio-sdl")
569 (version "2.5")
570 (source
571 (origin
572 (method git-fetch)
573 (uri (git-reference
574 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
575 (commit version)))
576 (file-name (git-file-name name version))
577 (sha256
578 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
579 (build-system gnu-build-system)
580 (native-inputs
581 `(("pkg-config" ,pkg-config)
582 ("which" ,which)))
583 (inputs
584 `(("mupen64plus-core" ,mupen64plus-core)
585 ("sdl2" ,sdl2)))
586 (arguments
587 '(#:phases
588 (modify-phases %standard-phases
589 ;; The mupen64plus build system has no configure phase.
590 (delete 'configure)
591 ;; Makefile is in a subdirectory.
592 (add-before
593 'build 'cd-to-project-dir
594 (lambda _
595 (chdir "projects/unix"))))
596 #:make-flags
597 (let ((out (assoc-ref %outputs "out"))
598 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
599 (list "all"
600 (string-append "PREFIX=" out)
601 (string-append "APIDIR=" m64p "/include/mupen64plus")))
602 ;; There are no tests.
603 #:tests? #f))
604 (home-page "https://www.mupen64plus.org/")
605 (synopsis "Mupen64Plus SDL input plugin")
606 (description
607 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
608 which is capable of accurately playing many games. This package contains the
609 SDL audio plugin.")
610 (license license:gpl2+)))
611
612 (define-public mupen64plus-input-sdl
613 (package
614 (name "mupen64plus-input-sdl")
615 (version "2.5")
616 (source
617 (origin
618 (method git-fetch)
619 (uri (git-reference
620 (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
621 (commit version)))
622 (file-name (git-file-name name version))
623 (sha256
624 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
625 (build-system gnu-build-system)
626 (native-inputs
627 `(("which" ,which)))
628 (inputs
629 `(("mupen64plus-core" ,mupen64plus-core)
630 ("sdl2" ,sdl2)))
631 (arguments
632 '(#:phases
633 (modify-phases %standard-phases
634 ;; The mupen64plus build system has no configure phase.
635 (delete 'configure)
636 ;; Makefile is in a subdirectory.
637 (add-before
638 'build 'cd-to-project-dir
639 (lambda _
640 (chdir "projects/unix"))))
641 #:make-flags
642 (let ((out (assoc-ref %outputs "out"))
643 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
644 (list "all"
645 (string-append "PREFIX=" out)
646 (string-append "APIDIR=" m64p "/include/mupen64plus")))
647 ;; There are no tests.
648 #:tests? #f))
649 (home-page "https://www.mupen64plus.org/")
650 (synopsis "Mupen64Plus SDL input plugin")
651 (description
652 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
653 which is capable of accurately playing many games. This package contains the
654 SDL input plugin.")
655 (license license:gpl2+)))
656
657 (define-public mupen64plus-rsp-hle
658 (package
659 (name "mupen64plus-rsp-hle")
660 (version "2.5")
661 (source
662 (origin
663 (method git-fetch)
664 (uri (git-reference
665 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
666 (commit version)))
667 (file-name (git-file-name name version))
668 (sha256
669 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
670 (build-system gnu-build-system)
671 (inputs
672 `(("mupen64plus-core" ,mupen64plus-core)))
673 (arguments
674 '(#:phases
675 (modify-phases %standard-phases
676 ;; The mupen64plus build system has no configure phase.
677 (delete 'configure)
678 ;; Makefile is in a subdirectory.
679 (add-before
680 'build 'cd-to-project-dir
681 (lambda _
682 (chdir "projects/unix"))))
683 #:make-flags
684 (let ((out (assoc-ref %outputs "out"))
685 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
686 (list "all"
687 (string-append "PREFIX=" out)
688 (string-append "APIDIR=" m64p "/include/mupen64plus")))
689 ;; There are no tests.
690 #:tests? #f))
691 (home-page "https://www.mupen64plus.org/")
692 (synopsis "Mupen64Plus SDL input plugin")
693 (description
694 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
695 which is capable of accurately playing many games. This package contains the
696 high-level emulation (HLE) RSP processor plugin.")
697 (license license:gpl2+)))
698
699 (define-public mupen64plus-rsp-z64
700 (package
701 (name "mupen64plus-rsp-z64")
702 (version "2.0.0")
703 (source
704 (origin
705 (method git-fetch)
706 (uri (git-reference
707 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
708 (commit version)))
709 (file-name (git-file-name name version))
710 (sha256
711 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
712 (build-system gnu-build-system)
713 (inputs
714 `(("mupen64plus-core" ,mupen64plus-core)))
715 (arguments
716 '(#:phases
717 (modify-phases %standard-phases
718 ;; The mupen64plus build system has no configure phase.
719 (delete 'configure)
720 ;; Makefile is in a subdirectory.
721 (add-before
722 'build 'cd-to-project-dir
723 (lambda _
724 (chdir "projects/unix"))))
725 #:make-flags
726 (let ((out (assoc-ref %outputs "out"))
727 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
728 (list "all"
729 (string-append "PREFIX=" out)
730 (string-append "APIDIR=" m64p "/include/mupen64plus")))
731 ;; There are no tests.
732 #:tests? #f))
733 (home-page "https://www.mupen64plus.org/")
734 (synopsis "Mupen64Plus SDL input plugin")
735 (description
736 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
737 which is capable of accurately playing many games. This package contains the
738 Z64 RSP processor plugin.")
739 (license license:gpl2+)))
740
741 (define-public mupen64plus-video-arachnoid
742 (package
743 (name "mupen64plus-video-arachnoid")
744 (version "2.0.0")
745 (source
746 (origin
747 (method git-fetch)
748 (uri (git-reference
749 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
750 (commit version)))
751 (file-name (git-file-name name version))
752 (sha256
753 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
754 (build-system gnu-build-system)
755 (native-inputs
756 `(("pkg-config" ,pkg-config)
757 ("which" ,which)))
758 (inputs
759 `(("mesa" ,mesa)
760 ("mupen64plus-core" ,mupen64plus-core)))
761 (arguments
762 '(#:phases
763 (modify-phases %standard-phases
764 ;; The mupen64plus build system has no configure phase.
765 (delete 'configure)
766 ;; Makefile is in a subdirectory.
767 (add-before
768 'build 'cd-to-project-dir
769 (lambda _
770 (chdir "projects/unix"))))
771 #:make-flags
772 (let ((out (assoc-ref %outputs "out"))
773 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
774 (list "all"
775 (string-append "PREFIX=" out)
776 (string-append "APIDIR=" m64p "/include/mupen64plus")))
777 ;; There are no tests.
778 #:tests? #f))
779 (home-page "https://www.mupen64plus.org/")
780 (synopsis "Mupen64Plus Rice Video plugin")
781 (description
782 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
783 which is capable of accurately playing many games. This package contains the
784 Arachnoid video plugin.")
785 (license license:gpl2+)))
786
787 (define-public mupen64plus-video-glide64
788 (package
789 (name "mupen64plus-video-glide64")
790 (version "2.0.0")
791 (source
792 (origin
793 (method git-fetch)
794 (uri (git-reference
795 (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
796 (commit version)))
797 (file-name (git-file-name name version))
798 (sha256
799 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
800 (build-system gnu-build-system)
801 (native-inputs
802 `(("pkg-config" ,pkg-config)
803 ("which" ,which)))
804 (inputs
805 `(("mesa" ,mesa)
806 ("mupen64plus-core" ,mupen64plus-core)
807 ("sdl2" ,sdl2)))
808 (arguments
809 '(#:phases
810 (modify-phases %standard-phases
811 ;; The mupen64plus build system has no configure phase.
812 (delete 'configure)
813 ;; Makefile is in a subdirectory.
814 (add-before
815 'build 'cd-to-project-dir
816 (lambda _
817 (chdir "projects/unix")))
818 ;; XXX Should be unnecessary with the next release.
819 (add-before
820 'build 'use-sdl2
821 (lambda _
822 (substitute* "Makefile"
823 (("SDL_CONFIG = (.*)sdl-config" all prefix)
824 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
825 #:make-flags
826 (let ((out (assoc-ref %outputs "out"))
827 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
828 (list "all"
829 (string-append "PREFIX=" out)
830 (string-append "APIDIR=" m64p "/include/mupen64plus")))
831 ;; There are no tests.
832 #:tests? #f))
833 (home-page "https://www.mupen64plus.org/")
834 (synopsis "Mupen64Plus Rice Video plugin")
835 (description
836 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
837 which is capable of accurately playing many games. This package contains the
838 Glide64 video plugin.")
839 (license license:gpl2+)))
840
841 (define-public mupen64plus-video-glide64mk2
842 (package
843 (name "mupen64plus-video-glide64mk2")
844 (version "2.5")
845 (source
846 (origin
847 (method git-fetch)
848 (uri (git-reference
849 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
850 (commit version)))
851 (file-name (git-file-name name version))
852 (sha256
853 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
854 (build-system gnu-build-system)
855 (native-inputs
856 `(("pkg-config" ,pkg-config)
857 ("which" ,which)))
858 (inputs
859 `(("boost" ,boost)
860 ("libpng" ,libpng)
861 ("mesa" ,mesa)
862 ("mupen64plus-core" ,mupen64plus-core)
863 ("sdl2" ,sdl2)
864 ("zlib" ,zlib)))
865 (arguments
866 '(#:phases
867 (modify-phases %standard-phases
868 ;; The mupen64plus build system has no configure phase.
869 (delete 'configure)
870 ;; Makefile is in a subdirectory.
871 (add-before
872 'build 'cd-to-project-dir
873 (lambda _
874 (chdir "projects/unix"))))
875 #:make-flags
876 (let ((out (assoc-ref %outputs "out"))
877 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
878 (list "all"
879 (string-append "PREFIX=" out)
880 (string-append "APIDIR=" m64p "/include/mupen64plus")))
881 ;; There are no tests.
882 #:tests? #f))
883 (home-page "https://www.mupen64plus.org/")
884 (synopsis "Mupen64Plus Rice Video plugin")
885 (description
886 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
887 which is capable of accurately playing many games. This package contains the
888 Glide64MK2 video plugin.")
889 (license license:gpl2+)))
890
891 (define-public mupen64plus-video-rice
892 (package
893 (name "mupen64plus-video-rice")
894 (version "2.5")
895 (source
896 (origin
897 (method git-fetch)
898 (uri (git-reference
899 (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
900 (commit version)))
901 (file-name (git-file-name name version))
902 (sha256
903 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
904 (build-system gnu-build-system)
905 (native-inputs
906 `(("pkg-config" ,pkg-config)
907 ("which" ,which)))
908 (inputs
909 `(("libpng" ,libpng)
910 ("mesa" ,mesa)
911 ("mupen64plus-core" ,mupen64plus-core)
912 ("sdl2" ,sdl2)))
913 (arguments
914 '(#:phases
915 (modify-phases %standard-phases
916 ;; The mupen64plus build system has no configure phase.
917 (delete 'configure)
918 ;; Makefile is in a subdirectory.
919 (add-before
920 'build 'cd-to-project-dir
921 (lambda _
922 (chdir "projects/unix"))))
923 #:make-flags
924 (let ((out (assoc-ref %outputs "out"))
925 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
926 (list "all"
927 (string-append "PREFIX=" out)
928 (string-append "APIDIR=" m64p "/include/mupen64plus")))
929 ;; There are no tests.
930 #:tests? #f))
931 (home-page "https://www.mupen64plus.org/")
932 (synopsis "Mupen64Plus Rice Video plugin")
933 (description
934 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
935 which is capable of accurately playing many games. This package contains the
936 Rice Video plugin.")
937 (license license:gpl2+)))
938
939 (define-public mupen64plus-video-z64
940 (package
941 (name "mupen64plus-video-z64")
942 (version "2.0.0")
943 (source
944 (origin
945 (method git-fetch)
946 (uri (git-reference
947 (url "https://github.com/mupen64plus/mupen64plus-video-z64.git")
948 (commit version)))
949 (file-name (git-file-name name version))
950 (sha256
951 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
952 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
953 (build-system gnu-build-system)
954 (native-inputs
955 `(("pkg-config" ,pkg-config)
956 ("which" ,which)))
957 (inputs
958 `(("glew" ,glew)
959 ("mupen64plus-core" ,mupen64plus-core)
960 ("sdl2" ,sdl2)))
961 (arguments
962 '(#:phases
963 (modify-phases %standard-phases
964 ;; The mupen64plus build system has no configure phase.
965 (delete 'configure)
966 ;; Makefile is in a subdirectory.
967 (add-before
968 'build 'cd-to-project-dir
969 (lambda _
970 (chdir "projects/unix")))
971 ;; XXX Should be unnecessary with the next release.
972 (add-before
973 'build 'use-sdl2
974 (lambda _
975 (substitute* "Makefile"
976 (("SDL_CONFIG = (.*)sdl-config" all prefix)
977 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
978 #:make-flags
979 (let ((out (assoc-ref %outputs "out"))
980 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
981 (list "all"
982 (string-append "PREFIX=" out)
983 (string-append "APIDIR=" m64p "/include/mupen64plus")))
984 ;; There are no tests.
985 #:tests? #f))
986 (home-page "https://www.mupen64plus.org/")
987 (synopsis "Mupen64Plus Z64 video plugin")
988 (description
989 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
990 which is capable of accurately playing many games. This package contains the
991 Z64 video plugin.")
992 (license license:gpl2+)))
993
994 (define-public mupen64plus-ui-console
995 (package
996 (name "mupen64plus-ui-console")
997 (version "2.5")
998 (source
999 (origin
1000 (method git-fetch)
1001 (uri (git-reference
1002 (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
1003 (commit version)))
1004 (file-name (git-file-name name version))
1005 (sha256
1006 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
1007 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
1008 (build-system gnu-build-system)
1009 (native-inputs
1010 `(("pkg-config" ,pkg-config)
1011 ("which" ,which)))
1012 (inputs
1013 `(("sdl2" ,sdl2)))
1014 ;; Mupen64Plus supports a single data directory and a single plugin
1015 ;; directory in its configuration, yet we need data and plugin files from
1016 ;; a variety of packages. The best way to deal with this is to install
1017 ;; all packages from which data and plugin files are needed into one's
1018 ;; profile, and point the configuration there. Hence, propagate the most
1019 ;; important packages here to save the user from the bother. The patch
1020 ;; mupen64plus-ui-console-notice also gives users instructions on what
1021 ;; they need to do in order to point the configuration to their profile.
1022 (propagated-inputs
1023 `(("mupen64plus-core" ,mupen64plus-core)
1024 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
1025 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
1026 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
1027 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
1028 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
1029 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
1030 (arguments
1031 '(#:phases
1032 (modify-phases %standard-phases
1033 ;; The mupen64plus build system has no configure phase.
1034 (delete 'configure)
1035 ;; Makefile is in a subdirectory.
1036 (add-before
1037 'build 'cd-to-project-dir
1038 (lambda _
1039 (chdir "projects/unix"))))
1040 #:make-flags
1041 (let ((out (assoc-ref %outputs "out"))
1042 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1043 (list "all"
1044 (string-append "PREFIX=" out)
1045 (string-append "APIDIR=" m64p "/include/mupen64plus")
1046 ;; Trailing slash matters here.
1047 (string-append "COREDIR=" m64p "/lib/")))
1048 ;; There are no tests.
1049 #:tests? #f))
1050 (home-page "https://www.mupen64plus.org/")
1051 (synopsis "Mupen64Plus command line user interface")
1052 (description
1053 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1054 which is capable of accurately playing many games. This package contains the
1055 command line user interface. Installing this package is the easiest way
1056 towards a working Mupen64Plus for casual users.")
1057 (license license:gpl2+)))
1058
1059 (define-public nestopia-ue
1060 (package
1061 (name "nestopia-ue")
1062 (version "1.48")
1063 (source
1064 (origin
1065 (method git-fetch)
1066 (uri (git-reference
1067 (url "https://github.com/rdanbrook/nestopia.git")
1068 (commit version)))
1069 (file-name (git-file-name name version))
1070 (sha256
1071 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1072 (modules '((guix build utils)))
1073 (snippet
1074 '(begin
1075 ;; We don't need libretro for the GNU/Linux build.
1076 (delete-file-recursively "libretro")
1077 #t))))
1078 (build-system cmake-build-system)
1079 (native-inputs
1080 `(("pkg-config" ,pkg-config)))
1081 (inputs
1082 `(("ao" ,ao)
1083 ("gtk+" ,gtk+)
1084 ("libarchive" ,libarchive)
1085 ("libepoxy" ,libepoxy)
1086 ("sdl2" ,sdl2)
1087 ("zlib" ,zlib)))
1088 (arguments
1089 '(#:phases
1090 (modify-phases %standard-phases
1091 ;; This fixes the file chooser crash that happens with GTK 3.
1092 (add-after 'install 'wrap-program
1093 (lambda* (#:key inputs outputs #:allow-other-keys)
1094 (let* ((out (assoc-ref outputs "out"))
1095 (nestopia (string-append out "/bin/nestopia"))
1096 (gtk (assoc-ref inputs "gtk+"))
1097 (gtk-share (string-append gtk "/share")))
1098 (wrap-program nestopia
1099 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1100 ;; There are no tests.
1101 #:tests? #f))
1102 (home-page "http://0ldsk00l.ca/nestopia/")
1103 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1104 (description
1105 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1106 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1107 emulation community. It provides highly accurate emulation.")
1108 (license license:gpl2+)))
1109
1110 (define-public retroarch
1111 (package
1112 (name "retroarch")
1113 (version "1.8.1")
1114 (source
1115 (origin
1116 (method git-fetch)
1117 (uri (git-reference
1118 (url "https://github.com/libretro/RetroArch.git")
1119 (commit (string-append "v" version))))
1120 (file-name (git-file-name name version))
1121 (sha256
1122 (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))
1123 (patches
1124 (search-patches "retroarch-disable-online-updater.patch"))
1125 (modules '((guix build utils)))
1126 (snippet
1127 '(begin
1128 ;; Don't suggest using the Online Updater if available: it never
1129 ;; is. This disables translation of this particular message.
1130 (substitute* (find-files "menu/drivers" "\\.c$")
1131 (("msg_hash_to_str\\(MSG_MISSING_ASSETS\\)")
1132 "\"Warning: Missing assets, go get some\""))
1133 #t))))
1134 (build-system gnu-build-system)
1135 (arguments
1136 `(#:tests? #f ; no tests
1137 #:phases
1138 (modify-phases %standard-phases
1139 (replace 'configure
1140 (lambda* (#:key inputs outputs #:allow-other-keys)
1141 (let* ((out (assoc-ref outputs "out"))
1142 (etc (string-append out "/etc"))
1143 (vulkan (assoc-ref inputs "vulkan-loader"))
1144 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1145 ;; Hard-code some store file names.
1146 (substitute* "gfx/common/vulkan_common.c"
1147 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1148 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1149 (("/usr/local/share/wayland-protocols")
1150 (string-append wayland-protocols "/share/wayland-protocols")))
1151 (substitute* "qb/qb.libs.sh"
1152 (("/bin/true") (which "true")))
1153
1154 ;; Use shared zlib.
1155 (substitute* '("libretro-common/file/archive_file_zlib.c"
1156 "libretro-common/streams/trans_stream_zlib.c")
1157 (("<compat/zlib.h>") "<zlib.h>"))
1158
1159 ;; The configure script does not yet accept the extra arguments
1160 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1161 (invoke
1162 "./configure"
1163 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1164 (%current-system)))
1165 '("--enable-neon" "--enable-floathard")
1166 '())
1167 (string-append "--prefix=" out)
1168 (string-append "--global-config-dir=" etc)
1169 "--disable-builtinminiupnpc")))))))
1170 (inputs
1171 `(("alsa-lib" ,alsa-lib)
1172 ("ffmpeg" ,ffmpeg)
1173 ("freetype" ,freetype)
1174 ("libxinerama" ,libxinerama)
1175 ("libxkbcommon" ,libxkbcommon)
1176 ("libxml2" ,libxml2)
1177 ("libxrandr" ,libxrandr)
1178 ("libxv" ,libxv)
1179 ("mesa" ,mesa)
1180 ("miniupnpc" ,miniupnpc)
1181 ("openal" ,openal)
1182 ("pulseaudio" ,pulseaudio)
1183 ("python" ,python)
1184 ("qtbase" ,qtbase)
1185 ("sdl" ,sdl2)
1186 ("udev" ,eudev)
1187 ("vulkan-loader" ,vulkan-loader)
1188 ("wayland" ,wayland)
1189 ("zlib" ,zlib)))
1190 (native-inputs
1191 `(("pkg-config" ,pkg-config)
1192 ("wayland-protocols" ,wayland-protocols)
1193 ("which" ,which)))
1194 (home-page "https://www.libretro.com/")
1195 (synopsis "Reference frontend for the libretro API")
1196 (description
1197 "Libretro is a simple but powerful development interface that allows for
1198 the easy creation of emulators, games and multimedia applications that can plug
1199 straight into any libretro-compatible frontend. RetroArch is the official
1200 reference frontend for the libretro API, currently used by most as a modular
1201 multi-system game/emulator system.")
1202 (license license:gpl3+)))
1203
1204 (define-public scummvm
1205 (package
1206 (name "scummvm")
1207 (version "2.1.2")
1208 (source
1209 (origin
1210 (method url-fetch)
1211 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1212 "/scummvm-" version ".tar.xz"))
1213 (sha256
1214 (base32 "1c4fz1nfg0nqnqx9iipayhzcsiqdmfxm2i95nw9dbhshhsdnrhf4"))))
1215 (build-system gnu-build-system)
1216 (arguments
1217 `(#:tests? #f ;require "git"
1218 #:configure-flags (list "--enable-release") ;for optimizations
1219 #:phases
1220 (modify-phases %standard-phases
1221 (add-after 'unpack 'fix-build
1222 ;; XXX: The following works around a build failure introduced when
1223 ;; Fluidsynth was updated to version 2.1. It has been applied
1224 ;; upstream as 68758a879e0c8ecc0d40962516d4e808aa4e15e5 and can be
1225 ;; removed once this commit makes it into a release.
1226 (lambda _
1227 (substitute* "audio/softsynth/fluidsynth.cpp"
1228 (("#include <fluidsynth.h>") "")
1229 (("#include \"common/scummsys.h\"") "#include \"config.h\"")
1230 (("#include \"common/config-manager.h\"" line)
1231 (string-append "#include <fluidsynth.h>\n"
1232 "#include \"common/scummsys.h\"\n"
1233 line)))
1234 #t))
1235 (replace 'configure
1236 ;; configure does not work followed by both "SHELL=..." and
1237 ;; "CONFIG_SHELL=..."; set environment variables instead
1238 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1239 (let* ((out (assoc-ref outputs "out"))
1240 (bash (which "bash"))
1241 (flags `(,(string-append "--prefix=" out)
1242 ,@configure-flags)))
1243 (setenv "SHELL" bash)
1244 (setenv "CONFIG_SHELL" bash)
1245 (apply invoke "./configure" flags)))))))
1246 (native-inputs
1247 `(("nasm" ,nasm)
1248 ("pkg-config" ,pkg-config)))
1249 (inputs
1250 `(("alsa-lib" ,alsa-lib)
1251 ("faad2" ,faad2)
1252 ("fluidsynth" ,fluidsynth)
1253 ("freetype" ,freetype)
1254 ("liba52" ,liba52)
1255 ("libflac" ,flac)
1256 ("libjpeg-turbo" ,libjpeg-turbo)
1257 ("libmad" ,libmad)
1258 ("libmpeg2" ,libmpeg2)
1259 ("libogg" ,libogg)
1260 ("libpng" ,libpng)
1261 ("libtheora" ,libtheora)
1262 ("libvorbis" ,libvorbis)
1263 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
1264 ("zlib" ,zlib)))
1265 (home-page "https://www.scummvm.org/")
1266 (synopsis "Engine for several graphical adventure games")
1267 (description "ScummVM is a program which allows you to run certain
1268 classic graphical point-and-click adventure games, provided you
1269 already have their data files. The clever part about this: ScummVM
1270 just replaces the executables shipped with the games, allowing you to
1271 play them on systems for which they were never designed!")
1272 (license license:gpl2+)))
1273
1274 (define-public mame
1275 (package
1276 (name "mame")
1277 (version "0.221")
1278 (source
1279 (origin
1280 (method git-fetch)
1281 (uri (git-reference
1282 (url "https://github.com/mamedev/mame.git")
1283 (commit (apply string-append "mame" (string-split version #\.)))))
1284 (file-name (git-file-name name version))
1285 (sha256
1286 (base32 "07fl7alj9zlyb93i8lnn4706ndy3qiv0pjvwnwysk5rqa0r3463y"))
1287 (modules '((guix build utils)))
1288 (snippet
1289 ;; Remove bundled libraries.
1290 '(begin
1291 (with-directory-excursion "3rdparty"
1292 (for-each delete-file-recursively
1293 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1294 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1295 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1296 #t))))
1297 (build-system gnu-build-system)
1298 (arguments
1299 `(#:make-flags
1300 (cons*
1301 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1302 "NOWERROR=1"
1303 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1304 (string-append "SDL_INI_PATH="
1305 (assoc-ref %outputs "out")
1306 "/share/mame/ini")
1307 (map (lambda (lib)
1308 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1309 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1310 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1311 #:tests? #f ;no test in regular release
1312 #:phases
1313 (modify-phases %standard-phases
1314 (delete 'configure)
1315 (add-after 'build 'build-documentation
1316 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1317 (replace 'install
1318 ;; Upstream does not provide an installation phase.
1319 (lambda* (#:key outputs #:allow-other-keys)
1320 (let* ((out (assoc-ref outputs "out"))
1321 (share (string-append out "/share/mame")))
1322 ;; Install data.
1323 (for-each (lambda (dir)
1324 (copy-recursively dir (string-append share "/" dir)))
1325 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1326 "plugins" "samples"))
1327 (let ((keymaps (string-append share "/keymaps")))
1328 (for-each (lambda (file) (install-file file keymaps))
1329 (find-files "keymaps" ".*LINUX\\.map")))
1330 (let ((fonts (string-append share "/fonts")))
1331 (install-file "uismall.bdf" fonts))
1332 (when (file-exists? "mame64")
1333 (rename-file "mame64" "mame"))
1334 (install-file "mame" (string-append out "/bin")))
1335 #t))
1336 (add-after 'install 'install-documentation
1337 (lambda* (#:key outputs #:allow-other-keys)
1338 (let* ((out (assoc-ref outputs "out"))
1339 (man (string-append out "/share/man/man1"))
1340 (info (string-append out "/share/info")))
1341 (install-file "docs/build/man/MAME.1" man)
1342 (install-file "docs/build/texinfo/MAME.info" info))
1343 #t))
1344 (add-after 'install 'install-ini-file
1345 ;; Generate an ini file so as to set some directories (e.g., roms)
1346 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1347 ;;
1348 ;; XXX: We need to insert absolute references to the store. It can
1349 ;; be an issue if they leak into user's home directory, e.g., with
1350 ;; "mame -createconfig" and the package is later GC'ed.
1351 (lambda* (#:key outputs #:allow-other-keys)
1352 (let* ((out (assoc-ref outputs "out"))
1353 (share (string-append out "/share/mame"))
1354 (ini (string-append share "/ini")))
1355 (with-output-to-file (string-append ini "/mame.ini")
1356 (lambda _
1357 (format #t
1358 "inipath $HOME/.mame;~a/ini~@
1359 homepath $HOME/mame~@
1360 rompath $HOME/mame/roms~@
1361 samplepath $HOME/mame/samples;~a/samples~@
1362 cheatpath $HOME/mame/cheat~@
1363 artpath $HOME/mame/artwork;~a/artwork~@
1364 crosshairpath $HOME/mame/crosshair~@
1365 snapshot_directory $HOME/mame/snapshots~@
1366 hashpath ~a/hash~@
1367 fontpath $HOME/mame/fonts;~a/fonts~@
1368 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1369 bgfx_path ~a/bgfx~@
1370 pluginspath $HOME/mame/plugins;~a/plugins~@
1371 languagepath ~a/language~@
1372 cfg_directory $HOME/.mame/cfg~@
1373 nvram_directory $HOME/.mame/nvram~@
1374 input_directory $HOME/.mame/inp~@
1375 state_directory $HOME/.mame/sta~@
1376 diff_directory $HOME/.mame/diff~@
1377 comment_directory $HOME/.mame/comments~%"
1378 share share share share share share share share
1379 share)))
1380 (with-output-to-file (string-append ini "/ui.ini")
1381 (lambda _
1382 (format #t
1383 "historypath $HOME/mame/history~@
1384 categorypath $HOME/mame/folders~@
1385 cabinets_directory $HOME/mame/cabinets~@
1386 cpanels_directory $HOME/mame/cpanel~@
1387 pcbs_directory $HOME/mame/pcb~@
1388 flyers_directory $HOME/mame/flyers~@
1389 titles_directory $HOME/mame/titles~@
1390 ends_directory $HOME/mame/ends~@
1391 marquees_directory $HOME/mame/marquees~@
1392 artwork_preview_directory $HOME/mame/artpreview~@
1393 bosses_directory $HOME/mame/bosses~@
1394 logos_directory $HOME/mame/logo~@
1395 scores_directory $HOME/mame/scores~@
1396 versus_directory $HOME/mame/versus~@
1397 gameover_directory $HOME/mame/gameover~@
1398 howto_directory $HOME/mame/howto~@
1399 select_directory $HOME/mame/select~@
1400 icons_directory $HOME/mame/icons~@
1401 covers_directory $HOME/mame/covers~@
1402 ui_path $HOME/.mame/ui~%")))
1403 #t)))
1404 (add-after 'install 'install-desktop-file
1405 (lambda* (#:key outputs #:allow-other-keys)
1406 (let* ((out (assoc-ref outputs "out"))
1407 (desktop (string-append out "/share/applications"))
1408 (executable (string-append out "/bin/mame")))
1409 (mkdir-p desktop)
1410 (with-output-to-file (string-append desktop "/mame.desktop")
1411 (lambda _
1412 (format #t
1413 "[Desktop Entry]~@
1414 Name=mame~@
1415 Comment=Multi-purpose emulation framework~@
1416 Exec=~a~@
1417 TryExec=~@*~a~@
1418 Terminal=false~@
1419 Type=Application~@
1420 Categories=Game;Emulator;~@
1421 Keywords=Game;Emulator;Arcade;~%"
1422 executable)))
1423 #t))))))
1424 (native-inputs
1425 `(("pkg-config" ,pkg-config)
1426 ("sphinx" ,python-sphinx)
1427 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1428 ("texinfo" ,texinfo)))
1429 (inputs
1430 `(("alsa-lib" ,alsa-lib)
1431 ("asio" ,asio)
1432 ("expat" ,expat)
1433 ("flac" ,flac)
1434 ("fontconfig" ,fontconfig)
1435 ("glm" ,glm)
1436 ("libjpeg" ,libjpeg-turbo)
1437 ("libxi" ,libxi)
1438 ("libxinerama" ,libxinerama)
1439 ("lua" ,lua)
1440 ("portaudio" ,portaudio)
1441 ("portmidi" ,portmidi)
1442 ("pugixml" ,pugixml)
1443 ("python-wrapper" ,python-wrapper)
1444 ("qtbase" ,qtbase)
1445 ("rapidjson" ,rapidjson)
1446 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1447 ("sqlite" ,sqlite)
1448 ("utf8proc" ,utf8proc)
1449 ("zlib" ,zlib)))
1450 (home-page "https://www.mamedev.org")
1451 (synopsis "Multi-purpose emulation framework")
1452 (description "MAME's purpose is to preserve decades of software
1453 history. As electronic technology continues to rush forward, MAME
1454 prevents this important @emph{vintage} software from being lost and
1455 forgotten. This is achieved by documenting the hardware and how it
1456 functions. The source code to MAME serves as this documentation.")
1457 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1458 ;; However, over 90% of the files are under Expat license. Also, artwork,
1459 ;; keymaps, languages and samples are under CC0.
1460 (license (list license:gpl2+ license:expat license:cc0))))
1461
1462 (define-public gnome-arcade
1463 (package
1464 (name "gnome-arcade")
1465 (version "0.218.2")
1466 (source
1467 (origin
1468 (method git-fetch)
1469 (uri (git-reference
1470 (url "https://github.com/strippato/gnome-arcade")
1471 (commit (string-append "v." version))))
1472 (file-name (git-file-name name version))
1473 (sha256
1474 (base32
1475 "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
1476 (build-system cmake-build-system)
1477 (arguments
1478 `(#:tests? #f ; No tests.
1479 #:configure-flags (list
1480 (string-append "-DMAME_BIN=\""
1481 (assoc-ref %build-inputs "mame")
1482 "/bin/mame\"")
1483 (string-append "-DAPP_RES=\""
1484 (assoc-ref %outputs "out")
1485 "/share/gnome-arcade/\""))
1486 #:phases
1487 (modify-phases %standard-phases
1488 (add-before 'build 'fix-paths
1489 (lambda* (#:key outputs #:allow-other-keys)
1490 (let ((out (assoc-ref outputs "out")))
1491 (pk 'cwd (getcwd))
1492 (substitute* "../source/src/config.c"
1493 (("/usr/share") (string-append out "/share"))))
1494 #t))
1495 (replace 'install
1496 (lambda* (#:key outputs #:allow-other-keys)
1497 (let* ((out (assoc-ref outputs "out"))
1498 (bin (string-append out "/bin"))
1499 (rom (string-append out "/share/gnome-arcade/data/rom"))
1500 (tile (string-append out "/share/gnome-arcade/data/tile")))
1501 (mkdir-p bin)
1502 (install-file "../gnome-arcade" bin)
1503 (copy-recursively "../source/res"
1504 (string-append out "/share/gnome-arcade/res"))
1505 (mkdir-p rom)
1506 (install-file "../source/data/rom/ROM.TXT" rom)
1507 (mkdir-p tile)
1508 (install-file "../source/data/tile/TILE.TXT" tile))
1509 #t)))))
1510 (native-inputs
1511 `(("pkg-config" ,pkg-config)))
1512 (inputs
1513 `(("mame" ,mame)
1514 ("gtk" ,gtk+)
1515 ("libevdev" ,libevdev)
1516 ("libvlc" ,vlc)
1517 ("libarchive" ,libarchive)))
1518 (home-page "https://github.com/strippato/gnome-arcade")
1519 (synopsis "Minimal MAME frontend")
1520 (description
1521 "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
1522 emulator.")
1523 (license license:gpl3+)))
1524
1525 (define-public pcsxr
1526 ;; No release since 2017.
1527 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1528 (package
1529 (name "pcsxr")
1530 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1531 (version "1.9.95")
1532 (source
1533 (origin
1534 (method git-fetch)
1535 (uri (git-reference
1536 (url "https://github.com/pcsxr/PCSX-Reloaded")
1537 (commit commit)))
1538 (sha256
1539 (base32
1540 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1541 (file-name (git-file-name name commit))))
1542 (build-system cmake-build-system)
1543 (arguments
1544 `(#:tests? #f ;no "test" target
1545 #:configure-flags
1546 (list "-DSND_BACKEND=pulse"
1547 "-DENABLE_CCDDA='ON'"
1548 "-DUSE_LIBARCHIVE='ON'"
1549 "-DUSE_LIBCDIO='ON'")
1550 #:phases
1551 (modify-phases %standard-phases
1552 (add-after 'unpack 'cd-subdir
1553 (lambda _ (chdir "pcsxr") #t))
1554 (add-before 'configure 'fix-cdio-lookup
1555 (lambda* (#:key inputs #:allow-other-keys)
1556 (substitute* "cmake/FindCdio.cmake"
1557 (("/usr/include/cdio")
1558 (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
1559 #t))
1560 (add-after 'install 'wrap-program
1561 (lambda* (#:key inputs outputs #:allow-other-keys)
1562 (wrap-program (string-append (assoc-ref outputs "out")
1563 "/bin/pcsxr")
1564 ;; For GtkFileChooserDialog.
1565 `("GSETTINGS_SCHEMA_DIR" =
1566 (,(string-append (assoc-ref inputs "gtk+")
1567 "/share/glib-2.0/schemas"))))
1568 #t)))))
1569 (native-inputs
1570 `(("pkg-config" ,pkg-config)
1571 ("intltool" ,intltool)
1572 ("glib" ,glib "bin")))
1573 (inputs
1574 `(("libcdio" ,libcdio)
1575 ("sdl2" ,sdl2)
1576 ("gtk+" ,gtk+)
1577 ("ffmpeg" ,ffmpeg)
1578 ("libxv" ,libxv)
1579 ("libarchive" ,libarchive)
1580 ("pulseaudio" ,pulseaudio)))
1581 (home-page "https://archive.codeplex.com/?p=pcsxr")
1582 (synopsis "PlayStation emulator")
1583 (description
1584 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1585 improvements.")
1586 (license license:gpl2+))))
1587
1588 (define-public gens-gs
1589 (package
1590 (name "gens-gs")
1591 (version "7")
1592 (source
1593 (origin
1594 (method url-fetch)
1595 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1596 version ".tar.gz"))
1597 (sha256
1598 (base32
1599 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1600 (build-system glib-or-gtk-build-system)
1601 (arguments
1602 `(#:system "i686-linux"
1603 #:phases
1604 (modify-phases %standard-phases
1605 (add-after 'unpack 'fix-CFLAGS
1606 (lambda* _
1607 ;; Remove GTK API deprecation flags that cause build errors.
1608 (substitute* "configure"
1609 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1610 #t)))))
1611 (native-inputs
1612 `(("pkg-config" ,pkg-config)
1613 ("nasm" ,nasm)))
1614 (inputs
1615 `(("sdl" ,sdl)
1616 ("gtk" ,gtk+-2)))
1617 (home-page "https://segaretro.org/Gens/GS")
1618 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1619 (description
1620 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1621 derived from Gens. Project goals include clean source code, combined features
1622 from various forks of Gens, and improved platform portability.")
1623 (supported-systems '("i686-linux" "x86_64-linux"))
1624 (license license:gpl2+)))