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