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