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