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