gnu: sicp: Remove unused module import.
[jackhill/guix/guix.git] / gnu / packages / emulators.scm
CommitLineData
e5f9ec8b 1;;; GNU Guix --- Functional package management for GNU
9af704c5
RH
2;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
4;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
5;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6;;; Copyright © 2015, 2018 David Thompson <dthompson2@worcester.edu>
7;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
e89bfc2d 8;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
d63e0ee7 9;;; Copyright © 2017, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
2d4b2488 10;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
478040d4 11;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
1403e1f7 12;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
f6a0be2f 13;;; Copyright © 2019 David Wilson <david@daviwil.com>
c9e7acbf 14;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
e5f9ec8b
RH
15;;;
16;;; This file is part of GNU Guix.
17;;;
18;;; GNU Guix is free software; you can redistribute it and/or modify it
19;;; under the terms of the GNU General Public License as published by
20;;; the Free Software Foundation; either version 3 of the License, or (at
21;;; your option) any later version.
22;;;
23;;; GNU Guix is distributed in the hope that it will be useful, but
24;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26;;; GNU General Public License for more details.
27;;;
28;;; You should have received a copy of the GNU General Public License
29;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30
31(define-module (gnu packages emulators)
1403e1f7 32 #:use-module (ice-9 match)
e5f9ec8b
RH
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
9af704c5 35 #:use-module (guix download)
e5f9ec8b 36 #:use-module (guix git-download)
9af704c5
RH
37 #:use-module (guix svn-download)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages algebra)
4c40ed9d 40 #:use-module (gnu packages assembly)
e5f9ec8b 41 #:use-module (gnu packages audio)
9af704c5
RH
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages backup)
1403e1f7 46 #:use-module (gnu packages cdrom)
e5f9ec8b
RH
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages curl)
e8ffa382 49 #:use-module (gnu packages elf)
e5f9ec8b
RH
50 #:use-module (gnu packages fonts)
51 #:use-module (gnu packages fontutils)
9af704c5 52 #:use-module (gnu packages freedesktop)
e5f9ec8b 53 #:use-module (gnu packages game-development)
cbf58afa 54 #:use-module (gnu packages gcc)
e5f9ec8b
RH
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages image)
9af704c5
RH
60 #:use-module (gnu packages imagemagick)
61 #:use-module (gnu packages libedit)
e5f9ec8b
RH
62 #:use-module (gnu packages libusb)
63 #:use-module (gnu packages linux)
c8b2fd28
NG
64 #:use-module (gnu packages lua)
65 #:use-module (gnu packages maths)
4c40ed9d 66 #:use-module (gnu packages mp3)
c8b2fd28 67 #:use-module (gnu packages music)
9af704c5 68 #:use-module (gnu packages ncurses)
c8b2fd28 69 #:use-module (gnu packages networking)
e5f9ec8b
RH
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages pulseaudio)
9af704c5 72 #:use-module (gnu packages python)
e5f9ec8b
RH
73 #:use-module (gnu packages qt)
74 #:use-module (gnu packages sdl)
9d0c291e 75 #:use-module (gnu packages sphinx)
cd0322a3 76 #:use-module (gnu packages sqlite)
c8b2fd28
NG
77 #:use-module (gnu packages texinfo)
78 #:use-module (gnu packages textutils)
e5f9ec8b
RH
79 #:use-module (gnu packages tls)
80 #:use-module (gnu packages upnp)
81 #:use-module (gnu packages video)
9af704c5 82 #:use-module (gnu packages vulkan)
e5f9ec8b 83 #:use-module (gnu packages wxwidgets)
9af704c5 84 #:use-module (gnu packages xdisorg)
e5f9ec8b 85 #:use-module (gnu packages xiph)
9af704c5 86 #:use-module (gnu packages xml)
e5f9ec8b 87 #:use-module (gnu packages xorg)
c8b2fd28 88 #:use-module (gnu packages web)
9af704c5 89 #:use-module (guix build-system cmake)
f6a0be2f 90 #:use-module (guix build-system glib-or-gtk)
9af704c5
RH
91 #:use-module (guix build-system gnu))
92
93(define-public desmume
94 (package
95 (name "desmume")
96 (version "0.9.11")
97 (source
98 (origin
99 (method url-fetch)
100 (uri (string-append
101 "mirror://sourceforge/desmume/desmume/"
102 version "/desmume-" version ".tar.gz"))
103 (sha256
104 (base32
105 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))))
106 (build-system gnu-build-system)
107 (arguments
108 ;; Enable support for WiFi and microphone.
109 `(#:configure-flags '("--enable-wifi"
110 "--enable-openal")))
111 (native-inputs
112 `(("pkg-config" ,pkg-config)
113 ("intltool" ,intltool)))
114 (inputs
115 `(("zlib" ,zlib)
116 ("sdl" ,sdl)
117 ("glib" ,glib)
118 ("gtk+" ,gtk+-2)
119 ("glu" ,glu)))
120 (home-page "http://desmume.org/")
121 (synopsis "Nintendo DS emulator")
122 (description
123 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
124 (license license:gpl2)))
e5f9ec8b
RH
125
126;; Building from recent Git because the official 5.0 release no longer builds.
127(define-public dolphin-emu
2b332c51
RH
128 (let ((commit "a9745400ec5cea7e55d94955afbdc44d1a4982d1")
129 (revision "7"))
e5f9ec8b
RH
130 (package
131 (name "dolphin-emu")
132 (version (git-version "5.0" revision commit))
133 (source
134 (origin
135 (method git-fetch)
136 (uri (git-reference
137 (url "https://github.com/dolphin-emu/dolphin.git")
138 (commit commit)))
139 (file-name (git-file-name name version))
85280804
EF
140 (modules '((guix build utils)))
141 (snippet
142 '(begin
143 ;; Remove external stuff we don't need.
144 (for-each (lambda (dir)
145 (delete-file-recursively
146 (string-append "Externals/" dir)))
fab8d41c 147 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
85280804 148 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
2b332c51 149 "miniupnpc" "MoltenVK" "zlib"))
85280804
EF
150 ;; Clean up source.
151 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
152 #t))
e5f9ec8b
RH
153 (sha256
154 (base32
2b332c51 155 "0ic08ii4vlqlmk2wkfc99jiy6nji2wfq56r7slj23wgvhznnaabk"))))
e5f9ec8b
RH
156 (build-system cmake-build-system)
157 (arguments
158 '(#:tests? #f
e5f9ec8b
RH
159 #:phases
160 (modify-phases %standard-phases
6bebad77 161 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
e5f9ec8b
RH
162 (lambda* (#:key inputs outputs #:allow-other-keys)
163 (let ((fontfile
164 (string-append (assoc-ref inputs "font-wqy-microhei")
6bebad77
RH
165 "/share/fonts/truetype/wqy-microhei.ttc"))
166 (libvulkan
e6fcf903 167 (string-append (assoc-ref inputs "vulkan-loader")
6bebad77 168 "/lib/libvulkan.so")))
e5f9ec8b 169 (chdir "docs")
0fe041bd 170 (invoke "bash" "-c" "g++ -O2 $(freetype-config \
e5f9ec8b
RH
171--cflags --libs) gc-font-tool.cpp -o gc-font-tool")
172 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
173 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
174 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
175 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
176 (chdir "..")
6bebad77 177 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
2b332c51
RH
178 (("\"vulkan\", 1") (string-append "\"vulkan\"")))
179 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
180 (("\"vulkan\"") (string-append "\"" libvulkan "\"")))
181 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
182 (("Common::DynamicLibrary::GetVersionedFilename") ""))
e5f9ec8b
RH
183 #t))))
184
fab8d41c
RH
185 ;; The FindGTK2 cmake script only checks hardcoded directories for
186 ;; glib/gtk headers.
187
e5f9ec8b 188 #:configure-flags
fab8d41c 189 (list (string-append "-DX11_INCLUDE_DIR="
e5f9ec8b
RH
190 (assoc-ref %build-inputs "libx11")
191 "/include")
192 (string-append "-DX11_LIBRARIES="
193 (assoc-ref %build-inputs "libx11")
194 "/lib/libX11.so")
195 "-DX11_FOUND=1")))
e5f9ec8b
RH
196 (native-inputs
197 `(("pkg-config" ,pkg-config)
198 ("gettext" ,gnu-gettext)))
199 (inputs
200 `(("alsa-lib" ,alsa-lib)
201 ("ao" ,ao)
202 ("bluez" ,bluez)
203 ("curl" ,curl)
204 ("eudev" ,eudev)
e7039f10 205 ("ffmpeg" ,ffmpeg)
e5f9ec8b
RH
206 ("font-wqy-microhei" ,font-wqy-microhei)
207 ("freetype" ,freetype)
208 ("glew" ,glew)
209 ("glib" ,glib)
210 ("glu" ,glu)
211 ("gtk+" ,gtk+-2)
212 ("hidapi" ,hidapi)
213 ("libevdev" ,libevdev)
214 ("libpng" ,libpng)
215 ("libusb" ,libusb)
216 ("libx11" ,libx11)
217 ("libxi" ,libxi)
218 ("libxrandr" ,libxrandr)
219 ("lzo" ,lzo)
220 ("mbedtls-apache" ,mbedtls-apache)
221 ("mesa" ,mesa)
222 ("miniupnpc" ,miniupnpc)
223 ("openal" ,openal)
fab8d41c 224 ("pugixml" ,pugixml)
e5f9ec8b
RH
225 ("pulseaudio" ,pulseaudio)
226 ("qtbase" ,qtbase)
227 ("sdl2" ,sdl2)
228 ("sfml" ,sfml)
229 ("soil" ,soil)
230 ("soundtouch" ,soundtouch)
e6fcf903 231 ("vulkan-loader" ,vulkan-loader)
e5f9ec8b
RH
232 ("zlib" ,zlib)))
233 (home-page "https://dolphin-emu.org/")
234 (synopsis "Nintendo Wii and GameCube emulator")
235 (description
236 "Dolphin is an emulator for two Nintendo video game consoles: the
237GameCube and the Wii. It provides compatibility with all PC controllers,
238turbo speed, networked multiplayer, and graphical enhancements.")
e89bfc2d 239 (supported-systems '("x86_64-linux" "aarch64-linux"))
e5f9ec8b
RH
240 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
241 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
9af704c5
RH
242
243(define-public dosbox
244 (package
245 (name "dosbox")
b09e4960 246 (version "0.74-3")
9af704c5 247 (source (origin
478040d4
RH
248 (method url-fetch)
249 (uri (string-append "https://sourceforge.net/projects/dosbox"
250 "/files/dosbox/" version "/dosbox-"
251 version ".tar.gz/download"))
252 (file-name (string-append name "-" version ".tar.gz"))
9af704c5
RH
253 (sha256
254 (base32
b09e4960 255 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
9af704c5 256 (build-system gnu-build-system)
9af704c5
RH
257 (native-inputs
258 `(("autoconf" ,autoconf)
259 ("automake" ,automake)))
260 (inputs
261 `(("sdl" ,sdl)
262 ("libpng" ,libpng)
263 ("zlib" ,zlib)
264 ("alsa-lib" ,alsa-lib)
265 ("glu" ,glu)
266 ("mesa" ,mesa)))
267 (home-page "http://www.dosbox.com")
268 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
269 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
270also emulates CPU:286/386 realmode/protected mode, Directory
271FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
272SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
273older games.")
274 (license license:gpl2+)))
275
276(define-public emulation-station
277 (let ((commit "646bede3d9ec0acf0ae378415edac136774a66c5"))
278 (package
279 (name "emulation-station")
280 (version "2.0.1")
281 (source (origin
282 (method git-fetch) ; no tarball available
283 (uri (git-reference
284 (url "https://github.com/Aloshi/EmulationStation.git")
285 (commit commit))) ; no version tag
286 (file-name (string-append name "-" version "-checkout"))
287 (sha256
288 (base32
289 "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v"))))
290 (build-system cmake-build-system)
291 (arguments
292 '(#:tests? #f)) ; no tests
293 (inputs
294 `(("alsa-lib" ,alsa-lib)
295 ("boost" ,boost)
296 ("curl" ,curl)
297 ("eigin" ,eigen)
298 ("freeimage" ,freeimage)
299 ("freetype" ,freetype)
300 ("mesa" ,mesa)
301 ("sdl2" ,sdl2)))
302 (synopsis "Video game console emulator front-end")
303 (description "EmulationStation provides a graphical front-end to a large
304number of video game console emulators. It features an interface that is
305usable with any game controller that has at least 4 buttons, theming support,
306and a game metadata scraper.")
307 (home-page "http://www.emulationstation.org")
308 (license license:expat))))
309
310(define-public higan
311 (package
312 (name "higan")
313 (version "106")
314 (source
315 (origin
316 (method url-fetch)
317 (uri (string-append
318 "https://gitlab.com/higan/higan/repository/archive.tar.gz?ref=v"
319 version))
320 (file-name (string-append name "-" version ".tar.gz"))
321 (sha256
322 (base32 "0y42pra0dxzlbkyzcp3r8a39pji2bj3p9fl40425f60af2igr4rw"))
323 (patches (search-patches "higan-remove-march-native-flag.patch"))))
324 (build-system gnu-build-system)
325 (native-inputs
326 `(("pkg-config" ,pkg-config)))
327 (inputs
328 `(("alsa-lib" ,alsa-lib)
329 ("ao" ,ao)
330 ("eudev" ,eudev)
331 ("gtk+" ,gtk+-2)
332 ("gtksourceview-2" ,gtksourceview-2)
333 ("libxv" ,libxv)
334 ("mesa" ,mesa)
335 ("openal" ,openal)
336 ("pulseaudio" ,pulseaudio)
337 ("sdl" ,sdl)))
338 (arguments
339 '(#:phases
340 (let ((build-phase (assoc-ref %standard-phases 'build))
341 (install-phase (assoc-ref %standard-phases 'install)))
342 (modify-phases %standard-phases
343 ;; The higan build system has no configure phase.
344 (delete 'configure)
345 (add-before 'build 'chdir-to-higan
346 (lambda _
347 (chdir "higan")))
348 (add-before 'install 'create-/share/applications
349 (lambda* (#:key outputs #:allow-other-keys)
350 (let ((out (assoc-ref outputs "out")))
351 ;; It seems the author forgot to do this in the Makefile.
352 (mkdir-p (string-append out "/share/applications")))))
353 (add-after 'install 'chdir-to-icarus
354 (lambda _
355 (chdir "../icarus")))
356 (add-after 'chdir-to-icarus 'build-icarus build-phase)
357 (add-after 'build-icarus 'install-icarus install-phase)
358 (add-after 'install-icarus 'wrap-higan-executable
359 (lambda* (#:key inputs outputs #:allow-other-keys)
360 (let* ((out (assoc-ref outputs "out"))
361 (bin (string-append out "/bin"))
362 (higan (string-append bin "/higan"))
363 (higan-original (string-append higan "-original"))
364 (bash (string-append (assoc-ref inputs "bash")
365 "/bin/bash"))
366 (coreutils (assoc-ref inputs "coreutils"))
367 (mkdir (string-append coreutils "/bin/mkdir"))
368 (cp (string-append coreutils "/bin/cp"))
369 (cp-r (string-append cp " -r --no-preserve=mode")))
370 ;; First, have the executable make sure ~/.local/share/higan
371 ;; contains up to date files. Higan insists on looking there
372 ;; for these data files.
373 (rename-file higan higan-original)
374 (with-output-to-file higan
375 (lambda ()
376 (display
377 (string-append
378 "#!" bash "\n"
379 ;; higan doesn't respect $XDG_DATA_HOME
380 mkdir " -p ~/.local/share\n"
381 cp-r " " out "/share/higan ~/.local/share\n"
382 "exec " higan-original))))
383 (chmod higan #o555)
384 ;; Second, make sure higan will find icarus in PATH.
385 (wrap-program higan
386 `("PATH" ":" prefix (,bin))))))))
387 #:make-flags
388 (list "compiler=g++"
389 (string-append "prefix=" (assoc-ref %outputs "out")))
390 ;; There is no test suite.
391 #:tests? #f))
392 (home-page "http://byuu.org/emulation/higan/")
393 (synopsis "Nintendo multi-system emulator")
394 (description
395 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
396consoles, including the Nintendo Entertainment System (NES/Famicom), Super
397Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
398Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
399Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
400 ;; As noted in these files among more:
401 ;; - icarus/icarus.cpp
402 ;; - higan/emulator/emulator.hpp
403 (license license:gpl3)))
404
405(define-public mgba
406 (package
407 (name "mgba")
d63e0ee7
NG
408 (version "0.8.0")
409 (source
410 (origin
411 (method git-fetch)
412 (uri (git-reference
413 (url "https://github.com/mgba-emu/mgba.git")
414 (commit version)))
415 (file-name (git-file-name name version))
416 (sha256
417 (base32 "0m3rgcdv32ms98j7rrmk2hphvn462bwsd6xfz2ssy05398pj4ljh"))
418 (modules '((guix build utils)))
419 (snippet
420 ;; Make sure we don't use the bundled software.
421 '(begin
422 (for-each
423 (lambda (subdir)
424 (let ((lib-subdir (string-append "src/third-party/" subdir)))
425 (delete-file-recursively lib-subdir)))
426 '("libpng" "lzma" "sqlite3" "zlib"))
427 #t))))
9af704c5
RH
428 (build-system cmake-build-system)
429 (arguments
430 `(#:tests? #f ;no "test" target
431 #:configure-flags
432 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
6ea1c6fc 433 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
9af704c5
RH
434 (native-inputs `(("pkg-config" ,pkg-config)))
435 (inputs `(("ffmpeg" ,ffmpeg)
436 ("imagemagick" ,imagemagick)
437 ("libedit" ,libedit)
6dcac920 438 ("libelf" ,libelf)
9af704c5
RH
439 ("libepoxy" ,libepoxy)
440 ("libpng" ,libpng)
441 ("mesa" ,mesa)
442 ("minizip" ,minizip)
443 ("ncurses" ,ncurses)
444 ("qtbase" ,qtbase)
445 ("qtmultimedia" ,qtmultimedia)
446 ("qttools" ,qttools)
447 ("sdl2" ,sdl2)
448 ("sqlite" ,sqlite)
449 ("zlib" ,zlib)))
450 (home-page "https://mgba.io")
451 (synopsis "Game Boy Advance emulator")
452 (description
453 "mGBA is an emulator for running Game Boy Advance games. It aims to be
454faster and more accurate than many existing Game Boy Advance emulators, as
455well as adding features that other emulators lack. It also supports Game Boy
456and Game Boy Color games.")
457 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c" is
458 ;; BSD-3.
459 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
460
c9e7acbf
JK
461(define-public sameboy
462 (package
463 (name "sameboy")
464 (version "0.12.3")
465 (source
466 (origin
467 (method git-fetch)
468 (uri (git-reference
469 (url "https://github.com/LIJI32/SameBoy.git")
470 (commit (string-append "v" version))))
471 (file-name (git-file-name name version))
472 (sha256
473 (base32 "0m5rv2x8qck1kr43xq186pp4kaiay7gd1x775n9qrljcd7z4x6fs"))))
474 (build-system gnu-build-system)
475 (native-inputs
476 `(("rgbds" ,rgbds)
477 ("gcc" ,gcc-9)
478 ("pkg-config" ,pkg-config)))
479 (inputs
480 `(("sdl2" ,sdl2)))
481 (arguments
482 `(#:tests? #f ; There are no tests
483 #:make-flags `("CC=gcc" "CONF=release"
484 ,(string-append "DATA_DIR="
485 (assoc-ref %outputs "out")
486 "/share/sameboy/"))
487 #:phases
488 (modify-phases %standard-phases
489 (delete 'configure)
490 (replace 'install
491 (lambda* (#:key outputs #:allow-other-keys)
492 (let* ((out (assoc-ref outputs "out"))
493 (bin (string-append out "/bin"))
494 (data (string-append out "/share/sameboy/")))
495 (with-directory-excursion "build/bin/SDL"
496 (install-file "sameboy" bin)
497 (delete-file "sameboy")
498 (copy-recursively "." data))))))))
499 (home-page "https://sameboy.github.io/")
500 (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
501 (description "SameBoy is a user friendly Game Boy, Game Boy Color
502and Super Game Boy emulator. SameBoy is accurate and includes a wide
503range of debugging features. It has all the features one would expect
504from an emulator---from save states to scaling filters.")
505 (license license:expat)))
506
9af704c5
RH
507(define-public mupen64plus-core
508 (package
509 (name "mupen64plus-core")
510 (version "2.5")
511 (source
512 (origin
10bcd4bb
TGR
513 (method git-fetch)
514 (uri (git-reference
515 (url "https://github.com/mupen64plus/mupen64plus-core.git")
516 (commit version)))
517 (file-name (git-file-name name version))
9af704c5 518 (sha256
10bcd4bb 519 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
9af704c5
RH
520 (build-system gnu-build-system)
521 (native-inputs
522 `(("pkg-config" ,pkg-config)
523 ("which" ,which)))
524 (inputs
525 `(("freetype" ,freetype)
526 ("glu" ,glu)
527 ("libpng" ,libpng)
528 ("mesa" ,mesa)
529 ("sdl2" ,sdl2)
530 ("zlib" ,zlib)))
531 (arguments
532 '(#:phases
533 (modify-phases %standard-phases
534 ;; The mupen64plus build system has no configure phase.
535 (delete 'configure)
536 ;; Makefile is in a subdirectory.
537 (add-before
eaa2b35c 538 'build 'chdir-to-project-directory
9af704c5 539 (lambda _
eaa2b35c
TGR
540 (chdir "projects/unix")
541 #t)))
9af704c5
RH
542 #:make-flags (let ((out (assoc-ref %outputs "out")))
543 (list "all" (string-append "PREFIX=" out)))
544 ;; There are no tests.
545 #:tests? #f))
546 ;; As per the Makefile (in projects/unix/Makefile):
547 (supported-systems '("i686-linux" "x86_64-linux"))
eaa2b35c 548 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
549 (synopsis "Nintendo 64 emulator core library")
550 (description
551 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
552which is capable of accurately playing many games. This package contains the
553core library.")
554 (license license:gpl2+)))
555
556(define-public mupen64plus-audio-sdl
557 (package
558 (name "mupen64plus-audio-sdl")
559 (version "2.5")
560 (source
561 (origin
8c6d45cb
TGR
562 (method git-fetch)
563 (uri (git-reference
564 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
565 (commit version)))
566 (file-name (git-file-name name version))
9af704c5 567 (sha256
8c6d45cb 568 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
9af704c5
RH
569 (build-system gnu-build-system)
570 (native-inputs
571 `(("pkg-config" ,pkg-config)
572 ("which" ,which)))
573 (inputs
574 `(("mupen64plus-core" ,mupen64plus-core)
575 ("sdl2" ,sdl2)))
576 (arguments
577 '(#:phases
578 (modify-phases %standard-phases
579 ;; The mupen64plus build system has no configure phase.
580 (delete 'configure)
581 ;; Makefile is in a subdirectory.
582 (add-before
583 'build 'cd-to-project-dir
584 (lambda _
585 (chdir "projects/unix"))))
586 #:make-flags
587 (let ((out (assoc-ref %outputs "out"))
588 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
589 (list "all"
590 (string-append "PREFIX=" out)
591 (string-append "APIDIR=" m64p "/include/mupen64plus")))
592 ;; There are no tests.
593 #:tests? #f))
cf5e9465 594 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
595 (synopsis "Mupen64Plus SDL input plugin")
596 (description
597 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
598which is capable of accurately playing many games. This package contains the
599SDL audio plugin.")
600 (license license:gpl2+)))
601
602(define-public mupen64plus-input-sdl
603 (package
604 (name "mupen64plus-input-sdl")
605 (version "2.5")
606 (source
607 (origin
ef5ef8f5
TGR
608 (method git-fetch)
609 (uri (git-reference
610 (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
611 (commit version)))
612 (file-name (git-file-name name version))
9af704c5 613 (sha256
ef5ef8f5 614 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
9af704c5
RH
615 (build-system gnu-build-system)
616 (native-inputs
617 `(("which" ,which)))
618 (inputs
619 `(("mupen64plus-core" ,mupen64plus-core)
620 ("sdl2" ,sdl2)))
621 (arguments
622 '(#:phases
623 (modify-phases %standard-phases
624 ;; The mupen64plus build system has no configure phase.
625 (delete 'configure)
626 ;; Makefile is in a subdirectory.
627 (add-before
628 'build 'cd-to-project-dir
629 (lambda _
630 (chdir "projects/unix"))))
631 #:make-flags
632 (let ((out (assoc-ref %outputs "out"))
633 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
634 (list "all"
635 (string-append "PREFIX=" out)
636 (string-append "APIDIR=" m64p "/include/mupen64plus")))
637 ;; There are no tests.
638 #:tests? #f))
d738ce16 639 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
640 (synopsis "Mupen64Plus SDL input plugin")
641 (description
642 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
643which is capable of accurately playing many games. This package contains the
644SDL input plugin.")
645 (license license:gpl2+)))
646
647(define-public mupen64plus-rsp-hle
648 (package
649 (name "mupen64plus-rsp-hle")
650 (version "2.5")
651 (source
652 (origin
c4f0c8ba
TGR
653 (method git-fetch)
654 (uri (git-reference
655 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
656 (commit version)))
657 (file-name (git-file-name name version))
9af704c5 658 (sha256
c4f0c8ba 659 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
9af704c5
RH
660 (build-system gnu-build-system)
661 (inputs
662 `(("mupen64plus-core" ,mupen64plus-core)))
663 (arguments
664 '(#:phases
665 (modify-phases %standard-phases
666 ;; The mupen64plus build system has no configure phase.
667 (delete 'configure)
668 ;; Makefile is in a subdirectory.
669 (add-before
670 'build 'cd-to-project-dir
671 (lambda _
672 (chdir "projects/unix"))))
673 #:make-flags
674 (let ((out (assoc-ref %outputs "out"))
675 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
676 (list "all"
677 (string-append "PREFIX=" out)
678 (string-append "APIDIR=" m64p "/include/mupen64plus")))
679 ;; There are no tests.
680 #:tests? #f))
cf396ea5 681 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
682 (synopsis "Mupen64Plus SDL input plugin")
683 (description
684 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
685which is capable of accurately playing many games. This package contains the
686high-level emulation (HLE) RSP processor plugin.")
687 (license license:gpl2+)))
688
689(define-public mupen64plus-rsp-z64
690 (package
691 (name "mupen64plus-rsp-z64")
692 (version "2.0.0")
693 (source
694 (origin
052650c8
TGR
695 (method git-fetch)
696 (uri (git-reference
697 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
698 (commit version)))
699 (file-name (git-file-name name version))
9af704c5 700 (sha256
052650c8 701 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
9af704c5
RH
702 (build-system gnu-build-system)
703 (inputs
704 `(("mupen64plus-core" ,mupen64plus-core)))
705 (arguments
706 '(#:phases
707 (modify-phases %standard-phases
708 ;; The mupen64plus build system has no configure phase.
709 (delete 'configure)
710 ;; Makefile is in a subdirectory.
711 (add-before
712 'build 'cd-to-project-dir
713 (lambda _
714 (chdir "projects/unix"))))
715 #:make-flags
716 (let ((out (assoc-ref %outputs "out"))
717 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
718 (list "all"
719 (string-append "PREFIX=" out)
720 (string-append "APIDIR=" m64p "/include/mupen64plus")))
721 ;; There are no tests.
722 #:tests? #f))
24b03073 723 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
724 (synopsis "Mupen64Plus SDL input plugin")
725 (description
726 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
727which is capable of accurately playing many games. This package contains the
728Z64 RSP processor plugin.")
729 (license license:gpl2+)))
730
731(define-public mupen64plus-video-arachnoid
732 (package
733 (name "mupen64plus-video-arachnoid")
734 (version "2.0.0")
735 (source
736 (origin
2074c8bf
TGR
737 (method git-fetch)
738 (uri (git-reference
739 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
740 (commit version)))
741 (file-name (git-file-name name version))
9af704c5 742 (sha256
2074c8bf 743 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
9af704c5
RH
744 (build-system gnu-build-system)
745 (native-inputs
746 `(("pkg-config" ,pkg-config)
747 ("which" ,which)))
748 (inputs
749 `(("mesa" ,mesa)
750 ("mupen64plus-core" ,mupen64plus-core)))
751 (arguments
752 '(#:phases
753 (modify-phases %standard-phases
754 ;; The mupen64plus build system has no configure phase.
755 (delete 'configure)
756 ;; Makefile is in a subdirectory.
757 (add-before
758 'build 'cd-to-project-dir
759 (lambda _
760 (chdir "projects/unix"))))
761 #:make-flags
762 (let ((out (assoc-ref %outputs "out"))
763 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
764 (list "all"
765 (string-append "PREFIX=" out)
766 (string-append "APIDIR=" m64p "/include/mupen64plus")))
767 ;; There are no tests.
768 #:tests? #f))
5daa2019 769 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
770 (synopsis "Mupen64Plus Rice Video plugin")
771 (description
772 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
773which is capable of accurately playing many games. This package contains the
774Arachnoid video plugin.")
775 (license license:gpl2+)))
776
777(define-public mupen64plus-video-glide64
778 (package
779 (name "mupen64plus-video-glide64")
780 (version "2.0.0")
781 (source
782 (origin
62536186
TGR
783 (method git-fetch)
784 (uri (git-reference
785 (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
786 (commit version)))
787 (file-name (git-file-name name version))
9af704c5 788 (sha256
62536186 789 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
9af704c5
RH
790 (build-system gnu-build-system)
791 (native-inputs
792 `(("pkg-config" ,pkg-config)
793 ("which" ,which)))
794 (inputs
795 `(("mesa" ,mesa)
796 ("mupen64plus-core" ,mupen64plus-core)
797 ("sdl2" ,sdl2)))
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 ;; XXX Should be unnecessary with the next release.
809 (add-before
810 'build 'use-sdl2
811 (lambda _
812 (substitute* "Makefile"
813 (("SDL_CONFIG = (.*)sdl-config" all prefix)
814 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
815 #:make-flags
816 (let ((out (assoc-ref %outputs "out"))
817 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
818 (list "all"
819 (string-append "PREFIX=" out)
820 (string-append "APIDIR=" m64p "/include/mupen64plus")))
821 ;; There are no tests.
822 #:tests? #f))
d1e63866 823 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
824 (synopsis "Mupen64Plus Rice Video plugin")
825 (description
826 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
827which is capable of accurately playing many games. This package contains the
828Glide64 video plugin.")
829 (license license:gpl2+)))
830
831(define-public mupen64plus-video-glide64mk2
832 (package
833 (name "mupen64plus-video-glide64mk2")
834 (version "2.5")
835 (source
836 (origin
e5e7a167
TGR
837 (method git-fetch)
838 (uri (git-reference
839 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
840 (commit version)))
841 (file-name (git-file-name name version))
9af704c5 842 (sha256
e5e7a167 843 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
9af704c5
RH
844 (build-system gnu-build-system)
845 (native-inputs
846 `(("pkg-config" ,pkg-config)
847 ("which" ,which)))
848 (inputs
849 `(("boost" ,boost)
850 ("libpng" ,libpng)
851 ("mesa" ,mesa)
852 ("mupen64plus-core" ,mupen64plus-core)
853 ("sdl2" ,sdl2)
854 ("zlib" ,zlib)))
855 (arguments
856 '(#:phases
857 (modify-phases %standard-phases
858 ;; The mupen64plus build system has no configure phase.
859 (delete 'configure)
860 ;; Makefile is in a subdirectory.
861 (add-before
862 'build 'cd-to-project-dir
863 (lambda _
864 (chdir "projects/unix"))))
865 #:make-flags
866 (let ((out (assoc-ref %outputs "out"))
867 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
868 (list "all"
869 (string-append "PREFIX=" out)
870 (string-append "APIDIR=" m64p "/include/mupen64plus")))
871 ;; There are no tests.
872 #:tests? #f))
84532c2b 873 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
874 (synopsis "Mupen64Plus Rice Video plugin")
875 (description
876 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
877which is capable of accurately playing many games. This package contains the
878Glide64MK2 video plugin.")
879 (license license:gpl2+)))
880
881(define-public mupen64plus-video-rice
882 (package
883 (name "mupen64plus-video-rice")
884 (version "2.5")
885 (source
886 (origin
d42d0a0b
TGR
887 (method git-fetch)
888 (uri (git-reference
889 (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
890 (commit version)))
891 (file-name (git-file-name name version))
9af704c5 892 (sha256
d42d0a0b 893 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
9af704c5
RH
894 (build-system gnu-build-system)
895 (native-inputs
896 `(("pkg-config" ,pkg-config)
897 ("which" ,which)))
898 (inputs
899 `(("libpng" ,libpng)
900 ("mesa" ,mesa)
901 ("mupen64plus-core" ,mupen64plus-core)
902 ("sdl2" ,sdl2)))
903 (arguments
904 '(#:phases
905 (modify-phases %standard-phases
906 ;; The mupen64plus build system has no configure phase.
907 (delete 'configure)
908 ;; Makefile is in a subdirectory.
909 (add-before
910 'build 'cd-to-project-dir
911 (lambda _
912 (chdir "projects/unix"))))
913 #:make-flags
914 (let ((out (assoc-ref %outputs "out"))
915 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
916 (list "all"
917 (string-append "PREFIX=" out)
918 (string-append "APIDIR=" m64p "/include/mupen64plus")))
919 ;; There are no tests.
920 #:tests? #f))
b21acd21 921 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
922 (synopsis "Mupen64Plus Rice Video plugin")
923 (description
924 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
925which is capable of accurately playing many games. This package contains the
926Rice Video plugin.")
927 (license license:gpl2+)))
928
929(define-public mupen64plus-video-z64
930 (package
931 (name "mupen64plus-video-z64")
932 (version "2.0.0")
933 (source
934 (origin
85baeb20
TGR
935 (method git-fetch)
936 (uri (git-reference
937 (url "https://github.com/mupen64plus/mupen64plus-video-z64.git")
938 (commit version)))
939 (file-name (git-file-name name version))
9af704c5 940 (sha256
85baeb20 941 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
fdb61400 942 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
9af704c5
RH
943 (build-system gnu-build-system)
944 (native-inputs
945 `(("pkg-config" ,pkg-config)
946 ("which" ,which)))
947 (inputs
948 `(("glew" ,glew)
949 ("mupen64plus-core" ,mupen64plus-core)
950 ("sdl2" ,sdl2)))
951 (arguments
952 '(#:phases
953 (modify-phases %standard-phases
954 ;; The mupen64plus build system has no configure phase.
955 (delete 'configure)
956 ;; Makefile is in a subdirectory.
957 (add-before
958 'build 'cd-to-project-dir
959 (lambda _
960 (chdir "projects/unix")))
961 ;; XXX Should be unnecessary with the next release.
962 (add-before
963 'build 'use-sdl2
964 (lambda _
965 (substitute* "Makefile"
966 (("SDL_CONFIG = (.*)sdl-config" all prefix)
967 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
968 #:make-flags
969 (let ((out (assoc-ref %outputs "out"))
970 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
971 (list "all"
972 (string-append "PREFIX=" out)
973 (string-append "APIDIR=" m64p "/include/mupen64plus")))
974 ;; There are no tests.
975 #:tests? #f))
26daadb9 976 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
977 (synopsis "Mupen64Plus Z64 video plugin")
978 (description
979 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
980which is capable of accurately playing many games. This package contains the
981Z64 video plugin.")
982 (license license:gpl2+)))
983
984(define-public mupen64plus-ui-console
985 (package
986 (name "mupen64plus-ui-console")
987 (version "2.5")
988 (source
989 (origin
225157a0
TGR
990 (method git-fetch)
991 (uri (git-reference
992 (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
993 (commit version)))
994 (file-name (git-file-name name version))
9af704c5 995 (sha256
225157a0 996 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
9af704c5
RH
997 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
998 (build-system gnu-build-system)
999 (native-inputs
1000 `(("pkg-config" ,pkg-config)
1001 ("which" ,which)))
1002 (inputs
1003 `(("sdl2" ,sdl2)))
1004 ;; Mupen64Plus supports a single data directory and a single plugin
1005 ;; directory in its configuration, yet we need data and plugin files from
1006 ;; a variety of packages. The best way to deal with this is to install
1007 ;; all packages from which data and plugin files are needed into one's
1008 ;; profile, and point the configuration there. Hence, propagate the most
1009 ;; important packages here to save the user from the bother. The patch
1010 ;; mupen64plus-ui-console-notice also gives users instructions on what
1011 ;; they need to do in order to point the configuration to their profile.
1012 (propagated-inputs
1013 `(("mupen64plus-core" ,mupen64plus-core)
1014 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
1015 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
1016 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
1017 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
1018 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
1019 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
1020 (arguments
1021 '(#:phases
1022 (modify-phases %standard-phases
1023 ;; The mupen64plus build system has no configure phase.
1024 (delete 'configure)
1025 ;; Makefile is in a subdirectory.
1026 (add-before
1027 'build 'cd-to-project-dir
1028 (lambda _
1029 (chdir "projects/unix"))))
1030 #:make-flags
1031 (let ((out (assoc-ref %outputs "out"))
1032 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1033 (list "all"
1034 (string-append "PREFIX=" out)
1035 (string-append "APIDIR=" m64p "/include/mupen64plus")
1036 ;; Trailing slash matters here.
1037 (string-append "COREDIR=" m64p "/lib/")))
1038 ;; There are no tests.
1039 #:tests? #f))
e8079ba4 1040 (home-page "https://www.mupen64plus.org/")
ff452bea 1041 (synopsis "Mupen64Plus command line user interface")
9af704c5
RH
1042 (description
1043 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1044which is capable of accurately playing many games. This package contains the
1045command line user interface. Installing this package is the easiest way
1046towards a working Mupen64Plus for casual users.")
1047 (license license:gpl2+)))
1048
1049(define-public nestopia-ue
1050 (package
1051 (name "nestopia-ue")
9d39c300 1052 (version "1.48")
3e461b71
TGR
1053 (source
1054 (origin
1055 (method git-fetch)
1056 (uri (git-reference
1057 (url "https://github.com/rdanbrook/nestopia.git")
1058 (commit version)))
1059 (file-name (git-file-name name version))
1060 (sha256
1061 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1062 (modules '((guix build utils)))
1063 (snippet
1064 '(begin
1065 ;; We don't need libretro for the GNU/Linux build.
1066 (delete-file-recursively "libretro")
1067 #t))))
9d39c300 1068 (build-system cmake-build-system)
9af704c5
RH
1069 (native-inputs
1070 `(("pkg-config" ,pkg-config)))
1071 (inputs
1072 `(("ao" ,ao)
9af704c5
RH
1073 ("gtk+" ,gtk+)
1074 ("libarchive" ,libarchive)
9d39c300 1075 ("libepoxy" ,libepoxy)
9af704c5
RH
1076 ("sdl2" ,sdl2)
1077 ("zlib" ,zlib)))
1078 (arguments
1079 '(#:phases
1080 (modify-phases %standard-phases
9d39c300
KK
1081 ;; This fixes the file chooser crash that happens with GTK 3.
1082 (add-after 'install 'wrap-program
1083 (lambda* (#:key inputs outputs #:allow-other-keys)
1084 (let* ((out (assoc-ref outputs "out"))
1085 (nestopia (string-append out "/bin/nestopia"))
1086 (gtk (assoc-ref inputs "gtk+"))
1087 (gtk-share (string-append gtk "/share")))
1088 (wrap-program nestopia
1089 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
9af704c5
RH
1090 ;; There are no tests.
1091 #:tests? #f))
1092 (home-page "http://0ldsk00l.ca/nestopia/")
1093 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1094 (description
1095 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1096System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1097emulation community. It provides highly accurate emulation.")
1098 (license license:gpl2+)))
1099
1100(define-public retroarch
1101 (package
1102 (name "retroarch")
bd671624 1103 (version "1.8.1")
9af704c5
RH
1104 (source
1105 (origin
1fc346de
TGR
1106 (method git-fetch)
1107 (uri (git-reference
1108 (url "https://github.com/libretro/RetroArch.git")
1109 (commit (string-append "v" version))))
1110 (file-name (git-file-name name version))
9af704c5 1111 (sha256
77549754
TGR
1112 (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))
1113 (patches
1114 (search-patches "retroarch-disable-online-updater.patch"))
1115 (modules '((guix build utils)))
1116 (snippet
1117 '(begin
1118 ;; Don't suggest using the Online Updater if available: it never
1119 ;; is. This disables translation of this particular message.
1120 (substitute* (find-files "menu/drivers" "\\.c$")
1121 (("msg_hash_to_str\\(MSG_MISSING_ASSETS\\)")
1122 "\"Warning: Missing assets, go get some\""))
1123 #t))))
9af704c5
RH
1124 (build-system gnu-build-system)
1125 (arguments
f21967a4 1126 `(#:tests? #f ; no tests
9af704c5
RH
1127 #:phases
1128 (modify-phases %standard-phases
1129 (replace 'configure
1130 (lambda* (#:key inputs outputs #:allow-other-keys)
1131 (let* ((out (assoc-ref outputs "out"))
1132 (etc (string-append out "/etc"))
12a3abc6
RH
1133 (vulkan (assoc-ref inputs "vulkan-loader"))
1134 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
77549754 1135 ;; Hard-code some store file names.
9af704c5
RH
1136 (substitute* "gfx/common/vulkan_common.c"
1137 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
12a3abc6
RH
1138 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1139 (("/usr/local/share/wayland-protocols")
1140 (string-append wayland-protocols "/share/wayland-protocols")))
9af704c5
RH
1141 (substitute* "qb/qb.libs.sh"
1142 (("/bin/true") (which "true")))
77549754 1143
fade67ab
EF
1144 ;; Use shared zlib.
1145 (substitute* '("libretro-common/file/archive_file_zlib.c"
e85bb00c 1146 "libretro-common/streams/trans_stream_zlib.c")
fade67ab 1147 (("<compat/zlib.h>") "<zlib.h>"))
77549754 1148
9af704c5
RH
1149 ;; The configure script does not yet accept the extra arguments
1150 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
f21967a4
EF
1151 (invoke
1152 "./configure"
1153 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1154 (%current-system)))
1155 '("--enable-neon" "--enable-floathard")
1156 '())
1157 (string-append "--prefix=" out)
73dd0654
TGR
1158 (string-append "--global-config-dir=" etc)
1159 "--disable-builtinminiupnpc")))))))
9af704c5
RH
1160 (inputs
1161 `(("alsa-lib" ,alsa-lib)
1162 ("ffmpeg" ,ffmpeg)
1163 ("freetype" ,freetype)
1164 ("libxinerama" ,libxinerama)
1165 ("libxkbcommon" ,libxkbcommon)
1166 ("libxml2" ,libxml2)
45267af1 1167 ("libxrandr" ,libxrandr)
9af704c5
RH
1168 ("libxv" ,libxv)
1169 ("mesa" ,mesa)
73dd0654 1170 ("miniupnpc" ,miniupnpc)
9af704c5
RH
1171 ("openal" ,openal)
1172 ("pulseaudio" ,pulseaudio)
1173 ("python" ,python)
76b7d8fd 1174 ("qtbase" ,qtbase)
9af704c5
RH
1175 ("sdl" ,sdl2)
1176 ("udev" ,eudev)
e6fcf903 1177 ("vulkan-loader" ,vulkan-loader)
c695fb76 1178 ("wayland" ,wayland)
9af704c5
RH
1179 ("zlib" ,zlib)))
1180 (native-inputs
1181 `(("pkg-config" ,pkg-config)
12a3abc6 1182 ("wayland-protocols" ,wayland-protocols)
9af704c5
RH
1183 ("which" ,which)))
1184 (home-page "https://www.libretro.com/")
1185 (synopsis "Reference frontend for the libretro API")
1186 (description
1187 "Libretro is a simple but powerful development interface that allows for
1188the easy creation of emulators, games and multimedia applications that can plug
1189straight into any libretro-compatible frontend. RetroArch is the official
1190reference frontend for the libretro API, currently used by most as a modular
1191multi-system game/emulator system.")
1192 (license license:gpl3+)))
4c40ed9d
NG
1193
1194(define-public scummvm
1195 (package
1196 (name "scummvm")
2d4b2488 1197 (version "2.1.1")
4c40ed9d
NG
1198 (source
1199 (origin
1200 (method url-fetch)
1201 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1202 "/scummvm-" version ".tar.xz"))
1203 (sha256
2d4b2488 1204 (base32 "1a6waf1ybp91nwva8g650cljlfb1di4l0jv13vg6yfgkas9pclsp"))))
4c40ed9d
NG
1205 (build-system gnu-build-system)
1206 (arguments
6177b14b 1207 `(#:tests? #f ;require "git"
4c40ed9d
NG
1208 #:configure-flags (list "--enable-release") ;for optimizations
1209 #:phases
1210 (modify-phases %standard-phases
161b297b
NG
1211 (add-after 'unpack 'fix-build
1212 ;; XXX: The following works around a build failure introduced when
1213 ;; Fluidsynth was updated to version 2.1. It has been applied
1214 ;; upstream as 68758a879e0c8ecc0d40962516d4e808aa4e15e5 and can be
2d4b2488 1215 ;; removed once this commit makes it into a release.
161b297b
NG
1216 (lambda _
1217 (substitute* "audio/softsynth/fluidsynth.cpp"
1218 (("#include <fluidsynth.h>") "")
1219 (("#include \"common/scummsys.h\"") "#include \"config.h\"")
1220 (("#include \"common/config-manager.h\"" line)
1221 (string-append "#include <fluidsynth.h>\n"
1222 "#include \"common/scummsys.h\"\n"
1223 line)))
1224 #t))
4c40ed9d
NG
1225 (replace 'configure
1226 ;; configure does not work followed by both "SHELL=..." and
1227 ;; "CONFIG_SHELL=..."; set environment variables instead
1228 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1229 (let* ((out (assoc-ref outputs "out"))
1230 (bash (which "bash"))
1231 (flags `(,(string-append "--prefix=" out)
1232 ,@configure-flags)))
1233 (setenv "SHELL" bash)
1234 (setenv "CONFIG_SHELL" bash)
1235 (apply invoke "./configure" flags)))))))
1236 (native-inputs
1237 `(("pkg-config" ,pkg-config)))
1238 (inputs
1239 `(("alsa-lib" ,alsa-lib)
1240 ("faad2" ,faad2)
1241 ("fluidsynth" ,fluidsynth)
1242 ("freetype" ,freetype)
6177b14b 1243 ("liba52" ,liba52)
4c40ed9d
NG
1244 ("libflac" ,flac)
1245 ("libjpeg-turbo" ,libjpeg-turbo)
1246 ("libmad" ,libmad)
1247 ("libmpeg2" ,libmpeg2)
1248 ("libogg" ,libogg)
1249 ("libpng" ,libpng)
1250 ("libtheora" ,libtheora)
1251 ("libvorbis" ,libvorbis)
1252 ("nasm" ,nasm)
6177b14b 1253 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
4c40ed9d
NG
1254 ("zlib" ,zlib)))
1255 (home-page "https://www.scummvm.org/")
1256 (synopsis "Engine for several graphical adventure games")
1257 (description "ScummVM is a program which allows you to run certain
1258classic graphical point-and-click adventure games, provided you
1259already have their data files. The clever part about this: ScummVM
1260just replaces the executables shipped with the games, allowing you to
1261play them on systems for which they were never designed!")
1262 (license license:gpl2+)))
c8b2fd28
NG
1263
1264(define-public mame
1265 (package
1266 (name "mame")
b7d95d3a 1267 (version "0.217")
c8b2fd28
NG
1268 (source
1269 (origin
1270 (method git-fetch)
1271 (uri (git-reference
1272 (url "https://github.com/mamedev/mame.git")
1273 (commit (apply string-append "mame" (string-split version #\.)))))
1274 (file-name (git-file-name name version))
1275 (sha256
1276 (base32
b7d95d3a 1277 "03h4d0d8lh6djjff3zqhjm14klc9n129yzwygdqppz0f43w97cmw"))
c8b2fd28
NG
1278 (modules '((guix build utils)))
1279 (snippet
1280 ;; Remove bundled libraries.
1281 '(begin
1282 (with-directory-excursion "3rdparty"
1283 (for-each delete-file-recursively
1284 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1285 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1286 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1287 #t))))
1288 (build-system gnu-build-system)
1289 (arguments
1290 `(#:make-flags
1291 (cons*
430e1528
NG
1292 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1293 "NOWERROR=1"
c8b2fd28
NG
1294 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1295 (string-append "SDL_INI_PATH="
1296 (assoc-ref %outputs "out")
1297 "/share/mame/ini")
1298 (map (lambda (lib)
1299 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1300 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1301 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1302 #:tests? #f ;no test in regular release
1303 #:phases
1304 (modify-phases %standard-phases
1305 (delete 'configure)
1306 (add-after 'build 'build-documentation
1307 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1308 (replace 'install
1309 ;; Upstream does not provide an installation phase.
1310 (lambda* (#:key outputs #:allow-other-keys)
1311 (let* ((out (assoc-ref outputs "out"))
1312 (share (string-append out "/share/mame")))
1313 ;; Install data.
1314 (for-each (lambda (dir)
1315 (copy-recursively dir (string-append share "/" dir)))
1316 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1317 "plugins" "samples"))
1318 (let ((keymaps (string-append share "/keymaps")))
1319 (for-each (lambda (file) (install-file file keymaps))
1320 (find-files "keymaps" ".*LINUX\\.map")))
1321 (let ((fonts (string-append share "/fonts")))
1322 (install-file "uismall.bdf" fonts))
6921e95a
EF
1323 (when (file-exists? "mame64")
1324 (rename-file "mame64" "mame"))
c8b2fd28
NG
1325 (install-file "mame" (string-append out "/bin")))
1326 #t))
1327 (add-after 'install 'install-documentation
1328 (lambda* (#:key outputs #:allow-other-keys)
1329 (let* ((out (assoc-ref outputs "out"))
1330 (man (string-append out "/share/man/man1"))
1331 (info (string-append out "/share/info")))
1332 (install-file "docs/build/man/MAME.1" man)
1333 (install-file "docs/build/texinfo/MAME.info" info))
1334 #t))
1335 (add-after 'install 'install-ini-file
1336 ;; Generate an ini file so as to set some directories (e.g., roms)
1337 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1338 ;;
1339 ;; XXX: We need to insert absolute references to the store. It can
1340 ;; be an issue if they leak into user's home directory, e.g., with
1341 ;; "mame -createconfig" and the package is later GC'ed.
1342 (lambda* (#:key outputs #:allow-other-keys)
1343 (let* ((out (assoc-ref outputs "out"))
1344 (share (string-append out "/share/mame"))
1345 (ini (string-append share "/ini")))
1346 (with-output-to-file (string-append ini "/mame.ini")
1347 (lambda _
1348 (format #t
1349 "inipath $HOME/.mame;~a/ini~@
1350 homepath $HOME/mame~@
1351 rompath $HOME/mame/roms~@
1352 samplepath $HOME/mame/samples;~a/samples~@
1353 cheatpath $HOME/mame/cheat~@
1354 artpath $HOME/mame/artwork;~a/artwork~@
1355 crosshairpath $HOME/mame/crosshair~@
1356 snapshot_directory $HOME/mame/snapshots~@
1357 hashpath ~a/hash~@
1358 fontpath $HOME/mame/fonts;~a/fonts~@
1359 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1360 bgfx_path ~a/bgfx~@
1361 pluginspath $HOME/mame/plugins;~a/plugins~@
1362 languagepath ~a/language~@
1363 cfg_directory $HOME/.mame/cfg~@
1364 nvram_directory $HOME/.mame/nvram~@
1365 input_directory $HOME/.mame/inp~@
1366 state_directory $HOME/.mame/sta~@
1367 diff_directory $HOME/.mame/diff~@
1368 comment_directory $HOME/.mame/comments~%"
1369 share share share share share share share share
1370 share)))
1371 (with-output-to-file (string-append ini "/ui.ini")
1372 (lambda _
1373 (format #t
1374 "historypath $HOME/mame/history~@
1375 categorypath $HOME/mame/folders~@
1376 cabinets_directory $HOME/mame/cabinets~@
1377 cpanels_directory $HOME/mame/cpanel~@
1378 pcbs_directory $HOME/mame/pcb~@
1379 flyers_directory $HOME/mame/flyers~@
1380 titles_directory $HOME/mame/titles~@
1381 ends_directory $HOME/mame/ends~@
1382 marquees_directory $HOME/mame/marquees~@
1383 artwork_preview_directory $HOME/mame/artpreview~@
1384 bosses_directory $HOME/mame/bosses~@
1385 logos_directory $HOME/mame/logo~@
1386 scores_directory $HOME/mame/scores~@
1387 versus_directory $HOME/mame/versus~@
1388 gameover_directory $HOME/mame/gameover~@
1389 howto_directory $HOME/mame/howto~@
1390 select_directory $HOME/mame/select~@
1391 icons_directory $HOME/mame/icons~@
1392 covers_directory $HOME/mame/covers~@
1393 ui_path $HOME/.mame/ui~%")))
1394 #t)))
1395 (add-after 'install 'install-desktop-file
1396 (lambda* (#:key outputs #:allow-other-keys)
1397 (let* ((out (assoc-ref outputs "out"))
1398 (desktop (string-append out "/share/applications"))
1399 (executable (string-append out "/bin/mame")))
1400 (mkdir-p desktop)
1401 (with-output-to-file (string-append desktop "/mame.desktop")
1402 (lambda _
1403 (format #t
1404 "[Desktop Entry]~@
1405 Name=mame~@
1406 Comment=Multi-purpose emulation framework~@
1407 Exec=~a~@
1408 TryExec=~@*~a~@
1409 Terminal=false~@
1410 Type=Application~@
1411 Categories=Game;Emulator;~@
1412 Keywords=Game;Emulator;Arcade;~%"
1413 executable)))
1414 #t))))))
1415 (native-inputs
1416 `(("pkg-config" ,pkg-config)
03370346
NG
1417 ("sphinx" ,python-sphinx)
1418 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
c8b2fd28
NG
1419 ("texinfo" ,texinfo)))
1420 (inputs
1421 `(("alsa-lib" ,alsa-lib)
1422 ("asio" ,asio)
1423 ("expat" ,expat)
1424 ("flac" ,flac)
1425 ("fontconfig" ,fontconfig)
1426 ("glm" ,glm)
7b24b76b 1427 ("libjpeg" ,libjpeg-turbo)
9f0650df 1428 ("libxi" ,libxi)
c8b2fd28
NG
1429 ("libxinerama" ,libxinerama)
1430 ("lua" ,lua)
1431 ("portaudio" ,portaudio)
1432 ("portmidi" ,portmidi)
63247277 1433 ("pugixml" ,pugixml)
c8b2fd28
NG
1434 ("python-wrapper" ,python-wrapper)
1435 ("qtbase" ,qtbase)
1436 ("rapidjson" ,rapidjson)
1437 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1438 ("sqlite" ,sqlite)
1439 ("utf8proc" ,utf8proc)
1440 ("zlib" ,zlib)))
1441 (home-page "http://mamedev.org/")
1442 (synopsis "Multi-purpose emulation framework")
1443 (description "MAME's purpose is to preserve decades of software
1444history. As electronic technology continues to rush forward, MAME
1445prevents this important @emph{vintage} software from being lost and
1446forgotten. This is achieved by documenting the hardware and how it
1447functions. The source code to MAME serves as this documentation.")
1448 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1449 ;; However, over 90% of the files are under Expat license. Also, artwork,
1450 ;; keymaps, languages and samples are under CC0.
1451 (license (list license:gpl2+ license:expat license:cc0))))
1403e1f7
PN
1452
1453(define-public pcsxr
1454 ;; No release since 2017.
1455 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1456 (package
1457 (name "pcsxr")
1458 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1459 (version "1.9.95")
1460 (source
1461 (origin
1462 (method git-fetch)
1463 (uri (git-reference
1464 (url "https://github.com/pcsxr/PCSX-Reloaded")
1465 (commit commit)))
1466 (sha256
1467 (base32
1468 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1469 (file-name (git-file-name name commit))))
1470 (build-system cmake-build-system)
1471 (arguments
1472 `(#:tests? #f ;no "test" target
1473 #:configure-flags
1474 (list "-DSND_BACKEND=pulse"
1475 "-DENABLE_CCDDA='ON'"
1476 "-DUSE_LIBARCHIVE='ON'"
1477 "-DUSE_LIBCDIO='ON'")
1478 #:phases
1479 (modify-phases %standard-phases
1480 (add-after 'unpack 'cd-subdir
1481 (lambda _ (chdir "pcsxr")))
1482 (add-before 'configure 'fix-cdio-lookup
1483 (lambda* (#:key inputs #:allow-other-keys)
1484 (substitute* "cmake/FindCdio.cmake"
1485 (("/usr/include/cdio")
1486 (string-append (assoc-ref inputs "libcdio") "/include/cdio"))))))))
1487 (native-inputs
1488 `(("pkg-config" ,pkg-config)
1489 ("intltool" ,intltool)
1490 ("glib" ,glib "bin")))
1491 (inputs
1492 `(("libcdio" ,libcdio)
1493 ("sdl2" ,sdl2)
1494 ("gtk+" ,gtk+)
1495 ("ffmpeg" ,ffmpeg)
1496 ("libxv" ,libxv)
1497 ("libarchive" ,libarchive)
1498 ("pulseaudio" ,pulseaudio)))
1499 (home-page "https://archive.codeplex.com/?p=pcsxr")
1500 (synopsis "PlayStation emulator")
1501 (description
1502 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1503improvements.")
1504 (license license:gpl2+))))
f6a0be2f
DW
1505
1506(define-public gens-gs
1507 (package
1508 (name "gens-gs")
1509 (version "7")
1510 (source
1511 (origin
1512 (method url-fetch)
1513 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1514 version ".tar.gz"))
1515 (sha256
1516 (base32
1517 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1518 (build-system glib-or-gtk-build-system)
1519 (arguments
1520 `(#:system "i686-linux"
1521 #:phases
1522 (modify-phases %standard-phases
1523 (add-after 'unpack 'fix-CFLAGS
1524 (lambda* _
1525 ;; Remove GTK API deprecation flags that cause build errors.
1526 (substitute* "configure"
1527 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1528 #t)))))
1529 (native-inputs
1530 `(("pkg-config" ,pkg-config)
1531 ("nasm" ,nasm)))
1532 (inputs
1533 `(("sdl" ,sdl)
1534 ("gtk" ,gtk+-2)))
1535 (home-page "https://segaretro.org/Gens/GS")
1536 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1537 (description
1538 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1539derived from Gens. Project goals include clean source code, combined features
1540from various forks of Gens, and improved platform portability.")
1541 (supported-systems '("i686-linux" "x86_64-linux"))
1542 (license license:gpl2+)))