gnu: mame: Update to 0.225.
[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, 2020 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 check)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages cross-base)
50 #:use-module (gnu packages curl)
51 #:use-module (gnu packages digest)
52 #:use-module (gnu packages elf)
53 #:use-module (gnu packages fonts)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages freedesktop)
56 #:use-module (gnu packages fribidi)
57 #:use-module (gnu packages game-development)
58 #:use-module (gnu packages gcc)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages gl)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages image)
64 #:use-module (gnu packages imagemagick)
65 #:use-module (gnu packages libedit)
66 #:use-module (gnu packages libusb)
67 #:use-module (gnu packages linux)
68 #:use-module (gnu packages lua)
69 #:use-module (gnu packages maths)
70 #:use-module (gnu packages mp3)
71 #:use-module (gnu packages music)
72 #:use-module (gnu packages ncurses)
73 #:use-module (gnu packages networking)
74 #:use-module (gnu packages pkg-config)
75 #:use-module (gnu packages pulseaudio)
76 #:use-module (gnu packages python)
77 #:use-module (gnu packages qt)
78 #:use-module (gnu packages sdl)
79 #:use-module (gnu packages sphinx)
80 #:use-module (gnu packages sqlite)
81 #:use-module (gnu packages texinfo)
82 #:use-module (gnu packages textutils)
83 #:use-module (gnu packages tls)
84 #:use-module (gnu packages upnp)
85 #:use-module (gnu packages video)
86 #:use-module (gnu packages vulkan)
87 #:use-module (gnu packages wxwidgets)
88 #:use-module (gnu packages xdisorg)
89 #:use-module (gnu packages xiph)
90 #:use-module (gnu packages xml)
91 #:use-module (gnu packages xorg)
92 #:use-module (gnu packages web)
93 #:use-module (guix build-system cmake)
94 #:use-module (guix build-system glib-or-gtk)
95 #:use-module (guix build-system gnu)
96 #:use-module (guix build-system python))
97
98 (define-public desmume
99 (package
100 (name "desmume")
101 (version "0.9.11")
102 (source
103 (origin
104 (method url-fetch)
105 (uri (string-append
106 "mirror://sourceforge/desmume/desmume/"
107 version "/desmume-" version ".tar.gz"))
108 (sha256
109 (base32
110 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))
111 (patches (search-patches "desmume-gcc6-fixes.patch"
112 "desmume-gcc7-fixes.patch"))))
113 (build-system gnu-build-system)
114 (arguments
115 ;; Enable support for WiFi and microphone.
116 `(#:configure-flags '("--enable-wifi"
117 "--enable-openal")))
118 (native-inputs
119 `(("pkg-config" ,pkg-config)
120 ("intltool" ,intltool)))
121 (inputs
122 `(("zlib" ,zlib)
123 ("sdl" ,sdl)
124 ("glib" ,glib)
125 ("gtk+" ,gtk+-2)
126 ("glu" ,glu)))
127 (home-page "http://desmume.org/")
128 (synopsis "Nintendo DS emulator")
129 (description
130 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
131 (license license:gpl2)))
132
133 ;; Building from recent Git because the official 5.0 release no longer builds.
134 (define-public dolphin-emu
135 (let ((commit "a9745400ec5cea7e55d94955afbdc44d1a4982d1")
136 (revision "7"))
137 (package
138 (name "dolphin-emu")
139 (version (git-version "5.0" revision commit))
140 (source
141 (origin
142 (method git-fetch)
143 (uri (git-reference
144 (url "https://github.com/dolphin-emu/dolphin")
145 (commit commit)))
146 (file-name (git-file-name name version))
147 (modules '((guix build utils)))
148 (snippet
149 '(begin
150 ;; Remove external stuff we don't need.
151 (for-each (lambda (dir)
152 (delete-file-recursively
153 (string-append "Externals/" dir)))
154 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
155 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
156 "miniupnpc" "MoltenVK" "zlib"))
157 ;; Clean up source.
158 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
159 #t))
160 (sha256
161 (base32
162 "0ic08ii4vlqlmk2wkfc99jiy6nji2wfq56r7slj23wgvhznnaabk"))))
163 (build-system cmake-build-system)
164 (arguments
165 '(#:tests? #f
166 #:phases
167 (modify-phases %standard-phases
168 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
169 (lambda* (#:key inputs outputs #:allow-other-keys)
170 (let ((fontfile
171 (string-append (assoc-ref inputs "font-wqy-microhei")
172 "/share/fonts/truetype/wqy-microhei.ttc"))
173 (libvulkan
174 (string-append (assoc-ref inputs "vulkan-loader")
175 "/lib/libvulkan.so")))
176 (chdir "docs")
177 (invoke "bash" "-c" "g++ -O2 $(freetype-config \
178 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
179 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
180 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
181 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
182 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
183 (chdir "..")
184 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
185 (("\"vulkan\", 1") (string-append "\"vulkan\"")))
186 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
187 (("\"vulkan\"") (string-append "\"" libvulkan "\"")))
188 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
189 (("Common::DynamicLibrary::GetVersionedFilename") ""))
190 #t))))
191
192 ;; The FindGTK2 cmake script only checks hardcoded directories for
193 ;; glib/gtk headers.
194
195 #:configure-flags
196 (list (string-append "-DX11_INCLUDE_DIR="
197 (assoc-ref %build-inputs "libx11")
198 "/include")
199 (string-append "-DX11_LIBRARIES="
200 (assoc-ref %build-inputs "libx11")
201 "/lib/libX11.so")
202 "-DX11_FOUND=1")))
203 (native-inputs
204 `(("pkg-config" ,pkg-config)
205 ("gettext" ,gettext-minimal)))
206 (inputs
207 `(("alsa-lib" ,alsa-lib)
208 ("ao" ,ao)
209 ("bluez" ,bluez)
210 ("curl" ,curl)
211 ("eudev" ,eudev)
212 ("ffmpeg" ,ffmpeg)
213 ("font-wqy-microhei" ,font-wqy-microhei)
214 ("freetype" ,freetype)
215 ("glew" ,glew)
216 ("glib" ,glib)
217 ("glu" ,glu)
218 ("gtk+" ,gtk+-2)
219 ("hidapi" ,hidapi)
220 ("libevdev" ,libevdev)
221 ("libpng" ,libpng)
222 ("libusb" ,libusb)
223 ("libx11" ,libx11)
224 ("libxi" ,libxi)
225 ("libxrandr" ,libxrandr)
226 ("lzo" ,lzo)
227 ("mbedtls-apache" ,mbedtls-apache)
228 ("mesa" ,mesa)
229 ("miniupnpc" ,miniupnpc)
230 ("openal" ,openal)
231 ("pugixml" ,pugixml)
232 ("pulseaudio" ,pulseaudio)
233 ("qtbase" ,qtbase)
234 ("sdl2" ,sdl2)
235 ("sfml" ,sfml)
236 ("soil" ,soil)
237 ("soundtouch" ,soundtouch)
238 ("vulkan-loader" ,vulkan-loader)
239 ("zlib" ,zlib)))
240 (home-page "https://dolphin-emu.org/")
241 (synopsis "Nintendo Wii and GameCube emulator")
242 (description
243 "Dolphin is an emulator for two Nintendo video game consoles: the
244 GameCube and the Wii. It provides compatibility with all PC controllers,
245 turbo speed, networked multiplayer, and graphical enhancements.")
246 (supported-systems '("x86_64-linux" "aarch64-linux"))
247 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
248 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
249
250 (define-public dosbox
251 (package
252 (name "dosbox")
253 (version "0.74-3")
254 (source (origin
255 (method url-fetch)
256 (uri (string-append "https://sourceforge.net/projects/dosbox"
257 "/files/dosbox/" version "/dosbox-"
258 version ".tar.gz/download"))
259 (file-name (string-append name "-" version ".tar.gz"))
260 (sha256
261 (base32
262 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
263 (build-system gnu-build-system)
264 (native-inputs
265 `(("autoconf" ,autoconf)
266 ("automake" ,automake)))
267 (inputs
268 `(("sdl" ,sdl)
269 ("libpng" ,libpng)
270 ("zlib" ,zlib)
271 ("alsa-lib" ,alsa-lib)
272 ("glu" ,glu)
273 ("mesa" ,mesa)))
274 (home-page "https://www.dosbox.com")
275 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
276 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
277 also emulates CPU:286/386 realmode/protected mode, Directory
278 FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
279 SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
280 older games.")
281 (license license:gpl2+)))
282
283 (define-public qtmips
284 (package
285 (name "qtmips")
286 (version "0.7.3")
287 (source (origin
288 (method git-fetch)
289 (uri (git-reference
290 (url "https://github.com/cvut/QtMips")
291 (commit (string-append "v" version))))
292 (file-name (git-file-name name version))
293 (sha256
294 (base32
295 "1khvwgqz4h6q6mhbbq0yx43ajz8gx9wmwzs8784vmfrglndbxgax"))))
296 (build-system cmake-build-system)
297 (arguments
298 '(#:phases
299 (modify-phases %standard-phases
300 (replace 'configure
301 (lambda* (#:key outputs #:allow-other-keys)
302 (invoke "qmake"
303 (string-append "PREFIX=" (assoc-ref outputs "out"))
304 "qtmips.pro")))
305 (replace 'check
306 (lambda* (#:key tests? #:allow-other-keys)
307 (substitute* "tests/test.sh"
308 (("qtchooser.*") ""))
309 (substitute* '("tests/cpu_trap/test.sh"
310 "tests/registers/test.sh")
311 (("sub-qtmips_cli") "qtmips_cli"))
312 (if tests?
313 (invoke "tests/run-all.sh")
314 #t)))
315 (replace 'install
316 ;; There is no install target.
317 (lambda* (#:key outputs #:allow-other-keys)
318 (let* ((out (assoc-ref outputs "out"))
319 (bin (string-append out "/bin"))
320 (apps (string-append out "/share/applications"))
321 (icons (string-append out "/share/icons/hicolor")))
322 (install-file "qtmips_gui/qtmips_gui" bin)
323 (install-file "qtmips_cli/qtmips_cli" bin)
324 (install-file "data/qtmips.desktop" apps)
325 (install-file "data/icons/qtmips_gui.svg"
326 (string-append icons "/scalable/apps"))
327 (install-file "data/icons/qtmips_gui.png"
328 (string-append icons "/48x48/apps"))
329 #t))))
330 #:tests? #f)) ; test suite wants mips toolchain
331 (inputs
332 `(("elfutils" ,elfutils)
333 ("qtbase" ,qtbase)))
334 (home-page "https://github.com/cvut/QtMips")
335 (synopsis "MIPS CPU emulator")
336 (description "This package contains a MIPS CPU emulator. The simulator
337 accepts ELF statically linked executables compiled for 32-bit big-endian
338 MIPS target, targeting mips-linux-gnu or mips-elf.")
339 (license license:gpl2+))) ; License file says GPL3
340
341 (define-public emulation-station
342 ;; No release for a long time, new commits fix build issues
343 (let ((commit "9cc42adff67946175d2b7e25c6ae69cc374e98a0")
344 (revision "1"))
345 (package
346 (name "emulation-station")
347 (version (git-version "2.0.1" revision commit))
348 (source (origin
349 (method git-fetch) ; no tarball available
350 (uri (git-reference
351 (url "https://github.com/Aloshi/EmulationStation")
352 (commit commit))) ; no version tag
353 (file-name (git-file-name name version))
354 (sha256
355 (base32
356 "1cva0ns650v17lfn8in095zci6lc43d23f1x3mlzc41qfqa6mbd1"))))
357 (build-system cmake-build-system)
358 (arguments
359 '(#:tests? #f)) ; no tests
360 (inputs
361 `(("alsa-lib" ,alsa-lib)
362 ("boost" ,boost)
363 ("curl" ,curl)
364 ("eigin" ,eigen)
365 ("freeimage" ,freeimage)
366 ("freetype" ,freetype)
367 ("mesa" ,mesa)
368 ("sdl2" ,sdl2)))
369 (synopsis "Video game console emulator front-end")
370 (description "EmulationStation provides a graphical front-end to a large
371 number of video game console emulators. It features an interface that is
372 usable with any game controller that has at least 4 buttons, theming support,
373 and a game metadata scraper.")
374 (home-page "https://emulationstation.org")
375 (license license:expat))))
376
377 (define-public higan
378 (package
379 (name "higan")
380 (version "110")
381 (source
382 (origin
383 (method git-fetch)
384 (uri (git-reference
385 (url "https://github.com/higan-emu/higan")
386 (commit (string-append "v" version))))
387 (file-name (git-file-name name version))
388 (sha256
389 (base32 "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2"))))
390 (build-system gnu-build-system)
391 (native-inputs
392 `(("pkg-config" ,pkg-config)))
393 (inputs
394 `(("alsa-lib" ,alsa-lib)
395 ("ao" ,ao)
396 ("eudev" ,eudev)
397 ("gtk+" ,gtk+-2)
398 ("gtksourceview-2" ,gtksourceview-2)
399 ("libxrandr" ,libxrandr)
400 ("libxv" ,libxv)
401 ("mesa" ,mesa)
402 ("openal" ,openal)
403 ("pulseaudio" ,pulseaudio)
404 ("sdl2" ,sdl2)))
405 (arguments
406 '(#:phases
407 (let ((build-phase (assoc-ref %standard-phases 'build))
408 (install-phase (assoc-ref %standard-phases 'install)))
409 (modify-phases %standard-phases
410 ;; The higan build system has no configure phase.
411 (delete 'configure)
412 (add-before 'build 'chdir-to-higan
413 (lambda _
414 (chdir "higan")
415 #t))
416 (add-before 'install 'create-/share/applications
417 (lambda* (#:key outputs #:allow-other-keys)
418 (let ((out (assoc-ref outputs "out")))
419 ;; It seems the author forgot to do this in the Makefile.
420 (mkdir-p (string-append out "/share/applications"))
421 #t)))
422 (add-after 'install 'chdir-to-icarus
423 (lambda _
424 (chdir "../icarus")
425 #t))
426 (add-after 'chdir-to-icarus 'build-icarus build-phase)
427 (add-after 'build-icarus 'install-icarus install-phase)
428 (add-after 'install-icarus 'wrap-higan-executable
429 (lambda* (#:key inputs outputs #:allow-other-keys)
430 (let* ((out (assoc-ref outputs "out"))
431 (bin (string-append out "/bin"))
432 (higan (string-append bin "/higan"))
433 (higan-original (string-append higan "-original"))
434 (bash (string-append (assoc-ref inputs "bash")
435 "/bin/bash"))
436 (coreutils (assoc-ref inputs "coreutils"))
437 (mkdir (string-append coreutils "/bin/mkdir"))
438 (cp (string-append coreutils "/bin/cp"))
439 (cp-r (string-append cp " -r --no-preserve=mode")))
440 ;; First, have the executable make sure ~/.local/share/higan
441 ;; contains up to date files. Higan insists on looking there
442 ;; for these data files.
443 (rename-file higan higan-original)
444 (with-output-to-file higan
445 (lambda ()
446 (display
447 (string-append
448 "#!" bash "\n"
449 ;; higan doesn't respect $XDG_DATA_HOME
450 mkdir " -p ~/.local/share\n"
451 cp-r " " out "/share/higan ~/.local/share\n"
452 "exec " higan-original))))
453 (chmod higan #o555)
454 ;; Second, make sure higan will find icarus in PATH.
455 (wrap-program higan
456 `("PATH" ":" prefix (,bin)))
457 #t)))))
458 #:make-flags
459 (list "compiler=g++"
460 (string-append "prefix=" (assoc-ref %outputs "out")))
461 ;; There is no test suite.
462 #:tests? #f))
463 (home-page "https://github.com/higan-emu/higan/")
464 (synopsis "Multi-system emulator")
465 (description
466 "higan is a multi-system emulator with an uncompromising focus on
467 accuracy and code readability.
468
469 It currently emulates the following systems: Famicom, Famicom Disk System,
470 Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
471 Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive, Mega
472 CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket, Neo Geo
473 Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge
474 V2.")
475 (license license:gpl3+)))
476
477 (define-public mednafen
478 (package
479 (name "mednafen")
480 (version "1.24.3")
481 (source
482 (origin
483 (method url-fetch)
484 (uri (string-append "https://mednafen.github.io/releases/files/"
485 "mednafen-" version ".tar.xz"))
486 (sha256
487 (base32 "03zplcfvmnnv7grhacmr1zy789pb2wda36wylmzmar23g0zqbsix"))))
488 (build-system gnu-build-system)
489 (arguments
490 `(#:configure-flags
491 (list
492 ;; "--with-external-mpcdec"
493 "--with-external-lzo")))
494 (native-inputs
495 `(("pkg-config" ,pkg-config)))
496 (inputs
497 `(("alsa" ,alsa-lib)
498 ;; ("libmpcdec" ,libmpcdec) FIXME: not recognized.
499 ("libsndfile" ,libsndfile)
500 ("lzo" ,lzo)
501 ("sdl2" ,sdl2)
502 ("zlib" ,zlib)))
503 (home-page "https://mednafen.github.io/")
504 (synopsis "Multi-system emulator utilizing OpenGL and SDL")
505 (description
506 "Mednafen is a portable, utilizing OpenGL and SDL, argument-driven
507 multi-system emulator. Mednafen has the ability to remap hotkey functions and
508 virtual system inputs to a keyboard, a joystick, or both simultaneously. Save
509 states are supported, as is real-time game rewinding. Screen snapshots may be
510 taken, in the PNG file format, at the press of a button. Mednafen can record
511 audiovisual movies in the QuickTime file format, with several different
512 lossless codecs supported.
513
514 The following systems are supported:
515
516 @itemize
517 @item Apple II/II+
518 @item Atari Lynx
519 @item Neo Geo Pocket (Color)
520 @item WonderSwan
521 @item GameBoy (Color)
522 @item GameBoy Advance
523 @item Nintendo Entertainment System
524 @item Super Nintendo Entertainment System/Super Famicom
525 @item Virtual Boy
526 @item PC Engine/TurboGrafx 16 (CD)
527 @item SuperGrafx
528 @item PC-FX
529 @item Sega Game Gear
530 @item Sega Genesis/Megadrive
531 @item Sega Master System
532 @item Sega Saturn (experimental, x86_64 only)
533 @item Sony PlayStation
534 @end itemize")
535 ;; Main license is GPL2+. Some parts are BSD-3.
536 (license (list license:gpl2+ license:bsd-3))))
537
538 (define-public mgba
539 (package
540 (name "mgba")
541 (version "0.8.3")
542 (source
543 (origin
544 (method git-fetch)
545 (uri (git-reference
546 (url "https://github.com/mgba-emu/mgba")
547 (commit version)))
548 (file-name (git-file-name name version))
549 (sha256
550 (base32 "0rwlfjdr0rzbq4kaplvwsgyb8xq6nrzxss2c8xrgw9hqw3ymx4s3"))
551 (modules '((guix build utils)))
552 (snippet
553 ;; Make sure we don't use the bundled software.
554 '(begin
555 (for-each
556 (lambda (subdir)
557 (let ((lib-subdir (string-append "src/third-party/" subdir)))
558 (delete-file-recursively lib-subdir)))
559 '("libpng" "lzma" "sqlite3" "zlib"))
560 #t))))
561 (build-system cmake-build-system)
562 (arguments
563 `(#:tests? #f ;no "test" target
564 #:configure-flags
565 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
566 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
567 (native-inputs `(("pkg-config" ,pkg-config)
568 ("qttools" ,qttools)))
569 (inputs `(("ffmpeg" ,ffmpeg)
570 ("imagemagick" ,imagemagick)
571 ("libedit" ,libedit)
572 ("libelf" ,libelf)
573 ("libepoxy" ,libepoxy)
574 ("libpng" ,libpng)
575 ("mesa" ,mesa)
576 ("minizip" ,minizip)
577 ("ncurses" ,ncurses)
578 ("qtbase" ,qtbase)
579 ("qtmultimedia" ,qtmultimedia)
580 ("sdl2" ,sdl2)
581 ("sqlite" ,sqlite)
582 ("zlib" ,zlib)))
583 (home-page "https://mgba.io")
584 (synopsis "Game Boy Advance emulator")
585 (description
586 "mGBA is an emulator for running Game Boy Advance games. It aims to be
587 faster and more accurate than many existing Game Boy Advance emulators, as
588 well as adding features that other emulators lack. It also supports Game Boy
589 and Game Boy Color games.")
590 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+, "inih.c" is
591 ;; BSD-3, and "discord-rpc" is Expat.
592 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3 license:expat))))
593
594 (define-public sameboy
595 (package
596 (name "sameboy")
597 (version "0.13.6")
598 (source
599 (origin
600 (method git-fetch)
601 (uri (git-reference
602 (url "https://github.com/LIJI32/SameBoy")
603 (commit (string-append "v" version))))
604 (file-name (git-file-name name version))
605 (sha256
606 (base32 "04w8lybi7ssnax37ka4qw7pmcm7cgnmk90p9m73zbyp5chgpqqzc"))))
607 (build-system gnu-build-system)
608 (native-inputs
609 `(("rgbds" ,rgbds)
610 ("gcc" ,gcc-9)
611 ("pkg-config" ,pkg-config)))
612 (inputs
613 `(("sdl2" ,sdl2)))
614 (arguments
615 `(#:tests? #f ; There are no tests
616 #:make-flags `("CC=gcc" "NATIVE_CC=gcc" "CONF=release"
617 ,(string-append "DATA_DIR="
618 (assoc-ref %outputs "out")
619 "/share/sameboy/"))
620 #:phases
621 (modify-phases %standard-phases
622 (delete 'configure)
623 (replace 'install
624 (lambda* (#:key outputs #:allow-other-keys)
625 (let* ((out (assoc-ref outputs "out"))
626 (bin (string-append out "/bin"))
627 (data (string-append out "/share/sameboy/")))
628 (with-directory-excursion "build/bin/SDL"
629 (install-file "sameboy" bin)
630 (delete-file "sameboy")
631 (copy-recursively "." data))
632 #t))))))
633 (home-page "https://sameboy.github.io/")
634 (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
635 (description "SameBoy is a user friendly Game Boy, Game Boy Color
636 and Super Game Boy emulator. SameBoy is accurate and includes a wide
637 range of debugging features. It has all the features one would expect
638 from an emulator---from save states to scaling filters.")
639 (license license:expat)))
640
641 (define-public mupen64plus-core
642 (package
643 (name "mupen64plus-core")
644 (version "2.5")
645 (source
646 (origin
647 (method git-fetch)
648 (uri (git-reference
649 (url "https://github.com/mupen64plus/mupen64plus-core")
650 (commit version)))
651 (file-name (git-file-name name version))
652 (sha256
653 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
654 (build-system gnu-build-system)
655 (native-inputs
656 `(("pkg-config" ,pkg-config)
657 ("which" ,which)))
658 (inputs
659 `(("freetype" ,freetype)
660 ("glu" ,glu)
661 ("libpng" ,libpng)
662 ("mesa" ,mesa)
663 ("sdl2" ,sdl2)
664 ("zlib" ,zlib)))
665 (arguments
666 '(#:phases
667 (modify-phases %standard-phases
668 ;; The mupen64plus build system has no configure phase.
669 (delete 'configure)
670 ;; Makefile is in a subdirectory.
671 (add-before
672 'build 'chdir-to-project-directory
673 (lambda _
674 (chdir "projects/unix")
675 #t)))
676 #:make-flags (let ((out (assoc-ref %outputs "out")))
677 (list "all" (string-append "PREFIX=" out)))
678 ;; There are no tests.
679 #:tests? #f))
680 ;; As per the Makefile (in projects/unix/Makefile):
681 (supported-systems '("i686-linux" "x86_64-linux"))
682 (home-page "https://www.mupen64plus.org/")
683 (synopsis "Nintendo 64 emulator core library")
684 (description
685 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
686 which is capable of accurately playing many games. This package contains the
687 core library.")
688 (license license:gpl2+)))
689
690 (define-public mupen64plus-audio-sdl
691 (package
692 (name "mupen64plus-audio-sdl")
693 (version "2.5")
694 (source
695 (origin
696 (method git-fetch)
697 (uri (git-reference
698 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl")
699 (commit version)))
700 (file-name (git-file-name name version))
701 (sha256
702 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
703 (build-system gnu-build-system)
704 (native-inputs
705 `(("pkg-config" ,pkg-config)
706 ("which" ,which)))
707 (inputs
708 `(("mupen64plus-core" ,mupen64plus-core)
709 ("sdl2" ,sdl2)))
710 (arguments
711 '(#:phases
712 (modify-phases %standard-phases
713 ;; The mupen64plus build system has no configure phase.
714 (delete 'configure)
715 ;; Makefile is in a subdirectory.
716 (add-before
717 'build 'cd-to-project-dir
718 (lambda _
719 (chdir "projects/unix"))))
720 #:make-flags
721 (let ((out (assoc-ref %outputs "out"))
722 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
723 (list "all"
724 (string-append "PREFIX=" out)
725 (string-append "APIDIR=" m64p "/include/mupen64plus")))
726 ;; There are no tests.
727 #:tests? #f))
728 (home-page "https://www.mupen64plus.org/")
729 (synopsis "Mupen64Plus SDL input plugin")
730 (description
731 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
732 which is capable of accurately playing many games. This package contains the
733 SDL audio plugin.")
734 (license license:gpl2+)))
735
736 (define-public mupen64plus-input-sdl
737 (package
738 (name "mupen64plus-input-sdl")
739 (version "2.5")
740 (source
741 (origin
742 (method git-fetch)
743 (uri (git-reference
744 (url "https://github.com/mupen64plus/mupen64plus-input-sdl")
745 (commit version)))
746 (file-name (git-file-name name version))
747 (sha256
748 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
749 (build-system gnu-build-system)
750 (native-inputs
751 `(("which" ,which)))
752 (inputs
753 `(("mupen64plus-core" ,mupen64plus-core)
754 ("sdl2" ,sdl2)))
755 (arguments
756 '(#:phases
757 (modify-phases %standard-phases
758 ;; The mupen64plus build system has no configure phase.
759 (delete 'configure)
760 ;; Makefile is in a subdirectory.
761 (add-before
762 'build 'cd-to-project-dir
763 (lambda _
764 (chdir "projects/unix"))))
765 #:make-flags
766 (let ((out (assoc-ref %outputs "out"))
767 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
768 (list "all"
769 (string-append "PREFIX=" out)
770 (string-append "APIDIR=" m64p "/include/mupen64plus")))
771 ;; There are no tests.
772 #:tests? #f))
773 (home-page "https://www.mupen64plus.org/")
774 (synopsis "Mupen64Plus SDL input plugin")
775 (description
776 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
777 which is capable of accurately playing many games. This package contains the
778 SDL input plugin.")
779 (license license:gpl2+)))
780
781 (define-public mupen64plus-rsp-hle
782 (package
783 (name "mupen64plus-rsp-hle")
784 (version "2.5")
785 (source
786 (origin
787 (method git-fetch)
788 (uri (git-reference
789 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle")
790 (commit version)))
791 (file-name (git-file-name name version))
792 (sha256
793 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
794 (build-system gnu-build-system)
795 (inputs
796 `(("mupen64plus-core" ,mupen64plus-core)))
797 (arguments
798 '(#:phases
799 (modify-phases %standard-phases
800 ;; The mupen64plus build system has no configure phase.
801 (delete 'configure)
802 ;; Makefile is in a subdirectory.
803 (add-before
804 'build 'cd-to-project-dir
805 (lambda _
806 (chdir "projects/unix"))))
807 #:make-flags
808 (let ((out (assoc-ref %outputs "out"))
809 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
810 (list "all"
811 (string-append "PREFIX=" out)
812 (string-append "APIDIR=" m64p "/include/mupen64plus")))
813 ;; There are no tests.
814 #:tests? #f))
815 (home-page "https://www.mupen64plus.org/")
816 (synopsis "Mupen64Plus SDL input plugin")
817 (description
818 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
819 which is capable of accurately playing many games. This package contains the
820 high-level emulation (HLE) RSP processor plugin.")
821 (license license:gpl2+)))
822
823 (define-public mupen64plus-rsp-z64
824 (package
825 (name "mupen64plus-rsp-z64")
826 (version "2.0.0")
827 (source
828 (origin
829 (method git-fetch)
830 (uri (git-reference
831 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64")
832 (commit version)))
833 (file-name (git-file-name name version))
834 (sha256
835 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
836 (build-system gnu-build-system)
837 (inputs
838 `(("mupen64plus-core" ,mupen64plus-core)))
839 (arguments
840 '(#:phases
841 (modify-phases %standard-phases
842 ;; The mupen64plus build system has no configure phase.
843 (delete 'configure)
844 ;; Makefile is in a subdirectory.
845 (add-before
846 'build 'cd-to-project-dir
847 (lambda _
848 (chdir "projects/unix"))))
849 #:make-flags
850 (let ((out (assoc-ref %outputs "out"))
851 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
852 (list "all"
853 (string-append "PREFIX=" out)
854 (string-append "APIDIR=" m64p "/include/mupen64plus")))
855 ;; There are no tests.
856 #:tests? #f))
857 (home-page "https://www.mupen64plus.org/")
858 (synopsis "Mupen64Plus SDL input plugin")
859 (description
860 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
861 which is capable of accurately playing many games. This package contains the
862 Z64 RSP processor plugin.")
863 (license license:gpl2+)))
864
865 (define-public mupen64plus-video-arachnoid
866 (package
867 (name "mupen64plus-video-arachnoid")
868 (version "2.0.0")
869 (source
870 (origin
871 (method git-fetch)
872 (uri (git-reference
873 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid")
874 (commit version)))
875 (file-name (git-file-name name version))
876 (sha256
877 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
878 (build-system gnu-build-system)
879 (native-inputs
880 `(("pkg-config" ,pkg-config)
881 ("which" ,which)))
882 (inputs
883 `(("mesa" ,mesa)
884 ("mupen64plus-core" ,mupen64plus-core)))
885 (arguments
886 '(#:phases
887 (modify-phases %standard-phases
888 ;; The mupen64plus build system has no configure phase.
889 (delete 'configure)
890 ;; Makefile is in a subdirectory.
891 (add-before
892 'build 'cd-to-project-dir
893 (lambda _
894 (chdir "projects/unix"))))
895 #:make-flags
896 (let ((out (assoc-ref %outputs "out"))
897 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
898 (list "all"
899 (string-append "PREFIX=" out)
900 (string-append "APIDIR=" m64p "/include/mupen64plus")))
901 ;; There are no tests.
902 #:tests? #f))
903 (home-page "https://www.mupen64plus.org/")
904 (synopsis "Mupen64Plus Rice Video plugin")
905 (description
906 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
907 which is capable of accurately playing many games. This package contains the
908 Arachnoid video plugin.")
909 (license license:gpl2+)))
910
911 (define-public mupen64plus-video-glide64
912 (package
913 (name "mupen64plus-video-glide64")
914 (version "2.0.0")
915 (source
916 (origin
917 (method git-fetch)
918 (uri (git-reference
919 (url "https://github.com/mupen64plus/mupen64plus-video-glide64")
920 (commit version)))
921 (file-name (git-file-name name version))
922 (sha256
923 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
924 (build-system gnu-build-system)
925 (native-inputs
926 `(("pkg-config" ,pkg-config)
927 ("which" ,which)))
928 (inputs
929 `(("mesa" ,mesa)
930 ("mupen64plus-core" ,mupen64plus-core)
931 ("sdl2" ,sdl2)))
932 (arguments
933 '(#:phases
934 (modify-phases %standard-phases
935 ;; The mupen64plus build system has no configure phase.
936 (delete 'configure)
937 ;; Makefile is in a subdirectory.
938 (add-before
939 'build 'cd-to-project-dir
940 (lambda _
941 (chdir "projects/unix")))
942 ;; XXX Should be unnecessary with the next release.
943 (add-before
944 'build 'use-sdl2
945 (lambda _
946 (substitute* "Makefile"
947 (("SDL_CONFIG = (.*)sdl-config" all prefix)
948 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
949 #:make-flags
950 (let ((out (assoc-ref %outputs "out"))
951 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
952 (list "all"
953 (string-append "PREFIX=" out)
954 (string-append "APIDIR=" m64p "/include/mupen64plus")))
955 ;; There are no tests.
956 #:tests? #f))
957 (home-page "https://www.mupen64plus.org/")
958 (synopsis "Mupen64Plus Rice Video plugin")
959 (description
960 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
961 which is capable of accurately playing many games. This package contains the
962 Glide64 video plugin.")
963 (license license:gpl2+)))
964
965 (define-public mupen64plus-video-glide64mk2
966 (package
967 (name "mupen64plus-video-glide64mk2")
968 (version "2.5")
969 (source
970 (origin
971 (method git-fetch)
972 (uri (git-reference
973 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2")
974 (commit version)))
975 (file-name (git-file-name name version))
976 (sha256
977 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
978 (build-system gnu-build-system)
979 (native-inputs
980 `(("pkg-config" ,pkg-config)
981 ("which" ,which)))
982 (inputs
983 `(("boost" ,boost)
984 ("libpng" ,libpng)
985 ("mesa" ,mesa)
986 ("mupen64plus-core" ,mupen64plus-core)
987 ("sdl2" ,sdl2)
988 ("zlib" ,zlib)))
989 (arguments
990 '(#:phases
991 (modify-phases %standard-phases
992 ;; The mupen64plus build system has no configure phase.
993 (delete 'configure)
994 ;; Makefile is in a subdirectory.
995 (add-before
996 'build 'cd-to-project-dir
997 (lambda _
998 (chdir "projects/unix"))))
999 #:make-flags
1000 (let ((out (assoc-ref %outputs "out"))
1001 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1002 (list "all"
1003 (string-append "PREFIX=" out)
1004 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1005 ;; There are no tests.
1006 #:tests? #f))
1007 (home-page "https://www.mupen64plus.org/")
1008 (synopsis "Mupen64Plus Rice Video plugin")
1009 (description
1010 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1011 which is capable of accurately playing many games. This package contains the
1012 Glide64MK2 video plugin.")
1013 (license license:gpl2+)))
1014
1015 (define-public mupen64plus-video-rice
1016 (package
1017 (name "mupen64plus-video-rice")
1018 (version "2.5")
1019 (source
1020 (origin
1021 (method git-fetch)
1022 (uri (git-reference
1023 (url "https://github.com/mupen64plus/mupen64plus-video-rice")
1024 (commit version)))
1025 (file-name (git-file-name name version))
1026 (sha256
1027 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
1028 (build-system gnu-build-system)
1029 (native-inputs
1030 `(("pkg-config" ,pkg-config)
1031 ("which" ,which)))
1032 (inputs
1033 `(("libpng" ,libpng)
1034 ("mesa" ,mesa)
1035 ("mupen64plus-core" ,mupen64plus-core)
1036 ("sdl2" ,sdl2)))
1037 (arguments
1038 '(#:phases
1039 (modify-phases %standard-phases
1040 ;; The mupen64plus build system has no configure phase.
1041 (delete 'configure)
1042 ;; Makefile is in a subdirectory.
1043 (add-before
1044 'build 'cd-to-project-dir
1045 (lambda _
1046 (chdir "projects/unix"))))
1047 #:make-flags
1048 (let ((out (assoc-ref %outputs "out"))
1049 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1050 (list "all"
1051 (string-append "PREFIX=" out)
1052 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1053 ;; There are no tests.
1054 #:tests? #f))
1055 (home-page "https://www.mupen64plus.org/")
1056 (synopsis "Mupen64Plus Rice Video plugin")
1057 (description
1058 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1059 which is capable of accurately playing many games. This package contains the
1060 Rice Video plugin.")
1061 (license license:gpl2+)))
1062
1063 (define-public mupen64plus-video-z64
1064 (package
1065 (name "mupen64plus-video-z64")
1066 (version "2.0.0")
1067 (source
1068 (origin
1069 (method git-fetch)
1070 (uri (git-reference
1071 (url "https://github.com/mupen64plus/mupen64plus-video-z64")
1072 (commit version)))
1073 (file-name (git-file-name name version))
1074 (sha256
1075 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
1076 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
1077 (build-system gnu-build-system)
1078 (native-inputs
1079 `(("pkg-config" ,pkg-config)
1080 ("which" ,which)))
1081 (inputs
1082 `(("glew" ,glew)
1083 ("mupen64plus-core" ,mupen64plus-core)
1084 ("sdl2" ,sdl2)))
1085 (arguments
1086 '(#:phases
1087 (modify-phases %standard-phases
1088 ;; The mupen64plus build system has no configure phase.
1089 (delete 'configure)
1090 ;; Makefile is in a subdirectory.
1091 (add-before
1092 'build 'cd-to-project-dir
1093 (lambda _
1094 (chdir "projects/unix")))
1095 ;; XXX Should be unnecessary with the next release.
1096 (add-before
1097 'build 'use-sdl2
1098 (lambda _
1099 (substitute* "Makefile"
1100 (("SDL_CONFIG = (.*)sdl-config" all prefix)
1101 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
1102 #:make-flags
1103 (let ((out (assoc-ref %outputs "out"))
1104 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1105 (list "all"
1106 (string-append "PREFIX=" out)
1107 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1108 ;; There are no tests.
1109 #:tests? #f))
1110 (home-page "https://www.mupen64plus.org/")
1111 (synopsis "Mupen64Plus Z64 video plugin")
1112 (description
1113 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1114 which is capable of accurately playing many games. This package contains the
1115 Z64 video plugin.")
1116 (license license:gpl2+)))
1117
1118 (define-public mupen64plus-ui-console
1119 (package
1120 (name "mupen64plus-ui-console")
1121 (version "2.5")
1122 (source
1123 (origin
1124 (method git-fetch)
1125 (uri (git-reference
1126 (url "https://github.com/mupen64plus/mupen64plus-ui-console")
1127 (commit version)))
1128 (file-name (git-file-name name version))
1129 (sha256
1130 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
1131 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
1132 (build-system gnu-build-system)
1133 (native-inputs
1134 `(("pkg-config" ,pkg-config)
1135 ("which" ,which)))
1136 (inputs
1137 `(("sdl2" ,sdl2)))
1138 ;; Mupen64Plus supports a single data directory and a single plugin
1139 ;; directory in its configuration, yet we need data and plugin files from
1140 ;; a variety of packages. The best way to deal with this is to install
1141 ;; all packages from which data and plugin files are needed into one's
1142 ;; profile, and point the configuration there. Hence, propagate the most
1143 ;; important packages here to save the user from the bother. The patch
1144 ;; mupen64plus-ui-console-notice also gives users instructions on what
1145 ;; they need to do in order to point the configuration to their profile.
1146 (propagated-inputs
1147 `(("mupen64plus-core" ,mupen64plus-core)
1148 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
1149 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
1150 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
1151 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
1152 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
1153 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
1154 (arguments
1155 '(#:phases
1156 (modify-phases %standard-phases
1157 ;; The mupen64plus build system has no configure phase.
1158 (delete 'configure)
1159 ;; Makefile is in a subdirectory.
1160 (add-before
1161 'build 'cd-to-project-dir
1162 (lambda _
1163 (chdir "projects/unix"))))
1164 #:make-flags
1165 (let ((out (assoc-ref %outputs "out"))
1166 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1167 (list "all"
1168 (string-append "PREFIX=" out)
1169 (string-append "APIDIR=" m64p "/include/mupen64plus")
1170 ;; Trailing slash matters here.
1171 (string-append "COREDIR=" m64p "/lib/")))
1172 ;; There are no tests.
1173 #:tests? #f))
1174 (home-page "https://www.mupen64plus.org/")
1175 (synopsis "Mupen64Plus command line user interface")
1176 (description
1177 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1178 which is capable of accurately playing many games. This package contains the
1179 command line user interface. Installing this package is the easiest way
1180 towards a working Mupen64Plus for casual users.")
1181 (license license:gpl2+)))
1182
1183 (define-public nestopia-ue
1184 (package
1185 (name "nestopia-ue")
1186 (version "1.48")
1187 (source
1188 (origin
1189 (method git-fetch)
1190 (uri (git-reference
1191 (url "https://github.com/rdanbrook/nestopia")
1192 (commit version)))
1193 (file-name (git-file-name name version))
1194 (sha256
1195 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1196 (modules '((guix build utils)))
1197 (snippet
1198 '(begin
1199 ;; We don't need libretro for the GNU/Linux build.
1200 (delete-file-recursively "libretro")
1201 #t))))
1202 (build-system cmake-build-system)
1203 (native-inputs
1204 `(("pkg-config" ,pkg-config)))
1205 (inputs
1206 `(("ao" ,ao)
1207 ("gtk+" ,gtk+)
1208 ("libarchive" ,libarchive)
1209 ("libepoxy" ,libepoxy)
1210 ("sdl2" ,sdl2)
1211 ("zlib" ,zlib)))
1212 (arguments
1213 '(#:phases
1214 (modify-phases %standard-phases
1215 ;; This fixes the file chooser crash that happens with GTK 3.
1216 (add-after 'install 'wrap-program
1217 (lambda* (#:key inputs outputs #:allow-other-keys)
1218 (let* ((out (assoc-ref outputs "out"))
1219 (nestopia (string-append out "/bin/nestopia"))
1220 (gtk (assoc-ref inputs "gtk+"))
1221 (gtk-share (string-append gtk "/share")))
1222 (wrap-program nestopia
1223 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1224 ;; There are no tests.
1225 #:tests? #f))
1226 (home-page "http://0ldsk00l.ca/nestopia/")
1227 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1228 (description
1229 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1230 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1231 emulation community. It provides highly accurate emulation.")
1232 (license license:gpl2+)))
1233
1234 (define-public retroarch
1235 (package
1236 (name "retroarch")
1237 (version "1.8.1")
1238 (source
1239 (origin
1240 (method git-fetch)
1241 (uri (git-reference
1242 (url "https://github.com/libretro/RetroArch")
1243 (commit (string-append "v" version))))
1244 (file-name (git-file-name name version))
1245 (sha256
1246 (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))
1247 (patches
1248 (search-patches "retroarch-disable-online-updater.patch"))
1249 (modules '((guix build utils)))
1250 (snippet
1251 '(begin
1252 ;; Don't suggest using the Online Updater if available: it never
1253 ;; is. This disables translation of this particular message.
1254 (substitute* (find-files "menu/drivers" "\\.c$")
1255 (("msg_hash_to_str\\(MSG_MISSING_ASSETS\\)")
1256 "\"Warning: Missing assets, go get some\""))
1257 #t))))
1258 (build-system gnu-build-system)
1259 (arguments
1260 `(#:tests? #f ; no tests
1261 #:phases
1262 (modify-phases %standard-phases
1263 (replace 'configure
1264 (lambda* (#:key inputs outputs #:allow-other-keys)
1265 (let* ((out (assoc-ref outputs "out"))
1266 (etc (string-append out "/etc"))
1267 (vulkan (assoc-ref inputs "vulkan-loader"))
1268 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1269 ;; Hard-code some store file names.
1270 (substitute* "gfx/common/vulkan_common.c"
1271 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1272 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1273 (("/usr/local/share/wayland-protocols")
1274 (string-append wayland-protocols "/share/wayland-protocols")))
1275 (substitute* "qb/qb.libs.sh"
1276 (("/bin/true") (which "true")))
1277
1278 ;; Use shared zlib.
1279 (substitute* '("libretro-common/file/archive_file_zlib.c"
1280 "libretro-common/streams/trans_stream_zlib.c")
1281 (("<compat/zlib.h>") "<zlib.h>"))
1282
1283 ;; The configure script does not yet accept the extra arguments
1284 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1285 (invoke
1286 "./configure"
1287 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1288 (%current-system)))
1289 '("--enable-neon" "--enable-floathard")
1290 '())
1291 (string-append "--prefix=" out)
1292 (string-append "--global-config-dir=" etc)
1293 "--disable-builtinminiupnpc")))))))
1294 (inputs
1295 `(("alsa-lib" ,alsa-lib)
1296 ("ffmpeg" ,ffmpeg)
1297 ("freetype" ,freetype)
1298 ("libxinerama" ,libxinerama)
1299 ("libxkbcommon" ,libxkbcommon)
1300 ("libxml2" ,libxml2)
1301 ("libxrandr" ,libxrandr)
1302 ("libxv" ,libxv)
1303 ("mesa" ,mesa)
1304 ("miniupnpc" ,miniupnpc)
1305 ("openal" ,openal)
1306 ("pulseaudio" ,pulseaudio)
1307 ("python" ,python)
1308 ("qtbase" ,qtbase)
1309 ("sdl" ,sdl2)
1310 ("udev" ,eudev)
1311 ("vulkan-loader" ,vulkan-loader)
1312 ("wayland" ,wayland)
1313 ("zlib" ,zlib)))
1314 (native-inputs
1315 `(("pkg-config" ,pkg-config)
1316 ("wayland-protocols" ,wayland-protocols)
1317 ("which" ,which)))
1318 (home-page "https://www.libretro.com/")
1319 (synopsis "Reference frontend for the libretro API")
1320 (description
1321 "Libretro is a simple but powerful development interface that allows for
1322 the easy creation of emulators, games and multimedia applications that can plug
1323 straight into any libretro-compatible frontend. RetroArch is the official
1324 reference frontend for the libretro API, currently used by most as a modular
1325 multi-system game/emulator system.")
1326 (license license:gpl3+)))
1327
1328 (define-public scummvm
1329 (package
1330 (name "scummvm")
1331 (version "2.2.0")
1332 (source
1333 (origin
1334 (method url-fetch)
1335 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1336 "/scummvm-" version ".tar.xz"))
1337 (sha256
1338 (base32 "11vknasm5dna2vqr6gk343qynh7nhsq3kf60zayarn1vb5z6as8l"))))
1339 (build-system gnu-build-system)
1340 (arguments
1341 `(#:tests? #f ;require "git"
1342 #:configure-flags (list "--enable-release") ;for optimizations
1343 #:phases
1344 (modify-phases %standard-phases
1345 (replace 'configure
1346 ;; configure does not work followed by both "SHELL=..." and
1347 ;; "CONFIG_SHELL=..."; set environment variables instead
1348 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1349 (let* ((out (assoc-ref outputs "out"))
1350 (bash (which "bash"))
1351 (flags `(,(string-append "--prefix=" out)
1352 ,@configure-flags)))
1353 (setenv "SHELL" bash)
1354 (setenv "CONFIG_SHELL" bash)
1355 (apply invoke "./configure" flags)))))))
1356 (native-inputs
1357 `(("nasm" ,nasm)
1358 ("pkg-config" ,pkg-config)))
1359 (inputs
1360 `(("alsa-lib" ,alsa-lib)
1361 ("faad2" ,faad2)
1362 ("fluidsynth" ,fluidsynth)
1363 ("freetype" ,freetype)
1364 ("fribidi" ,fribidi)
1365 ("liba52" ,liba52)
1366 ("libflac" ,flac)
1367 ("libjpeg-turbo" ,libjpeg-turbo)
1368 ("libmad" ,libmad)
1369 ("libmpeg2" ,libmpeg2)
1370 ("libogg" ,libogg)
1371 ("libpng" ,libpng)
1372 ("libtheora" ,libtheora)
1373 ("libvorbis" ,libvorbis)
1374 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
1375 ("zlib" ,zlib)))
1376 (home-page "https://www.scummvm.org/")
1377 (synopsis "Engine for several graphical adventure games")
1378 (description "ScummVM is a program which allows you to run certain
1379 classic graphical point-and-click adventure games, provided you
1380 already have their data files. The clever part about this: ScummVM
1381 just replaces the executables shipped with the games, allowing you to
1382 play them on systems for which they were never designed!")
1383 (license license:gpl2+)))
1384
1385 (define-public mame
1386 (package
1387 (name "mame")
1388 (version "0.225")
1389 (source
1390 (origin
1391 (method git-fetch)
1392 (uri (git-reference
1393 (url "https://github.com/mamedev/mame")
1394 (commit (apply string-append "mame" (string-split version #\.)))))
1395 (file-name (git-file-name name version))
1396 (sha256
1397 (base32 "1n61v1yqmc69399khcm8gdabqaz8rwwj822m8vm5mbyxnw92icqg"))
1398 (modules '((guix build utils)))
1399 (snippet
1400 ;; Remove bundled libraries.
1401 '(begin
1402 (with-directory-excursion "3rdparty"
1403 (for-each delete-file-recursively
1404 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1405 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1406 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1407 #t))))
1408 (build-system gnu-build-system)
1409 (arguments
1410 `(#:make-flags
1411 (cons*
1412 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1413 "NOWERROR=1"
1414 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1415 (string-append "SDL_INI_PATH="
1416 (assoc-ref %outputs "out")
1417 "/share/mame/ini")
1418 (map (lambda (lib)
1419 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1420 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1421 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1422 #:tests? #f ;no test in regular release
1423 #:phases
1424 (modify-phases %standard-phases
1425 (delete 'configure)
1426 (add-after 'build 'build-documentation
1427 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1428 (replace 'install
1429 ;; Upstream does not provide an installation phase.
1430 (lambda* (#:key outputs #:allow-other-keys)
1431 (let* ((out (assoc-ref outputs "out"))
1432 (share (string-append out "/share/mame")))
1433 ;; Install data.
1434 (for-each (lambda (dir)
1435 (copy-recursively dir (string-append share "/" dir)))
1436 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1437 "plugins" "samples"))
1438 (let ((keymaps (string-append share "/keymaps")))
1439 (for-each (lambda (file) (install-file file keymaps))
1440 (find-files "keymaps" ".*LINUX\\.map")))
1441 (let ((fonts (string-append share "/fonts")))
1442 (install-file "uismall.bdf" fonts))
1443 (when (file-exists? "mame64")
1444 (rename-file "mame64" "mame"))
1445 (install-file "mame" (string-append out "/bin")))
1446 #t))
1447 (add-after 'install 'install-documentation
1448 (lambda* (#:key outputs #:allow-other-keys)
1449 (let* ((out (assoc-ref outputs "out"))
1450 (man (string-append out "/share/man/man1"))
1451 (info (string-append out "/share/info")))
1452 (install-file "docs/build/man/MAME.1" man)
1453 (install-file "docs/build/texinfo/MAME.info" info))
1454 #t))
1455 (add-after 'install 'install-ini-file
1456 ;; Generate an ini file so as to set some directories (e.g., roms)
1457 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1458 ;;
1459 ;; XXX: We need to insert absolute references to the store. It can
1460 ;; be an issue if they leak into user's home directory, e.g., with
1461 ;; "mame -createconfig" and the package is later GC'ed.
1462 (lambda* (#:key outputs #:allow-other-keys)
1463 (let* ((out (assoc-ref outputs "out"))
1464 (share (string-append out "/share/mame"))
1465 (ini (string-append share "/ini")))
1466 (with-output-to-file (string-append ini "/mame.ini")
1467 (lambda _
1468 (format #t
1469 "inipath $HOME/.mame;~a/ini~@
1470 homepath $HOME/mame~@
1471 rompath $HOME/mame/roms~@
1472 samplepath $HOME/mame/samples;~a/samples~@
1473 cheatpath $HOME/mame/cheat~@
1474 artpath $HOME/mame/artwork;~a/artwork~@
1475 crosshairpath $HOME/mame/crosshair~@
1476 snapshot_directory $HOME/mame/snapshots~@
1477 hashpath ~a/hash~@
1478 fontpath $HOME/mame/fonts;~a/fonts~@
1479 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1480 bgfx_path ~a/bgfx~@
1481 pluginspath $HOME/mame/plugins;~a/plugins~@
1482 languagepath ~a/language~@
1483 cfg_directory $HOME/.mame/cfg~@
1484 nvram_directory $HOME/.mame/nvram~@
1485 input_directory $HOME/.mame/inp~@
1486 state_directory $HOME/.mame/sta~@
1487 diff_directory $HOME/.mame/diff~@
1488 comment_directory $HOME/.mame/comments~%"
1489 share share share share share share share share
1490 share)))
1491 (with-output-to-file (string-append ini "/ui.ini")
1492 (lambda _
1493 (format #t
1494 "historypath $HOME/mame/history~@
1495 categorypath $HOME/mame/folders~@
1496 cabinets_directory $HOME/mame/cabinets~@
1497 cpanels_directory $HOME/mame/cpanel~@
1498 pcbs_directory $HOME/mame/pcb~@
1499 flyers_directory $HOME/mame/flyers~@
1500 titles_directory $HOME/mame/titles~@
1501 ends_directory $HOME/mame/ends~@
1502 marquees_directory $HOME/mame/marquees~@
1503 artwork_preview_directory $HOME/mame/artpreview~@
1504 bosses_directory $HOME/mame/bosses~@
1505 logos_directory $HOME/mame/logo~@
1506 scores_directory $HOME/mame/scores~@
1507 versus_directory $HOME/mame/versus~@
1508 gameover_directory $HOME/mame/gameover~@
1509 howto_directory $HOME/mame/howto~@
1510 select_directory $HOME/mame/select~@
1511 icons_directory $HOME/mame/icons~@
1512 covers_directory $HOME/mame/covers~@
1513 ui_path $HOME/.mame/ui~%")))
1514 #t)))
1515 (add-after 'install 'install-desktop-file
1516 (lambda* (#:key outputs #:allow-other-keys)
1517 (let* ((out (assoc-ref outputs "out"))
1518 (desktop (string-append out "/share/applications"))
1519 (executable (string-append out "/bin/mame")))
1520 (mkdir-p desktop)
1521 (with-output-to-file (string-append desktop "/mame.desktop")
1522 (lambda _
1523 (format #t
1524 "[Desktop Entry]~@
1525 Name=mame~@
1526 Comment=Multi-purpose emulation framework~@
1527 Exec=~a~@
1528 TryExec=~@*~a~@
1529 Terminal=false~@
1530 Type=Application~@
1531 Categories=Game;Emulator;~@
1532 Keywords=Game;Emulator;Arcade;~%"
1533 executable)))
1534 #t))))))
1535 (native-inputs
1536 `(("pkg-config" ,pkg-config)
1537 ("sphinx" ,python-sphinx)
1538 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1539 ("texinfo" ,texinfo)))
1540 (inputs
1541 `(("alsa-lib" ,alsa-lib)
1542 ("asio" ,asio)
1543 ("expat" ,expat)
1544 ("flac" ,flac)
1545 ("fontconfig" ,fontconfig)
1546 ("glm" ,glm)
1547 ("libjpeg" ,libjpeg-turbo)
1548 ("libxi" ,libxi)
1549 ("libxinerama" ,libxinerama)
1550 ("lua" ,lua)
1551 ("portaudio" ,portaudio)
1552 ("portmidi" ,portmidi)
1553 ("pugixml" ,pugixml)
1554 ("python-wrapper" ,python-wrapper)
1555 ("qtbase" ,qtbase)
1556 ("rapidjson" ,rapidjson)
1557 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1558 ("sqlite" ,sqlite)
1559 ("utf8proc" ,utf8proc)
1560 ("zlib" ,zlib)))
1561 (home-page "https://www.mamedev.org")
1562 (synopsis "Multi-purpose emulation framework")
1563 (description "MAME's purpose is to preserve decades of software
1564 history. As electronic technology continues to rush forward, MAME
1565 prevents this important @emph{vintage} software from being lost and
1566 forgotten. This is achieved by documenting the hardware and how it
1567 functions. The source code to MAME serves as this documentation.")
1568 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1569 ;; However, over 90% of the files are under Expat license. Also, artwork,
1570 ;; keymaps, languages and samples are under CC0.
1571 (license (list license:gpl2+ license:expat license:cc0))))
1572
1573 (define-public gnome-arcade
1574 (package
1575 (name "gnome-arcade")
1576 (version "0.218.2")
1577 (source
1578 (origin
1579 (method git-fetch)
1580 (uri (git-reference
1581 (url "https://github.com/strippato/gnome-arcade")
1582 (commit (string-append "v." version))))
1583 (file-name (git-file-name name version))
1584 (sha256
1585 (base32
1586 "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
1587 (build-system cmake-build-system)
1588 (arguments
1589 `(#:tests? #f ; No tests.
1590 #:configure-flags (list
1591 (string-append "-DMAME_BIN=\""
1592 (assoc-ref %build-inputs "mame")
1593 "/bin/mame\"")
1594 (string-append "-DAPP_RES=\""
1595 (assoc-ref %outputs "out")
1596 "/share/gnome-arcade/\""))
1597 #:phases
1598 (modify-phases %standard-phases
1599 (add-before 'build 'fix-paths
1600 (lambda* (#:key outputs #:allow-other-keys)
1601 (let ((out (assoc-ref outputs "out")))
1602 (pk 'cwd (getcwd))
1603 (substitute* "../source/src/config.c"
1604 (("/usr/share") (string-append out "/share"))))
1605 #t))
1606 (replace 'install
1607 (lambda* (#:key outputs #:allow-other-keys)
1608 (let* ((out (assoc-ref outputs "out"))
1609 (bin (string-append out "/bin"))
1610 (rom (string-append out "/share/gnome-arcade/data/rom"))
1611 (tile (string-append out "/share/gnome-arcade/data/tile")))
1612 (mkdir-p bin)
1613 (install-file "../gnome-arcade" bin)
1614 (copy-recursively "../source/res"
1615 (string-append out "/share/gnome-arcade/res"))
1616 (mkdir-p rom)
1617 (install-file "../source/data/rom/ROM.TXT" rom)
1618 (mkdir-p tile)
1619 (install-file "../source/data/tile/TILE.TXT" tile))
1620 #t)))))
1621 (native-inputs
1622 `(("pkg-config" ,pkg-config)))
1623 (inputs
1624 `(("mame" ,mame)
1625 ("gtk" ,gtk+)
1626 ("libevdev" ,libevdev)
1627 ("libvlc" ,vlc)
1628 ("libarchive" ,libarchive)))
1629 (home-page "https://github.com/strippato/gnome-arcade")
1630 (synopsis "Minimal MAME frontend")
1631 (description
1632 "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
1633 emulator.")
1634 (license license:gpl3+)))
1635
1636 (define-public pcsxr
1637 ;; No release since 2017.
1638 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1639 (package
1640 (name "pcsxr")
1641 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1642 (version "1.9.95")
1643 (source
1644 (origin
1645 (method git-fetch)
1646 (uri (git-reference
1647 (url "https://github.com/pcsxr/PCSX-Reloaded")
1648 (commit commit)))
1649 (sha256
1650 (base32
1651 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1652 (file-name (git-file-name name commit))))
1653 (build-system cmake-build-system)
1654 (arguments
1655 `(#:tests? #f ;no "test" target
1656 #:configure-flags
1657 (list "-DSND_BACKEND=pulse"
1658 "-DENABLE_CCDDA='ON'"
1659 "-DUSE_LIBARCHIVE='ON'"
1660 "-DUSE_LIBCDIO='ON'")
1661 #:phases
1662 (modify-phases %standard-phases
1663 (add-after 'unpack 'cd-subdir
1664 (lambda _ (chdir "pcsxr") #t))
1665 (add-before 'configure 'fix-cdio-lookup
1666 (lambda* (#:key inputs #:allow-other-keys)
1667 (substitute* "cmake/FindCdio.cmake"
1668 (("/usr/include/cdio")
1669 (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
1670 #t))
1671 (add-after 'install 'wrap-program
1672 (lambda* (#:key inputs outputs #:allow-other-keys)
1673 (wrap-program (string-append (assoc-ref outputs "out")
1674 "/bin/pcsxr")
1675 ;; For GtkFileChooserDialog.
1676 `("GSETTINGS_SCHEMA_DIR" =
1677 (,(string-append (assoc-ref inputs "gtk+")
1678 "/share/glib-2.0/schemas"))))
1679 #t)))))
1680 (native-inputs
1681 `(("pkg-config" ,pkg-config)
1682 ("intltool" ,intltool)
1683 ("glib" ,glib "bin")))
1684 (inputs
1685 `(("libcdio" ,libcdio)
1686 ("sdl2" ,sdl2)
1687 ("gtk+" ,gtk+)
1688 ("ffmpeg" ,ffmpeg)
1689 ("libxv" ,libxv)
1690 ("libarchive" ,libarchive)
1691 ("pulseaudio" ,pulseaudio)))
1692 (home-page "https://archive.codeplex.com/?p=pcsxr")
1693 (synopsis "PlayStation emulator")
1694 (description
1695 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1696 improvements.")
1697 (license license:gpl2+))))
1698
1699 (define-public gens-gs
1700 (package
1701 (name "gens-gs")
1702 (version "7")
1703 (source
1704 (origin
1705 (method url-fetch)
1706 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1707 version ".tar.gz"))
1708 (sha256
1709 (base32
1710 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1711 (build-system glib-or-gtk-build-system)
1712 (arguments
1713 `(#:system "i686-linux"
1714 #:phases
1715 (modify-phases %standard-phases
1716 (add-after 'unpack 'fix-CFLAGS
1717 (lambda* _
1718 ;; Remove GTK API deprecation flags that cause build errors.
1719 (substitute* "configure"
1720 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1721 #t)))))
1722 (native-inputs
1723 `(("pkg-config" ,pkg-config)
1724 ("nasm" ,nasm)))
1725 (inputs
1726 `(("sdl" ,sdl)
1727 ("gtk" ,gtk+-2)))
1728 (home-page "https://segaretro.org/Gens/GS")
1729 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1730 (description
1731 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1732 derived from Gens. Project goals include clean source code, combined features
1733 from various forks of Gens, and improved platform portability.")
1734 (supported-systems '("i686-linux" "x86_64-linux"))
1735 (license license:gpl2+)))
1736
1737 (define-public bsnes
1738 (package
1739 (name "bsnes")
1740 (version "115")
1741 (source
1742 (origin
1743 (method git-fetch)
1744 (uri (git-reference
1745 (url "https://github.com/bsnes-emu/bsnes")
1746 (commit (string-append "v" version))))
1747 (file-name (git-file-name name version))
1748 (sha256
1749 (base32
1750 "0j054x38fwai61vj36sc04r3zkzay5acq2cgd9zqv5hs51s36g5b"))))
1751 (build-system gnu-build-system)
1752 (arguments
1753 `(#:make-flags (list "-C" "bsnes"
1754 (string-append "prefix=" (assoc-ref %outputs "out")))
1755 #:tests? #f ; No tests.
1756 #:phases (modify-phases %standard-phases
1757 (delete 'configure))))
1758 (native-inputs
1759 `(("pkg-config" ,pkg-config)))
1760 (inputs
1761 `(("alsa-lib" ,alsa-lib)
1762 ("ao" ,ao)
1763 ("cairo" ,cairo)
1764 ("eudev" ,eudev)
1765 ("gtksourceview-2" ,gtksourceview-2)
1766 ("libxrandr" ,libxrandr)
1767 ("libxv" ,libxv)
1768 ("openal" ,openal)
1769 ("pulseaudio" ,pulseaudio)
1770 ("sdl2" ,sdl2)))
1771 (home-page "https://bsnes.dev/")
1772 (synopsis "Emulator for the Super Nintendo / Super Famicom systems")
1773 (description
1774 "bsnes is a Super Nintendo / Super Famicom emulator that focuses on
1775 performance, features, and ease of use.")
1776 (license license:gpl3)))
1777
1778 ;; python-pwntools requires a -rc release of unicorn
1779 (define-public unicorn
1780 (let ((unless-x86
1781 (lambda (code)
1782 (if (member (%current-system) '("x86_64-linux" "i686-linux"))
1783 '()
1784 code))))
1785 (package
1786 (name "unicorn")
1787 (version "1.0.2-rc4")
1788 ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
1789 (source
1790 (origin
1791 (method git-fetch)
1792 (uri (git-reference
1793 (url "https://github.com/unicorn-engine/unicorn")
1794 (commit version)))
1795 (file-name (git-file-name name version))
1796 (sha256
1797 (base32
1798 "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy"))))
1799 (outputs '("out" "python"))
1800 ;; The main library is not written in Python, but the build process has
1801 ;; little in common with any defined build system, so we might as well
1802 ;; build on top of python-build-system and make use of all
1803 ;; the Python-specific phases that can be reused.
1804 (build-system python-build-system)
1805 (arguments
1806 `(#:modules ((srfi srfi-26)
1807 (guix build python-build-system)
1808 (guix build utils))
1809 #:phases
1810 (modify-phases %standard-phases
1811 (add-after 'unpack 'install-bindings-to-python-output
1812 (lambda* (#:key outputs #:allow-other-keys)
1813 ;; python-build-system will build the bindings and install them to
1814 ;; the "out" output, so change the build-internal names of the
1815 ;; outputs.
1816 ;;
1817 ;; TODO: remove this once #40469 lands, through the core-updates
1818 ;; holding zone, on master.
1819 (set-car! (assoc "out" outputs) "lib")
1820 (set-car! (assoc "python" outputs) "out")
1821 #t))
1822 (add-before 'build 'build-library
1823 (lambda* (#:key inputs #:allow-other-keys)
1824 (invoke "make"
1825 "-j" (number->string (parallel-job-count))
1826 "UNICORN_STATIC=no"
1827 "CC=gcc")))
1828 (add-after 'build-library 'install-library
1829 (lambda* (#:key outputs #:allow-other-keys)
1830 (invoke "make" "install"
1831 "UNICORN_STATIC=no"
1832 (string-append
1833 "PREFIX="
1834 (assoc-ref outputs "lib")))))
1835 (add-before 'build 'prepare-bindings
1836 (lambda* (#:key outputs #:allow-other-keys)
1837 (chdir "bindings/python")
1838 ;; Set this environment variable so that the Python bindings
1839 ;; don't build their own copy of the shared object, but use
1840 ;; a dummy value such that the bindings test suite uses the
1841 ;; same mechanism for loading the library as any other user.
1842 (setenv "LIBUNICORN_PATH" "1")
1843 (substitute* "unicorn/unicorn.py"
1844 (("_path_list = \\[.*")
1845 (string-append
1846 "_path_list = [\""
1847 (assoc-ref outputs "lib")
1848 ;; eat the rest of the list
1849 "/lib\"] + 0*[")))
1850 #t))
1851 (add-before 'check 'check-library
1852 (lambda* (#:key outputs #:allow-other-keys)
1853 (for-each
1854 (lambda (suite)
1855 (with-directory-excursion
1856 (string-append "../../tests/" suite)
1857 (invoke "make" "test" "CC=gcc"
1858 ,@(unless-x86
1859 '("AS=i686-unknown-linux-gnu-as"
1860 "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
1861 '("unit" "regress"))
1862 #t))
1863 (add-after 'install 'install-samples
1864 (lambda* (#:key outputs #:allow-other-keys)
1865 (let* ((python-samples (find-files "." "sample_.*"))
1866 (c-samples (find-files "../../samples" ".*\\.c"))
1867 (python-docdir
1868 (string-append (assoc-ref outputs "out")
1869 "/share/doc/unicorn/samples"))
1870 (c-docdir
1871 (string-append (assoc-ref outputs "lib")
1872 "/share/doc/unicorn/samples")))
1873 (for-each (cut install-file <> c-docdir) c-samples)
1874 (for-each (cut install-file <> python-docdir) python-samples)
1875 #t))))))
1876 (native-inputs
1877 ;; NOTE: cross-binutils needs to be wrapped with unless-x86, as otherwise
1878 ;; the linker provided by the package will be used, circumventing the ld-wrapper.
1879 `(,@(unless-x86
1880 `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
1881 ("cmocka" ,cmocka)
1882 ("hexdump-for-tests" ,util-linux)))
1883 (home-page "http://www.unicorn-engine.org")
1884 (synopsis "Unicorn CPU emulator framework")
1885 (description
1886 "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
1887 framework based on QEMU.")
1888 (license license:gpl2+))))
1889
1890 (define-public ppsspp
1891 (package
1892 (name "ppsspp")
1893 (version "1.10.3")
1894 (source
1895 (origin
1896 (method git-fetch)
1897 (uri (git-reference
1898 (url "https://github.com/hrydgard/ppsspp")
1899 (commit (string-append "v" version))))
1900 (sha256
1901 (base32 "0znxlbj6cfw7gn0naay0mzhc0k5saw8nrwpspcn7gap1023p06w2"))
1902 (file-name (git-file-name name version))
1903 (patches
1904 (search-patches "ppsspp-disable-upgrade-and-gold.patch"))
1905 (modules '((guix build utils)))
1906 (snippet
1907 `(begin
1908 ;; The following is quite a heavy-handed way of unbundling PPSSPP.
1909 ;; There are still a number of external sources, that we don't
1910 ;; remove here. Some may be packaged, others are not.
1911 ;; First, we patch existing sources to include the right headers.
1912 (substitute* (append (list "ext/native/thin3d/vulkan_utils.cpp"
1913 "ext/native/thin3d/thin3d_vulkan.cpp")
1914 (find-files "Common" ".*\\.(h|cpp)")
1915 (find-files "Core" ".*\\.(h|cpp)")
1916 (find-files "GPU" ".*\\.(h|cpp)")
1917 (find-files "SDL" ".*\\.(h|cpp)")
1918 (find-files "UI" ".*\\.(h|cpp)"))
1919 ;; These headers are all hard-coded in the original source.
1920 (("ext/cityhash/") "")
1921 (("ext/glslang/") "")
1922 (("ext/SPIRV-Cross/") "spirv_cross/")
1923 (("ext/vulkan/") "vulkan/")
1924 (("ext/xxhash.h") "xxhash.h")
1925 ;; These definitions do not actually exist in the Vulkan headers,
1926 ;; but PPSSPP defines them in ext/vulkan.
1927 (("VK_FORMAT_BEGIN_RANGE") "VK_FORMAT_UNDEFINED")
1928 (("VK_FORMAT_END_RANGE") "VK_FORMAT_ASTC_12x12_SRGB_BLOCK"))
1929 ;; Next, we patch CMakeLists.
1930 (substitute* "CMakeLists.txt"
1931 ;; Drop unnecessary includes and targets.
1932 (("include_directories\\(ext/glslang\\)") "")
1933 (("include_directories\\(ext/xxhash\\)") "")
1934 (("include_directories\\(ext/cityhash\\)") "")
1935 (("set_target_properties\\(cityhash .*\\)") "")
1936 ;; Fix linking to GLEW.
1937 (("TARGET Ext::GLEW") "true")
1938 (("target_link_libraries\\(native Ext::GLEW\\)")
1939 "find_package(GLEW)\ntarget_link_libraries(native GLEW::GLEW)")
1940 (("Ext::Snappy") "snappy")
1941 ;; Don't search for cityhash/xxhash, we already have them.
1942 (("add_library\\((city|xx)hash STATIC") "if()\nendif(")
1943 (("ext/xxhash\\.[ch]") "")
1944 (("ext/native/ext/cityhash/.*\\.(cpp|h)") "")
1945 ;; Link all of spirv-cross.
1946 (("spirv-cross-glsl" all)
1947 (string-append all
1948 " spirv-cross-core spirv-cross-cpp"
1949 " spirv-cross-reflect spirv-cross-util")))
1950 (substitute* "ext/CMakeLists.txt"
1951 (("add_subdirectory\\(glew\\)") "")
1952 (("add_subdirectory\\(glslang( [A-Z_]*)*\\)") "")
1953 (("add_subdirectory\\(snappy\\)") "")
1954 (("add_subdirectory\\(SPIRV-Cross-build\\)") ""))
1955 ;; Finally, we can delete the bundled sources.
1956 (for-each delete-file-recursively
1957 '("ext/cmake"
1958 "ext/glew"
1959 "ext/glslang" "ext/glslang-build"
1960 "ext/native/ext/cityhash"
1961 "ext/native/ext/libpng17"
1962 "ext/native/ext/libzip"
1963 "ext/snappy"
1964 "ext/SPIRV-Cross" "ext/SPIRV-Cross-build"
1965 "ext/vulkan"
1966 "ext/xxhash.c"
1967 "ext/xxhash.h"
1968 "ext/zlib"))
1969 ;; Since we are not including git as an input, PPSSPP is confused
1970 ;; about its version. Let's fix that here.
1971 (substitute* "git-version.cmake"
1972 (("unknown") ,version))))))
1973 (build-system cmake-build-system)
1974 (native-inputs
1975 `(("pkg-config" ,pkg-config)
1976 ("python" ,python)))
1977 (inputs
1978 `(("cityhash" ,cityhash)
1979 ("ffmpeg" ,ffmpeg)
1980 ("glew" ,glew)
1981 ("glslang" ,glslang)
1982 ("libpng" ,libpng)
1983 ("libzip" ,libzip)
1984 ("mesa" ,mesa)
1985 ("sdl2" ,sdl2)
1986 ("snappy" ,snappy)
1987 ("spirv-cross" ,spirv-cross)
1988 ("vulkan-headers" ,vulkan-headers)
1989 ("vulkan-loader" ,vulkan-loader)
1990 ("xxhash" ,xxhash)
1991 ("zlib" ,zlib)
1992 ;; TODO: unbundle armips.
1993 ("armips-source" ,(package-source armips))
1994 ("lang"
1995 ,(let ((commit "1c64b8fbd3cb6bd87935eb53f302f7de6f86e209"))
1996 (origin
1997 (method git-fetch)
1998 (uri (git-reference
1999 (url "https://github.com/hrydgard/ppsspp-lang")
2000 (commit commit)))
2001 (sha256
2002 (base32 "0rprn3yd8xfrvi0fm62sgpqa8n73jk7zmlscp8cp0h2fawqpiamd"))
2003 (file-name (git-file-name "ppsspp-lang" commit)))))
2004 ("tests"
2005 ,(let ((commit "328b839c7243e7f733f9eae88d059485e3d808e7"))
2006 (origin
2007 (method git-fetch)
2008 (uri (git-reference
2009 (url "https://github.com/hrydgard/pspautotests")
2010 (commit commit)))
2011 (sha256
2012 (base32 "1gj1kr5ijxrqwvz7c41phskjr70ndp8iz0gr8c3xxsd8p9z5gdvm"))
2013 (file-name (git-file-name "pspautotests" commit)))))))
2014 (arguments
2015 `(#:out-of-source? #f
2016 #:configure-flags (list "-DUSE_DISCORD=OFF"
2017 "-DUSE_SYSTEM_FFMPEG=ON"
2018 "-DUSE_SYSTEM_LIBZIP=ON"
2019 ;; for testing
2020 "-DUNITTEST=ON" "-DHEADLESS=ON")
2021 #:phases
2022 (modify-phases %standard-phases
2023 (add-after 'unpack 'add-external-sources
2024 (lambda* (#:key inputs #:allow-other-keys)
2025 ;; TODO: unbundle armips.
2026 (copy-recursively (assoc-ref inputs "armips-source")
2027 "ext/armips")
2028 ;; Some tests are externalised, so we add them here.
2029 (copy-recursively (assoc-ref inputs "tests")
2030 "pspautotests")
2031 ;; i18n is externalised, so we add it here.
2032 (copy-recursively (assoc-ref inputs "lang")
2033 "assets/lang")
2034 #t))
2035 (replace 'check
2036 (lambda _
2037 (for-each
2038 (lambda (t) (invoke "./unitTest" t))
2039 '("Arm64Emitter" "ArmEmitter" "X64Emitter" "VertexJit" "Asin"
2040 "SinCos" "VFPUSinCos" "MathUtil" "Parsers" "Jit"
2041 "MatrixTranspose" "ParseLBN" "QuickTexHash" "CLZ" "MemMap"))
2042 (invoke "python3" "test.py" "-g")
2043 #t))
2044 (replace 'install
2045 (lambda* (#:key inputs outputs #:allow-other-keys)
2046 (let* ((out (assoc-ref outputs "out"))
2047 (bin/ppsspp (string-append out "/bin/ppsspp"))
2048 (share (string-append out "/share/ppsspp")))
2049 (copy-recursively "icons/hicolor"
2050 (string-append out "/share/icons/hicolor"))
2051 (install-file "PPSSPPSDL" share)
2052 (copy-recursively "assets" (string-append share "/assets"))
2053
2054 (make-desktop-entry-file
2055 (string-append out "/share/applications/ppsspp.desktop")
2056 #:name "PPSSPP"
2057 #:exec (string-append share "/PPSSPPSDL")
2058 #:icon "ppsspp")
2059 (mkdir-p (string-append out "/bin"))
2060 (with-output-to-file bin/ppsspp
2061 (lambda ()
2062 (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\""
2063 (which "sh") share)))
2064 (chmod bin/ppsspp #o755)
2065 #t))))))
2066 (home-page "https://www.ppsspp.org/")
2067 (synopsis "PSP emulator")
2068 (description
2069 "PPSSPP is a ``high-level'' emulator simulating the PSP operating
2070 system.")
2071 (license license:gpl2+)))