services: xorg: Filter modules based on system
[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
c66f3b3b
JK
310;; Note: higan v107 has been released, but as explained by the dialog that
311;; appears after starting the new version, it's an experimental release. The
312;; author recommends v106 for general use.
313;;
314;; When updating to v107 (or probably beyond), sdl will have to be replaced
315;; with sdl2, and libxrandr will need to be added to inputs. The patch
316;; `higan-remove-march-native-flag.patch' will not be necessary, since the flag
317;; is now being added only for `platform=local', which is not the default.
9af704c5
RH
318(define-public higan
319 (package
320 (name "higan")
321 (version "106")
322 (source
323 (origin
f3686999
JK
324 (method git-fetch)
325 (uri (git-reference
326 (url "https://github.com/byuu/higan/")
327 (commit (string-append "v" version))))
328 (file-name (git-file-name name version))
9af704c5 329 (sha256
f3686999 330 (base32 "1mxivf8124vz4hl0b0xa1yqv0z9m3i12v9psmbpqkprrbq0wbgn1"))
9af704c5
RH
331 (patches (search-patches "higan-remove-march-native-flag.patch"))))
332 (build-system gnu-build-system)
333 (native-inputs
334 `(("pkg-config" ,pkg-config)))
335 (inputs
336 `(("alsa-lib" ,alsa-lib)
337 ("ao" ,ao)
338 ("eudev" ,eudev)
339 ("gtk+" ,gtk+-2)
340 ("gtksourceview-2" ,gtksourceview-2)
341 ("libxv" ,libxv)
342 ("mesa" ,mesa)
343 ("openal" ,openal)
344 ("pulseaudio" ,pulseaudio)
345 ("sdl" ,sdl)))
346 (arguments
347 '(#:phases
348 (let ((build-phase (assoc-ref %standard-phases 'build))
349 (install-phase (assoc-ref %standard-phases 'install)))
350 (modify-phases %standard-phases
351 ;; The higan build system has no configure phase.
352 (delete 'configure)
353 (add-before 'build 'chdir-to-higan
354 (lambda _
6d34d3f8
JK
355 (chdir "higan")
356 #t))
9af704c5
RH
357 (add-before 'install 'create-/share/applications
358 (lambda* (#:key outputs #:allow-other-keys)
359 (let ((out (assoc-ref outputs "out")))
360 ;; It seems the author forgot to do this in the Makefile.
6d34d3f8
JK
361 (mkdir-p (string-append out "/share/applications"))
362 #t)))
9af704c5
RH
363 (add-after 'install 'chdir-to-icarus
364 (lambda _
6d34d3f8
JK
365 (chdir "../icarus")
366 #t))
9af704c5
RH
367 (add-after 'chdir-to-icarus 'build-icarus build-phase)
368 (add-after 'build-icarus 'install-icarus install-phase)
369 (add-after 'install-icarus 'wrap-higan-executable
370 (lambda* (#:key inputs outputs #:allow-other-keys)
371 (let* ((out (assoc-ref outputs "out"))
372 (bin (string-append out "/bin"))
373 (higan (string-append bin "/higan"))
374 (higan-original (string-append higan "-original"))
375 (bash (string-append (assoc-ref inputs "bash")
376 "/bin/bash"))
377 (coreutils (assoc-ref inputs "coreutils"))
378 (mkdir (string-append coreutils "/bin/mkdir"))
379 (cp (string-append coreutils "/bin/cp"))
380 (cp-r (string-append cp " -r --no-preserve=mode")))
381 ;; First, have the executable make sure ~/.local/share/higan
382 ;; contains up to date files. Higan insists on looking there
383 ;; for these data files.
384 (rename-file higan higan-original)
385 (with-output-to-file higan
386 (lambda ()
387 (display
388 (string-append
389 "#!" bash "\n"
390 ;; higan doesn't respect $XDG_DATA_HOME
391 mkdir " -p ~/.local/share\n"
392 cp-r " " out "/share/higan ~/.local/share\n"
393 "exec " higan-original))))
394 (chmod higan #o555)
395 ;; Second, make sure higan will find icarus in PATH.
396 (wrap-program higan
6d34d3f8
JK
397 `("PATH" ":" prefix (,bin)))
398 #t)))))
9af704c5
RH
399 #:make-flags
400 (list "compiler=g++"
401 (string-append "prefix=" (assoc-ref %outputs "out")))
402 ;; There is no test suite.
403 #:tests? #f))
404 (home-page "http://byuu.org/emulation/higan/")
405 (synopsis "Nintendo multi-system emulator")
406 (description
407 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
408consoles, including the Nintendo Entertainment System (NES/Famicom), Super
409Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
410Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
411Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
412 ;; As noted in these files among more:
413 ;; - icarus/icarus.cpp
414 ;; - higan/emulator/emulator.hpp
415 (license license:gpl3)))
416
417(define-public mgba
418 (package
419 (name "mgba")
d63e0ee7
NG
420 (version "0.8.0")
421 (source
422 (origin
423 (method git-fetch)
424 (uri (git-reference
425 (url "https://github.com/mgba-emu/mgba.git")
426 (commit version)))
427 (file-name (git-file-name name version))
428 (sha256
429 (base32 "0m3rgcdv32ms98j7rrmk2hphvn462bwsd6xfz2ssy05398pj4ljh"))
430 (modules '((guix build utils)))
431 (snippet
432 ;; Make sure we don't use the bundled software.
433 '(begin
434 (for-each
435 (lambda (subdir)
436 (let ((lib-subdir (string-append "src/third-party/" subdir)))
437 (delete-file-recursively lib-subdir)))
438 '("libpng" "lzma" "sqlite3" "zlib"))
439 #t))))
9af704c5
RH
440 (build-system cmake-build-system)
441 (arguments
442 `(#:tests? #f ;no "test" target
443 #:configure-flags
444 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
6ea1c6fc 445 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
9af704c5
RH
446 (native-inputs `(("pkg-config" ,pkg-config)))
447 (inputs `(("ffmpeg" ,ffmpeg)
448 ("imagemagick" ,imagemagick)
449 ("libedit" ,libedit)
6dcac920 450 ("libelf" ,libelf)
9af704c5
RH
451 ("libepoxy" ,libepoxy)
452 ("libpng" ,libpng)
453 ("mesa" ,mesa)
454 ("minizip" ,minizip)
455 ("ncurses" ,ncurses)
456 ("qtbase" ,qtbase)
457 ("qtmultimedia" ,qtmultimedia)
458 ("qttools" ,qttools)
459 ("sdl2" ,sdl2)
460 ("sqlite" ,sqlite)
461 ("zlib" ,zlib)))
462 (home-page "https://mgba.io")
463 (synopsis "Game Boy Advance emulator")
464 (description
465 "mGBA is an emulator for running Game Boy Advance games. It aims to be
466faster and more accurate than many existing Game Boy Advance emulators, as
467well as adding features that other emulators lack. It also supports Game Boy
468and Game Boy Color games.")
469 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c" is
470 ;; BSD-3.
471 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
472
c9e7acbf
JK
473(define-public sameboy
474 (package
475 (name "sameboy")
476 (version "0.12.3")
477 (source
478 (origin
479 (method git-fetch)
480 (uri (git-reference
481 (url "https://github.com/LIJI32/SameBoy.git")
482 (commit (string-append "v" version))))
483 (file-name (git-file-name name version))
484 (sha256
485 (base32 "0m5rv2x8qck1kr43xq186pp4kaiay7gd1x775n9qrljcd7z4x6fs"))))
486 (build-system gnu-build-system)
487 (native-inputs
488 `(("rgbds" ,rgbds)
489 ("gcc" ,gcc-9)
490 ("pkg-config" ,pkg-config)))
491 (inputs
492 `(("sdl2" ,sdl2)))
493 (arguments
494 `(#:tests? #f ; There are no tests
495 #:make-flags `("CC=gcc" "CONF=release"
496 ,(string-append "DATA_DIR="
497 (assoc-ref %outputs "out")
498 "/share/sameboy/"))
499 #:phases
500 (modify-phases %standard-phases
501 (delete 'configure)
502 (replace 'install
503 (lambda* (#:key outputs #:allow-other-keys)
504 (let* ((out (assoc-ref outputs "out"))
505 (bin (string-append out "/bin"))
506 (data (string-append out "/share/sameboy/")))
507 (with-directory-excursion "build/bin/SDL"
508 (install-file "sameboy" bin)
509 (delete-file "sameboy")
510 (copy-recursively "." data))))))))
511 (home-page "https://sameboy.github.io/")
512 (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
513 (description "SameBoy is a user friendly Game Boy, Game Boy Color
514and Super Game Boy emulator. SameBoy is accurate and includes a wide
515range of debugging features. It has all the features one would expect
516from an emulator---from save states to scaling filters.")
517 (license license:expat)))
518
9af704c5
RH
519(define-public mupen64plus-core
520 (package
521 (name "mupen64plus-core")
522 (version "2.5")
523 (source
524 (origin
10bcd4bb
TGR
525 (method git-fetch)
526 (uri (git-reference
527 (url "https://github.com/mupen64plus/mupen64plus-core.git")
528 (commit version)))
529 (file-name (git-file-name name version))
9af704c5 530 (sha256
10bcd4bb 531 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
9af704c5
RH
532 (build-system gnu-build-system)
533 (native-inputs
534 `(("pkg-config" ,pkg-config)
535 ("which" ,which)))
536 (inputs
537 `(("freetype" ,freetype)
538 ("glu" ,glu)
539 ("libpng" ,libpng)
540 ("mesa" ,mesa)
541 ("sdl2" ,sdl2)
542 ("zlib" ,zlib)))
543 (arguments
544 '(#:phases
545 (modify-phases %standard-phases
546 ;; The mupen64plus build system has no configure phase.
547 (delete 'configure)
548 ;; Makefile is in a subdirectory.
549 (add-before
eaa2b35c 550 'build 'chdir-to-project-directory
9af704c5 551 (lambda _
eaa2b35c
TGR
552 (chdir "projects/unix")
553 #t)))
9af704c5
RH
554 #:make-flags (let ((out (assoc-ref %outputs "out")))
555 (list "all" (string-append "PREFIX=" out)))
556 ;; There are no tests.
557 #:tests? #f))
558 ;; As per the Makefile (in projects/unix/Makefile):
559 (supported-systems '("i686-linux" "x86_64-linux"))
eaa2b35c 560 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
561 (synopsis "Nintendo 64 emulator core library")
562 (description
563 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
564which is capable of accurately playing many games. This package contains the
565core library.")
566 (license license:gpl2+)))
567
568(define-public mupen64plus-audio-sdl
569 (package
570 (name "mupen64plus-audio-sdl")
571 (version "2.5")
572 (source
573 (origin
8c6d45cb
TGR
574 (method git-fetch)
575 (uri (git-reference
576 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
577 (commit version)))
578 (file-name (git-file-name name version))
9af704c5 579 (sha256
8c6d45cb 580 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
9af704c5
RH
581 (build-system gnu-build-system)
582 (native-inputs
583 `(("pkg-config" ,pkg-config)
584 ("which" ,which)))
585 (inputs
586 `(("mupen64plus-core" ,mupen64plus-core)
587 ("sdl2" ,sdl2)))
588 (arguments
589 '(#:phases
590 (modify-phases %standard-phases
591 ;; The mupen64plus build system has no configure phase.
592 (delete 'configure)
593 ;; Makefile is in a subdirectory.
594 (add-before
595 'build 'cd-to-project-dir
596 (lambda _
597 (chdir "projects/unix"))))
598 #:make-flags
599 (let ((out (assoc-ref %outputs "out"))
600 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
601 (list "all"
602 (string-append "PREFIX=" out)
603 (string-append "APIDIR=" m64p "/include/mupen64plus")))
604 ;; There are no tests.
605 #:tests? #f))
cf5e9465 606 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
607 (synopsis "Mupen64Plus SDL input plugin")
608 (description
609 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
610which is capable of accurately playing many games. This package contains the
611SDL audio plugin.")
612 (license license:gpl2+)))
613
614(define-public mupen64plus-input-sdl
615 (package
616 (name "mupen64plus-input-sdl")
617 (version "2.5")
618 (source
619 (origin
ef5ef8f5
TGR
620 (method git-fetch)
621 (uri (git-reference
622 (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
623 (commit version)))
624 (file-name (git-file-name name version))
9af704c5 625 (sha256
ef5ef8f5 626 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
9af704c5
RH
627 (build-system gnu-build-system)
628 (native-inputs
629 `(("which" ,which)))
630 (inputs
631 `(("mupen64plus-core" ,mupen64plus-core)
632 ("sdl2" ,sdl2)))
633 (arguments
634 '(#:phases
635 (modify-phases %standard-phases
636 ;; The mupen64plus build system has no configure phase.
637 (delete 'configure)
638 ;; Makefile is in a subdirectory.
639 (add-before
640 'build 'cd-to-project-dir
641 (lambda _
642 (chdir "projects/unix"))))
643 #:make-flags
644 (let ((out (assoc-ref %outputs "out"))
645 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
646 (list "all"
647 (string-append "PREFIX=" out)
648 (string-append "APIDIR=" m64p "/include/mupen64plus")))
649 ;; There are no tests.
650 #:tests? #f))
d738ce16 651 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
652 (synopsis "Mupen64Plus SDL input plugin")
653 (description
654 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
655which is capable of accurately playing many games. This package contains the
656SDL input plugin.")
657 (license license:gpl2+)))
658
659(define-public mupen64plus-rsp-hle
660 (package
661 (name "mupen64plus-rsp-hle")
662 (version "2.5")
663 (source
664 (origin
c4f0c8ba
TGR
665 (method git-fetch)
666 (uri (git-reference
667 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
668 (commit version)))
669 (file-name (git-file-name name version))
9af704c5 670 (sha256
c4f0c8ba 671 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
9af704c5
RH
672 (build-system gnu-build-system)
673 (inputs
674 `(("mupen64plus-core" ,mupen64plus-core)))
675 (arguments
676 '(#:phases
677 (modify-phases %standard-phases
678 ;; The mupen64plus build system has no configure phase.
679 (delete 'configure)
680 ;; Makefile is in a subdirectory.
681 (add-before
682 'build 'cd-to-project-dir
683 (lambda _
684 (chdir "projects/unix"))))
685 #:make-flags
686 (let ((out (assoc-ref %outputs "out"))
687 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
688 (list "all"
689 (string-append "PREFIX=" out)
690 (string-append "APIDIR=" m64p "/include/mupen64plus")))
691 ;; There are no tests.
692 #:tests? #f))
cf396ea5 693 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
694 (synopsis "Mupen64Plus SDL input plugin")
695 (description
696 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
697which is capable of accurately playing many games. This package contains the
698high-level emulation (HLE) RSP processor plugin.")
699 (license license:gpl2+)))
700
701(define-public mupen64plus-rsp-z64
702 (package
703 (name "mupen64plus-rsp-z64")
704 (version "2.0.0")
705 (source
706 (origin
052650c8
TGR
707 (method git-fetch)
708 (uri (git-reference
709 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
710 (commit version)))
711 (file-name (git-file-name name version))
9af704c5 712 (sha256
052650c8 713 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
9af704c5
RH
714 (build-system gnu-build-system)
715 (inputs
716 `(("mupen64plus-core" ,mupen64plus-core)))
717 (arguments
718 '(#:phases
719 (modify-phases %standard-phases
720 ;; The mupen64plus build system has no configure phase.
721 (delete 'configure)
722 ;; Makefile is in a subdirectory.
723 (add-before
724 'build 'cd-to-project-dir
725 (lambda _
726 (chdir "projects/unix"))))
727 #:make-flags
728 (let ((out (assoc-ref %outputs "out"))
729 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
730 (list "all"
731 (string-append "PREFIX=" out)
732 (string-append "APIDIR=" m64p "/include/mupen64plus")))
733 ;; There are no tests.
734 #:tests? #f))
24b03073 735 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
736 (synopsis "Mupen64Plus SDL input plugin")
737 (description
738 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
739which is capable of accurately playing many games. This package contains the
740Z64 RSP processor plugin.")
741 (license license:gpl2+)))
742
743(define-public mupen64plus-video-arachnoid
744 (package
745 (name "mupen64plus-video-arachnoid")
746 (version "2.0.0")
747 (source
748 (origin
2074c8bf
TGR
749 (method git-fetch)
750 (uri (git-reference
751 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
752 (commit version)))
753 (file-name (git-file-name name version))
9af704c5 754 (sha256
2074c8bf 755 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
9af704c5
RH
756 (build-system gnu-build-system)
757 (native-inputs
758 `(("pkg-config" ,pkg-config)
759 ("which" ,which)))
760 (inputs
761 `(("mesa" ,mesa)
762 ("mupen64plus-core" ,mupen64plus-core)))
763 (arguments
764 '(#:phases
765 (modify-phases %standard-phases
766 ;; The mupen64plus build system has no configure phase.
767 (delete 'configure)
768 ;; Makefile is in a subdirectory.
769 (add-before
770 'build 'cd-to-project-dir
771 (lambda _
772 (chdir "projects/unix"))))
773 #:make-flags
774 (let ((out (assoc-ref %outputs "out"))
775 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
776 (list "all"
777 (string-append "PREFIX=" out)
778 (string-append "APIDIR=" m64p "/include/mupen64plus")))
779 ;; There are no tests.
780 #:tests? #f))
5daa2019 781 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
782 (synopsis "Mupen64Plus Rice Video plugin")
783 (description
784 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
785which is capable of accurately playing many games. This package contains the
786Arachnoid video plugin.")
787 (license license:gpl2+)))
788
789(define-public mupen64plus-video-glide64
790 (package
791 (name "mupen64plus-video-glide64")
792 (version "2.0.0")
793 (source
794 (origin
62536186
TGR
795 (method git-fetch)
796 (uri (git-reference
797 (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
798 (commit version)))
799 (file-name (git-file-name name version))
9af704c5 800 (sha256
62536186 801 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
9af704c5
RH
802 (build-system gnu-build-system)
803 (native-inputs
804 `(("pkg-config" ,pkg-config)
805 ("which" ,which)))
806 (inputs
807 `(("mesa" ,mesa)
808 ("mupen64plus-core" ,mupen64plus-core)
809 ("sdl2" ,sdl2)))
810 (arguments
811 '(#:phases
812 (modify-phases %standard-phases
813 ;; The mupen64plus build system has no configure phase.
814 (delete 'configure)
815 ;; Makefile is in a subdirectory.
816 (add-before
817 'build 'cd-to-project-dir
818 (lambda _
819 (chdir "projects/unix")))
820 ;; XXX Should be unnecessary with the next release.
821 (add-before
822 'build 'use-sdl2
823 (lambda _
824 (substitute* "Makefile"
825 (("SDL_CONFIG = (.*)sdl-config" all prefix)
826 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
827 #:make-flags
828 (let ((out (assoc-ref %outputs "out"))
829 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
830 (list "all"
831 (string-append "PREFIX=" out)
832 (string-append "APIDIR=" m64p "/include/mupen64plus")))
833 ;; There are no tests.
834 #:tests? #f))
d1e63866 835 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
836 (synopsis "Mupen64Plus Rice Video plugin")
837 (description
838 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
839which is capable of accurately playing many games. This package contains the
840Glide64 video plugin.")
841 (license license:gpl2+)))
842
843(define-public mupen64plus-video-glide64mk2
844 (package
845 (name "mupen64plus-video-glide64mk2")
846 (version "2.5")
847 (source
848 (origin
e5e7a167
TGR
849 (method git-fetch)
850 (uri (git-reference
851 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
852 (commit version)))
853 (file-name (git-file-name name version))
9af704c5 854 (sha256
e5e7a167 855 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
9af704c5
RH
856 (build-system gnu-build-system)
857 (native-inputs
858 `(("pkg-config" ,pkg-config)
859 ("which" ,which)))
860 (inputs
861 `(("boost" ,boost)
862 ("libpng" ,libpng)
863 ("mesa" ,mesa)
864 ("mupen64plus-core" ,mupen64plus-core)
865 ("sdl2" ,sdl2)
866 ("zlib" ,zlib)))
867 (arguments
868 '(#:phases
869 (modify-phases %standard-phases
870 ;; The mupen64plus build system has no configure phase.
871 (delete 'configure)
872 ;; Makefile is in a subdirectory.
873 (add-before
874 'build 'cd-to-project-dir
875 (lambda _
876 (chdir "projects/unix"))))
877 #:make-flags
878 (let ((out (assoc-ref %outputs "out"))
879 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
880 (list "all"
881 (string-append "PREFIX=" out)
882 (string-append "APIDIR=" m64p "/include/mupen64plus")))
883 ;; There are no tests.
884 #:tests? #f))
84532c2b 885 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
886 (synopsis "Mupen64Plus Rice Video plugin")
887 (description
888 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
889which is capable of accurately playing many games. This package contains the
890Glide64MK2 video plugin.")
891 (license license:gpl2+)))
892
893(define-public mupen64plus-video-rice
894 (package
895 (name "mupen64plus-video-rice")
896 (version "2.5")
897 (source
898 (origin
d42d0a0b
TGR
899 (method git-fetch)
900 (uri (git-reference
901 (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
902 (commit version)))
903 (file-name (git-file-name name version))
9af704c5 904 (sha256
d42d0a0b 905 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
9af704c5
RH
906 (build-system gnu-build-system)
907 (native-inputs
908 `(("pkg-config" ,pkg-config)
909 ("which" ,which)))
910 (inputs
911 `(("libpng" ,libpng)
912 ("mesa" ,mesa)
913 ("mupen64plus-core" ,mupen64plus-core)
914 ("sdl2" ,sdl2)))
915 (arguments
916 '(#:phases
917 (modify-phases %standard-phases
918 ;; The mupen64plus build system has no configure phase.
919 (delete 'configure)
920 ;; Makefile is in a subdirectory.
921 (add-before
922 'build 'cd-to-project-dir
923 (lambda _
924 (chdir "projects/unix"))))
925 #:make-flags
926 (let ((out (assoc-ref %outputs "out"))
927 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
928 (list "all"
929 (string-append "PREFIX=" out)
930 (string-append "APIDIR=" m64p "/include/mupen64plus")))
931 ;; There are no tests.
932 #:tests? #f))
b21acd21 933 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
934 (synopsis "Mupen64Plus Rice Video plugin")
935 (description
936 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
937which is capable of accurately playing many games. This package contains the
938Rice Video plugin.")
939 (license license:gpl2+)))
940
941(define-public mupen64plus-video-z64
942 (package
943 (name "mupen64plus-video-z64")
944 (version "2.0.0")
945 (source
946 (origin
85baeb20
TGR
947 (method git-fetch)
948 (uri (git-reference
949 (url "https://github.com/mupen64plus/mupen64plus-video-z64.git")
950 (commit version)))
951 (file-name (git-file-name name version))
9af704c5 952 (sha256
85baeb20 953 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
fdb61400 954 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
9af704c5
RH
955 (build-system gnu-build-system)
956 (native-inputs
957 `(("pkg-config" ,pkg-config)
958 ("which" ,which)))
959 (inputs
960 `(("glew" ,glew)
961 ("mupen64plus-core" ,mupen64plus-core)
962 ("sdl2" ,sdl2)))
963 (arguments
964 '(#:phases
965 (modify-phases %standard-phases
966 ;; The mupen64plus build system has no configure phase.
967 (delete 'configure)
968 ;; Makefile is in a subdirectory.
969 (add-before
970 'build 'cd-to-project-dir
971 (lambda _
972 (chdir "projects/unix")))
973 ;; XXX Should be unnecessary with the next release.
974 (add-before
975 'build 'use-sdl2
976 (lambda _
977 (substitute* "Makefile"
978 (("SDL_CONFIG = (.*)sdl-config" all prefix)
979 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
980 #:make-flags
981 (let ((out (assoc-ref %outputs "out"))
982 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
983 (list "all"
984 (string-append "PREFIX=" out)
985 (string-append "APIDIR=" m64p "/include/mupen64plus")))
986 ;; There are no tests.
987 #:tests? #f))
26daadb9 988 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
989 (synopsis "Mupen64Plus Z64 video plugin")
990 (description
991 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
992which is capable of accurately playing many games. This package contains the
993Z64 video plugin.")
994 (license license:gpl2+)))
995
996(define-public mupen64plus-ui-console
997 (package
998 (name "mupen64plus-ui-console")
999 (version "2.5")
1000 (source
1001 (origin
225157a0
TGR
1002 (method git-fetch)
1003 (uri (git-reference
1004 (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
1005 (commit version)))
1006 (file-name (git-file-name name version))
9af704c5 1007 (sha256
225157a0 1008 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
9af704c5
RH
1009 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
1010 (build-system gnu-build-system)
1011 (native-inputs
1012 `(("pkg-config" ,pkg-config)
1013 ("which" ,which)))
1014 (inputs
1015 `(("sdl2" ,sdl2)))
1016 ;; Mupen64Plus supports a single data directory and a single plugin
1017 ;; directory in its configuration, yet we need data and plugin files from
1018 ;; a variety of packages. The best way to deal with this is to install
1019 ;; all packages from which data and plugin files are needed into one's
1020 ;; profile, and point the configuration there. Hence, propagate the most
1021 ;; important packages here to save the user from the bother. The patch
1022 ;; mupen64plus-ui-console-notice also gives users instructions on what
1023 ;; they need to do in order to point the configuration to their profile.
1024 (propagated-inputs
1025 `(("mupen64plus-core" ,mupen64plus-core)
1026 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
1027 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
1028 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
1029 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
1030 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
1031 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
1032 (arguments
1033 '(#:phases
1034 (modify-phases %standard-phases
1035 ;; The mupen64plus build system has no configure phase.
1036 (delete 'configure)
1037 ;; Makefile is in a subdirectory.
1038 (add-before
1039 'build 'cd-to-project-dir
1040 (lambda _
1041 (chdir "projects/unix"))))
1042 #:make-flags
1043 (let ((out (assoc-ref %outputs "out"))
1044 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
1045 (list "all"
1046 (string-append "PREFIX=" out)
1047 (string-append "APIDIR=" m64p "/include/mupen64plus")
1048 ;; Trailing slash matters here.
1049 (string-append "COREDIR=" m64p "/lib/")))
1050 ;; There are no tests.
1051 #:tests? #f))
e8079ba4 1052 (home-page "https://www.mupen64plus.org/")
ff452bea 1053 (synopsis "Mupen64Plus command line user interface")
9af704c5
RH
1054 (description
1055 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
1056which is capable of accurately playing many games. This package contains the
1057command line user interface. Installing this package is the easiest way
1058towards a working Mupen64Plus for casual users.")
1059 (license license:gpl2+)))
1060
1061(define-public nestopia-ue
1062 (package
1063 (name "nestopia-ue")
9d39c300 1064 (version "1.48")
3e461b71
TGR
1065 (source
1066 (origin
1067 (method git-fetch)
1068 (uri (git-reference
1069 (url "https://github.com/rdanbrook/nestopia.git")
1070 (commit version)))
1071 (file-name (git-file-name name version))
1072 (sha256
1073 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1074 (modules '((guix build utils)))
1075 (snippet
1076 '(begin
1077 ;; We don't need libretro for the GNU/Linux build.
1078 (delete-file-recursively "libretro")
1079 #t))))
9d39c300 1080 (build-system cmake-build-system)
9af704c5
RH
1081 (native-inputs
1082 `(("pkg-config" ,pkg-config)))
1083 (inputs
1084 `(("ao" ,ao)
9af704c5
RH
1085 ("gtk+" ,gtk+)
1086 ("libarchive" ,libarchive)
9d39c300 1087 ("libepoxy" ,libepoxy)
9af704c5
RH
1088 ("sdl2" ,sdl2)
1089 ("zlib" ,zlib)))
1090 (arguments
1091 '(#:phases
1092 (modify-phases %standard-phases
9d39c300
KK
1093 ;; This fixes the file chooser crash that happens with GTK 3.
1094 (add-after 'install 'wrap-program
1095 (lambda* (#:key inputs outputs #:allow-other-keys)
1096 (let* ((out (assoc-ref outputs "out"))
1097 (nestopia (string-append out "/bin/nestopia"))
1098 (gtk (assoc-ref inputs "gtk+"))
1099 (gtk-share (string-append gtk "/share")))
1100 (wrap-program nestopia
1101 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
9af704c5
RH
1102 ;; There are no tests.
1103 #:tests? #f))
1104 (home-page "http://0ldsk00l.ca/nestopia/")
1105 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1106 (description
1107 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1108System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1109emulation community. It provides highly accurate emulation.")
1110 (license license:gpl2+)))
1111
1112(define-public retroarch
1113 (package
1114 (name "retroarch")
bd671624 1115 (version "1.8.1")
9af704c5
RH
1116 (source
1117 (origin
1fc346de
TGR
1118 (method git-fetch)
1119 (uri (git-reference
1120 (url "https://github.com/libretro/RetroArch.git")
1121 (commit (string-append "v" version))))
1122 (file-name (git-file-name name version))
9af704c5 1123 (sha256
77549754
TGR
1124 (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))
1125 (patches
1126 (search-patches "retroarch-disable-online-updater.patch"))
1127 (modules '((guix build utils)))
1128 (snippet
1129 '(begin
1130 ;; Don't suggest using the Online Updater if available: it never
1131 ;; is. This disables translation of this particular message.
1132 (substitute* (find-files "menu/drivers" "\\.c$")
1133 (("msg_hash_to_str\\(MSG_MISSING_ASSETS\\)")
1134 "\"Warning: Missing assets, go get some\""))
1135 #t))))
9af704c5
RH
1136 (build-system gnu-build-system)
1137 (arguments
f21967a4 1138 `(#:tests? #f ; no tests
9af704c5
RH
1139 #:phases
1140 (modify-phases %standard-phases
1141 (replace 'configure
1142 (lambda* (#:key inputs outputs #:allow-other-keys)
1143 (let* ((out (assoc-ref outputs "out"))
1144 (etc (string-append out "/etc"))
12a3abc6
RH
1145 (vulkan (assoc-ref inputs "vulkan-loader"))
1146 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
77549754 1147 ;; Hard-code some store file names.
9af704c5
RH
1148 (substitute* "gfx/common/vulkan_common.c"
1149 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
12a3abc6
RH
1150 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1151 (("/usr/local/share/wayland-protocols")
1152 (string-append wayland-protocols "/share/wayland-protocols")))
9af704c5
RH
1153 (substitute* "qb/qb.libs.sh"
1154 (("/bin/true") (which "true")))
77549754 1155
fade67ab
EF
1156 ;; Use shared zlib.
1157 (substitute* '("libretro-common/file/archive_file_zlib.c"
e85bb00c 1158 "libretro-common/streams/trans_stream_zlib.c")
fade67ab 1159 (("<compat/zlib.h>") "<zlib.h>"))
77549754 1160
9af704c5
RH
1161 ;; The configure script does not yet accept the extra arguments
1162 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
f21967a4
EF
1163 (invoke
1164 "./configure"
1165 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1166 (%current-system)))
1167 '("--enable-neon" "--enable-floathard")
1168 '())
1169 (string-append "--prefix=" out)
73dd0654
TGR
1170 (string-append "--global-config-dir=" etc)
1171 "--disable-builtinminiupnpc")))))))
9af704c5
RH
1172 (inputs
1173 `(("alsa-lib" ,alsa-lib)
1174 ("ffmpeg" ,ffmpeg)
1175 ("freetype" ,freetype)
1176 ("libxinerama" ,libxinerama)
1177 ("libxkbcommon" ,libxkbcommon)
1178 ("libxml2" ,libxml2)
45267af1 1179 ("libxrandr" ,libxrandr)
9af704c5
RH
1180 ("libxv" ,libxv)
1181 ("mesa" ,mesa)
73dd0654 1182 ("miniupnpc" ,miniupnpc)
9af704c5
RH
1183 ("openal" ,openal)
1184 ("pulseaudio" ,pulseaudio)
1185 ("python" ,python)
76b7d8fd 1186 ("qtbase" ,qtbase)
9af704c5
RH
1187 ("sdl" ,sdl2)
1188 ("udev" ,eudev)
e6fcf903 1189 ("vulkan-loader" ,vulkan-loader)
c695fb76 1190 ("wayland" ,wayland)
9af704c5
RH
1191 ("zlib" ,zlib)))
1192 (native-inputs
1193 `(("pkg-config" ,pkg-config)
12a3abc6 1194 ("wayland-protocols" ,wayland-protocols)
9af704c5
RH
1195 ("which" ,which)))
1196 (home-page "https://www.libretro.com/")
1197 (synopsis "Reference frontend for the libretro API")
1198 (description
1199 "Libretro is a simple but powerful development interface that allows for
1200the easy creation of emulators, games and multimedia applications that can plug
1201straight into any libretro-compatible frontend. RetroArch is the official
1202reference frontend for the libretro API, currently used by most as a modular
1203multi-system game/emulator system.")
1204 (license license:gpl3+)))
4c40ed9d
NG
1205
1206(define-public scummvm
1207 (package
1208 (name "scummvm")
2d4b2488 1209 (version "2.1.1")
4c40ed9d
NG
1210 (source
1211 (origin
1212 (method url-fetch)
1213 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1214 "/scummvm-" version ".tar.xz"))
1215 (sha256
2d4b2488 1216 (base32 "1a6waf1ybp91nwva8g650cljlfb1di4l0jv13vg6yfgkas9pclsp"))))
4c40ed9d
NG
1217 (build-system gnu-build-system)
1218 (arguments
6177b14b 1219 `(#:tests? #f ;require "git"
4c40ed9d
NG
1220 #:configure-flags (list "--enable-release") ;for optimizations
1221 #:phases
1222 (modify-phases %standard-phases
161b297b
NG
1223 (add-after 'unpack 'fix-build
1224 ;; XXX: The following works around a build failure introduced when
1225 ;; Fluidsynth was updated to version 2.1. It has been applied
1226 ;; upstream as 68758a879e0c8ecc0d40962516d4e808aa4e15e5 and can be
2d4b2488 1227 ;; removed once this commit makes it into a release.
161b297b
NG
1228 (lambda _
1229 (substitute* "audio/softsynth/fluidsynth.cpp"
1230 (("#include <fluidsynth.h>") "")
1231 (("#include \"common/scummsys.h\"") "#include \"config.h\"")
1232 (("#include \"common/config-manager.h\"" line)
1233 (string-append "#include <fluidsynth.h>\n"
1234 "#include \"common/scummsys.h\"\n"
1235 line)))
1236 #t))
4c40ed9d
NG
1237 (replace 'configure
1238 ;; configure does not work followed by both "SHELL=..." and
1239 ;; "CONFIG_SHELL=..."; set environment variables instead
1240 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1241 (let* ((out (assoc-ref outputs "out"))
1242 (bash (which "bash"))
1243 (flags `(,(string-append "--prefix=" out)
1244 ,@configure-flags)))
1245 (setenv "SHELL" bash)
1246 (setenv "CONFIG_SHELL" bash)
1247 (apply invoke "./configure" flags)))))))
1248 (native-inputs
64e9d128
NG
1249 `(("nasm" ,nasm)
1250 ("pkg-config" ,pkg-config)))
4c40ed9d
NG
1251 (inputs
1252 `(("alsa-lib" ,alsa-lib)
1253 ("faad2" ,faad2)
1254 ("fluidsynth" ,fluidsynth)
1255 ("freetype" ,freetype)
6177b14b 1256 ("liba52" ,liba52)
4c40ed9d
NG
1257 ("libflac" ,flac)
1258 ("libjpeg-turbo" ,libjpeg-turbo)
1259 ("libmad" ,libmad)
1260 ("libmpeg2" ,libmpeg2)
1261 ("libogg" ,libogg)
1262 ("libpng" ,libpng)
1263 ("libtheora" ,libtheora)
1264 ("libvorbis" ,libvorbis)
6177b14b 1265 ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
4c40ed9d
NG
1266 ("zlib" ,zlib)))
1267 (home-page "https://www.scummvm.org/")
1268 (synopsis "Engine for several graphical adventure games")
1269 (description "ScummVM is a program which allows you to run certain
1270classic graphical point-and-click adventure games, provided you
1271already have their data files. The clever part about this: ScummVM
1272just replaces the executables shipped with the games, allowing you to
1273play them on systems for which they were never designed!")
1274 (license license:gpl2+)))
c8b2fd28
NG
1275
1276(define-public mame
1277 (package
1278 (name "mame")
0b15c110 1279 (version "0.218")
c8b2fd28
NG
1280 (source
1281 (origin
1282 (method git-fetch)
1283 (uri (git-reference
1284 (url "https://github.com/mamedev/mame.git")
1285 (commit (apply string-append "mame" (string-split version #\.)))))
1286 (file-name (git-file-name name version))
1287 (sha256
0b15c110 1288 (base32 "1c43hqfabc7spkyk5ma4bjdb0yqm93sdg5g13ka8mvi462snrfd7"))
c8b2fd28
NG
1289 (modules '((guix build utils)))
1290 (snippet
1291 ;; Remove bundled libraries.
1292 '(begin
1293 (with-directory-excursion "3rdparty"
1294 (for-each delete-file-recursively
1295 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1296 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1297 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1298 #t))))
1299 (build-system gnu-build-system)
1300 (arguments
1301 `(#:make-flags
1302 (cons*
430e1528
NG
1303 ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
1304 "NOWERROR=1"
c8b2fd28
NG
1305 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1306 (string-append "SDL_INI_PATH="
1307 (assoc-ref %outputs "out")
1308 "/share/mame/ini")
1309 (map (lambda (lib)
1310 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1311 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1312 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1313 #:tests? #f ;no test in regular release
1314 #:phases
1315 (modify-phases %standard-phases
1316 (delete 'configure)
1317 (add-after 'build 'build-documentation
1318 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1319 (replace 'install
1320 ;; Upstream does not provide an installation phase.
1321 (lambda* (#:key outputs #:allow-other-keys)
1322 (let* ((out (assoc-ref outputs "out"))
1323 (share (string-append out "/share/mame")))
1324 ;; Install data.
1325 (for-each (lambda (dir)
1326 (copy-recursively dir (string-append share "/" dir)))
1327 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1328 "plugins" "samples"))
1329 (let ((keymaps (string-append share "/keymaps")))
1330 (for-each (lambda (file) (install-file file keymaps))
1331 (find-files "keymaps" ".*LINUX\\.map")))
1332 (let ((fonts (string-append share "/fonts")))
1333 (install-file "uismall.bdf" fonts))
6921e95a
EF
1334 (when (file-exists? "mame64")
1335 (rename-file "mame64" "mame"))
c8b2fd28
NG
1336 (install-file "mame" (string-append out "/bin")))
1337 #t))
1338 (add-after 'install 'install-documentation
1339 (lambda* (#:key outputs #:allow-other-keys)
1340 (let* ((out (assoc-ref outputs "out"))
1341 (man (string-append out "/share/man/man1"))
1342 (info (string-append out "/share/info")))
1343 (install-file "docs/build/man/MAME.1" man)
1344 (install-file "docs/build/texinfo/MAME.info" info))
1345 #t))
1346 (add-after 'install 'install-ini-file
1347 ;; Generate an ini file so as to set some directories (e.g., roms)
1348 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1349 ;;
1350 ;; XXX: We need to insert absolute references to the store. It can
1351 ;; be an issue if they leak into user's home directory, e.g., with
1352 ;; "mame -createconfig" and the package is later GC'ed.
1353 (lambda* (#:key outputs #:allow-other-keys)
1354 (let* ((out (assoc-ref outputs "out"))
1355 (share (string-append out "/share/mame"))
1356 (ini (string-append share "/ini")))
1357 (with-output-to-file (string-append ini "/mame.ini")
1358 (lambda _
1359 (format #t
1360 "inipath $HOME/.mame;~a/ini~@
1361 homepath $HOME/mame~@
1362 rompath $HOME/mame/roms~@
1363 samplepath $HOME/mame/samples;~a/samples~@
1364 cheatpath $HOME/mame/cheat~@
1365 artpath $HOME/mame/artwork;~a/artwork~@
1366 crosshairpath $HOME/mame/crosshair~@
1367 snapshot_directory $HOME/mame/snapshots~@
1368 hashpath ~a/hash~@
1369 fontpath $HOME/mame/fonts;~a/fonts~@
1370 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1371 bgfx_path ~a/bgfx~@
1372 pluginspath $HOME/mame/plugins;~a/plugins~@
1373 languagepath ~a/language~@
1374 cfg_directory $HOME/.mame/cfg~@
1375 nvram_directory $HOME/.mame/nvram~@
1376 input_directory $HOME/.mame/inp~@
1377 state_directory $HOME/.mame/sta~@
1378 diff_directory $HOME/.mame/diff~@
1379 comment_directory $HOME/.mame/comments~%"
1380 share share share share share share share share
1381 share)))
1382 (with-output-to-file (string-append ini "/ui.ini")
1383 (lambda _
1384 (format #t
1385 "historypath $HOME/mame/history~@
1386 categorypath $HOME/mame/folders~@
1387 cabinets_directory $HOME/mame/cabinets~@
1388 cpanels_directory $HOME/mame/cpanel~@
1389 pcbs_directory $HOME/mame/pcb~@
1390 flyers_directory $HOME/mame/flyers~@
1391 titles_directory $HOME/mame/titles~@
1392 ends_directory $HOME/mame/ends~@
1393 marquees_directory $HOME/mame/marquees~@
1394 artwork_preview_directory $HOME/mame/artpreview~@
1395 bosses_directory $HOME/mame/bosses~@
1396 logos_directory $HOME/mame/logo~@
1397 scores_directory $HOME/mame/scores~@
1398 versus_directory $HOME/mame/versus~@
1399 gameover_directory $HOME/mame/gameover~@
1400 howto_directory $HOME/mame/howto~@
1401 select_directory $HOME/mame/select~@
1402 icons_directory $HOME/mame/icons~@
1403 covers_directory $HOME/mame/covers~@
1404 ui_path $HOME/.mame/ui~%")))
1405 #t)))
1406 (add-after 'install 'install-desktop-file
1407 (lambda* (#:key outputs #:allow-other-keys)
1408 (let* ((out (assoc-ref outputs "out"))
1409 (desktop (string-append out "/share/applications"))
1410 (executable (string-append out "/bin/mame")))
1411 (mkdir-p desktop)
1412 (with-output-to-file (string-append desktop "/mame.desktop")
1413 (lambda _
1414 (format #t
1415 "[Desktop Entry]~@
1416 Name=mame~@
1417 Comment=Multi-purpose emulation framework~@
1418 Exec=~a~@
1419 TryExec=~@*~a~@
1420 Terminal=false~@
1421 Type=Application~@
1422 Categories=Game;Emulator;~@
1423 Keywords=Game;Emulator;Arcade;~%"
1424 executable)))
1425 #t))))))
1426 (native-inputs
1427 `(("pkg-config" ,pkg-config)
03370346
NG
1428 ("sphinx" ,python-sphinx)
1429 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
c8b2fd28
NG
1430 ("texinfo" ,texinfo)))
1431 (inputs
1432 `(("alsa-lib" ,alsa-lib)
1433 ("asio" ,asio)
1434 ("expat" ,expat)
1435 ("flac" ,flac)
1436 ("fontconfig" ,fontconfig)
1437 ("glm" ,glm)
7b24b76b 1438 ("libjpeg" ,libjpeg-turbo)
9f0650df 1439 ("libxi" ,libxi)
c8b2fd28
NG
1440 ("libxinerama" ,libxinerama)
1441 ("lua" ,lua)
1442 ("portaudio" ,portaudio)
1443 ("portmidi" ,portmidi)
63247277 1444 ("pugixml" ,pugixml)
c8b2fd28
NG
1445 ("python-wrapper" ,python-wrapper)
1446 ("qtbase" ,qtbase)
1447 ("rapidjson" ,rapidjson)
1448 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1449 ("sqlite" ,sqlite)
1450 ("utf8proc" ,utf8proc)
1451 ("zlib" ,zlib)))
1452 (home-page "http://mamedev.org/")
1453 (synopsis "Multi-purpose emulation framework")
1454 (description "MAME's purpose is to preserve decades of software
1455history. As electronic technology continues to rush forward, MAME
1456prevents this important @emph{vintage} software from being lost and
1457forgotten. This is achieved by documenting the hardware and how it
1458functions. The source code to MAME serves as this documentation.")
1459 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1460 ;; However, over 90% of the files are under Expat license. Also, artwork,
1461 ;; keymaps, languages and samples are under CC0.
1462 (license (list license:gpl2+ license:expat license:cc0))))
1403e1f7
PN
1463
1464(define-public pcsxr
1465 ;; No release since 2017.
1466 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1467 (package
1468 (name "pcsxr")
1469 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1470 (version "1.9.95")
1471 (source
1472 (origin
1473 (method git-fetch)
1474 (uri (git-reference
1475 (url "https://github.com/pcsxr/PCSX-Reloaded")
1476 (commit commit)))
1477 (sha256
1478 (base32
1479 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1480 (file-name (git-file-name name commit))))
1481 (build-system cmake-build-system)
1482 (arguments
1483 `(#:tests? #f ;no "test" target
1484 #:configure-flags
1485 (list "-DSND_BACKEND=pulse"
1486 "-DENABLE_CCDDA='ON'"
1487 "-DUSE_LIBARCHIVE='ON'"
1488 "-DUSE_LIBCDIO='ON'")
1489 #:phases
1490 (modify-phases %standard-phases
1491 (add-after 'unpack 'cd-subdir
1ef71f52 1492 (lambda _ (chdir "pcsxr") #t))
1403e1f7
PN
1493 (add-before 'configure 'fix-cdio-lookup
1494 (lambda* (#:key inputs #:allow-other-keys)
1495 (substitute* "cmake/FindCdio.cmake"
1496 (("/usr/include/cdio")
1ef71f52
KK
1497 (string-append (assoc-ref inputs "libcdio") "/include/cdio")))
1498 #t))
1499 (add-after 'install 'wrap-program
1500 (lambda* (#:key inputs outputs #:allow-other-keys)
1501 (wrap-program (string-append (assoc-ref outputs "out")
1502 "/bin/pcsxr")
1503 ;; For GtkFileChooserDialog.
1504 `("GSETTINGS_SCHEMA_DIR" =
1505 (,(string-append (assoc-ref inputs "gtk+")
1506 "/share/glib-2.0/schemas"))))
1507 #t)))))
1403e1f7
PN
1508 (native-inputs
1509 `(("pkg-config" ,pkg-config)
1510 ("intltool" ,intltool)
1511 ("glib" ,glib "bin")))
1512 (inputs
1513 `(("libcdio" ,libcdio)
1514 ("sdl2" ,sdl2)
1515 ("gtk+" ,gtk+)
1516 ("ffmpeg" ,ffmpeg)
1517 ("libxv" ,libxv)
1518 ("libarchive" ,libarchive)
1519 ("pulseaudio" ,pulseaudio)))
1520 (home-page "https://archive.codeplex.com/?p=pcsxr")
1521 (synopsis "PlayStation emulator")
1522 (description
1523 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1524improvements.")
1525 (license license:gpl2+))))
f6a0be2f
DW
1526
1527(define-public gens-gs
1528 (package
1529 (name "gens-gs")
1530 (version "7")
1531 (source
1532 (origin
1533 (method url-fetch)
1534 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1535 version ".tar.gz"))
1536 (sha256
1537 (base32
1538 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1539 (build-system glib-or-gtk-build-system)
1540 (arguments
1541 `(#:system "i686-linux"
1542 #:phases
1543 (modify-phases %standard-phases
1544 (add-after 'unpack 'fix-CFLAGS
1545 (lambda* _
1546 ;; Remove GTK API deprecation flags that cause build errors.
1547 (substitute* "configure"
1548 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1549 #t)))))
1550 (native-inputs
1551 `(("pkg-config" ,pkg-config)
1552 ("nasm" ,nasm)))
1553 (inputs
1554 `(("sdl" ,sdl)
1555 ("gtk" ,gtk+-2)))
1556 (home-page "https://segaretro.org/Gens/GS")
1557 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1558 (description
1559 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1560derived from Gens. Project goals include clean source code, combined features
1561from various forks of Gens, and improved platform portability.")
1562 (supported-systems '("i686-linux" "x86_64-linux"))
1563 (license license:gpl2+)))