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