doc: fcgiwrap-configuration: Remove stray period.
[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>
8f4d15f1 9;;; Copyright © 2017, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
9af704c5 10;;; Copyright © 2017 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>
e5f9ec8b
RH
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)
1403e1f7 31 #:use-module (ice-9 match)
e5f9ec8b
RH
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
9af704c5 34 #:use-module (guix download)
e5f9ec8b 35 #:use-module (guix git-download)
9af704c5
RH
36 #:use-module (guix svn-download)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages algebra)
4c40ed9d 39 #:use-module (gnu packages assembly)
e5f9ec8b 40 #:use-module (gnu packages audio)
9af704c5
RH
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages boost)
44 #:use-module (gnu packages backup)
1403e1f7 45 #:use-module (gnu packages cdrom)
e5f9ec8b
RH
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages curl)
e8ffa382 48 #:use-module (gnu packages elf)
e5f9ec8b
RH
49 #:use-module (gnu packages fonts)
50 #:use-module (gnu packages fontutils)
9af704c5 51 #:use-module (gnu packages freedesktop)
e5f9ec8b 52 #:use-module (gnu packages game-development)
cbf58afa 53 #:use-module (gnu packages gcc)
e5f9ec8b
RH
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)
9af704c5
RH
59 #:use-module (gnu packages imagemagick)
60 #:use-module (gnu packages libedit)
e5f9ec8b
RH
61 #:use-module (gnu packages libusb)
62 #:use-module (gnu packages linux)
c8b2fd28
NG
63 #:use-module (gnu packages lua)
64 #:use-module (gnu packages maths)
4c40ed9d 65 #:use-module (gnu packages mp3)
c8b2fd28 66 #:use-module (gnu packages music)
9af704c5 67 #:use-module (gnu packages ncurses)
c8b2fd28 68 #:use-module (gnu packages networking)
e5f9ec8b
RH
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages pulseaudio)
9af704c5 71 #:use-module (gnu packages python)
e5f9ec8b
RH
72 #:use-module (gnu packages qt)
73 #:use-module (gnu packages sdl)
9d0c291e 74 #:use-module (gnu packages sphinx)
cd0322a3 75 #:use-module (gnu packages sqlite)
c8b2fd28
NG
76 #:use-module (gnu packages texinfo)
77 #:use-module (gnu packages textutils)
e5f9ec8b
RH
78 #:use-module (gnu packages tls)
79 #:use-module (gnu packages upnp)
80 #:use-module (gnu packages video)
9af704c5 81 #:use-module (gnu packages vulkan)
e5f9ec8b 82 #:use-module (gnu packages wxwidgets)
9af704c5 83 #:use-module (gnu packages xdisorg)
e5f9ec8b 84 #:use-module (gnu packages xiph)
9af704c5 85 #:use-module (gnu packages xml)
e5f9ec8b 86 #:use-module (gnu packages xorg)
c8b2fd28 87 #:use-module (gnu packages web)
9af704c5 88 #:use-module (guix build-system cmake)
f6a0be2f 89 #:use-module (guix build-system glib-or-gtk)
9af704c5
RH
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)))
e5f9ec8b
RH
124
125;; Building from recent Git because the official 5.0 release no longer builds.
126(define-public dolphin-emu
2b332c51
RH
127 (let ((commit "a9745400ec5cea7e55d94955afbdc44d1a4982d1")
128 (revision "7"))
e5f9ec8b
RH
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))
85280804
EF
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)))
fab8d41c 146 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
85280804 147 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
2b332c51 148 "miniupnpc" "MoltenVK" "zlib"))
85280804
EF
149 ;; Clean up source.
150 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
151 #t))
e5f9ec8b
RH
152 (sha256
153 (base32
2b332c51 154 "0ic08ii4vlqlmk2wkfc99jiy6nji2wfq56r7slj23wgvhznnaabk"))))
e5f9ec8b
RH
155 (build-system cmake-build-system)
156 (arguments
157 '(#:tests? #f
e5f9ec8b
RH
158 #:phases
159 (modify-phases %standard-phases
6bebad77 160 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
e5f9ec8b
RH
161 (lambda* (#:key inputs outputs #:allow-other-keys)
162 (let ((fontfile
163 (string-append (assoc-ref inputs "font-wqy-microhei")
6bebad77
RH
164 "/share/fonts/truetype/wqy-microhei.ttc"))
165 (libvulkan
e6fcf903 166 (string-append (assoc-ref inputs "vulkan-loader")
6bebad77 167 "/lib/libvulkan.so")))
e5f9ec8b 168 (chdir "docs")
0fe041bd 169 (invoke "bash" "-c" "g++ -O2 $(freetype-config \
e5f9ec8b
RH
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 "..")
6bebad77 176 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
2b332c51
RH
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") ""))
e5f9ec8b
RH
182 #t))))
183
fab8d41c
RH
184 ;; The FindGTK2 cmake script only checks hardcoded directories for
185 ;; glib/gtk headers.
186
e5f9ec8b 187 #:configure-flags
fab8d41c 188 (list (string-append "-DX11_INCLUDE_DIR="
e5f9ec8b
RH
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")))
e5f9ec8b
RH
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)
e7039f10 204 ("ffmpeg" ,ffmpeg)
e5f9ec8b
RH
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)
fab8d41c 223 ("pugixml" ,pugixml)
e5f9ec8b
RH
224 ("pulseaudio" ,pulseaudio)
225 ("qtbase" ,qtbase)
226 ("sdl2" ,sdl2)
227 ("sfml" ,sfml)
228 ("soil" ,soil)
229 ("soundtouch" ,soundtouch)
e6fcf903 230 ("vulkan-loader" ,vulkan-loader)
e5f9ec8b
RH
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.")
e89bfc2d 238 (supported-systems '("x86_64-linux" "aarch64-linux"))
e5f9ec8b
RH
239 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
240 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
9af704c5
RH
241
242(define-public dosbox
243 (package
244 (name "dosbox")
b09e4960 245 (version "0.74-3")
9af704c5 246 (source (origin
478040d4
RH
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"))
9af704c5
RH
252 (sha256
253 (base32
b09e4960 254 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
9af704c5 255 (build-system gnu-build-system)
9af704c5
RH
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")
eca0f3d0 407 (version "0.7.3")
9af704c5 408 (source (origin
6ea1c6fc
RH
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))
9af704c5
RH
414 (sha256
415 (base32
eca0f3d0 416 "1wrmwh50rv8bd328r8cisrihq6h90kx2bfb0vmjfbsd3l1jvgrgm"))
9af704c5
RH
417 (modules '((guix build utils)))
418 (snippet
419 ;; Make sure we don't use the bundled software.
6cbee49d
MW
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))))
9af704c5
RH
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
6ea1c6fc 432 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
9af704c5
RH
433 (native-inputs `(("pkg-config" ,pkg-config)))
434 (inputs `(("ffmpeg" ,ffmpeg)
435 ("imagemagick" ,imagemagick)
436 ("libedit" ,libedit)
6dcac920 437 ("libelf" ,libelf)
9af704c5
RH
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
10bcd4bb
TGR
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))
9af704c5 471 (sha256
10bcd4bb 472 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
9af704c5
RH
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
eaa2b35c 491 'build 'chdir-to-project-directory
9af704c5 492 (lambda _
eaa2b35c
TGR
493 (chdir "projects/unix")
494 #t)))
9af704c5
RH
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"))
eaa2b35c 501 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
8c6d45cb
TGR
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))
9af704c5 520 (sha256
8c6d45cb 521 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
9af704c5
RH
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))
cf5e9465 547 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
ef5ef8f5
TGR
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))
9af704c5 566 (sha256
ef5ef8f5 567 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
9af704c5
RH
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))
d738ce16 592 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
c4f0c8ba
TGR
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))
9af704c5 611 (sha256
c4f0c8ba 612 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
9af704c5
RH
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))
cf396ea5 634 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
052650c8
TGR
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))
9af704c5 653 (sha256
052650c8 654 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
9af704c5
RH
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))
24b03073 676 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
2074c8bf
TGR
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))
9af704c5 695 (sha256
2074c8bf 696 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
9af704c5
RH
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))
5daa2019 722 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
62536186
TGR
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))
9af704c5 741 (sha256
62536186 742 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
9af704c5
RH
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))
d1e63866 776 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
e5e7a167
TGR
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))
9af704c5 795 (sha256
e5e7a167 796 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
9af704c5
RH
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))
84532c2b 826 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
d42d0a0b
TGR
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))
9af704c5 845 (sha256
d42d0a0b 846 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
9af704c5
RH
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))
b21acd21 874 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
85baeb20
TGR
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))
9af704c5 893 (sha256
85baeb20 894 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
fdb61400 895 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
9af704c5
RH
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))
26daadb9 929 (home-page "https://www.mupen64plus.org/")
9af704c5
RH
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
225157a0
TGR
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))
9af704c5 948 (sha256
225157a0 949 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
9af704c5
RH
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))
e8079ba4 993 (home-page "https://www.mupen64plus.org/")
ff452bea 994 (synopsis "Mupen64Plus command line user interface")
9af704c5
RH
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")
9d39c300 1005 (version "1.48")
3e461b71
TGR
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))))
9d39c300 1021 (build-system cmake-build-system)
9af704c5
RH
1022 (native-inputs
1023 `(("pkg-config" ,pkg-config)))
1024 (inputs
1025 `(("ao" ,ao)
9af704c5
RH
1026 ("gtk+" ,gtk+)
1027 ("libarchive" ,libarchive)
9d39c300 1028 ("libepoxy" ,libepoxy)
9af704c5
RH
1029 ("sdl2" ,sdl2)
1030 ("zlib" ,zlib)))
1031 (arguments
1032 '(#:phases
1033 (modify-phases %standard-phases
9d39c300
KK
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)))))))
9af704c5
RH
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")
bd671624 1056 (version "1.8.1")
9af704c5
RH
1057 (source
1058 (origin
1fc346de
TGR
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))
9af704c5 1064 (sha256
bd671624 1065 (base32 "0y7rcpz7psf8k3agsrq277jdm651vbnn9xpqvmj2in1a786idya7"))))
9af704c5
RH
1066 (build-system gnu-build-system)
1067 (arguments
f21967a4 1068 `(#:tests? #f ; no tests
9af704c5
RH
1069 #:phases
1070 (modify-phases %standard-phases
1071 (replace 'configure
1072 (lambda* (#:key inputs outputs #:allow-other-keys)
1073 (let* ((out (assoc-ref outputs "out"))
1074 (etc (string-append out "/etc"))
12a3abc6
RH
1075 (vulkan (assoc-ref inputs "vulkan-loader"))
1076 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
9af704c5
RH
1077 ;; Hard-code the path to libvulkan.so.
1078 (substitute* "gfx/common/vulkan_common.c"
1079 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
12a3abc6
RH
1080 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1081 (("/usr/local/share/wayland-protocols")
1082 (string-append wayland-protocols "/share/wayland-protocols")))
9af704c5
RH
1083 (substitute* "qb/qb.libs.sh"
1084 (("/bin/true") (which "true")))
fade67ab
EF
1085 ;; Use shared zlib.
1086 (substitute* '("libretro-common/file/archive_file_zlib.c"
e85bb00c 1087 "libretro-common/streams/trans_stream_zlib.c")
fade67ab 1088 (("<compat/zlib.h>") "<zlib.h>"))
9af704c5
RH
1089 ;; The configure script does not yet accept the extra arguments
1090 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
f21967a4
EF
1091 (invoke
1092 "./configure"
1093 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1094 (%current-system)))
1095 '("--enable-neon" "--enable-floathard")
1096 '())
1097 (string-append "--prefix=" out)
1098 (string-append "--global-config-dir=" etc))))))))
9af704c5
RH
1099 (inputs
1100 `(("alsa-lib" ,alsa-lib)
1101 ("ffmpeg" ,ffmpeg)
1102 ("freetype" ,freetype)
1103 ("libxinerama" ,libxinerama)
1104 ("libxkbcommon" ,libxkbcommon)
1105 ("libxml2" ,libxml2)
45267af1 1106 ("libxrandr" ,libxrandr)
9af704c5
RH
1107 ("libxv" ,libxv)
1108 ("mesa" ,mesa)
1109 ("openal" ,openal)
1110 ("pulseaudio" ,pulseaudio)
1111 ("python" ,python)
76b7d8fd 1112 ("qtbase" ,qtbase)
9af704c5
RH
1113 ("sdl" ,sdl2)
1114 ("udev" ,eudev)
e6fcf903 1115 ("vulkan-loader" ,vulkan-loader)
c695fb76 1116 ("wayland" ,wayland)
9af704c5
RH
1117 ("zlib" ,zlib)))
1118 (native-inputs
1119 `(("pkg-config" ,pkg-config)
12a3abc6 1120 ("wayland-protocols" ,wayland-protocols)
9af704c5
RH
1121 ("which" ,which)))
1122 (home-page "https://www.libretro.com/")
1123 (synopsis "Reference frontend for the libretro API")
1124 (description
1125 "Libretro is a simple but powerful development interface that allows for
1126the easy creation of emulators, games and multimedia applications that can plug
1127straight into any libretro-compatible frontend. RetroArch is the official
1128reference frontend for the libretro API, currently used by most as a modular
1129multi-system game/emulator system.")
1130 (license license:gpl3+)))
4c40ed9d
NG
1131
1132(define-public scummvm
1133 (package
1134 (name "scummvm")
1135 (version "2.0.0")
1136 (source
1137 (origin
1138 (method url-fetch)
1139 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1140 "/scummvm-" version ".tar.xz"))
1141 (sha256
1142 (base32
1143 "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
1144 (build-system gnu-build-system)
1145 (arguments
1146 `(#:tests? #f ;require "git"
1147 #:configure-flags (list "--enable-release") ;for optimizations
1148 #:phases
1149 (modify-phases %standard-phases
1150 (replace 'configure
1151 ;; configure does not work followed by both "SHELL=..." and
1152 ;; "CONFIG_SHELL=..."; set environment variables instead
1153 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1154 (let* ((out (assoc-ref outputs "out"))
1155 (bash (which "bash"))
1156 (flags `(,(string-append "--prefix=" out)
1157 ,@configure-flags)))
1158 (setenv "SHELL" bash)
1159 (setenv "CONFIG_SHELL" bash)
1160 (apply invoke "./configure" flags)))))))
1161 (native-inputs
1162 `(("pkg-config" ,pkg-config)))
1163 (inputs
1164 `(("alsa-lib" ,alsa-lib)
1165 ("faad2" ,faad2)
1166 ("fluidsynth" ,fluidsynth)
1167 ("freetype" ,freetype)
1168 ("libflac" ,flac)
1169 ("libjpeg-turbo" ,libjpeg-turbo)
1170 ("libmad" ,libmad)
1171 ("libmpeg2" ,libmpeg2)
1172 ("libogg" ,libogg)
1173 ("libpng" ,libpng)
1174 ("libtheora" ,libtheora)
1175 ("libvorbis" ,libvorbis)
1176 ("nasm" ,nasm)
1177 ("sdl2" ,sdl2)
1178 ("zlib" ,zlib)))
1179 (home-page "https://www.scummvm.org/")
1180 (synopsis "Engine for several graphical adventure games")
1181 (description "ScummVM is a program which allows you to run certain
1182classic graphical point-and-click adventure games, provided you
1183already have their data files. The clever part about this: ScummVM
1184just replaces the executables shipped with the games, allowing you to
1185play them on systems for which they were never designed!")
1186 (license license:gpl2+)))
c8b2fd28
NG
1187
1188(define-public mame
1189 (package
1190 (name "mame")
b36726af 1191 (version "0.215")
c8b2fd28
NG
1192 (source
1193 (origin
1194 (method git-fetch)
1195 (uri (git-reference
1196 (url "https://github.com/mamedev/mame.git")
1197 (commit (apply string-append "mame" (string-split version #\.)))))
1198 (file-name (git-file-name name version))
1199 (sha256
1200 (base32
b36726af 1201 "1fj2qahi0fpn41zxph06wdgjashy6vsgj0gqfly8hvcmv99r3d65"))
c8b2fd28
NG
1202 (modules '((guix build utils)))
1203 (snippet
1204 ;; Remove bundled libraries.
1205 '(begin
1206 (with-directory-excursion "3rdparty"
1207 (for-each delete-file-recursively
1208 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1209 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1210 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1211 #t))))
1212 (build-system gnu-build-system)
1213 (arguments
1214 `(#:make-flags
1215 (cons*
1216 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1217 (string-append "SDL_INI_PATH="
1218 (assoc-ref %outputs "out")
1219 "/share/mame/ini")
1220 (map (lambda (lib)
1221 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1222 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1223 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1224 #:tests? #f ;no test in regular release
1225 #:phases
1226 (modify-phases %standard-phases
1227 (delete 'configure)
1228 (add-after 'build 'build-documentation
1229 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1230 (replace 'install
1231 ;; Upstream does not provide an installation phase.
1232 (lambda* (#:key outputs #:allow-other-keys)
1233 (let* ((out (assoc-ref outputs "out"))
1234 (share (string-append out "/share/mame")))
1235 ;; Install data.
1236 (for-each (lambda (dir)
1237 (copy-recursively dir (string-append share "/" dir)))
1238 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1239 "plugins" "samples"))
1240 (let ((keymaps (string-append share "/keymaps")))
1241 (for-each (lambda (file) (install-file file keymaps))
1242 (find-files "keymaps" ".*LINUX\\.map")))
1243 (let ((fonts (string-append share "/fonts")))
1244 (install-file "uismall.bdf" fonts))
6921e95a
EF
1245 (when (file-exists? "mame64")
1246 (rename-file "mame64" "mame"))
c8b2fd28
NG
1247 (install-file "mame" (string-append out "/bin")))
1248 #t))
1249 (add-after 'install 'install-documentation
1250 (lambda* (#:key outputs #:allow-other-keys)
1251 (let* ((out (assoc-ref outputs "out"))
1252 (man (string-append out "/share/man/man1"))
1253 (info (string-append out "/share/info")))
1254 (install-file "docs/build/man/MAME.1" man)
1255 (install-file "docs/build/texinfo/MAME.info" info))
1256 #t))
1257 (add-after 'install 'install-ini-file
1258 ;; Generate an ini file so as to set some directories (e.g., roms)
1259 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1260 ;;
1261 ;; XXX: We need to insert absolute references to the store. It can
1262 ;; be an issue if they leak into user's home directory, e.g., with
1263 ;; "mame -createconfig" and the package is later GC'ed.
1264 (lambda* (#:key outputs #:allow-other-keys)
1265 (let* ((out (assoc-ref outputs "out"))
1266 (share (string-append out "/share/mame"))
1267 (ini (string-append share "/ini")))
1268 (with-output-to-file (string-append ini "/mame.ini")
1269 (lambda _
1270 (format #t
1271 "inipath $HOME/.mame;~a/ini~@
1272 homepath $HOME/mame~@
1273 rompath $HOME/mame/roms~@
1274 samplepath $HOME/mame/samples;~a/samples~@
1275 cheatpath $HOME/mame/cheat~@
1276 artpath $HOME/mame/artwork;~a/artwork~@
1277 crosshairpath $HOME/mame/crosshair~@
1278 snapshot_directory $HOME/mame/snapshots~@
1279 hashpath ~a/hash~@
1280 fontpath $HOME/mame/fonts;~a/fonts~@
1281 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1282 bgfx_path ~a/bgfx~@
1283 pluginspath $HOME/mame/plugins;~a/plugins~@
1284 languagepath ~a/language~@
1285 cfg_directory $HOME/.mame/cfg~@
1286 nvram_directory $HOME/.mame/nvram~@
1287 input_directory $HOME/.mame/inp~@
1288 state_directory $HOME/.mame/sta~@
1289 diff_directory $HOME/.mame/diff~@
1290 comment_directory $HOME/.mame/comments~%"
1291 share share share share share share share share
1292 share)))
1293 (with-output-to-file (string-append ini "/ui.ini")
1294 (lambda _
1295 (format #t
1296 "historypath $HOME/mame/history~@
1297 categorypath $HOME/mame/folders~@
1298 cabinets_directory $HOME/mame/cabinets~@
1299 cpanels_directory $HOME/mame/cpanel~@
1300 pcbs_directory $HOME/mame/pcb~@
1301 flyers_directory $HOME/mame/flyers~@
1302 titles_directory $HOME/mame/titles~@
1303 ends_directory $HOME/mame/ends~@
1304 marquees_directory $HOME/mame/marquees~@
1305 artwork_preview_directory $HOME/mame/artpreview~@
1306 bosses_directory $HOME/mame/bosses~@
1307 logos_directory $HOME/mame/logo~@
1308 scores_directory $HOME/mame/scores~@
1309 versus_directory $HOME/mame/versus~@
1310 gameover_directory $HOME/mame/gameover~@
1311 howto_directory $HOME/mame/howto~@
1312 select_directory $HOME/mame/select~@
1313 icons_directory $HOME/mame/icons~@
1314 covers_directory $HOME/mame/covers~@
1315 ui_path $HOME/.mame/ui~%")))
1316 #t)))
1317 (add-after 'install 'install-desktop-file
1318 (lambda* (#:key outputs #:allow-other-keys)
1319 (let* ((out (assoc-ref outputs "out"))
1320 (desktop (string-append out "/share/applications"))
1321 (executable (string-append out "/bin/mame")))
1322 (mkdir-p desktop)
1323 (with-output-to-file (string-append desktop "/mame.desktop")
1324 (lambda _
1325 (format #t
1326 "[Desktop Entry]~@
1327 Name=mame~@
1328 Comment=Multi-purpose emulation framework~@
1329 Exec=~a~@
1330 TryExec=~@*~a~@
1331 Terminal=false~@
1332 Type=Application~@
1333 Categories=Game;Emulator;~@
1334 Keywords=Game;Emulator;Arcade;~%"
1335 executable)))
1336 #t))))))
1337 (native-inputs
1338 `(("pkg-config" ,pkg-config)
03370346
NG
1339 ("sphinx" ,python-sphinx)
1340 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
c8b2fd28
NG
1341 ("texinfo" ,texinfo)))
1342 (inputs
1343 `(("alsa-lib" ,alsa-lib)
1344 ("asio" ,asio)
1345 ("expat" ,expat)
1346 ("flac" ,flac)
1347 ("fontconfig" ,fontconfig)
1348 ("glm" ,glm)
1349 ("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
9f0650df 1350 ("libxi" ,libxi)
c8b2fd28
NG
1351 ("libxinerama" ,libxinerama)
1352 ("lua" ,lua)
1353 ("portaudio" ,portaudio)
1354 ("portmidi" ,portmidi)
63247277 1355 ("pugixml" ,pugixml)
c8b2fd28
NG
1356 ("python-wrapper" ,python-wrapper)
1357 ("qtbase" ,qtbase)
1358 ("rapidjson" ,rapidjson)
1359 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1360 ("sqlite" ,sqlite)
1361 ("utf8proc" ,utf8proc)
1362 ("zlib" ,zlib)))
1363 (home-page "http://mamedev.org/")
1364 (synopsis "Multi-purpose emulation framework")
1365 (description "MAME's purpose is to preserve decades of software
1366history. As electronic technology continues to rush forward, MAME
1367prevents this important @emph{vintage} software from being lost and
1368forgotten. This is achieved by documenting the hardware and how it
1369functions. The source code to MAME serves as this documentation.")
1370 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1371 ;; However, over 90% of the files are under Expat license. Also, artwork,
1372 ;; keymaps, languages and samples are under CC0.
1373 (license (list license:gpl2+ license:expat license:cc0))))
1403e1f7
PN
1374
1375(define-public pcsxr
1376 ;; No release since 2017.
1377 (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
1378 (package
1379 (name "pcsxr")
1380 ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
1381 (version "1.9.95")
1382 (source
1383 (origin
1384 (method git-fetch)
1385 (uri (git-reference
1386 (url "https://github.com/pcsxr/PCSX-Reloaded")
1387 (commit commit)))
1388 (sha256
1389 (base32
1390 "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
1391 (file-name (git-file-name name commit))))
1392 (build-system cmake-build-system)
1393 (arguments
1394 `(#:tests? #f ;no "test" target
1395 #:configure-flags
1396 (list "-DSND_BACKEND=pulse"
1397 "-DENABLE_CCDDA='ON'"
1398 "-DUSE_LIBARCHIVE='ON'"
1399 "-DUSE_LIBCDIO='ON'")
1400 #:phases
1401 (modify-phases %standard-phases
1402 (add-after 'unpack 'cd-subdir
1403 (lambda _ (chdir "pcsxr")))
1404 (add-before 'configure 'fix-cdio-lookup
1405 (lambda* (#:key inputs #:allow-other-keys)
1406 (substitute* "cmake/FindCdio.cmake"
1407 (("/usr/include/cdio")
1408 (string-append (assoc-ref inputs "libcdio") "/include/cdio"))))))))
1409 (native-inputs
1410 `(("pkg-config" ,pkg-config)
1411 ("intltool" ,intltool)
1412 ("glib" ,glib "bin")))
1413 (inputs
1414 `(("libcdio" ,libcdio)
1415 ("sdl2" ,sdl2)
1416 ("gtk+" ,gtk+)
1417 ("ffmpeg" ,ffmpeg)
1418 ("libxv" ,libxv)
1419 ("libarchive" ,libarchive)
1420 ("pulseaudio" ,pulseaudio)))
1421 (home-page "https://archive.codeplex.com/?p=pcsxr")
1422 (synopsis "PlayStation emulator")
1423 (description
1424 "A PlayStation emulator based on PCSX-df Project with bugfixes and
1425improvements.")
1426 (license license:gpl2+))))
f6a0be2f
DW
1427
1428(define-public gens-gs
1429 (package
1430 (name "gens-gs")
1431 (version "7")
1432 (source
1433 (origin
1434 (method url-fetch)
1435 (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
1436 version ".tar.gz"))
1437 (sha256
1438 (base32
1439 "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
1440 (build-system glib-or-gtk-build-system)
1441 (arguments
1442 `(#:system "i686-linux"
1443 #:phases
1444 (modify-phases %standard-phases
1445 (add-after 'unpack 'fix-CFLAGS
1446 (lambda* _
1447 ;; Remove GTK API deprecation flags that cause build errors.
1448 (substitute* "configure"
1449 (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
1450 #t)))))
1451 (native-inputs
1452 `(("pkg-config" ,pkg-config)
1453 ("nasm" ,nasm)))
1454 (inputs
1455 `(("sdl" ,sdl)
1456 ("gtk" ,gtk+-2)))
1457 (home-page "https://segaretro.org/Gens/GS")
1458 (synopsis "Emulator for Sega Genesis/Mega Drive systems")
1459 (description
1460 "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
1461derived from Gens. Project goals include clean source code, combined features
1462from various forks of Gens, and improved platform portability.")
1463 (supported-systems '("i686-linux" "x86_64-linux"))
1464 (license license:gpl2+)))