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>
20 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
112 (uri (string-append "mirror://sourceforge/vice-emu/releases/"
113 "vice-" version ".tar.gz"))
116 "03nwcldg2h7dxj6aa77ggqc0442hqc1lsq5x69h8kcmqmvx7ifan"))))
117 (build-system gnu-build-system)
119 `(#:configure-flags '("--disable-pdf-docs")))
122 ("dos2unix" ,dos2unix)
124 ("glib" ,glib "bin") ; for glib-genmarshal, etc.
125 ("pkg-config" ,pkg-config)))
127 `(("alsa-lib" ,alsa-lib)
131 ("pulseaudio" ,pulseaudio)
133 ("sdl-image" ,sdl-image)
135 (home-page "https://vice-emu.sourceforge.io/")
136 (synopsis "The versatile Commodore emulator")
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
142 (license license:gpl2+)))
144 (define-public desmume
152 "mirror://sourceforge/desmume/desmume/"
153 version "/desmume-" version ".tar.gz"))
156 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))
157 (patches (search-patches "desmume-gcc6-fixes.patch"
158 "desmume-gcc7-fixes.patch"))))
159 (build-system gnu-build-system)
161 ;; Enable support for WiFi and microphone.
162 `(#:configure-flags '("--enable-wifi"
165 `(("pkg-config" ,pkg-config)
166 ("intltool" ,intltool)))
173 (home-page "http://desmume.org/")
174 (synopsis "Nintendo DS emulator")
176 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
177 (license license:gpl2)))
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")
187 (version (git-version "5.0" revision commit))
192 (url "https://github.com/dolphin-emu/dolphin")
194 (file-name (git-file-name name version))
195 (modules '((guix build utils)))
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"))
206 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
210 "0j6hnj60iai366kl0kdbn1jkwc183l02g65mp2vq4qb2yd4399l1"))))
211 (build-system cmake-build-system)
215 (modify-phases %standard-phases
216 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
217 (lambda* (#:key inputs outputs #:allow-other-keys)
219 (string-append (assoc-ref inputs "font-wqy-microhei")
220 "/share/fonts/truetype/wqy-microhei.ttc"))
222 (string-append (assoc-ref inputs "vulkan-loader")
223 "/lib/libvulkan.so")))
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")
232 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
233 (("\"vulkan\", 1") (string-append "\"vulkan\""))
234 (("\"vulkan\"") (string-append "\"" libvulkan "\""))
235 (("Common::DynamicLibrary::GetVersionedFilename") ""))
238 ;; The FindGTK2 cmake script only checks hardcoded directories for
242 (list (string-append "-DX11_INCLUDE_DIR="
243 (assoc-ref %build-inputs "libx11")
245 (string-append "-DX11_LIBRARIES="
246 (assoc-ref %build-inputs "libx11")
250 `(("pkg-config" ,pkg-config)
251 ("gettext" ,gettext-minimal)))
253 `(("alsa-lib" ,alsa-lib)
259 ("font-wqy-microhei" ,font-wqy-microhei)
260 ("freetype" ,freetype)
266 ("libevdev" ,libevdev)
271 ("libxrandr" ,libxrandr)
273 ("mbedtls-apache" ,mbedtls-apache)
275 ("miniupnpc" ,miniupnpc)
278 ("pulseaudio" ,pulseaudio)
283 ("soundtouch" ,soundtouch)
284 ("vulkan-loader" ,vulkan-loader)
286 (home-page "https://dolphin-emu.org/")
287 (synopsis "Nintendo Wii and GameCube emulator")
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+)))))
296 (define-public dosbox
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"))
308 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
309 (build-system gnu-build-system)
311 `(("autoconf" ,autoconf)
312 ("automake" ,automake)))
317 ("alsa-lib" ,alsa-lib)
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
327 (license license:gpl2+)))
329 (define-public qtmips
336 (url "https://github.com/cvut/QtMips")
337 (commit (string-append "v" version))))
338 (file-name (git-file-name name version))
341 "1fal7a8y5g0rqqjrk795jh1l50ihz01ppjnrfjrk9vkjbd59szbp"))))
342 (build-system cmake-build-system)
345 (modify-phases %standard-phases
347 (lambda* (#:key outputs #:allow-other-keys)
349 (string-append "PREFIX=" (assoc-ref outputs "out"))
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"))
359 (invoke "tests/run-all.sh")
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"))
376 #:tests? #f)) ; test suite wants mips toolchain
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
387 (define-public emulation-station
388 ;; No release for a long time, new commits fix build issues
389 (let ((commit "9cc42adff67946175d2b7e25c6ae69cc374e98a0")
392 (name "emulation-station")
393 (version (git-version "2.0.1" revision commit))
395 (method git-fetch) ; no tarball available
397 (url "https://github.com/Aloshi/EmulationStation")
398 (commit commit))) ; no version tag
399 (file-name (git-file-name name version))
402 "1cva0ns650v17lfn8in095zci6lc43d23f1x3mlzc41qfqa6mbd1"))))
403 (build-system cmake-build-system)
405 '(#:tests? #f)) ; no tests
407 `(("alsa-lib" ,alsa-lib)
411 ("freeimage" ,freeimage)
412 ("freetype" ,freetype)
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))))
431 (url "https://github.com/higan-emu/higan")
432 (commit (string-append "v" version))))
433 (file-name (git-file-name name version))
435 (base32 "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2"))))
436 (build-system gnu-build-system)
438 `(("pkg-config" ,pkg-config)))
440 `(("alsa-lib" ,alsa-lib)
444 ("gtksourceview-2" ,gtksourceview-2)
445 ("libxrandr" ,libxrandr)
449 ("pulseaudio" ,pulseaudio)
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.
458 (add-before 'build 'chdir-to-higan
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"))
468 (add-after 'install 'chdir-to-icarus
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")
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
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))))
500 ;; Second, make sure higan will find icarus in PATH.
502 `("PATH" ":" prefix (,bin)))
506 (string-append "prefix=" (assoc-ref %outputs "out")))
507 ;; There is no test suite.
509 (home-page "https://github.com/higan-emu/higan/")
510 (synopsis "Multi-system emulator")
512 "higan is a multi-system emulator with an uncompromising focus on
513 accuracy and code readability.
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
521 (license license:gpl3+)))
523 (define-public mednafen
530 (uri (string-append "https://mednafen.github.io/releases/files/"
531 "mednafen-" version ".tar.xz"))
533 (base32 "1ysmb56wzr17ki6f1b486r2dzjr11igd021qb4r3437l68prpa7k"))))
534 (build-system gnu-build-system)
538 ;; "--with-external-mpcdec"
539 "--with-external-lzo")))
541 `(("pkg-config" ,pkg-config)))
545 ;; ("libmpcdec" ,libmpcdec) FIXME: not recognized.
546 ("libsndfile" ,libsndfile)
550 (home-page "https://mednafen.github.io/")
551 (synopsis "Multi-system emulator utilizing OpenGL and SDL")
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.
561 The following systems are supported:
566 @item Neo Geo Pocket (Color)
568 @item GameBoy (Color)
569 @item GameBoy Advance
570 @item Nintendo Entertainment System
571 @item Super Nintendo Entertainment System/Super Famicom
573 @item PC Engine/TurboGrafx 16 (CD)
577 @item Sega Genesis/Megadrive
578 @item Sega Master System
579 @item Sega Saturn (experimental, x86_64 only)
580 @item Sony PlayStation
582 ;; Main license is GPL2+. Some parts are BSD-3.
583 (license (list license:gpl2+ license:bsd-3))))
593 (url "https://github.com/mgba-emu/mgba")
595 (file-name (git-file-name name version))
597 (base32 "163azad5y4zxwzxyrb481rwfc2p86v99pf7nvdr6bavzq98x2z8h"))
598 (modules '((guix build utils)))
600 ;; Make sure we don't use the bundled software.
604 (let ((lib-subdir (string-append "src/third-party/" subdir)))
605 (delete-file-recursively lib-subdir)))
606 '("libpng" "lzma" "sqlite3" "zlib"))
608 (build-system cmake-build-system)
610 `(#:tests? #f ;no "test" target
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)
619 ("libepoxy" ,libepoxy)
625 ("qtmultimedia" ,qtmultimedia)
629 (home-page "https://mgba.io")
630 (synopsis "Game Boy Advance emulator")
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))))
640 (define-public sameboy
648 (url "https://github.com/LIJI32/SameBoy")
649 (commit (string-append "v" version))))
650 (file-name (git-file-name name version))
652 (base32 "1dipidx12ai62hnzf0pvnsk1cgjcmw1h5x2r7ilxq0k0pkia5b7a"))))
653 (build-system gnu-build-system)
656 ("pkg-config" ,pkg-config)))
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")
667 (modify-phases %standard-phases
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))
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)))
687 (define-public mupen64plus-core
689 (name "mupen64plus-core")
695 (url "https://github.com/mupen64plus/mupen64plus-core")
697 (file-name (git-file-name name version))
699 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
700 (build-system gnu-build-system)
702 `(("pkg-config" ,pkg-config)
705 `(("freetype" ,freetype)
713 (modify-phases %standard-phases
714 ;; The mupen64plus build system has no configure phase.
716 ;; Makefile is in a subdirectory.
718 'build 'chdir-to-project-directory
720 (chdir "projects/unix")
722 #:make-flags (let ((out (assoc-ref %outputs "out")))
723 (list "all" (string-append "PREFIX=" out)))
724 ;; There are no tests.
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")
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
734 (license license:gpl2+)))
736 (define-public mupen64plus-audio-sdl
738 (name "mupen64plus-audio-sdl")
744 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl")
746 (file-name (git-file-name name version))
748 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
749 (build-system gnu-build-system)
751 `(("pkg-config" ,pkg-config)
754 `(("mupen64plus-core" ,mupen64plus-core)
758 (modify-phases %standard-phases
759 ;; The mupen64plus build system has no configure phase.
761 ;; Makefile is in a subdirectory.
763 'build 'cd-to-project-dir
765 (chdir "projects/unix"))))
767 (let ((out (assoc-ref %outputs "out"))
768 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
770 (string-append "PREFIX=" out)
771 (string-append "APIDIR=" m64p "/include/mupen64plus")))
772 ;; There are no tests.
774 (home-page "https://www.mupen64plus.org/")
775 (synopsis "Mupen64Plus SDL input plugin")
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
780 (license license:gpl2+)))
782 (define-public mupen64plus-input-sdl
784 (name "mupen64plus-input-sdl")
790 (url "https://github.com/mupen64plus/mupen64plus-input-sdl")
792 (file-name (git-file-name name version))
794 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
795 (build-system gnu-build-system)
799 `(("mupen64plus-core" ,mupen64plus-core)
803 (modify-phases %standard-phases
804 ;; The mupen64plus build system has no configure phase.
806 ;; Makefile is in a subdirectory.
808 'build 'cd-to-project-dir
810 (chdir "projects/unix"))))
812 (let ((out (assoc-ref %outputs "out"))
813 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
815 (string-append "PREFIX=" out)
816 (string-append "APIDIR=" m64p "/include/mupen64plus")))
817 ;; There are no tests.
819 (home-page "https://www.mupen64plus.org/")
820 (synopsis "Mupen64Plus SDL input plugin")
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
825 (license license:gpl2+)))
827 (define-public mupen64plus-rsp-hle
829 (name "mupen64plus-rsp-hle")
835 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle")
837 (file-name (git-file-name name version))
839 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
840 (build-system gnu-build-system)
842 `(("mupen64plus-core" ,mupen64plus-core)))
845 (modify-phases %standard-phases
846 ;; The mupen64plus build system has no configure phase.
848 ;; Makefile is in a subdirectory.
850 'build 'cd-to-project-dir
852 (chdir "projects/unix"))))
854 (let ((out (assoc-ref %outputs "out"))
855 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
857 (string-append "PREFIX=" out)
858 (string-append "APIDIR=" m64p "/include/mupen64plus")))
859 ;; There are no tests.
861 (home-page "https://www.mupen64plus.org/")
862 (synopsis "Mupen64Plus SDL input plugin")
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+)))
869 (define-public mupen64plus-rsp-z64
871 (name "mupen64plus-rsp-z64")
877 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64")
879 (file-name (git-file-name name version))
881 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
882 (build-system gnu-build-system)
884 `(("mupen64plus-core" ,mupen64plus-core)))
887 (modify-phases %standard-phases
888 ;; The mupen64plus build system has no configure phase.
890 ;; Makefile is in a subdirectory.
892 'build 'cd-to-project-dir
894 (chdir "projects/unix"))))
896 (let ((out (assoc-ref %outputs "out"))
897 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
899 (string-append "PREFIX=" out)
900 (string-append "APIDIR=" m64p "/include/mupen64plus")))
901 ;; There are no tests.
903 (home-page "https://www.mupen64plus.org/")
904 (synopsis "Mupen64Plus SDL input plugin")
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+)))
911 (define-public mupen64plus-video-arachnoid
913 (name "mupen64plus-video-arachnoid")
919 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid")
921 (file-name (git-file-name name version))
923 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
924 (build-system gnu-build-system)
926 `(("pkg-config" ,pkg-config)
930 ("mupen64plus-core" ,mupen64plus-core)))
933 (modify-phases %standard-phases
934 ;; The mupen64plus build system has no configure phase.
936 ;; Makefile is in a subdirectory.
938 'build 'cd-to-project-dir
940 (chdir "projects/unix"))))
942 (let ((out (assoc-ref %outputs "out"))
943 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
945 (string-append "PREFIX=" out)
946 (string-append "APIDIR=" m64p "/include/mupen64plus")))
947 ;; There are no tests.
949 (home-page "https://www.mupen64plus.org/")
950 (synopsis "Mupen64Plus Rice Video plugin")
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+)))
957 (define-public mupen64plus-video-glide64
959 (name "mupen64plus-video-glide64")
965 (url "https://github.com/mupen64plus/mupen64plus-video-glide64")
967 (file-name (git-file-name name version))
969 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
970 (build-system gnu-build-system)
972 `(("pkg-config" ,pkg-config)
976 ("mupen64plus-core" ,mupen64plus-core)
980 (modify-phases %standard-phases
981 ;; The mupen64plus build system has no configure phase.
983 ;; Makefile is in a subdirectory.
985 'build 'cd-to-project-dir
987 (chdir "projects/unix")))
988 ;; XXX Should be unnecessary with the next release.
992 (substitute* "Makefile"
993 (("SDL_CONFIG = (.*)sdl-config" all prefix)
994 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
996 (let ((out (assoc-ref %outputs "out"))
997 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
999 (string-append "PREFIX=" out)
1000 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1001 ;; There are no tests.
1003 (home-page "https://www.mupen64plus.org/")
1004 (synopsis "Mupen64Plus Rice Video plugin")
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+)))
1011 (define-public mupen64plus-video-glide64mk2
1013 (name "mupen64plus-video-glide64mk2")
1019 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2")
1021 (file-name (git-file-name name version))
1023 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
1024 (build-system gnu-build-system)
1026 `(("pkg-config" ,pkg-config)
1032 ("mupen64plus-core" ,mupen64plus-core)
1037 (modify-phases %standard-phases
1038 ;; The mupen64plus build system has no configure phase.
1040 ;; Makefile is in a subdirectory.
1042 'build 'cd-to-project-dir
1044 (chdir "projects/unix"))))
1046 (let ((out (assoc-ref %outputs "out"))
1047 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1049 (string-append "PREFIX=" out)
1050 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1051 ;; There are no tests.
1053 (home-page "https://www.mupen64plus.org/")
1054 (synopsis "Mupen64Plus Rice Video plugin")
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+)))
1061 (define-public mupen64plus-video-rice
1063 (name "mupen64plus-video-rice")
1069 (url "https://github.com/mupen64plus/mupen64plus-video-rice")
1071 (file-name (git-file-name name version))
1073 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
1074 (build-system gnu-build-system)
1076 `(("pkg-config" ,pkg-config)
1079 `(("libpng" ,libpng)
1081 ("mupen64plus-core" ,mupen64plus-core)
1085 (modify-phases %standard-phases
1086 ;; The mupen64plus build system has no configure phase.
1088 ;; Makefile is in a subdirectory.
1090 'build 'cd-to-project-dir
1092 (chdir "projects/unix"))))
1094 (let ((out (assoc-ref %outputs "out"))
1095 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1097 (string-append "PREFIX=" out)
1098 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1099 ;; There are no tests.
1101 (home-page "https://www.mupen64plus.org/")
1102 (synopsis "Mupen64Plus Rice Video plugin")
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+)))
1109 (define-public mupen64plus-video-z64
1111 (name "mupen64plus-video-z64")
1117 (url "https://github.com/mupen64plus/mupen64plus-video-z64")
1119 (file-name (git-file-name name version))
1121 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
1122 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
1123 (build-system gnu-build-system)
1125 `(("pkg-config" ,pkg-config)
1129 ("mupen64plus-core" ,mupen64plus-core)
1133 (modify-phases %standard-phases
1134 ;; The mupen64plus build system has no configure phase.
1136 ;; Makefile is in a subdirectory.
1138 'build 'cd-to-project-dir
1140 (chdir "projects/unix")))
1141 ;; XXX Should be unnecessary with the next release.
1145 (substitute* "Makefile"
1146 (("SDL_CONFIG = (.*)sdl-config" all prefix)
1147 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
1149 (let ((out (assoc-ref %outputs "out"))
1150 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1152 (string-append "PREFIX=" out)
1153 (string-append "APIDIR=" m64p "/include/mupen64plus")))
1154 ;; There are no tests.
1156 (home-page "https://www.mupen64plus.org/")
1157 (synopsis "Mupen64Plus Z64 video plugin")
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
1162 (license license:gpl2+)))
1164 (define-public mupen64plus-ui-console
1166 (name "mupen64plus-ui-console")
1172 (url "https://github.com/mupen64plus/mupen64plus-ui-console")
1174 (file-name (git-file-name name version))
1176 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
1177 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
1178 (build-system gnu-build-system)
1180 `(("pkg-config" ,pkg-config)
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.
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)))
1202 (modify-phases %standard-phases
1203 ;; The mupen64plus build system has no configure phase.
1205 ;; Makefile is in a subdirectory.
1207 'build 'cd-to-project-dir
1209 (chdir "projects/unix"))))
1211 (let ((out (assoc-ref %outputs "out"))
1212 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
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.
1220 (home-page "https://www.mupen64plus.org/")
1221 (synopsis "Mupen64Plus command line user interface")
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+)))
1229 (define-public nestopia-ue
1231 (name "nestopia-ue")
1237 (url "https://github.com/rdanbrook/nestopia")
1239 (file-name (git-file-name name version))
1241 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1242 (modules '((guix build utils)))
1245 ;; We don't need libretro for the GNU/Linux build.
1246 (delete-file-recursively "libretro")
1248 (build-system cmake-build-system)
1250 `(("pkg-config" ,pkg-config)))
1254 ("libarchive" ,libarchive)
1255 ("libepoxy" ,libepoxy)
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.
1272 (home-page "http://0ldsk00l.ca/nestopia/")
1273 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
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+)))
1280 (define-public libretro-lowresnx
1282 (name "libretro-lowresnx")
1287 (url "https://github.com/timoinutilis/lowres-nx")
1288 (commit (string-append "v" version))))
1289 (file-name (git-file-name name version))
1292 "0b0vg3iz342dpkffvf7frsnqh8inj8yzi8550bsx8vnbpq5r2ay5"))))
1293 (build-system gnu-build-system)
1295 `(#:tests? #f ; no tests
1296 #:make-flags (list "-C" "platform/LibRetro"
1297 (string-append "CC=" ,(cc-for-target)))
1299 (modify-phases %standard-phases
1300 (delete 'configure) ; no configure script
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"
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
1314 (license license:zlib)))
1316 (define-public retroarch
1324 (url "https://github.com/libretro/RetroArch")
1325 (commit (string-append "v" version))))
1326 (file-name (git-file-name name version))
1328 (base32 "1wky28y52nsjmannks3y1hbjgw0dvqh85gxrllr98f9y7kvk1cvf"))
1330 (search-patches "retroarch-LIBRETRO_DIRECTORY.patch"))))
1331 (build-system gnu-build-system)
1333 `(#:tests? #f ; no tests
1335 (modify-phases %standard-phases
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")))
1352 (substitute* '("libretro-common/file/archive_file_zlib.c"
1353 "libretro-common/streams/trans_stream_zlib.c")
1354 (("<compat/zlib.h>") "<zlib.h>"))
1356 ;; The configure script does not yet accept the extra arguments
1357 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1360 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1362 '("--enable-neon" "--enable-floathard")
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")))))))
1370 `(("alsa-lib" ,alsa-lib)
1372 ("freetype" ,freetype)
1373 ("libxinerama" ,libxinerama)
1374 ("libxkbcommon" ,libxkbcommon)
1375 ("libxml2" ,libxml2)
1376 ("libxrandr" ,libxrandr)
1379 ("miniupnpc" ,miniupnpc)
1381 ("pulseaudio" ,pulseaudio)
1383 ("qtbase" ,qtbase-5)
1386 ("vulkan-loader" ,vulkan-loader)
1387 ("wayland" ,wayland)
1390 `(("pkg-config" ,pkg-config)
1391 ("wayland-protocols" ,wayland-protocols)
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")
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+)))
1408 (define-public scummvm
1415 (uri (string-append "https://downloads.scummvm.org/frs/scummvm/" version
1416 "/scummvm-" version ".tar.xz"))
1418 (base32 "11vknasm5dna2vqr6gk343qynh7nhsq3kf60zayarn1vb5z6as8l"))))
1419 (build-system gnu-build-system)
1421 `(#:tests? #f ;require "git"
1422 #:configure-flags (list "--enable-release") ;for optimizations
1424 (modify-phases %standard-phases
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)))))))
1438 ("pkg-config" ,pkg-config)))
1440 `(("alsa-lib" ,alsa-lib)
1442 ("fluidsynth" ,fluidsynth)
1443 ("freetype" ,freetype)
1444 ("fribidi" ,fribidi)
1447 ("libjpeg-turbo" ,libjpeg-turbo)
1449 ("libmpeg2" ,libmpeg2)
1452 ("libtheora" ,libtheora)
1453 ("libvorbis" ,libvorbis)
1454 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
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+)))
1465 (define-public libticables2
1467 (name "libticables2")
1471 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1474 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1475 (build-system gnu-build-system)
1477 `(#:configure-flags (list "--enable-libusb10")
1479 (modify-phases %standard-phases
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))
1489 `(("autoconf" ,autoconf)
1490 ("autogen" ,autogen)
1491 ("automake" ,automake)
1492 ("gettext" ,gnu-gettext)
1493 ("libtool" ,libtool)
1494 ("pkg-config" ,pkg-config)))
1497 ("libusb" ,libusb)))
1498 (synopsis "Link cable library for TI calculators")
1500 "This package contains libticables, a library for operations on
1501 @acronym{TI, Texas Instruments} calculator link cables.
1503 This is a part of the TiLP project.")
1504 (home-page "http://lpg.ticalc.org/prj_tilp/")
1505 (license license:gpl2+)))
1507 (define-public libticonv
1513 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1516 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1517 (build-system gnu-build-system)
1519 ;; build fails with out --enable-iconv (...?)
1520 `(#:configure-flags (list "--enable-iconv")
1522 (modify-phases %standard-phases
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))
1532 `(("autoconf" ,autoconf)
1533 ("automake" ,automake)
1534 ("libtool" ,libtool)
1535 ("pkg-config" ,pkg-config)))
1538 (synopsis "Character conversion library for TI calculators")
1540 "This package contains libticonv, a library to support working with
1541 @acronym{TI, Texas Instruments} calculator charsets.
1543 This is a part of the TiLP project.")
1544 (home-page "http://lpg.ticalc.org/prj_tilp/")
1545 (license license:gpl2+)))
1547 (define-public libtifiles2
1549 (name "libtifiles2")
1553 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1556 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1557 (build-system gnu-build-system)
1560 (modify-phases %standard-phases
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))
1570 `(("autoconf" ,autoconf)
1571 ("automake" ,automake)
1572 ("gettext" ,gnu-gettext)
1573 ("libtool" ,libtool)
1574 ("pkg-config" ,pkg-config)))
1577 ("libarchive" ,libarchive)
1578 ("libticonv" ,libticonv)))
1579 (synopsis "File functions library for TI calculators")
1581 "This package contains libticonv, a library to support working with
1582 @acronym{TI, Texas Instruments} calculator files.
1584 This is a part of the TiLP project.")
1585 (home-page "http://lpg.ticalc.org/prj_tilp/")
1586 (license license:gpl2+)))
1588 (define-public libticalcs2
1590 (name "libticalcs2")
1594 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1597 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1598 (build-system gnu-build-system)
1601 (modify-phases %standard-phases
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))
1611 `(("autoconf" ,autoconf)
1612 ("automake" ,automake)
1613 ("gettext" ,gnu-gettext)
1614 ("libtool" ,libtool)
1615 ("pkg-config" ,pkg-config)))
1618 ("libarchive" ,libarchive)
1619 ("libticables2" ,libticables2)
1620 ("libticonv" ,libticonv)
1621 ("libtifiles2" ,libtifiles2)))
1622 (synopsis "Support library for TI calculators")
1624 "This project aims to develop a multi-platform linking program for use
1625 with all @acronym{TI, Texas Instruments} graphing calculators (TI73 to
1628 This is a part of the TiLP project.")
1629 (home-page "http://lpg.ticalc.org/prj_tilp/")
1630 (license license:gpl2+)))
1640 (url "https://github.com/mamedev/mame")
1641 (commit (apply string-append "mame" (string-split version #\.)))))
1642 (file-name (git-file-name name version))
1644 (base32 "1v6qka8k4smah08rp62kgjmc84hwsg1iqhms0369rhdh722bgpn7"))
1645 (modules '((guix build utils)))
1647 ;; Remove bundled libraries.
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")))
1655 (build-system gnu-build-system)
1659 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1661 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1662 (string-append "SDL_INI_PATH="
1663 (assoc-ref %outputs "out")
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
1671 (modify-phases %standard-phases
1673 (add-after 'build 'build-documentation
1674 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
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")))
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")))
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))
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/".
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")
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~@
1725 fontpath $HOME/mame/fonts;~a/fonts~@
1726 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
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
1738 (with-output-to-file (string-append ini "/ui.ini")
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~%")))
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")))
1768 (with-output-to-file (string-append desktop "/mame.desktop")
1773 Comment=Multi-purpose emulation framework~@
1778 Categories=Game;Emulator;~@
1779 Keywords=Game;Emulator;Arcade;~%"
1783 `(("pkg-config" ,pkg-config)
1784 ("sphinx" ,python-sphinx)
1785 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1786 ("texinfo" ,texinfo)))
1788 `(("alsa-lib" ,alsa-lib)
1789 ("asio" ,asio-1.12) ;the bundled copy is at 1.11
1792 ("fontconfig" ,fontconfig)
1794 ("libjpeg" ,libjpeg-turbo)
1796 ("libxinerama" ,libxinerama)
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)))
1807 ("utf8proc" ,utf8proc)
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))))
1821 (define-public gnome-arcade
1823 (name "gnome-arcade")
1829 (url "https://github.com/strippato/gnome-arcade")
1830 (commit (string-append "v." version))))
1831 (file-name (git-file-name name version))
1834 "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
1835 (build-system cmake-build-system)
1837 `(#:tests? #f ; No tests.
1838 #:configure-flags (list
1839 (string-append "-DMAME_BIN=\""
1840 (assoc-ref %build-inputs "mame")
1842 (string-append "-DAPP_RES=\""
1843 (assoc-ref %outputs "out")
1844 "/share/gnome-arcade/\""))
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")))
1851 (substitute* "../source/src/config.c"
1852 (("/usr/share") (string-append out "/share"))))
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")))
1861 (install-file "../gnome-arcade" bin)
1862 (copy-recursively "../source/res"
1863 (string-append out "/share/gnome-arcade/res"))
1865 (install-file "../source/data/rom/ROM.TXT" rom)
1867 (install-file "../source/data/tile/TILE.TXT" tile))
1870 `(("pkg-config" ,pkg-config)))
1874 ("libevdev" ,libevdev)
1876 ("libarchive" ,libarchive)))
1877 (home-page "https://github.com/strippato/gnome-arcade")
1878 (synopsis "Minimal MAME frontend")
1880 "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
1882 (license license:gpl3+)))
1884 (define-public pcsxr
1885 ;; No release since 2017.
1886 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1889 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1895 (url "https://github.com/pcsxr/PCSX-Reloaded")
1899 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1900 (file-name (git-file-name name commit))))
1901 (build-system cmake-build-system)
1903 `(#:tests? #f ;no "test" target
1905 (list "-DSND_BACKEND=pulse"
1906 "-DENABLE_CCDDA='ON'"
1907 "-DUSE_LIBARCHIVE='ON'"
1908 "-DUSE_LIBCDIO='ON'")
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")))
1919 (add-after 'install 'wrap-program
1920 (lambda* (#:key inputs outputs #:allow-other-keys)
1921 (wrap-program (string-append (assoc-ref outputs "out")
1923 ;; For GtkFileChooserDialog.
1924 `("GSETTINGS_SCHEMA_DIR" =
1925 (,(string-append (assoc-ref inputs "gtk+")
1926 "/share/glib-2.0/schemas"))))
1929 `(("pkg-config" ,pkg-config)
1930 ("intltool" ,intltool)
1931 ("glib" ,glib "bin")))
1933 `(("libcdio" ,libcdio)
1938 ("libarchive" ,libarchive)
1939 ("pulseaudio" ,pulseaudio)))
1940 (home-page "https://archive.codeplex.com/?p=pcsxr")
1941 (synopsis "PlayStation emulator")
1943 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1945 (license license:gpl2+))))
1947 (define-public gens-gs
1954 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1958 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1959 (build-system glib-or-gtk-build-system)
1961 `(#:system "i686-linux"
1963 (modify-phases %standard-phases
1964 (add-after 'unpack 'fix-CFLAGS
1966 ;; Remove GTK API deprecation flags that cause build errors.
1967 (substitute* "configure"
1968 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1971 `(("pkg-config" ,pkg-config)
1976 (home-page "https://segaretro.org/Gens/GS")
1977 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
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+)))
1985 (define-public bsnes
1993 (url "https://github.com/bsnes-emu/bsnes")
1994 (commit (string-append "v" version))))
1995 (file-name (git-file-name name version))
1998 "0j054x38fwai61vj36sc04r3zkzay5acq2cgd9zqv5hs51s36g5b"))))
1999 (build-system gnu-build-system)
2001 `(#:make-flags (list "-C" "bsnes"
2002 ;; Remove march=native
2004 (string-append "prefix=" (assoc-ref %outputs "out")))
2005 #:tests? #f ; No tests.
2006 #:phases (modify-phases %standard-phases
2007 (delete 'configure))))
2009 `(("pkg-config" ,pkg-config)))
2011 `(("alsa-lib" ,alsa-lib)
2015 ("gtksourceview-2" ,gtksourceview-2)
2016 ("libxrandr" ,libxrandr)
2019 ("pulseaudio" ,pulseaudio)
2021 (home-page "https://bsnes.dev/")
2022 (synopsis "Emulator for the Super Nintendo / Super Famicom systems")
2024 "bsnes is a Super Nintendo / Super Famicom emulator that focuses on
2025 performance, features, and ease of use.")
2026 (license license:gpl3)))
2028 ;; python-pwntools requires a -rc release of unicorn
2029 (define-public unicorn
2032 (if (member (%current-system) '("x86_64-linux" "i686-linux"))
2037 (version "1.0.2-rc4")
2038 ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
2043 (url "https://github.com/unicorn-engine/unicorn")
2045 (file-name (git-file-name name version))
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)
2056 `(#:modules ((srfi srfi-26)
2057 (guix build python-build-system)
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
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")
2072 (add-before 'build 'build-library
2073 (lambda* (#:key inputs #:allow-other-keys)
2075 "-j" (number->string (parallel-job-count))
2078 (add-after 'build-library 'install-library
2079 (lambda* (#:key outputs #:allow-other-keys)
2080 (invoke "make" "install"
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 = \\[.*")
2097 (assoc-ref outputs "lib")
2098 ;; eat the rest of the list
2101 (add-before 'check 'check-library
2102 (lambda* (#:key outputs #:allow-other-keys)
2105 (with-directory-excursion
2106 (string-append "../../tests/" suite)
2107 (invoke "make" "test" "CC=gcc"
2109 '("AS=i686-unknown-linux-gnu-as"
2110 "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
2111 '("unit" "regress"))
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"))
2118 (string-append (assoc-ref outputs "out")
2119 "/share/doc/unicorn/samples"))
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)
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.
2130 `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
2132 ("hexdump-for-tests" ,util-linux)))
2133 (home-page "https://www.unicorn-engine.org")
2134 (synopsis "Unicorn CPU emulator framework")
2136 "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
2137 framework based on QEMU.")
2138 (license license:gpl2+))))
2140 (define-public ppsspp
2141 ;; Use a recent commit as fixes for ffmpeg 4.4 haven't been released as of
2143 (let ((commit "69fa20744958aef8da9ca052ba7675fdc1636e46")
2147 (version (git-version "1.11.3" revision commit))
2152 (url "https://github.com/hrydgard/ppsspp")
2155 (base32 "0r8w4hllhn6zsfxlajxw3sn3f8vsri45srr4mdwsffzcb4hvl0cr"))
2156 (file-name (git-file-name name version))
2158 (search-patches "ppsspp-disable-upgrade-and-gold.patch"))
2159 (modules '((guix build utils)))
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})
2206 ;; Link all of spirv-cross.
2207 (("spirv-cross-glsl" 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
2222 "ext/glslang" "ext/glslang-build"
2223 "ext/miniupnp" "ext/miniupnp-build"
2226 "ext/SPIRV-Cross" "ext/SPIRV-Cross-build"
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)
2238 `(("pkg-config" ,pkg-config)
2239 ("python" ,python)))
2241 `(("cityhash" ,cityhash)
2242 ;; ppsspp doesn't yet build with ffmpeg 4.4 (see:
2245 ("glslang" ,glslang)
2249 ("miniupnpc" ,miniupnpc)
2252 ("spirv-cross" ,spirv-cross)
2253 ("vulkan-headers" ,vulkan-headers)
2254 ("vulkan-loader" ,vulkan-loader)
2257 ("zstd" ,zstd "lib")
2258 ; ("zstd" ,zstd "static")
2259 ;; TODO: unbundle armips.
2260 ("armips-source" ,(package-source armips))
2262 ,(let ((commit "6bd5b4bc983917ea8402f73c726b46e36f3de0b4"))
2266 (url "https://github.com/hrydgard/ppsspp-lang")
2269 (base32 "08npr3a4xskf85gnlxidl4ksc3rhc7m5rgnj7vsbjvhvw5ap02qx"))
2270 (file-name (git-file-name "ppsspp-lang" commit)))))
2272 ,(let ((commit "1047400eaec6bcbdb2a64d326375ef6a6617c4ac"))
2276 (url "https://github.com/hrydgard/pspautotests")
2279 (base32 "0nxv1lskcr8zbg6nrfai21mxsw0n5vaqhbsa41c3cxfyx5c4w2pg"))
2280 (file-name (git-file-name "pspautotests" commit)))))))
2282 `(#:out-of-source? #f
2283 #:configure-flags (list "-DUSE_DISCORD=OFF"
2284 "-DUSE_SYSTEM_FFMPEG=ON"
2285 "-DUSE_SYSTEM_LIBZIP=ON"
2287 "-DUNITTEST=ON" "-DHEADLESS=ON")
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")
2295 ;; Some tests are externalised, so we add them here.
2296 (copy-recursively (assoc-ref inputs "tests")
2298 ;; i18n is externalised, so we add it here.
2299 (copy-recursively (assoc-ref inputs "lang")
2302 (add-after 'unpack 'fix-unittest-build
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>")))
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")
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"))
2331 (make-desktop-entry-file
2332 (string-append out "/share/applications/ppsspp.desktop")
2334 #:exec (string-append share "/PPSSPPSDL")
2336 (mkdir-p (string-append out "/bin"))
2337 (with-output-to-file bin/ppsspp
2339 (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\""
2340 (which "sh") share)))
2341 (chmod bin/ppsspp #o755)
2343 (home-page "https://www.ppsspp.org/")
2344 (synopsis "PSP emulator")
2346 "PPSSPP is a ``high-level'' emulator simulating the PSP operating
2348 (license license:gpl2+))))