gnu: python-xlsxwriter: Update to 1.3.9.
[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")
cacab685 288 (version "0.7.5")
fad22f09
EF
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
cacab685 297 "1fal7a8y5g0rqqjrk795jh1l50ihz01ppjnrfjrk9vkjbd59szbp"))))
fad22f09
EF
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")
18ffc387 543 (version "0.9.0")
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
18ffc387 552 (base32 "16v08m9irping65d94vb5skp4m6nc63zj6bfajbzhmf944dswmi5"))
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")
9c30f26b 1276 (version "1.9.0")
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
9c30f26b 1285 (base32 "1n0dcv85vqrdr79psnf009hi4r2mvsgsjbghrrc9pm5g7ywwwcvp"))
77549754 1286 (patches
9c30f26b 1287 (search-patches "retroarch-LIBRETRO_DIRECTORY.patch"))))
9af704c5
RH
1288 (build-system gnu-build-system)
1289 (arguments
f21967a4 1290 `(#:tests? #f ; no tests
9af704c5
RH
1291 #:phases
1292 (modify-phases %standard-phases
1293 (replace 'configure
1294 (lambda* (#:key inputs outputs #:allow-other-keys)
1295 (let* ((out (assoc-ref outputs "out"))
1296 (etc (string-append out "/etc"))
12a3abc6
RH
1297 (vulkan (assoc-ref inputs "vulkan-loader"))
1298 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
77549754 1299 ;; Hard-code some store file names.
9af704c5
RH
1300 (substitute* "gfx/common/vulkan_common.c"
1301 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
12a3abc6
RH
1302 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1303 (("/usr/local/share/wayland-protocols")
1304 (string-append wayland-protocols "/share/wayland-protocols")))
9af704c5
RH
1305 (substitute* "qb/qb.libs.sh"
1306 (("/bin/true") (which "true")))
77549754 1307
fade67ab
EF
1308 ;; Use shared zlib.
1309 (substitute* '("libretro-common/file/archive_file_zlib.c"
e85bb00c 1310 "libretro-common/streams/trans_stream_zlib.c")
fade67ab 1311 (("<compat/zlib.h>") "<zlib.h>"))
77549754 1312
9af704c5
RH
1313 ;; The configure script does not yet accept the extra arguments
1314 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
f21967a4
EF
1315 (invoke
1316 "./configure"
1317 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1318 (%current-system)))
1319 '("--enable-neon" "--enable-floathard")
1320 '())
1321 (string-append "--prefix=" out)
9c30f26b
SB
1322 ;; Non-free software are available through the core updater,
1323 ;; disable it. See <https://issues.guix.gnu.org/38360>.
1324 "--disable-update_cores"
73dd0654 1325 "--disable-builtinminiupnpc")))))))
9af704c5
RH
1326 (inputs
1327 `(("alsa-lib" ,alsa-lib)
1328 ("ffmpeg" ,ffmpeg)
1329 ("freetype" ,freetype)
1330 ("libxinerama" ,libxinerama)
1331 ("libxkbcommon" ,libxkbcommon)
1332 ("libxml2" ,libxml2)
45267af1 1333 ("libxrandr" ,libxrandr)
9af704c5
RH
1334 ("libxv" ,libxv)
1335 ("mesa" ,mesa)
73dd0654 1336 ("miniupnpc" ,miniupnpc)
9af704c5
RH
1337 ("openal" ,openal)
1338 ("pulseaudio" ,pulseaudio)
1339 ("python" ,python)
76b7d8fd 1340 ("qtbase" ,qtbase)
9af704c5
RH
1341 ("sdl" ,sdl2)
1342 ("udev" ,eudev)
e6fcf903 1343 ("vulkan-loader" ,vulkan-loader)
c695fb76 1344 ("wayland" ,wayland)
9af704c5
RH
1345 ("zlib" ,zlib)))
1346 (native-inputs
1347 `(("pkg-config" ,pkg-config)
12a3abc6 1348 ("wayland-protocols" ,wayland-protocols)
9af704c5 1349 ("which" ,which)))
9c30f26b
SB
1350 (native-search-paths
1351 (list (search-path-specification
1352 (variable "LIBRETRO_DIRECTORY")
1353 (separator #f) ; single entry
1354 (files '("lib/libretro")))))
9af704c5
RH
1355 (home-page "https://www.libretro.com/")
1356 (synopsis "Reference frontend for the libretro API")
1357 (description
1358 "Libretro is a simple but powerful development interface that allows for
1359the easy creation of emulators, games and multimedia applications that can plug
1360straight into any libretro-compatible frontend. RetroArch is the official
1361reference frontend for the libretro API, currently used by most as a modular
1362multi-system game/emulator system.")
1363 (license license:gpl3+)))
4c40ed9d
NG
1364
1365(define-public scummvm
1366 (package
1367 (name "scummvm")
63d69215 1368 (version "2.2.0")
4c40ed9d
NG
1369 (source
1370 (origin
1371 (method url-fetch)
53cd301b 1372 (uri (string-append "https://downloads.scummvm.org/frs/scummvm/" version
4c40ed9d
NG
1373 "/scummvm-" version ".tar.xz"))
1374 (sha256
63d69215 1375 (base32 "11vknasm5dna2vqr6gk343qynh7nhsq3kf60zayarn1vb5z6as8l"))))
4c40ed9d
NG
1376 (build-system gnu-build-system)
1377 (arguments
6177b14b 1378 `(#:tests? #f ;require "git"
4c40ed9d
NG
1379 #:configure-flags (list "--enable-release") ;for optimizations
1380 #:phases
1381 (modify-phases %standard-phases
1382 (replace 'configure
1383 ;; configure does not work followed by both "SHELL=..." and
1384 ;; "CONFIG_SHELL=..."; set environment variables instead
1385 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1386 (let* ((out (assoc-ref outputs "out"))
1387 (bash (which "bash"))
1388 (flags `(,(string-append "--prefix=" out)
1389 ,@configure-flags)))
1390 (setenv "SHELL" bash)
1391 (setenv "CONFIG_SHELL" bash)
1392 (apply invoke "./configure" flags)))))))
1393 (native-inputs
64e9d128
NG
1394 `(("nasm" ,nasm)
1395 ("pkg-config" ,pkg-config)))
4c40ed9d
NG
1396 (inputs
1397 `(("alsa-lib" ,alsa-lib)
1398 ("faad2" ,faad2)
1399 ("fluidsynth" ,fluidsynth)
1400 ("freetype" ,freetype)
63d69215 1401 ("fribidi" ,fribidi)
6177b14b 1402 ("liba52" ,liba52)
4c40ed9d
NG
1403 ("libflac" ,flac)
1404 ("libjpeg-turbo" ,libjpeg-turbo)
1405 ("libmad" ,libmad)
1406 ("libmpeg2" ,libmpeg2)
1407 ("libogg" ,libogg)
1408 ("libpng" ,libpng)
1409 ("libtheora" ,libtheora)
1410 ("libvorbis" ,libvorbis)
6177b14b 1411 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
4c40ed9d
NG
1412 ("zlib" ,zlib)))
1413 (home-page "https://www.scummvm.org/")
1414 (synopsis "Engine for several graphical adventure games")
1415 (description "ScummVM is a program which allows you to run certain
1416classic graphical point-and-click adventure games, provided you
1417already have their data files. The clever part about this: ScummVM
1418just replaces the executables shipped with the games, allowing you to
1419play them on systems for which they were never designed!")
1420 (license license:gpl2+)))
c8b2fd28 1421
45c58518
CH
1422(define-public libticables2
1423 (package
1424 (name "libticables2")
1425 (version "1.3.5")
1426 (source (origin
1427 (method url-fetch)
1428 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1429 (sha256
1430 (base32
1431 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1432 (build-system gnu-build-system)
1433 (arguments
1434 `(#:configure-flags (list "--enable-libusb10")
1435 #:phases
1436 (modify-phases %standard-phases
1437 (replace 'unpack
1438 (lambda* (#:key source #:allow-other-keys)
1439 (invoke "tar" "xvkf" source)
1440 (invoke "tar" "xvkf"
1441 (string-append "tilibs2/libticables2-"
1442 ,version ".tar.bz2"))
1443 (chdir (string-append "libticables2-" ,version))
1444 #t)))))
1445 (native-inputs
1446 `(("autoconf" ,autoconf)
1447 ("autogen" ,autogen)
1448 ("automake" ,automake)
1449 ("gettext" ,gnu-gettext)
1450 ("libtool" ,libtool)
1451 ("pkg-config" ,pkg-config)))
1452 (inputs
1453 `(("glib" ,glib)
1454 ("libusb" ,libusb)))
1455 (synopsis "Link cable library for TI calculators")
1456 (description
1457 "This package contains libticables, a library for operations on
1458@acronym{TI, Texas Instruments} calculator link cables.
1459
98ff729e
CH
1460This is a part of the TiLP project.")
1461 (home-page "http://lpg.ticalc.org/prj_tilp/")
1462 (license license:gpl2+)))
1463
1464(define-public libticonv
1465 (package
1466 (name "libticonv")
1467 (version "1.1.5")
1468 (source (origin
1469 (method url-fetch)
1470 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1471 (sha256
1472 (base32
1473 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1474 (build-system gnu-build-system)
1475 (arguments
1476 ;; build fails with out --enable-iconv (...?)
1477 `(#:configure-flags (list "--enable-iconv")
1478 #:phases
1479 (modify-phases %standard-phases
1480 (replace 'unpack
1481 (lambda* (#:key source #:allow-other-keys)
1482 (invoke "tar" "xvkf" source)
1483 (invoke "tar" "xvkf"
1484 (string-append "tilibs2/libticonv-"
1485 ,version ".tar.bz2"))
1486 (chdir (string-append "libticonv-" ,version))
1487 #t)))))
1488 (native-inputs
1489 `(("autoconf" ,autoconf)
1490 ("automake" ,automake)
1491 ("libtool" ,libtool)
1492 ("pkg-config" ,pkg-config)))
1493 (inputs
1494 `(("glib" ,glib)))
1495 (synopsis "Character conversion library for TI calculators")
1496 (description
1497 "This package contains libticonv, a library to support working with
1498@acronym{TI, Texas Instruments} calculator charsets.
1499
b823d4ed
CH
1500This is a part of the TiLP project.")
1501 (home-page "http://lpg.ticalc.org/prj_tilp/")
1502 (license license:gpl2+)))
1503
1504(define-public libtifiles2
1505 (package
1506 (name "libtifiles2")
1507 (version "1.1.7")
1508 (source (origin
1509 (method url-fetch)
1510 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1511 (sha256
1512 (base32
1513 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1514 (build-system gnu-build-system)
1515 (arguments
1516 `(#:phases
1517 (modify-phases %standard-phases
1518 (replace 'unpack
1519 (lambda* (#:key source #:allow-other-keys)
1520 (invoke "tar" "xvkf" source)
1521 (invoke "tar" "xvkf"
1522 (string-append "tilibs2/libtifiles2-"
1523 ,version ".tar.bz2"))
1524 (chdir (string-append "libtifiles2-" ,version))
1525 #t)))))
1526 (native-inputs
1527 `(("autoconf" ,autoconf)
1528 ("automake" ,automake)
1529 ("gettext" ,gnu-gettext)
1530 ("libtool" ,libtool)
1531 ("pkg-config" ,pkg-config)))
1532 (inputs
1533 `(("glib" ,glib)
1534 ("libarchive" ,libarchive)
1535 ("libticonv" ,libticonv)))
1536 (synopsis "File functions library for TI calculators")
1537 (description
1538 "This package contains libticonv, a library to support working with
1539@acronym{TI, Texas Instruments} calculator files.
1540
e5bbb466
CH
1541This is a part of the TiLP project.")
1542 (home-page "http://lpg.ticalc.org/prj_tilp/")
1543 (license license:gpl2+)))
1544
1545(define-public libticalcs2
1546 (package
1547 (name "libticalcs2")
1548 (version "1.1.9")
1549 (source (origin
1550 (method url-fetch)
1551 (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
1552 (sha256
1553 (base32
1554 "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
1555 (build-system gnu-build-system)
1556 (arguments
1557 `(#:phases
1558 (modify-phases %standard-phases
1559 (replace 'unpack
1560 (lambda* (#:key source #:allow-other-keys)
1561 (invoke "tar" "xvkf" source)
1562 (invoke "tar" "xvkf"
1563 (string-append "tilibs2/libticalcs2-"
1564 ,version ".tar.bz2"))
1565 (chdir (string-append "libticalcs2-" ,version))
1566 #t)))))
1567 (native-inputs
1568 `(("autoconf" ,autoconf)
1569 ("automake" ,automake)
1570 ("gettext" ,gnu-gettext)
1571 ("libtool" ,libtool)
1572 ("pkg-config" ,pkg-config)))
1573 (inputs
1574 `(("glib" ,glib)
1575 ("libarchive" ,libarchive)
1576 ("libticables2" ,libticables2)
1577 ("libticonv" ,libticonv)
1578 ("libtifiles2" ,libtifiles2)))
1579 (synopsis "Support library for TI calculators")
1580 (description
1581 "This project aims to develop a multi-platform linking program for use
1582with all @acronym{TI, Texas Instruments} graphing calculators (TI73 to
1583V200PLT).
1584
45c58518
CH
1585This is a part of the TiLP project.")
1586 (home-page "http://lpg.ticalc.org/prj_tilp/")
1587 (license license:gpl2+)))
1588
c8b2fd28
NG
1589(define-public mame
1590 (package
1591 (name "mame")
3a638b10 1592 (version "0.230")
c8b2fd28
NG
1593 (source
1594 (origin
1595 (method git-fetch)
1596 (uri (git-reference
b0e7b699 1597 (url "https://github.com/mamedev/mame")
c8b2fd28
NG
1598 (commit (apply string-append "mame" (string-split version #\.)))))
1599 (file-name (git-file-name name version))
1600 (sha256
3a638b10 1601 (base32 "0dk8q2691pycv9mq77h6sdfwjnwdrfwrblf8nwyykrmdawzi56ks"))
c8b2fd28
NG
1602 (modules '((guix build utils)))
1603 (snippet
1604 ;; Remove bundled libraries.
1605 '(begin
1606 (with-directory-excursion "3rdparty"
1607 (for-each delete-file-recursively
1608 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1609 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1610 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1611 #t))))
1612 (build-system gnu-build-system)
1613 (arguments
1614 `(#:make-flags
1615 (cons*
430e1528
NG
1616 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1617 "NOWERROR=1"
c8b2fd28
NG
1618 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1619 (string-append "SDL_INI_PATH="
1620 (assoc-ref %outputs "out")
1621 "/share/mame/ini")
1622 (map (lambda (lib)
1623 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1624 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1625 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1626 #:tests? #f ;no test in regular release
1627 #:phases
1628 (modify-phases %standard-phases
1629 (delete 'configure)
1630 (add-after 'build 'build-documentation
1631 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1632 (replace 'install
1633 ;; Upstream does not provide an installation phase.
1634 (lambda* (#:key outputs #:allow-other-keys)
1635 (let* ((out (assoc-ref outputs "out"))
1636 (share (string-append out "/share/mame")))
1637 ;; Install data.
1638 (for-each (lambda (dir)
1639 (copy-recursively dir (string-append share "/" dir)))
1640 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1641 "plugins" "samples"))
1642 (let ((keymaps (string-append share "/keymaps")))
1643 (for-each (lambda (file) (install-file file keymaps))
1644 (find-files "keymaps" ".*LINUX\\.map")))
1645 (let ((fonts (string-append share "/fonts")))
1646 (install-file "uismall.bdf" fonts))
6921e95a
EF
1647 (when (file-exists? "mame64")
1648 (rename-file "mame64" "mame"))
c8b2fd28
NG
1649 (install-file "mame" (string-append out "/bin")))
1650 #t))
1651 (add-after 'install 'install-documentation
1652 (lambda* (#:key outputs #:allow-other-keys)
1653 (let* ((out (assoc-ref outputs "out"))
1654 (man (string-append out "/share/man/man1"))
1655 (info (string-append out "/share/info")))
1656 (install-file "docs/build/man/MAME.1" man)
1657 (install-file "docs/build/texinfo/MAME.info" info))
1658 #t))
1659 (add-after 'install 'install-ini-file
1660 ;; Generate an ini file so as to set some directories (e.g., roms)
1661 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1662 ;;
1663 ;; XXX: We need to insert absolute references to the store. It can
1664 ;; be an issue if they leak into user's home directory, e.g., with
1665 ;; "mame -createconfig" and the package is later GC'ed.
1666 (lambda* (#:key outputs #:allow-other-keys)
1667 (let* ((out (assoc-ref outputs "out"))
1668 (share (string-append out "/share/mame"))
1669 (ini (string-append share "/ini")))
1670 (with-output-to-file (string-append ini "/mame.ini")
1671 (lambda _
1672 (format #t
1673 "inipath $HOME/.mame;~a/ini~@
1674 homepath $HOME/mame~@
1675 rompath $HOME/mame/roms~@
1676 samplepath $HOME/mame/samples;~a/samples~@
1677 cheatpath $HOME/mame/cheat~@
1678 artpath $HOME/mame/artwork;~a/artwork~@
1679 crosshairpath $HOME/mame/crosshair~@
1680 snapshot_directory $HOME/mame/snapshots~@
1681 hashpath ~a/hash~@
1682 fontpath $HOME/mame/fonts;~a/fonts~@
1683 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1684 bgfx_path ~a/bgfx~@
1685 pluginspath $HOME/mame/plugins;~a/plugins~@
1686 languagepath ~a/language~@
1687 cfg_directory $HOME/.mame/cfg~@
1688 nvram_directory $HOME/.mame/nvram~@
1689 input_directory $HOME/.mame/inp~@
1690 state_directory $HOME/.mame/sta~@
1691 diff_directory $HOME/.mame/diff~@
1692 comment_directory $HOME/.mame/comments~%"
1693 share share share share share share share share
1694 share)))
1695 (with-output-to-file (string-append ini "/ui.ini")
1696 (lambda _
1697 (format #t
1698 "historypath $HOME/mame/history~@
1699 categorypath $HOME/mame/folders~@
1700 cabinets_directory $HOME/mame/cabinets~@
1701 cpanels_directory $HOME/mame/cpanel~@
1702 pcbs_directory $HOME/mame/pcb~@
1703 flyers_directory $HOME/mame/flyers~@
1704 titles_directory $HOME/mame/titles~@
1705 ends_directory $HOME/mame/ends~@
1706 marquees_directory $HOME/mame/marquees~@
1707 artwork_preview_directory $HOME/mame/artpreview~@
1708 bosses_directory $HOME/mame/bosses~@
1709 logos_directory $HOME/mame/logo~@
1710 scores_directory $HOME/mame/scores~@
1711 versus_directory $HOME/mame/versus~@
1712 gameover_directory $HOME/mame/gameover~@
1713 howto_directory $HOME/mame/howto~@
1714 select_directory $HOME/mame/select~@
1715 icons_directory $HOME/mame/icons~@
1716 covers_directory $HOME/mame/covers~@
1717 ui_path $HOME/.mame/ui~%")))
1718 #t)))
1719 (add-after 'install 'install-desktop-file
1720 (lambda* (#:key outputs #:allow-other-keys)
1721 (let* ((out (assoc-ref outputs "out"))
1722 (desktop (string-append out "/share/applications"))
1723 (executable (string-append out "/bin/mame")))
1724 (mkdir-p desktop)
1725 (with-output-to-file (string-append desktop "/mame.desktop")
1726 (lambda _
1727 (format #t
1728 "[Desktop Entry]~@
1729 Name=mame~@
1730 Comment=Multi-purpose emulation framework~@
1731 Exec=~a~@
1732 TryExec=~@*~a~@
1733 Terminal=false~@
1734 Type=Application~@
1735 Categories=Game;Emulator;~@
1736 Keywords=Game;Emulator;Arcade;~%"
1737 executable)))
1738 #t))))))
1739 (native-inputs
1740 `(("pkg-config" ,pkg-config)
03370346
NG
1741 ("sphinx" ,python-sphinx)
1742 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
c8b2fd28
NG
1743 ("texinfo" ,texinfo)))
1744 (inputs
1745 `(("alsa-lib" ,alsa-lib)
566408da 1746 ("asio" ,asio-1.12) ;the bundled copy is at 1.11
c8b2fd28
NG
1747 ("expat" ,expat)
1748 ("flac" ,flac)
1749 ("fontconfig" ,fontconfig)
1750 ("glm" ,glm)
7b24b76b 1751 ("libjpeg" ,libjpeg-turbo)
9f0650df 1752 ("libxi" ,libxi)
c8b2fd28
NG
1753 ("libxinerama" ,libxinerama)
1754 ("lua" ,lua)
1755 ("portaudio" ,portaudio)
1756 ("portmidi" ,portmidi)
63247277 1757 ("pugixml" ,pugixml)
c8b2fd28
NG
1758 ("python-wrapper" ,python-wrapper)
1759 ("qtbase" ,qtbase)
1760 ("rapidjson" ,rapidjson)
1761 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1762 ("sqlite" ,sqlite)
1763 ("utf8proc" ,utf8proc)
1764 ("zlib" ,zlib)))
cf580e5e 1765 (home-page "https://www.mamedev.org")
c8b2fd28
NG
1766 (synopsis "Multi-purpose emulation framework")
1767 (description "MAME's purpose is to preserve decades of software
1768history. As electronic technology continues to rush forward, MAME
1769prevents this important @emph{vintage} software from being lost and
1770forgotten. This is achieved by documenting the hardware and how it
1771functions. The source code to MAME serves as this documentation.")
1772 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1773 ;; However, over 90% of the files are under Expat license. Also, artwork,
1774 ;; keymaps, languages and samples are under CC0.
1775 (license (list license:gpl2+ license:expat license:cc0))))
1403e1f7 1776
08d34100
PN
1777(define-public gnome-arcade
1778 (package
1779 (name "gnome-arcade")
1780 (version "0.218.2")
1781 (source
1782 (origin
1783 (method git-fetch)
1784 (uri (git-reference
1785 (url "https://github.com/strippato/gnome-arcade")
1786 (commit (string-append "v." version))))
1787 (file-name (git-file-name name version))
1788 (sha256
1789 (base32
1790 "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
1791 (build-system cmake-build-system)
1792 (arguments
1793 `(#:tests? #f ; No tests.
1794 #:configure-flags (list
1795 (string-append "-DMAME_BIN=\""
1796 (assoc-ref %build-inputs "mame")
1797 "/bin/mame\"")
1798 (string-append "-DAPP_RES=\""
1799 (assoc-ref %outputs "out")
1800 "/share/gnome-arcade/\""))
1801 #:phases
1802 (modify-phases %standard-phases
1803 (add-before 'build 'fix-paths
1804 (lambda* (#:key outputs #:allow-other-keys)
1805 (let ((out (assoc-ref outputs "out")))
1806 (pk 'cwd (getcwd))
1807 (substitute* "../source/src/config.c"
1808 (("/usr/share") (string-append out "/share"))))
1809 #t))
1810 (replace 'install
1811 (lambda* (#:key outputs #:allow-other-keys)
1812 (let* ((out (assoc-ref outputs "out"))
1813 (bin (string-append out "/bin"))
1814 (rom (string-append out "/share/gnome-arcade/data/rom"))
1815 (tile (string-append out "/share/gnome-arcade/data/tile")))
1816 (mkdir-p bin)
1817 (install-file "../gnome-arcade" bin)
1818 (copy-recursively "../source/res"
1819 (string-append out "/share/gnome-arcade/res"))
1820 (mkdir-p rom)
1821 (install-file "../source/data/rom/ROM.TXT" rom)
1822 (mkdir-p tile)
1823 (install-file "../source/data/tile/TILE.TXT" tile))
1824 #t)))))
1825 (native-inputs
1826 `(("pkg-config" ,pkg-config)))
1827 (inputs
1828 `(("mame" ,mame)
1829 ("gtk" ,gtk+)
1830 ("libevdev" ,libevdev)
1831 ("libvlc" ,vlc)
1832 ("libarchive" ,libarchive)))
1833 (home-page "https://github.com/strippato/gnome-arcade")
1834 (synopsis "Minimal MAME frontend")
1835 (description
1836 "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
1837emulator.")
1838 (license license:gpl3+)))
1839
1403e1f7
PN
1840(define-public pcsxr
1841 ;; No release since 2017.
1842 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1843 (package
1844 (name "pcsxr")
1845 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1846 (version "1.9.95")
1847 (source
1848 (origin
1849 (method git-fetch)
1850 (uri (git-reference
1851 (url "https://github.com/pcsxr/PCSX-Reloaded")
1852 (commit commit)))
1853 (sha256
1854 (base32
1855 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1856 (file-name (git-file-name name commit))))
1857 (build-system cmake-build-system)
1858 (arguments
1859 `(#:tests? #f ;no "test" target
1860 #:configure-flags
1861 (list "-DSND_BACKEND=pulse"
1862 "-DENABLE_CCDDA='ON'"
1863 "-DUSE_LIBARCHIVE='ON'"
1864 "-DUSE_LIBCDIO='ON'")
1865 #:phases
1866 (modify-phases %standard-phases
1867 (add-after 'unpack 'cd-subdir
1ef71f52 1868 (lambda _ (chdir "pcsxr") #t))
1403e1f7
PN
1869 (add-before 'configure 'fix-cdio-lookup
1870 (lambda* (#:key inputs #:allow-other-keys)
1871 (substitute* "cmake/FindCdio.cmake"
1872 (("/usr/include/cdio")
1ef71f52
KK
1873 (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
1874 #t))
1875 (add-after 'install 'wrap-program
1876 (lambda* (#:key inputs outputs #:allow-other-keys)
1877 (wrap-program (string-append (assoc-ref outputs "out")
1878 "/bin/pcsxr")
1879 ;; For GtkFileChooserDialog.
1880 `("GSETTINGS_SCHEMA_DIR" =
1881 (,(string-append (assoc-ref inputs "gtk+")
1882 "/share/glib-2.0/schemas"))))
1883 #t)))))
1403e1f7
PN
1884 (native-inputs
1885 `(("pkg-config" ,pkg-config)
1886 ("intltool" ,intltool)
1887 ("glib" ,glib "bin")))
1888 (inputs
1889 `(("libcdio" ,libcdio)
1890 ("sdl2" ,sdl2)
1891 ("gtk+" ,gtk+)
1892 ("ffmpeg" ,ffmpeg)
1893 ("libxv" ,libxv)
1894 ("libarchive" ,libarchive)
1895 ("pulseaudio" ,pulseaudio)))
1896 (home-page "https://archive.codeplex.com/?p=pcsxr")
1897 (synopsis "PlayStation emulator")
1898 (description
1899 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1900improvements.")
1901 (license license:gpl2+))))
f6a0be2f
DW
1902
1903(define-public gens-gs
1904 (package
1905 (name "gens-gs")
1906 (version "7")
1907 (source
1908 (origin
1909 (method url-fetch)
1910 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1911 version ".tar.gz"))
1912 (sha256
1913 (base32
1914 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1915 (build-system glib-or-gtk-build-system)
1916 (arguments
1917 `(#:system "i686-linux"
1918 #:phases
1919 (modify-phases %standard-phases
1920 (add-after 'unpack 'fix-CFLAGS
1921 (lambda* _
1922 ;; Remove GTK API deprecation flags that cause build errors.
1923 (substitute* "configure"
1924 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1925 #t)))))
1926 (native-inputs
1927 `(("pkg-config" ,pkg-config)
1928 ("nasm" ,nasm)))
1929 (inputs
1930 `(("sdl" ,sdl)
1931 ("gtk" ,gtk+-2)))
1932 (home-page "https://segaretro.org/Gens/GS")
1933 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1934 (description
1935 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1936derived from Gens. Project goals include clean source code, combined features
1937from various forks of Gens, and improved platform portability.")
1938 (supported-systems '("i686-linux" "x86_64-linux"))
1939 (license license:gpl2+)))
391aff1f
PN
1940
1941(define-public bsnes
1942 (package
1943 (name "bsnes")
1944 (version "115")
1945 (source
1946 (origin
1947 (method git-fetch)
1948 (uri (git-reference
1949 (url "https://github.com/bsnes-emu/bsnes")
1950 (commit (string-append "v" version))))
1951 (file-name (git-file-name name version))
1952 (sha256
1953 (base32
1954 "0j054x38fwai61vj36sc04r3zkzay5acq2cgd9zqv5hs51s36g5b"))))
1955 (build-system gnu-build-system)
1956 (arguments
1957 `(#:make-flags (list "-C" "bsnes"
1958 (string-append "prefix=" (assoc-ref %outputs "out")))
1959 #:tests? #f ; No tests.
1960 #:phases (modify-phases %standard-phases
1961 (delete 'configure))))
1962 (native-inputs
1963 `(("pkg-config" ,pkg-config)))
1964 (inputs
1965 `(("alsa-lib" ,alsa-lib)
1966 ("ao" ,ao)
1967 ("cairo" ,cairo)
1968 ("eudev" ,eudev)
391aff1f 1969 ("gtksourceview-2" ,gtksourceview-2)
391aff1f
PN
1970 ("libxrandr" ,libxrandr)
1971 ("libxv" ,libxv)
1972 ("openal" ,openal)
1973 ("pulseaudio" ,pulseaudio)
1974 ("sdl2" ,sdl2)))
1975 (home-page "https://bsnes.dev/")
1976 (synopsis "Emulator for the Super Nintendo / Super Famicom systems")
1977 (description
1978 "bsnes is a Super Nintendo / Super Famicom emulator that focuses on
1979performance, features, and ease of use.")
1980 (license license:gpl3)))
f43e4104
JK
1981
1982;; python-pwntools requires a -rc release of unicorn
1983(define-public unicorn
1984 (let ((unless-x86
1985 (lambda (code)
1986 (if (member (%current-system) '("x86_64-linux" "i686-linux"))
1987 '()
1988 code))))
1989 (package
1990 (name "unicorn")
1991 (version "1.0.2-rc4")
1992 ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
1993 (source
1994 (origin
1995 (method git-fetch)
1996 (uri (git-reference
1997 (url "https://github.com/unicorn-engine/unicorn")
1998 (commit version)))
1999 (file-name (git-file-name name version))
2000 (sha256
2001 (base32
2002 "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy"))))
2003 (outputs '("out" "python"))
2004 ;; The main library is not written in Python, but the build process has
2005 ;; little in common with any defined build system, so we might as well
2006 ;; build on top of python-build-system and make use of all
2007 ;; the Python-specific phases that can be reused.
2008 (build-system python-build-system)
2009 (arguments
2010 `(#:modules ((srfi srfi-26)
2011 (guix build python-build-system)
2012 (guix build utils))
2013 #:phases
2014 (modify-phases %standard-phases
2015 (add-after 'unpack 'install-bindings-to-python-output
2016 (lambda* (#:key outputs #:allow-other-keys)
2017 ;; python-build-system will build the bindings and install them to
2018 ;; the "out" output, so change the build-internal names of the
2019 ;; outputs.
2020 ;;
2021 ;; TODO: remove this once #40469 lands, through the core-updates
2022 ;; holding zone, on master.
2023 (set-car! (assoc "out" outputs) "lib")
2024 (set-car! (assoc "python" outputs) "out")
2025 #t))
2026 (add-before 'build 'build-library
2027 (lambda* (#:key inputs #:allow-other-keys)
2028 (invoke "make"
2029 "-j" (number->string (parallel-job-count))
2030 "UNICORN_STATIC=no"
2031 "CC=gcc")))
2032 (add-after 'build-library 'install-library
2033 (lambda* (#:key outputs #:allow-other-keys)
2034 (invoke "make" "install"
2035 "UNICORN_STATIC=no"
2036 (string-append
2037 "PREFIX="
2038 (assoc-ref outputs "lib")))))
2039 (add-before 'build 'prepare-bindings
2040 (lambda* (#:key outputs #:allow-other-keys)
2041 (chdir "bindings/python")
2042 ;; Set this environment variable so that the Python bindings
2043 ;; don't build their own copy of the shared object, but use
2044 ;; a dummy value such that the bindings test suite uses the
2045 ;; same mechanism for loading the library as any other user.
2046 (setenv "LIBUNICORN_PATH" "1")
2047 (substitute* "unicorn/unicorn.py"
2048 (("_path_list = \\[.*")
2049 (string-append
2050 "_path_list = [\""
2051 (assoc-ref outputs "lib")
2052 ;; eat the rest of the list
2053 "/lib\"] + 0*[")))
2054 #t))
2055 (add-before 'check 'check-library
2056 (lambda* (#:key outputs #:allow-other-keys)
2057 (for-each
2058 (lambda (suite)
2059 (with-directory-excursion
2060 (string-append "../../tests/" suite)
2061 (invoke "make" "test" "CC=gcc"
2062 ,@(unless-x86
2063 '("AS=i686-unknown-linux-gnu-as"
2064 "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
2065 '("unit" "regress"))
2066 #t))
2067 (add-after 'install 'install-samples
2068 (lambda* (#:key outputs #:allow-other-keys)
2069 (let* ((python-samples (find-files "." "sample_.*"))
2070 (c-samples (find-files "../../samples" ".*\\.c"))
2071 (python-docdir
2072 (string-append (assoc-ref outputs "out")
2073 "/share/doc/unicorn/samples"))
2074 (c-docdir
2075 (string-append (assoc-ref outputs "lib")
2076 "/share/doc/unicorn/samples")))
2077 (for-each (cut install-file <> c-docdir) c-samples)
2078 (for-each (cut install-file <> python-docdir) python-samples)
2079 #t))))))
2080 (native-inputs
2081 ;; NOTE: cross-binutils needs to be wrapped with unless-x86, as otherwise
2082 ;; the linker provided by the package will be used, circumventing the ld-wrapper.
2083 `(,@(unless-x86
2084 `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
2085 ("cmocka" ,cmocka)
2086 ("hexdump-for-tests" ,util-linux)))
fed13678 2087 (home-page "https://www.unicorn-engine.org")
f43e4104
JK
2088 (synopsis "Unicorn CPU emulator framework")
2089 (description
2090 "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
2091framework based on QEMU.")
2092 (license license:gpl2+))))
10543ef8
LP
2093
2094(define-public ppsspp
2095 (package
2096 (name "ppsspp")
4c6fa851 2097 (version "1.11.3")
10543ef8
LP
2098 (source
2099 (origin
2100 (method git-fetch)
2101 (uri (git-reference
b0e7b699 2102 (url "https://github.com/hrydgard/ppsspp")
10543ef8
LP
2103 (commit (string-append "v" version))))
2104 (sha256
4c6fa851 2105 (base32 "1dpxnwvl6jq7z67lbjws4lqc1bxc31xi6ddlmg5n3aig008yi2fp"))
10543ef8
LP
2106 (file-name (git-file-name name version))
2107 (patches
2108 (search-patches "ppsspp-disable-upgrade-and-gold.patch"))
2109 (modules '((guix build utils)))
2110 (snippet
2111 `(begin
bb3ddda2
LP
2112 ;; The following is quite a heavy-handed way of unbundling PPSSPP.
2113 ;; There are still a number of external sources, that we don't
2114 ;; remove here. Some may be packaged, others are not.
2115 ;; First, we patch existing sources to include the right headers.
a3084e1e 2116 (substitute* (append (find-files "Common" ".*\\.(h|cpp)")
bb3ddda2
LP
2117 (find-files "Core" ".*\\.(h|cpp)")
2118 (find-files "GPU" ".*\\.(h|cpp)")
2119 (find-files "SDL" ".*\\.(h|cpp)")
2120 (find-files "UI" ".*\\.(h|cpp)"))
2121 ;; These headers are all hard-coded in the original source.
2122 (("ext/cityhash/") "")
a3084e1e
LP
2123 (("ext/glslang/glslang/") "glslang/")
2124 (("ext/glslang/") "glslang/")
2125 (("ext/miniupnp/") "")
bb3ddda2
LP
2126 (("ext/SPIRV-Cross/") "spirv_cross/")
2127 (("ext/vulkan/") "vulkan/")
2128 (("ext/xxhash.h") "xxhash.h")
2129 ;; These definitions do not actually exist in the Vulkan headers,
2130 ;; but PPSSPP defines them in ext/vulkan.
2131 (("VK_FORMAT_BEGIN_RANGE") "VK_FORMAT_UNDEFINED")
2132 (("VK_FORMAT_END_RANGE") "VK_FORMAT_ASTC_12x12_SRGB_BLOCK"))
2133 ;; Next, we patch CMakeLists.
10543ef8 2134 (substitute* "CMakeLists.txt"
bb3ddda2 2135 ;; Drop unnecessary includes and targets.
10543ef8 2136 (("include_directories\\(ext/glslang\\)") "")
bb3ddda2
LP
2137 (("include_directories\\(ext/xxhash\\)") "")
2138 (("include_directories\\(ext/cityhash\\)") "")
2139 (("set_target_properties\\(cityhash .*\\)") "")
2140 ;; Fix linking to GLEW.
2141 (("TARGET Ext::GLEW") "true")
2142 (("target_link_libraries\\(native Ext::GLEW\\)")
2143 "find_package(GLEW)\ntarget_link_libraries(native GLEW::GLEW)")
2144 (("Ext::Snappy") "snappy")
2145 ;; Don't search for cityhash/xxhash, we already have them.
2146 (("add_library\\((city|xx)hash STATIC") "if()\nendif(")
2147 (("ext/xxhash\\.[ch]") "")
a3084e1e
LP
2148 (("ext/cityhash/.*\\.(cpp|h)") "")
2149 (("if\\(USE_MINIUPNPC\\)" all)
2150 (string-append all "
2151find_package(miniupnpc)
2152target_link_libraries(${CoreLibName} miniupnpc ${LDLIBS})
2153elseif(FALSE)"))
bb3ddda2 2154 ;; Link all of spirv-cross.
10543ef8
LP
2155 (("spirv-cross-glsl" all)
2156 (string-append all
2157 " spirv-cross-core spirv-cross-cpp"
2158 " spirv-cross-reflect spirv-cross-util")))
2159 (substitute* "ext/CMakeLists.txt"
bb3ddda2 2160 (("add_subdirectory\\(glew\\)") "")
e7cacc91 2161 (("add_subdirectory\\(glslang( [A-Z_]*)*\\)") "")
bb3ddda2 2162 (("add_subdirectory\\(snappy\\)") "")
10543ef8 2163 (("add_subdirectory\\(SPIRV-Cross-build\\)") ""))
bb3ddda2
LP
2164 ;; Finally, we can delete the bundled sources.
2165 (for-each delete-file-recursively
a3084e1e
LP
2166 '("MoltenVK"
2167 "ext/cmake"
bb3ddda2
LP
2168 "ext/glew"
2169 "ext/glslang" "ext/glslang-build"
a3084e1e
LP
2170 "ext/miniupnp" "ext/miniupnp-build"
2171 "ext/native"
bb3ddda2
LP
2172 "ext/snappy"
2173 "ext/SPIRV-Cross" "ext/SPIRV-Cross-build"
2174 "ext/vulkan"
2175 "ext/xxhash.c"
2176 "ext/xxhash.h"
2177 "ext/zlib"))
2178 ;; Since we are not including git as an input, PPSSPP is confused
2179 ;; about its version. Let's fix that here.
10543ef8
LP
2180 (substitute* "git-version.cmake"
2181 (("unknown") ,version))))))
2182 (build-system cmake-build-system)
2183 (native-inputs
2184 `(("pkg-config" ,pkg-config)
2185 ("python" ,python)))
2186 (inputs
bb3ddda2
LP
2187 `(("cityhash" ,cityhash)
2188 ("ffmpeg" ,ffmpeg)
10543ef8
LP
2189 ("glew" ,glew)
2190 ("glslang" ,glslang)
2191 ("libpng" ,libpng)
bb3ddda2 2192 ("libzip" ,libzip)
10543ef8 2193 ("mesa" ,mesa)
a3084e1e 2194 ("miniupnpc" ,miniupnpc)
10543ef8
LP
2195 ("sdl2" ,sdl2)
2196 ("snappy" ,snappy)
2197 ("spirv-cross" ,spirv-cross)
bb3ddda2
LP
2198 ("vulkan-headers" ,vulkan-headers)
2199 ("vulkan-loader" ,vulkan-loader)
2200 ("xxhash" ,xxhash)
10543ef8 2201 ("zlib" ,zlib)
bb3ddda2 2202 ;; TODO: unbundle armips.
10543ef8
LP
2203 ("armips-source" ,(package-source armips))
2204 ("lang"
a3084e1e 2205 ,(let ((commit "6bd5b4bc983917ea8402f73c726b46e36f3de0b4"))
c4659802
TGR
2206 (origin
2207 (method git-fetch)
2208 (uri (git-reference
2209 (url "https://github.com/hrydgard/ppsspp-lang")
2210 (commit commit)))
2211 (sha256
a3084e1e 2212 (base32 "08npr3a4xskf85gnlxidl4ksc3rhc7m5rgnj7vsbjvhvw5ap02qx"))
c4659802 2213 (file-name (git-file-name "ppsspp-lang" commit)))))
10543ef8 2214 ("tests"
a3084e1e 2215 ,(let ((commit "1047400eaec6bcbdb2a64d326375ef6a6617c4ac"))
c4659802
TGR
2216 (origin
2217 (method git-fetch)
2218 (uri (git-reference
2219 (url "https://github.com/hrydgard/pspautotests")
2220 (commit commit)))
2221 (sha256
a3084e1e 2222 (base32 "0nxv1lskcr8zbg6nrfai21mxsw0n5vaqhbsa41c3cxfyx5c4w2pg"))
c4659802 2223 (file-name (git-file-name "pspautotests" commit)))))))
10543ef8
LP
2224 (arguments
2225 `(#:out-of-source? #f
2226 #:configure-flags (list "-DUSE_DISCORD=OFF"
2227 "-DUSE_SYSTEM_FFMPEG=ON"
bb3ddda2
LP
2228 "-DUSE_SYSTEM_LIBZIP=ON"
2229 ;; for testing
10543ef8
LP
2230 "-DUNITTEST=ON" "-DHEADLESS=ON")
2231 #:phases
2232 (modify-phases %standard-phases
2233 (add-after 'unpack 'add-external-sources
2234 (lambda* (#:key inputs #:allow-other-keys)
bb3ddda2 2235 ;; TODO: unbundle armips.
10543ef8
LP
2236 (copy-recursively (assoc-ref inputs "armips-source")
2237 "ext/armips")
2238 ;; Some tests are externalised, so we add them here.
2239 (copy-recursively (assoc-ref inputs "tests")
2240 "pspautotests")
2241 ;; i18n is externalised, so we add it here.
2242 (copy-recursively (assoc-ref inputs "lang")
2243 "assets/lang")
2244 #t))
a3084e1e
LP
2245 (add-after 'unpack 'fix-unittest-build
2246 (lambda _
2247 (substitute* "CMakeLists.txt"
2248 (("unittest/TestVertexJit.cpp" all)
2249 (string-append all " unittest/TestShaderGenerators.cpp")))
2250 (substitute* "unittest/TestVertexJit.cpp"
2251 (("#include \"unittest/UnitTest.h\"" all)
2252 (string-append all "\n#include <cmath>")))
2253 #t))
10543ef8
LP
2254 (replace 'check
2255 (lambda _
2256 (for-each
2257 (lambda (t) (invoke "./unitTest" t))
2258 '("Arm64Emitter" "ArmEmitter" "X64Emitter" "VertexJit" "Asin"
a3084e1e
LP
2259 "SinCos" #|"VFPUSinCos" SIGSEGV|# "MathUtil" "Parsers" "Jit"
2260 "MatrixTranspose" "ParseLBN" "QuickTexHash" "CLZ"
2261 #|"ShaderGenerators"|#))
10543ef8
LP
2262 (invoke "python3" "test.py" "-g")
2263 #t))
2264 (replace 'install
2265 (lambda* (#:key inputs outputs #:allow-other-keys)
2266 (let* ((out (assoc-ref outputs "out"))
2267 (bin/ppsspp (string-append out "/bin/ppsspp"))
2268 (share (string-append out "/share/ppsspp")))
2269 (copy-recursively "icons/hicolor"
2270 (string-append out "/share/icons/hicolor"))
2271 (install-file "PPSSPPSDL" share)
2272 (copy-recursively "assets" (string-append share "/assets"))
2273
2274 (make-desktop-entry-file
2275 (string-append out "/share/applications/ppsspp.desktop")
2276 #:name "PPSSPP"
2277 #:exec (string-append share "/PPSSPPSDL")
2278 #:icon "ppsspp")
2279 (mkdir-p (string-append out "/bin"))
2280 (with-output-to-file bin/ppsspp
2281 (lambda ()
2282 (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\""
2283 (which "sh") share)))
2284 (chmod bin/ppsspp #o755)
2285 #t))))))
2286 (home-page "https://www.ppsspp.org/")
2287 (synopsis "PSP emulator")
2288 (description
2289 "PPSSPP is a ``high-level'' emulator simulating the PSP operating
2290system.")
2291 (license license:gpl2+)))