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, 2020 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2017, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10 ;;; Copyright © 2017, 2020, 2021 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 ;;; Copyright © 2020 Christopher Howard <christopher@librehacker.com>
16 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages emulators)
33 #:use-module (ice-9 match)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix svn-download)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages algebra)
41 #:use-module (gnu packages assembly)
42 #:use-module (gnu packages audio)
43 #:use-module (gnu packages autogen)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages base)
46 #:use-module (gnu packages boost)
47 #:use-module (gnu packages backup)
48 #:use-module (gnu packages cdrom)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages cross-base)
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages digest)
54 #:use-module (gnu packages elf)
55 #:use-module (gnu packages fonts)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages freedesktop)
58 #:use-module (gnu packages fribidi)
59 #:use-module (gnu packages game-development)
60 #:use-module (gnu packages gcc)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages gl)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages image)
66 #:use-module (gnu packages libedit)
67 #:use-module (gnu packages libusb)
68 #:use-module (gnu packages linux)
69 #:use-module (gnu packages lua)
70 #:use-module (gnu packages maths)
71 #:use-module (gnu packages mp3)
72 #:use-module (gnu packages music)
73 #:use-module (gnu packages ncurses)
74 #:use-module (gnu packages networking)
75 #:use-module (gnu packages pkg-config)
76 #:use-module (gnu packages pulseaudio)
77 #:use-module (gnu packages python)
78 #:use-module (gnu packages qt)
79 #:use-module (gnu packages sdl)
80 #:use-module (gnu packages sphinx)
81 #:use-module (gnu packages sqlite)
82 #:use-module (gnu packages texinfo)
83 #:use-module (gnu packages textutils)
84 #:use-module (gnu packages tls)
85 #:use-module (gnu packages upnp)
86 #:use-module (gnu packages video)
87 #:use-module (gnu packages vulkan)
88 #:use-module (gnu packages wxwidgets)
89 #:use-module (gnu packages xdisorg)
90 #:use-module (gnu packages xiph)
91 #:use-module (gnu packages xml)
92 #:use-module (gnu packages xorg)
93 #:use-module (gnu packages web)
94 #:use-module (guix build-system cmake)
95 #:use-module (guix build-system glib-or-gtk)
96 #:use-module (guix build-system gnu)
97 #:use-module (guix build-system python))
98
99 (define-public desmume
100 (package
101 (name "desmume")
102 (version "0.9.11")
103 (source
104 (origin
105 (method url-fetch)
106 (uri (string-append
107 "mirror://sourceforge/desmume/desmume/"
108 version "/desmume-" version ".tar.gz"))
109 (sha256
110 (base32
111 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))
112 (patches (search-patches "desmume-gcc6-fixes.patch"
113 "desmume-gcc7-fixes.patch"))))
114 (build-system gnu-build-system)
115 (arguments
116 ;; Enable support for WiFi and microphone.
117 `(#:configure-flags '("--enable-wifi"
118 "--enable-openal")))
119 (native-inputs
120 `(("pkg-config" ,pkg-config)
121 ("intltool" ,intltool)))
122 (inputs
123 `(("zlib" ,zlib)
124 ("sdl" ,sdl)
125 ("glib" ,glib)
126 ("gtk+" ,gtk+-2)
127 ("glu" ,glu)))
128 (home-page "http://desmume.org/")
129 (synopsis "Nintendo DS emulator")
130 (description
131 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
132 (license license:gpl2)))
133
134 ;; Building from recent Git because the official 5.0 release no longer builds.
135 (define-public dolphin-emu
136 (let ((commit "a9745400ec5cea7e55d94955afbdc44d1a4982d1")
137 (revision "7"))
138 (package
139 (name "dolphin-emu")
140 (version (git-version "5.0" revision commit))
141 (source
142 (origin
143 (method git-fetch)
144 (uri (git-reference
145 (url "https://github.com/dolphin-emu/dolphin")
146 (commit commit)))
147 (file-name (git-file-name name version))
148 (modules '((guix build utils)))
149 (snippet
150 '(begin
151 ;; Remove external stuff we don't need.
152 (for-each (lambda (dir)
153 (delete-file-recursively
154 (string-append "Externals/" dir)))
155 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
156 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
157 "miniupnpc" "MoltenVK" "zlib"))
158 ;; Clean up source.
159 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
160 #t))
161 (sha256
162 (base32
163 "0ic08ii4vlqlmk2wkfc99jiy6nji2wfq56r7slj23wgvhznnaabk"))))
164 (build-system cmake-build-system)
165 (arguments
166 '(#:tests? #f
167 #:phases
168 (modify-phases %standard-phases
169 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
170 (lambda* (#:key inputs outputs #:allow-other-keys)
171 (let ((fontfile
172 (string-append (assoc-ref inputs "font-wqy-microhei")
173 "/share/fonts/truetype/wqy-microhei.ttc"))
174 (libvulkan
175 (string-append (assoc-ref inputs "vulkan-loader")
176 "/lib/libvulkan.so")))
177 (chdir "docs")
178 (invoke "bash" "-c" "g++ -O2 $(freetype-config \
179 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
180 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
181 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
182 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
183 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
184 (chdir "..")
185 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
186 (("\"vulkan\", 1") (string-append "\"vulkan\"")))
187 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
188 (("\"vulkan\"") (string-append "\"" libvulkan "\"")))
189 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
190 (("Common::DynamicLibrary::GetVersionedFilename") ""))
191 #t))))
192
193 ;; The FindGTK2 cmake script only checks hardcoded directories for
194 ;; glib/gtk headers.
195
196 #:configure-flags
197 (list (string-append "-DX11_INCLUDE_DIR="
198 (assoc-ref %build-inputs "libx11")
199 "/include")
200 (string-append "-DX11_LIBRARIES="
201 (assoc-ref %build-inputs "libx11")
202 "/lib/libX11.so")
203 "-DX11_FOUND=1")))
204 (native-inputs
205 `(("pkg-config" ,pkg-config)
206 ("gettext" ,gettext-minimal)))
207 (inputs
208 `(("alsa-lib" ,alsa-lib)
209 ("ao" ,ao)
210 ("bluez" ,bluez)
211 ("curl" ,curl)
212 ("eudev" ,eudev)
213 ("ffmpeg" ,ffmpeg)
214 ("font-wqy-microhei" ,font-wqy-microhei)
215 ("freetype" ,freetype)
216 ("glew" ,glew)
217 ("glib" ,glib)
218 ("glu" ,glu)
219 ("gtk+" ,gtk+-2)
220 ("hidapi" ,hidapi)
221 ("libevdev" ,libevdev)
222 ("libpng" ,libpng)
223 ("libusb" ,libusb)
224 ("libx11" ,libx11)
225 ("libxi" ,libxi)
226 ("libxrandr" ,libxrandr)
227 ("lzo" ,lzo)
228 ("mbedtls-apache" ,mbedtls-apache)
229 ("mesa" ,mesa)
230 ("miniupnpc" ,miniupnpc)
231 ("openal" ,openal)
232 ("pugixml" ,pugixml)
233 ("pulseaudio" ,pulseaudio)
234 ("qtbase" ,qtbase)
235 ("sdl2" ,sdl2)
236 ("sfml" ,sfml)
237 ("soil" ,soil)
238 ("soundtouch" ,soundtouch)
239 ("vulkan-loader" ,vulkan-loader)
240 ("zlib" ,zlib)))
241 (home-page "https://dolphin-emu.org/")
242 (synopsis "Nintendo Wii and GameCube emulator")
243 (description
244 "Dolphin is an emulator for two Nintendo video game consoles: the
245 GameCube and the Wii. It provides compatibility with all PC controllers,
246 turbo speed, networked multiplayer, and graphical enhancements.")
247 (supported-systems '("x86_64-linux" "aarch64-linux"))
248 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
249 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
250
251 (define-public dosbox
252 (package
253 (name "dosbox")
254 (version "0.74-3")
255 (source (origin
256 (method url-fetch)
257 (uri (string-append "https://sourceforge.net/projects/dosbox"
258 "/files/dosbox/" version "/dosbox-"
259 version ".tar.gz/download"))
260 (file-name (string-append name "-" version ".tar.gz"))
261 (sha256
262 (base32
263 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
264 (build-system gnu-build-system)
265 (native-inputs
266 `(("autoconf" ,autoconf)
267 ("automake" ,automake)))
268 (inputs
269 `(("sdl" ,sdl)
270 ("libpng" ,libpng)
271 ("zlib" ,zlib)
272 ("alsa-lib" ,alsa-lib)
273 ("glu" ,glu)
274 ("mesa" ,mesa)))
275 (home-page "https://www.dosbox.com")
276 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
277 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
278 also emulates CPU:286/386 realmode/protected mode, Directory
279 FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
280 SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
281 older games.")
282 (license license:gpl2+)))
283
284 (define-public qtmips
285 (package
286 (name "qtmips")
287 (version "0.7.3")
288 (source (origin
289 (method git-fetch)
290 (uri (git-reference
291 (url "https://github.com/cvut/QtMips")
292 (commit (string-append "v" version))))
293 (file-name (git-file-name name version))
294 (sha256
295 (base32
296 "1khvwgqz4h6q6mhbbq0yx43ajz8gx9wmwzs8784vmfrglndbxgax"))))
297 (build-system cmake-build-system)
298 (arguments
299 '(#:phases
300 (modify-phases %standard-phases
301 (replace 'configure
302 (lambda* (#:key outputs #:allow-other-keys)
303 (invoke "qmake"
304 (string-append "PREFIX=" (assoc-ref outputs "out"))
305 "qtmips.pro")))
306 (replace 'check
307 (lambda* (#:key tests? #:allow-other-keys)
308 (substitute* "tests/test.sh"
309 (("qtchooser.*") ""))
310 (substitute* '("tests/cpu_trap/test.sh"
311 "tests/registers/test.sh")
312 (("sub-qtmips_cli") "qtmips_cli"))
313 (if tests?
314 (invoke "tests/run-all.sh")
315 #t)))
316 (replace 'install
317 ;; There is no install target.
318 (lambda* (#:key outputs #:allow-other-keys)
319 (let* ((out (assoc-ref outputs "out"))
320 (bin (string-append out "/bin"))
321 (apps (string-append out "/share/applications"))
322 (icons (string-append out "/share/icons/hicolor")))
323 (install-file "qtmips_gui/qtmips_gui" bin)
324 (install-file "qtmips_cli/qtmips_cli" bin)
325 (install-file "data/qtmips.desktop" apps)
326 (install-file "data/icons/qtmips_gui.svg"
327 (string-append icons "/scalable/apps"))
328 (install-file "data/icons/qtmips_gui.png"
329 (string-append icons "/48x48/apps"))
330 #t))))
331 #:tests? #f)) ; test suite wants mips toolchain
332 (inputs
333 `(("elfutils" ,elfutils)
334 ("qtbase" ,qtbase)))
335 (home-page "https://github.com/cvut/QtMips")
336 (synopsis "MIPS CPU emulator")
337 (description "This package contains a MIPS CPU emulator. The simulator
338 accepts ELF statically linked executables compiled for 32-bit big-endian
339 MIPS target, targeting mips-linux-gnu or mips-elf.")
340 (license license:gpl2+))) ; License file says GPL3
341
342 (define-public emulation-station
343 ;; No release for a long time, new commits fix build issues
344 (let ((commit "9cc42adff67946175d2b7e25c6ae69cc374e98a0")
345 (revision "1"))
346 (package
347 (name "emulation-station")
348 (version (git-version "2.0.1" revision commit))
349 (source (origin
350 (method git-fetch) ; no tarball available
351 (uri (git-reference
352 (url "https://github.com/Aloshi/EmulationStation")
353 (commit commit))) ; no version tag
354 (file-name (git-file-name name version))
355 (sha256
356 (base32
357 "1cva0ns650v17lfn8in095zci6lc43d23f1x3mlzc41qfqa6mbd1"))))
358 (build-system cmake-build-system)
359 (arguments
360 '(#:tests? #f)) ; no tests
361 (inputs
362 `(("alsa-lib" ,alsa-lib)
363 ("boost" ,boost)
364 ("curl" ,curl)
365 ("eigin" ,eigen)
366 ("freeimage" ,freeimage)
367 ("freetype" ,freetype)
368 ("mesa" ,mesa)
369 ("sdl2" ,sdl2)))
370 (synopsis "Video game console emulator front-end")
371 (description "EmulationStation provides a graphical front-end to a large
372 number of video game console emulators. It features an interface that is
373 usable with any game controller that has at least 4 buttons, theming support,
374 and a game metadata scraper.")
375 (home-page "https://emulationstation.org")
376 (license license:expat))))
377
378 (define-public higan
379 (package
380 (name "higan")
381 (version "110")
382 (source
383 (origin
384 (method git-fetch)
385 (uri (git-reference
386 (url "https://github.com/higan-emu/higan")
387 (commit (string-append "v" version))))
388 (file-name (git-file-name name version))
389 (sha256
390 (base32 "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2"))))
391 (build-system gnu-build-system)
392 (native-inputs
393 `(("pkg-config" ,pkg-config)))
394 (inputs
395 `(("alsa-lib" ,alsa-lib)
396 ("ao" ,ao)
397 ("eudev" ,eudev)
398 ("gtk+" ,gtk+-2)
399 ("gtksourceview-2" ,gtksourceview-2)
400 ("libxrandr" ,libxrandr)
401 ("libxv" ,libxv)
402 ("mesa" ,mesa)
403 ("openal" ,openal)
404 ("pulseaudio" ,pulseaudio)
405 ("sdl2" ,sdl2)))
406 (arguments
407 '(#:phases
408 (let ((build-phase (assoc-ref %standard-phases 'build))
409 (install-phase (assoc-ref %standard-phases 'install)))
410 (modify-phases %standard-phases
411 ;; The higan build system has no configure phase.
412 (delete 'configure)
413 (add-before 'build 'chdir-to-higan
414 (lambda _
415 (chdir "higan")
416 #t))
417 (add-before 'install 'create-/share/applications
418 (lambda* (#:key outputs #:allow-other-keys)
419 (let ((out (assoc-ref outputs "out")))
420 ;; It seems the author forgot to do this in the Makefile.
421 (mkdir-p (string-append out "/share/applications"))
422 #t)))
423 (add-after 'install 'chdir-to-icarus
424 (lambda _
425 (chdir "../icarus")
426 #t))
427 (add-after 'chdir-to-icarus 'build-icarus build-phase)
428 (add-after 'build-icarus 'install-icarus install-phase)
429 (add-after 'install-icarus 'wrap-higan-executable
430 (lambda* (#:key inputs outputs #:allow-other-keys)
431 (let* ((out (assoc-ref outputs "out"))
432 (bin (string-append out "/bin"))
433 (higan (string-append bin "/higan"))
434 (higan-original (string-append higan "-original"))
435 (bash (string-append (assoc-ref inputs "bash")
436 "/bin/bash"))
437 (coreutils (assoc-ref inputs "coreutils"))
438 (mkdir (string-append coreutils "/bin/mkdir"))
439 (cp (string-append coreutils "/bin/cp"))
440 (cp-r (string-append cp " -r --no-preserve=mode")))
441 ;; First, have the executable make sure ~/.local/share/higan
442 ;; contains up to date files. Higan insists on looking there
443 ;; for these data files.
444 (rename-file higan higan-original)
445 (with-output-to-file higan
446 (lambda ()
447 (display
448 (string-append
449 "#!" bash "\n"
450 ;; higan doesn't respect $XDG_DATA_HOME
451 mkdir " -p ~/.local/share\n"
452 cp-r " " out "/share/higan ~/.local/share\n"
453 "exec " higan-original))))
454 (chmod higan #o555)
455 ;; Second, make sure higan will find icarus in PATH.
456 (wrap-program higan
457 `("PATH" ":" prefix (,bin)))
458 #t)))))
459 #:make-flags
460 (list "compiler=g++"
461 (string-append "prefix=" (assoc-ref %outputs "out")))
462 ;; There is no test suite.
463 #:tests? #f))
464 (home-page "https://github.com/higan-emu/higan/")
465 (synopsis "Multi-system emulator")
466 (description
467 "higan is a multi-system emulator with an uncompromising focus on
468 accuracy and code readability.
469
470 It currently emulates the following systems: Famicom, Famicom Disk System,
471 Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
472 Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive, Mega
473 CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket, Neo Geo
474 Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge
475 V2.")
476 (license license:gpl3+)))
477
478 (define-public mednafen
479 (package
480 (name "mednafen")
481 (version "1.26.1")
482 (source
483 (origin
484 (method url-fetch)
485 (uri (string-append "https://mednafen.github.io/releases/files/"
486 "mednafen-" version ".tar.xz"))
487 (sha256
488 (base32 "1x7xhxjhwsdbak8l0iyb497f043xkhibk73w96xck4j2bk10fac4"))))
489 (build-system gnu-build-system)
490 (arguments
491 `(#:configure-flags
492 (list
493 ;; "--with-external-mpcdec"
494 "--with-external-lzo")))
495 (native-inputs
496 `(("pkg-config" ,pkg-config)))
497 (inputs
498 `(("alsa" ,alsa-lib)
499 ;; ("libmpcdec" ,libmpcdec) FIXME: not recognized.
500 ("libsndfile" ,libsndfile)
501 ("lzo" ,lzo)
502 ("sdl2" ,sdl2)
503 ("zlib" ,zlib)))
504 (home-page "https://mednafen.github.io/")
505 (synopsis "Multi-system emulator utilizing OpenGL and SDL")
506 (description
507 "Mednafen is a portable, utilizing OpenGL and SDL, argument-driven
508 multi-system emulator. Mednafen has the ability to remap hotkey functions and
509 virtual system inputs to a keyboard, a joystick, or both simultaneously. Save
510 states are supported, as is real-time game rewinding. Screen snapshots may be
511 taken, in the PNG file format, at the press of a button. Mednafen can record
512 audiovisual movies in the QuickTime file format, with several different
513 lossless codecs supported.
514
515 The following systems are supported:
516
517 @itemize
518 @item Apple II/II+
519 @item Atari Lynx
520 @item Neo Geo Pocket (Color)
521 @item WonderSwan
522 @item GameBoy (Color)
523 @item GameBoy Advance
524 @item Nintendo Entertainment System
525 @item Super Nintendo Entertainment System/Super Famicom
526 @item Virtual Boy
527 @item PC Engine/TurboGrafx 16 (CD)
528 @item SuperGrafx
529 @item PC-FX
530 @item Sega Game Gear
531 @item Sega Genesis/Megadrive
532 @item Sega Master System
533 @item Sega Saturn (experimental, x86_64 only)
534 @item Sony PlayStation
535 @end itemize")
536 ;; Main license is GPL2+. Some parts are BSD-3.
537 (license (list license:gpl2+ license:bsd-3))))
538
539 (define-public mgba
540 (package
541 (name "mgba")
542 (version "0.8.4")
543 (source
544 (origin
545 (method git-fetch)
546 (uri (git-reference
547 (url "https://github.com/mgba-emu/mgba")
548 (commit version)))
549 (file-name (git-file-name name version))
550 (sha256
551 (base32 "0nqj4bnn5c2z1bq4bnbw1wznc0wpmq4sy3w8pipd6n6620b9m4qq"))
552 (modules '((guix build utils)))
553 (snippet
554 ;; Make sure we don't use the bundled software.
555 '(begin
556 (for-each
557 (lambda (subdir)
558 (let ((lib-subdir (string-append "src/third-party/" subdir)))
559 (delete-file-recursively lib-subdir)))
560 '("libpng" "lzma" "sqlite3" "zlib"))
561 #t))))
562 (build-system cmake-build-system)
563 (arguments
564 `(#:tests? #f ;no "test" target
565 #:configure-flags
566 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
567 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
568 (native-inputs `(("pkg-config" ,pkg-config)
569 ("qttools" ,qttools)))
570 (inputs `(("ffmpeg" ,ffmpeg)
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 "https://downloads.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 libticables2
1386 (package
1387 (name "libticables2")
1388 (version "1.3.5")
1389 (source (origin
1390 (method url-fetch)
1391 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1392 (sha256
1393 (base32
1394 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1395 (build-system gnu-build-system)
1396 (arguments
1397 `(#:configure-flags (list "--enable-libusb10")
1398 #:phases
1399 (modify-phases %standard-phases
1400 (replace 'unpack
1401 (lambda* (#:key source #:allow-other-keys)
1402 (invoke "tar" "xvkf" source)
1403 (invoke "tar" "xvkf"
1404 (string-append "tilibs2/libticables2-"
1405 ,version ".tar.bz2"))
1406 (chdir (string-append "libticables2-" ,version))
1407 #t)))))
1408 (native-inputs
1409 `(("autoconf" ,autoconf)
1410 ("autogen" ,autogen)
1411 ("automake" ,automake)
1412 ("gettext" ,gnu-gettext)
1413 ("libtool" ,libtool)
1414 ("pkg-config" ,pkg-config)))
1415 (inputs
1416 `(("glib" ,glib)
1417 ("libusb" ,libusb)))
1418 (synopsis "Link cable library for TI calculators")
1419 (description
1420 "This package contains libticables, a library for operations on
1421 @acronym{TI, Texas Instruments} calculator link cables.
1422
1423 This is a part of the TiLP project.")
1424 (home-page "http://lpg.ticalc.org/prj_tilp/")
1425 (license license:gpl2+)))
1426
1427 (define-public libticonv
1428 (package
1429 (name "libticonv")
1430 (version "1.1.5")
1431 (source (origin
1432 (method url-fetch)
1433 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1434 (sha256
1435 (base32
1436 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1437 (build-system gnu-build-system)
1438 (arguments
1439 ;; build fails with out --enable-iconv (...?)
1440 `(#:configure-flags (list "--enable-iconv")
1441 #:phases
1442 (modify-phases %standard-phases
1443 (replace 'unpack
1444 (lambda* (#:key source #:allow-other-keys)
1445 (invoke "tar" "xvkf" source)
1446 (invoke "tar" "xvkf"
1447 (string-append "tilibs2/libticonv-"
1448 ,version ".tar.bz2"))
1449 (chdir (string-append "libticonv-" ,version))
1450 #t)))))
1451 (native-inputs
1452 `(("autoconf" ,autoconf)
1453 ("automake" ,automake)
1454 ("libtool" ,libtool)
1455 ("pkg-config" ,pkg-config)))
1456 (inputs
1457 `(("glib" ,glib)))
1458 (synopsis "Character conversion library for TI calculators")
1459 (description
1460 "This package contains libticonv, a library to support working with
1461 @acronym{TI, Texas Instruments} calculator charsets.
1462
1463 This is a part of the TiLP project.")
1464 (home-page "http://lpg.ticalc.org/prj_tilp/")
1465 (license license:gpl2+)))
1466
1467 (define-public libtifiles2
1468 (package
1469 (name "libtifiles2")
1470 (version "1.1.7")
1471 (source (origin
1472 (method url-fetch)
1473 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1474 (sha256
1475 (base32
1476 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1477 (build-system gnu-build-system)
1478 (arguments
1479 `(#:phases
1480 (modify-phases %standard-phases
1481 (replace 'unpack
1482 (lambda* (#:key source #:allow-other-keys)
1483 (invoke "tar" "xvkf" source)
1484 (invoke "tar" "xvkf"
1485 (string-append "tilibs2/libtifiles2-"
1486 ,version ".tar.bz2"))
1487 (chdir (string-append "libtifiles2-" ,version))
1488 #t)))))
1489 (native-inputs
1490 `(("autoconf" ,autoconf)
1491 ("automake" ,automake)
1492 ("gettext" ,gnu-gettext)
1493 ("libtool" ,libtool)
1494 ("pkg-config" ,pkg-config)))
1495 (inputs
1496 `(("glib" ,glib)
1497 ("libarchive" ,libarchive)
1498 ("libticonv" ,libticonv)))
1499 (synopsis "File functions library for TI calculators")
1500 (description
1501 "This package contains libticonv, a library to support working with
1502 @acronym{TI, Texas Instruments} calculator files.
1503
1504 This is a part of the TiLP project.")
1505 (home-page "http://lpg.ticalc.org/prj_tilp/")
1506 (license license:gpl2+)))
1507
1508 (define-public libticalcs2
1509 (package
1510 (name "libticalcs2")
1511 (version "1.1.9")
1512 (source (origin
1513 (method url-fetch)
1514 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1515 (sha256
1516 (base32
1517 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1518 (build-system gnu-build-system)
1519 (arguments
1520 `(#:phases
1521 (modify-phases %standard-phases
1522 (replace 'unpack
1523 (lambda* (#:key source #:allow-other-keys)
1524 (invoke "tar" "xvkf" source)
1525 (invoke "tar" "xvkf"
1526 (string-append "tilibs2/libticalcs2-"
1527 ,version ".tar.bz2"))
1528 (chdir (string-append "libticalcs2-" ,version))
1529 #t)))))
1530 (native-inputs
1531 `(("autoconf" ,autoconf)
1532 ("automake" ,automake)
1533 ("gettext" ,gnu-gettext)
1534 ("libtool" ,libtool)
1535 ("pkg-config" ,pkg-config)))
1536 (inputs
1537 `(("glib" ,glib)
1538 ("libarchive" ,libarchive)
1539 ("libticables2" ,libticables2)
1540 ("libticonv" ,libticonv)
1541 ("libtifiles2" ,libtifiles2)))
1542 (synopsis "Support library for TI calculators")
1543 (description
1544 "This project aims to develop a multi-platform linking program for use
1545 with all @acronym{TI, Texas Instruments} graphing calculators (TI73 to
1546 V200PLT).
1547
1548 This is a part of the TiLP project.")
1549 (home-page "http://lpg.ticalc.org/prj_tilp/")
1550 (license license:gpl2+)))
1551
1552 (define-public mame
1553 (package
1554 (name "mame")
1555 (version "0.227")
1556 (source
1557 (origin
1558 (method git-fetch)
1559 (uri (git-reference
1560 (url "https://github.com/mamedev/mame")
1561 (commit (apply string-append "mame" (string-split version #\.)))))
1562 (file-name (git-file-name name version))
1563 (sha256
1564 (base32 "0p7xhsahmkr5hh3j6hc1mpgi5z4navy77v4k35i0sgpdv1ax4y2l"))
1565 (modules '((guix build utils)))
1566 (snippet
1567 ;; Remove bundled libraries.
1568 '(begin
1569 (with-directory-excursion "3rdparty"
1570 (for-each delete-file-recursively
1571 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1572 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1573 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1574 #t))))
1575 (build-system gnu-build-system)
1576 (arguments
1577 `(#:make-flags
1578 (cons*
1579 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1580 "NOWERROR=1"
1581 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1582 (string-append "SDL_INI_PATH="
1583 (assoc-ref %outputs "out")
1584 "/share/mame/ini")
1585 (map (lambda (lib)
1586 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1587 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1588 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1589 #:tests? #f ;no test in regular release
1590 #:phases
1591 (modify-phases %standard-phases
1592 (delete 'configure)
1593 (add-after 'build 'build-documentation
1594 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1595 (replace 'install
1596 ;; Upstream does not provide an installation phase.
1597 (lambda* (#:key outputs #:allow-other-keys)
1598 (let* ((out (assoc-ref outputs "out"))
1599 (share (string-append out "/share/mame")))
1600 ;; Install data.
1601 (for-each (lambda (dir)
1602 (copy-recursively dir (string-append share "/" dir)))
1603 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1604 "plugins" "samples"))
1605 (let ((keymaps (string-append share "/keymaps")))
1606 (for-each (lambda (file) (install-file file keymaps))
1607 (find-files "keymaps" ".*LINUX\\.map")))
1608 (let ((fonts (string-append share "/fonts")))
1609 (install-file "uismall.bdf" fonts))
1610 (when (file-exists? "mame64")
1611 (rename-file "mame64" "mame"))
1612 (install-file "mame" (string-append out "/bin")))
1613 #t))
1614 (add-after 'install 'install-documentation
1615 (lambda* (#:key outputs #:allow-other-keys)
1616 (let* ((out (assoc-ref outputs "out"))
1617 (man (string-append out "/share/man/man1"))
1618 (info (string-append out "/share/info")))
1619 (install-file "docs/build/man/MAME.1" man)
1620 (install-file "docs/build/texinfo/MAME.info" info))
1621 #t))
1622 (add-after 'install 'install-ini-file
1623 ;; Generate an ini file so as to set some directories (e.g., roms)
1624 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1625 ;;
1626 ;; XXX: We need to insert absolute references to the store. It can
1627 ;; be an issue if they leak into user's home directory, e.g., with
1628 ;; "mame -createconfig" and the package is later GC'ed.
1629 (lambda* (#:key outputs #:allow-other-keys)
1630 (let* ((out (assoc-ref outputs "out"))
1631 (share (string-append out "/share/mame"))
1632 (ini (string-append share "/ini")))
1633 (with-output-to-file (string-append ini "/mame.ini")
1634 (lambda _
1635 (format #t
1636 "inipath $HOME/.mame;~a/ini~@
1637 homepath $HOME/mame~@
1638 rompath $HOME/mame/roms~@
1639 samplepath $HOME/mame/samples;~a/samples~@
1640 cheatpath $HOME/mame/cheat~@
1641 artpath $HOME/mame/artwork;~a/artwork~@
1642 crosshairpath $HOME/mame/crosshair~@
1643 snapshot_directory $HOME/mame/snapshots~@
1644 hashpath ~a/hash~@
1645 fontpath $HOME/mame/fonts;~a/fonts~@
1646 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1647 bgfx_path ~a/bgfx~@
1648 pluginspath $HOME/mame/plugins;~a/plugins~@
1649 languagepath ~a/language~@
1650 cfg_directory $HOME/.mame/cfg~@
1651 nvram_directory $HOME/.mame/nvram~@
1652 input_directory $HOME/.mame/inp~@
1653 state_directory $HOME/.mame/sta~@
1654 diff_directory $HOME/.mame/diff~@
1655 comment_directory $HOME/.mame/comments~%"
1656 share share share share share share share share
1657 share)))
1658 (with-output-to-file (string-append ini "/ui.ini")
1659 (lambda _
1660 (format #t
1661 "historypath $HOME/mame/history~@
1662 categorypath $HOME/mame/folders~@
1663 cabinets_directory $HOME/mame/cabinets~@
1664 cpanels_directory $HOME/mame/cpanel~@
1665 pcbs_directory $HOME/mame/pcb~@
1666 flyers_directory $HOME/mame/flyers~@
1667 titles_directory $HOME/mame/titles~@
1668 ends_directory $HOME/mame/ends~@
1669 marquees_directory $HOME/mame/marquees~@
1670 artwork_preview_directory $HOME/mame/artpreview~@
1671 bosses_directory $HOME/mame/bosses~@
1672 logos_directory $HOME/mame/logo~@
1673 scores_directory $HOME/mame/scores~@
1674 versus_directory $HOME/mame/versus~@
1675 gameover_directory $HOME/mame/gameover~@
1676 howto_directory $HOME/mame/howto~@
1677 select_directory $HOME/mame/select~@
1678 icons_directory $HOME/mame/icons~@
1679 covers_directory $HOME/mame/covers~@
1680 ui_path $HOME/.mame/ui~%")))
1681 #t)))
1682 (add-after 'install 'install-desktop-file
1683 (lambda* (#:key outputs #:allow-other-keys)
1684 (let* ((out (assoc-ref outputs "out"))
1685 (desktop (string-append out "/share/applications"))
1686 (executable (string-append out "/bin/mame")))
1687 (mkdir-p desktop)
1688 (with-output-to-file (string-append desktop "/mame.desktop")
1689 (lambda _
1690 (format #t
1691 "[Desktop Entry]~@
1692 Name=mame~@
1693 Comment=Multi-purpose emulation framework~@
1694 Exec=~a~@
1695 TryExec=~@*~a~@
1696 Terminal=false~@
1697 Type=Application~@
1698 Categories=Game;Emulator;~@
1699 Keywords=Game;Emulator;Arcade;~%"
1700 executable)))
1701 #t))))))
1702 (native-inputs
1703 `(("pkg-config" ,pkg-config)
1704 ("sphinx" ,python-sphinx)
1705 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1706 ("texinfo" ,texinfo)))
1707 (inputs
1708 `(("alsa-lib" ,alsa-lib)
1709 ("asio" ,asio)
1710 ("expat" ,expat)
1711 ("flac" ,flac)
1712 ("fontconfig" ,fontconfig)
1713 ("glm" ,glm)
1714 ("libjpeg" ,libjpeg-turbo)
1715 ("libxi" ,libxi)
1716 ("libxinerama" ,libxinerama)
1717 ("lua" ,lua)
1718 ("portaudio" ,portaudio)
1719 ("portmidi" ,portmidi)
1720 ("pugixml" ,pugixml)
1721 ("python-wrapper" ,python-wrapper)
1722 ("qtbase" ,qtbase)
1723 ("rapidjson" ,rapidjson)
1724 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1725 ("sqlite" ,sqlite)
1726 ("utf8proc" ,utf8proc)
1727 ("zlib" ,zlib)))
1728 (home-page "https://www.mamedev.org")
1729 (synopsis "Multi-purpose emulation framework")
1730 (description "MAME's purpose is to preserve decades of software
1731 history. As electronic technology continues to rush forward, MAME
1732 prevents this important @emph{vintage} software from being lost and
1733 forgotten. This is achieved by documenting the hardware and how it
1734 functions. The source code to MAME serves as this documentation.")
1735 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1736 ;; However, over 90% of the files are under Expat license. Also, artwork,
1737 ;; keymaps, languages and samples are under CC0.
1738 (license (list license:gpl2+ license:expat license:cc0))))
1739
1740 (define-public gnome-arcade
1741 (package
1742 (name "gnome-arcade")
1743 (version "0.218.2")
1744 (source
1745 (origin
1746 (method git-fetch)
1747 (uri (git-reference
1748 (url "https://github.com/strippato/gnome-arcade")
1749 (commit (string-append "v." version))))
1750 (file-name (git-file-name name version))
1751 (sha256
1752 (base32
1753 "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
1754 (build-system cmake-build-system)
1755 (arguments
1756 `(#:tests? #f ; No tests.
1757 #:configure-flags (list
1758 (string-append "-DMAME_BIN=\""
1759 (assoc-ref %build-inputs "mame")
1760 "/bin/mame\"")
1761 (string-append "-DAPP_RES=\""
1762 (assoc-ref %outputs "out")
1763 "/share/gnome-arcade/\""))
1764 #:phases
1765 (modify-phases %standard-phases
1766 (add-before 'build 'fix-paths
1767 (lambda* (#:key outputs #:allow-other-keys)
1768 (let ((out (assoc-ref outputs "out")))
1769 (pk 'cwd (getcwd))
1770 (substitute* "../source/src/config.c"
1771 (("/usr/share") (string-append out "/share"))))
1772 #t))
1773 (replace 'install
1774 (lambda* (#:key outputs #:allow-other-keys)
1775 (let* ((out (assoc-ref outputs "out"))
1776 (bin (string-append out "/bin"))
1777 (rom (string-append out "/share/gnome-arcade/data/rom"))
1778 (tile (string-append out "/share/gnome-arcade/data/tile")))
1779 (mkdir-p bin)
1780 (install-file "../gnome-arcade" bin)
1781 (copy-recursively "../source/res"
1782 (string-append out "/share/gnome-arcade/res"))
1783 (mkdir-p rom)
1784 (install-file "../source/data/rom/ROM.TXT" rom)
1785 (mkdir-p tile)
1786 (install-file "../source/data/tile/TILE.TXT" tile))
1787 #t)))))
1788 (native-inputs
1789 `(("pkg-config" ,pkg-config)))
1790 (inputs
1791 `(("mame" ,mame)
1792 ("gtk" ,gtk+)
1793 ("libevdev" ,libevdev)
1794 ("libvlc" ,vlc)
1795 ("libarchive" ,libarchive)))
1796 (home-page "https://github.com/strippato/gnome-arcade")
1797 (synopsis "Minimal MAME frontend")
1798 (description
1799 "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
1800 emulator.")
1801 (license license:gpl3+)))
1802
1803 (define-public pcsxr
1804 ;; No release since 2017.
1805 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1806 (package
1807 (name "pcsxr")
1808 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1809 (version "1.9.95")
1810 (source
1811 (origin
1812 (method git-fetch)
1813 (uri (git-reference
1814 (url "https://github.com/pcsxr/PCSX-Reloaded")
1815 (commit commit)))
1816 (sha256
1817 (base32
1818 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1819 (file-name (git-file-name name commit))))
1820 (build-system cmake-build-system)
1821 (arguments
1822 `(#:tests? #f ;no "test" target
1823 #:configure-flags
1824 (list "-DSND_BACKEND=pulse"
1825 "-DENABLE_CCDDA='ON'"
1826 "-DUSE_LIBARCHIVE='ON'"
1827 "-DUSE_LIBCDIO='ON'")
1828 #:phases
1829 (modify-phases %standard-phases
1830 (add-after 'unpack 'cd-subdir
1831 (lambda _ (chdir "pcsxr") #t))
1832 (add-before 'configure 'fix-cdio-lookup
1833 (lambda* (#:key inputs #:allow-other-keys)
1834 (substitute* "cmake/FindCdio.cmake"
1835 (("/usr/include/cdio")
1836 (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
1837 #t))
1838 (add-after 'install 'wrap-program
1839 (lambda* (#:key inputs outputs #:allow-other-keys)
1840 (wrap-program (string-append (assoc-ref outputs "out")
1841 "/bin/pcsxr")
1842 ;; For GtkFileChooserDialog.
1843 `("GSETTINGS_SCHEMA_DIR" =
1844 (,(string-append (assoc-ref inputs "gtk+")
1845 "/share/glib-2.0/schemas"))))
1846 #t)))))
1847 (native-inputs
1848 `(("pkg-config" ,pkg-config)
1849 ("intltool" ,intltool)
1850 ("glib" ,glib "bin")))
1851 (inputs
1852 `(("libcdio" ,libcdio)
1853 ("sdl2" ,sdl2)
1854 ("gtk+" ,gtk+)
1855 ("ffmpeg" ,ffmpeg)
1856 ("libxv" ,libxv)
1857 ("libarchive" ,libarchive)
1858 ("pulseaudio" ,pulseaudio)))
1859 (home-page "https://archive.codeplex.com/?p=pcsxr")
1860 (synopsis "PlayStation emulator")
1861 (description
1862 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1863 improvements.")
1864 (license license:gpl2+))))
1865
1866 (define-public gens-gs
1867 (package
1868 (name "gens-gs")
1869 (version "7")
1870 (source
1871 (origin
1872 (method url-fetch)
1873 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1874 version ".tar.gz"))
1875 (sha256
1876 (base32
1877 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1878 (build-system glib-or-gtk-build-system)
1879 (arguments
1880 `(#:system "i686-linux"
1881 #:phases
1882 (modify-phases %standard-phases
1883 (add-after 'unpack 'fix-CFLAGS
1884 (lambda* _
1885 ;; Remove GTK API deprecation flags that cause build errors.
1886 (substitute* "configure"
1887 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1888 #t)))))
1889 (native-inputs
1890 `(("pkg-config" ,pkg-config)
1891 ("nasm" ,nasm)))
1892 (inputs
1893 `(("sdl" ,sdl)
1894 ("gtk" ,gtk+-2)))
1895 (home-page "https://segaretro.org/Gens/GS")
1896 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1897 (description
1898 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1899 derived from Gens. Project goals include clean source code, combined features
1900 from various forks of Gens, and improved platform portability.")
1901 (supported-systems '("i686-linux" "x86_64-linux"))
1902 (license license:gpl2+)))
1903
1904 (define-public bsnes
1905 (package
1906 (name "bsnes")
1907 (version "115")
1908 (source
1909 (origin
1910 (method git-fetch)
1911 (uri (git-reference
1912 (url "https://github.com/bsnes-emu/bsnes")
1913 (commit (string-append "v" version))))
1914 (file-name (git-file-name name version))
1915 (sha256
1916 (base32
1917 "0j054x38fwai61vj36sc04r3zkzay5acq2cgd9zqv5hs51s36g5b"))))
1918 (build-system gnu-build-system)
1919 (arguments
1920 `(#:make-flags (list "-C" "bsnes"
1921 (string-append "prefix=" (assoc-ref %outputs "out")))
1922 #:tests? #f ; No tests.
1923 #:phases (modify-phases %standard-phases
1924 (delete 'configure))))
1925 (native-inputs
1926 `(("pkg-config" ,pkg-config)))
1927 (inputs
1928 `(("alsa-lib" ,alsa-lib)
1929 ("ao" ,ao)
1930 ("cairo" ,cairo)
1931 ("eudev" ,eudev)
1932 ("gtksourceview-2" ,gtksourceview-2)
1933 ("libxrandr" ,libxrandr)
1934 ("libxv" ,libxv)
1935 ("openal" ,openal)
1936 ("pulseaudio" ,pulseaudio)
1937 ("sdl2" ,sdl2)))
1938 (home-page "https://bsnes.dev/")
1939 (synopsis "Emulator for the Super Nintendo / Super Famicom systems")
1940 (description
1941 "bsnes is a Super Nintendo / Super Famicom emulator that focuses on
1942 performance, features, and ease of use.")
1943 (license license:gpl3)))
1944
1945 ;; python-pwntools requires a -rc release of unicorn
1946 (define-public unicorn
1947 (let ((unless-x86
1948 (lambda (code)
1949 (if (member (%current-system) '("x86_64-linux" "i686-linux"))
1950 '()
1951 code))))
1952 (package
1953 (name "unicorn")
1954 (version "1.0.2-rc4")
1955 ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
1956 (source
1957 (origin
1958 (method git-fetch)
1959 (uri (git-reference
1960 (url "https://github.com/unicorn-engine/unicorn")
1961 (commit version)))
1962 (file-name (git-file-name name version))
1963 (sha256
1964 (base32
1965 "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy"))))
1966 (outputs '("out" "python"))
1967 ;; The main library is not written in Python, but the build process has
1968 ;; little in common with any defined build system, so we might as well
1969 ;; build on top of python-build-system and make use of all
1970 ;; the Python-specific phases that can be reused.
1971 (build-system python-build-system)
1972 (arguments
1973 `(#:modules ((srfi srfi-26)
1974 (guix build python-build-system)
1975 (guix build utils))
1976 #:phases
1977 (modify-phases %standard-phases
1978 (add-after 'unpack 'install-bindings-to-python-output
1979 (lambda* (#:key outputs #:allow-other-keys)
1980 ;; python-build-system will build the bindings and install them to
1981 ;; the "out" output, so change the build-internal names of the
1982 ;; outputs.
1983 ;;
1984 ;; TODO: remove this once #40469 lands, through the core-updates
1985 ;; holding zone, on master.
1986 (set-car! (assoc "out" outputs) "lib")
1987 (set-car! (assoc "python" outputs) "out")
1988 #t))
1989 (add-before 'build 'build-library
1990 (lambda* (#:key inputs #:allow-other-keys)
1991 (invoke "make"
1992 "-j" (number->string (parallel-job-count))
1993 "UNICORN_STATIC=no"
1994 "CC=gcc")))
1995 (add-after 'build-library 'install-library
1996 (lambda* (#:key outputs #:allow-other-keys)
1997 (invoke "make" "install"
1998 "UNICORN_STATIC=no"
1999 (string-append
2000 "PREFIX="
2001 (assoc-ref outputs "lib")))))
2002 (add-before 'build 'prepare-bindings
2003 (lambda* (#:key outputs #:allow-other-keys)
2004 (chdir "bindings/python")
2005 ;; Set this environment variable so that the Python bindings
2006 ;; don't build their own copy of the shared object, but use
2007 ;; a dummy value such that the bindings test suite uses the
2008 ;; same mechanism for loading the library as any other user.
2009 (setenv "LIBUNICORN_PATH" "1")
2010 (substitute* "unicorn/unicorn.py"
2011 (("_path_list = \\[.*")
2012 (string-append
2013 "_path_list = [\""
2014 (assoc-ref outputs "lib")
2015 ;; eat the rest of the list
2016 "/lib\"] + 0*[")))
2017 #t))
2018 (add-before 'check 'check-library
2019 (lambda* (#:key outputs #:allow-other-keys)
2020 (for-each
2021 (lambda (suite)
2022 (with-directory-excursion
2023 (string-append "../../tests/" suite)
2024 (invoke "make" "test" "CC=gcc"
2025 ,@(unless-x86
2026 '("AS=i686-unknown-linux-gnu-as"
2027 "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
2028 '("unit" "regress"))
2029 #t))
2030 (add-after 'install 'install-samples
2031 (lambda* (#:key outputs #:allow-other-keys)
2032 (let* ((python-samples (find-files "." "sample_.*"))
2033 (c-samples (find-files "../../samples" ".*\\.c"))
2034 (python-docdir
2035 (string-append (assoc-ref outputs "out")
2036 "/share/doc/unicorn/samples"))
2037 (c-docdir
2038 (string-append (assoc-ref outputs "lib")
2039 "/share/doc/unicorn/samples")))
2040 (for-each (cut install-file <> c-docdir) c-samples)
2041 (for-each (cut install-file <> python-docdir) python-samples)
2042 #t))))))
2043 (native-inputs
2044 ;; NOTE: cross-binutils needs to be wrapped with unless-x86, as otherwise
2045 ;; the linker provided by the package will be used, circumventing the ld-wrapper.
2046 `(,@(unless-x86
2047 `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
2048 ("cmocka" ,cmocka)
2049 ("hexdump-for-tests" ,util-linux)))
2050 (home-page "http://www.unicorn-engine.org")
2051 (synopsis "Unicorn CPU emulator framework")
2052 (description
2053 "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
2054 framework based on QEMU.")
2055 (license license:gpl2+))))
2056
2057 (define-public ppsspp
2058 (package
2059 (name "ppsspp")
2060 (version "1.10.3")
2061 (source
2062 (origin
2063 (method git-fetch)
2064 (uri (git-reference
2065 (url "https://github.com/hrydgard/ppsspp")
2066 (commit (string-append "v" version))))
2067 (sha256
2068 (base32 "0znxlbj6cfw7gn0naay0mzhc0k5saw8nrwpspcn7gap1023p06w2"))
2069 (file-name (git-file-name name version))
2070 (patches
2071 (search-patches "ppsspp-disable-upgrade-and-gold.patch"))
2072 (modules '((guix build utils)))
2073 (snippet
2074 `(begin
2075 ;; The following is quite a heavy-handed way of unbundling PPSSPP.
2076 ;; There are still a number of external sources, that we don't
2077 ;; remove here. Some may be packaged, others are not.
2078 ;; First, we patch existing sources to include the right headers.
2079 (substitute* (append (list "ext/native/thin3d/vulkan_utils.cpp"
2080 "ext/native/thin3d/thin3d_vulkan.cpp")
2081 (find-files "Common" ".*\\.(h|cpp)")
2082 (find-files "Core" ".*\\.(h|cpp)")
2083 (find-files "GPU" ".*\\.(h|cpp)")
2084 (find-files "SDL" ".*\\.(h|cpp)")
2085 (find-files "UI" ".*\\.(h|cpp)"))
2086 ;; These headers are all hard-coded in the original source.
2087 (("ext/cityhash/") "")
2088 (("ext/glslang/") "")
2089 (("ext/SPIRV-Cross/") "spirv_cross/")
2090 (("ext/vulkan/") "vulkan/")
2091 (("ext/xxhash.h") "xxhash.h")
2092 ;; These definitions do not actually exist in the Vulkan headers,
2093 ;; but PPSSPP defines them in ext/vulkan.
2094 (("VK_FORMAT_BEGIN_RANGE") "VK_FORMAT_UNDEFINED")
2095 (("VK_FORMAT_END_RANGE") "VK_FORMAT_ASTC_12x12_SRGB_BLOCK"))
2096 ;; Next, we patch CMakeLists.
2097 (substitute* "CMakeLists.txt"
2098 ;; Drop unnecessary includes and targets.
2099 (("include_directories\\(ext/glslang\\)") "")
2100 (("include_directories\\(ext/xxhash\\)") "")
2101 (("include_directories\\(ext/cityhash\\)") "")
2102 (("set_target_properties\\(cityhash .*\\)") "")
2103 ;; Fix linking to GLEW.
2104 (("TARGET Ext::GLEW") "true")
2105 (("target_link_libraries\\(native Ext::GLEW\\)")
2106 "find_package(GLEW)\ntarget_link_libraries(native GLEW::GLEW)")
2107 (("Ext::Snappy") "snappy")
2108 ;; Don't search for cityhash/xxhash, we already have them.
2109 (("add_library\\((city|xx)hash STATIC") "if()\nendif(")
2110 (("ext/xxhash\\.[ch]") "")
2111 (("ext/native/ext/cityhash/.*\\.(cpp|h)") "")
2112 ;; Link all of spirv-cross.
2113 (("spirv-cross-glsl" all)
2114 (string-append all
2115 " spirv-cross-core spirv-cross-cpp"
2116 " spirv-cross-reflect spirv-cross-util")))
2117 (substitute* "ext/CMakeLists.txt"
2118 (("add_subdirectory\\(glew\\)") "")
2119 (("add_subdirectory\\(glslang( [A-Z_]*)*\\)") "")
2120 (("add_subdirectory\\(snappy\\)") "")
2121 (("add_subdirectory\\(SPIRV-Cross-build\\)") ""))
2122 ;; Finally, we can delete the bundled sources.
2123 (for-each delete-file-recursively
2124 '("ext/cmake"
2125 "ext/glew"
2126 "ext/glslang" "ext/glslang-build"
2127 "ext/native/ext/cityhash"
2128 "ext/native/ext/libpng17"
2129 "ext/native/ext/libzip"
2130 "ext/snappy"
2131 "ext/SPIRV-Cross" "ext/SPIRV-Cross-build"
2132 "ext/vulkan"
2133 "ext/xxhash.c"
2134 "ext/xxhash.h"
2135 "ext/zlib"))
2136 ;; Since we are not including git as an input, PPSSPP is confused
2137 ;; about its version. Let's fix that here.
2138 (substitute* "git-version.cmake"
2139 (("unknown") ,version))))))
2140 (build-system cmake-build-system)
2141 (native-inputs
2142 `(("pkg-config" ,pkg-config)
2143 ("python" ,python)))
2144 (inputs
2145 `(("cityhash" ,cityhash)
2146 ("ffmpeg" ,ffmpeg)
2147 ("glew" ,glew)
2148 ("glslang" ,glslang)
2149 ("libpng" ,libpng)
2150 ("libzip" ,libzip)
2151 ("mesa" ,mesa)
2152 ("sdl2" ,sdl2)
2153 ("snappy" ,snappy)
2154 ("spirv-cross" ,spirv-cross)
2155 ("vulkan-headers" ,vulkan-headers)
2156 ("vulkan-loader" ,vulkan-loader)
2157 ("xxhash" ,xxhash)
2158 ("zlib" ,zlib)
2159 ;; TODO: unbundle armips.
2160 ("armips-source" ,(package-source armips))
2161 ("lang"
2162 ,(let ((commit "1c64b8fbd3cb6bd87935eb53f302f7de6f86e209"))
2163 (origin
2164 (method git-fetch)
2165 (uri (git-reference
2166 (url "https://github.com/hrydgard/ppsspp-lang")
2167 (commit commit)))
2168 (sha256
2169 (base32 "0rprn3yd8xfrvi0fm62sgpqa8n73jk7zmlscp8cp0h2fawqpiamd"))
2170 (file-name (git-file-name "ppsspp-lang" commit)))))
2171 ("tests"
2172 ,(let ((commit "328b839c7243e7f733f9eae88d059485e3d808e7"))
2173 (origin
2174 (method git-fetch)
2175 (uri (git-reference
2176 (url "https://github.com/hrydgard/pspautotests")
2177 (commit commit)))
2178 (sha256
2179 (base32 "1gj1kr5ijxrqwvz7c41phskjr70ndp8iz0gr8c3xxsd8p9z5gdvm"))
2180 (file-name (git-file-name "pspautotests" commit)))))))
2181 (arguments
2182 `(#:out-of-source? #f
2183 #:configure-flags (list "-DUSE_DISCORD=OFF"
2184 "-DUSE_SYSTEM_FFMPEG=ON"
2185 "-DUSE_SYSTEM_LIBZIP=ON"
2186 ;; for testing
2187 "-DUNITTEST=ON" "-DHEADLESS=ON")
2188 #:phases
2189 (modify-phases %standard-phases
2190 (add-after 'unpack 'add-external-sources
2191 (lambda* (#:key inputs #:allow-other-keys)
2192 ;; TODO: unbundle armips.
2193 (copy-recursively (assoc-ref inputs "armips-source")
2194 "ext/armips")
2195 ;; Some tests are externalised, so we add them here.
2196 (copy-recursively (assoc-ref inputs "tests")
2197 "pspautotests")
2198 ;; i18n is externalised, so we add it here.
2199 (copy-recursively (assoc-ref inputs "lang")
2200 "assets/lang")
2201 #t))
2202 (replace 'check
2203 (lambda _
2204 (for-each
2205 (lambda (t) (invoke "./unitTest" t))
2206 '("Arm64Emitter" "ArmEmitter" "X64Emitter" "VertexJit" "Asin"
2207 "SinCos" "VFPUSinCos" "MathUtil" "Parsers" "Jit"
2208 "MatrixTranspose" "ParseLBN" "QuickTexHash" "CLZ" "MemMap"))
2209 (invoke "python3" "test.py" "-g")
2210 #t))
2211 (replace 'install
2212 (lambda* (#:key inputs outputs #:allow-other-keys)
2213 (let* ((out (assoc-ref outputs "out"))
2214 (bin/ppsspp (string-append out "/bin/ppsspp"))
2215 (share (string-append out "/share/ppsspp")))
2216 (copy-recursively "icons/hicolor"
2217 (string-append out "/share/icons/hicolor"))
2218 (install-file "PPSSPPSDL" share)
2219 (copy-recursively "assets" (string-append share "/assets"))
2220
2221 (make-desktop-entry-file
2222 (string-append out "/share/applications/ppsspp.desktop")
2223 #:name "PPSSPP"
2224 #:exec (string-append share "/PPSSPPSDL")
2225 #:icon "ppsspp")
2226 (mkdir-p (string-append out "/bin"))
2227 (with-output-to-file bin/ppsspp
2228 (lambda ()
2229 (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\""
2230 (which "sh") share)))
2231 (chmod bin/ppsspp #o755)
2232 #t))))))
2233 (home-page "https://www.ppsspp.org/")
2234 (synopsis "PSP emulator")
2235 (description
2236 "PPSSPP is a ``high-level'' emulator simulating the PSP operating
2237 system.")
2238 (license license:gpl2+)))