gnu: Remove spice-protocol@0.12.14.
[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>
e5f9ec8b
RH
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages emulators)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
9af704c5 31 #:use-module (guix download)
e5f9ec8b 32 #:use-module (guix git-download)
9af704c5
RH
33 #:use-module (guix svn-download)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages algebra)
4c40ed9d 36 #:use-module (gnu packages assembly)
e5f9ec8b 37 #:use-module (gnu packages audio)
9af704c5
RH
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages backup)
e5f9ec8b
RH
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages curl)
44 #:use-module (gnu packages fonts)
45 #:use-module (gnu packages fontutils)
9af704c5 46 #:use-module (gnu packages freedesktop)
e5f9ec8b 47 #:use-module (gnu packages game-development)
cbf58afa 48 #:use-module (gnu packages gcc)
e5f9ec8b
RH
49 #:use-module (gnu packages gettext)
50 #:use-module (gnu packages gl)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages gtk)
53 #:use-module (gnu packages image)
9af704c5
RH
54 #:use-module (gnu packages imagemagick)
55 #:use-module (gnu packages libedit)
e5f9ec8b
RH
56 #:use-module (gnu packages libusb)
57 #:use-module (gnu packages linux)
c8b2fd28
NG
58 #:use-module (gnu packages lua)
59 #:use-module (gnu packages maths)
4c40ed9d 60 #:use-module (gnu packages mp3)
c8b2fd28 61 #:use-module (gnu packages music)
9af704c5 62 #:use-module (gnu packages ncurses)
c8b2fd28 63 #:use-module (gnu packages networking)
e5f9ec8b
RH
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages pulseaudio)
9af704c5 66 #:use-module (gnu packages python)
44d10b1f 67 #:use-module (gnu packages python-xyz)
e5f9ec8b
RH
68 #:use-module (gnu packages qt)
69 #:use-module (gnu packages sdl)
cd0322a3 70 #:use-module (gnu packages sqlite)
c8b2fd28
NG
71 #:use-module (gnu packages texinfo)
72 #:use-module (gnu packages textutils)
e5f9ec8b
RH
73 #:use-module (gnu packages tls)
74 #:use-module (gnu packages upnp)
75 #:use-module (gnu packages video)
9af704c5 76 #:use-module (gnu packages vulkan)
e5f9ec8b 77 #:use-module (gnu packages wxwidgets)
9af704c5 78 #:use-module (gnu packages xdisorg)
e5f9ec8b 79 #:use-module (gnu packages xiph)
9af704c5 80 #:use-module (gnu packages xml)
e5f9ec8b 81 #:use-module (gnu packages xorg)
c8b2fd28 82 #:use-module (gnu packages web)
9af704c5
RH
83 #:use-module (guix build-system cmake)
84 #:use-module (guix build-system gnu))
85
86(define-public desmume
87 (package
88 (name "desmume")
89 (version "0.9.11")
90 (source
91 (origin
92 (method url-fetch)
93 (uri (string-append
94 "mirror://sourceforge/desmume/desmume/"
95 version "/desmume-" version ".tar.gz"))
96 (sha256
97 (base32
98 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))))
99 (build-system gnu-build-system)
100 (arguments
101 ;; Enable support for WiFi and microphone.
102 `(#:configure-flags '("--enable-wifi"
103 "--enable-openal")))
104 (native-inputs
105 `(("pkg-config" ,pkg-config)
106 ("intltool" ,intltool)))
107 (inputs
108 `(("zlib" ,zlib)
109 ("sdl" ,sdl)
110 ("glib" ,glib)
111 ("gtk+" ,gtk+-2)
112 ("glu" ,glu)))
113 (home-page "http://desmume.org/")
114 (synopsis "Nintendo DS emulator")
115 (description
116 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
117 (license license:gpl2)))
e5f9ec8b
RH
118
119;; Building from recent Git because the official 5.0 release no longer builds.
120(define-public dolphin-emu
1f51f0d9
RH
121 (let ((commit "2c57e709d0f9e4010a4415de4192de887e37f187")
122 (revision "5"))
e5f9ec8b
RH
123 (package
124 (name "dolphin-emu")
125 (version (git-version "5.0" revision commit))
126 (source
127 (origin
128 (method git-fetch)
129 (uri (git-reference
130 (url "https://github.com/dolphin-emu/dolphin.git")
131 (commit commit)))
132 (file-name (git-file-name name version))
85280804
EF
133 (modules '((guix build utils)))
134 (snippet
135 '(begin
136 ;; Remove external stuff we don't need.
137 (for-each (lambda (dir)
138 (delete-file-recursively
139 (string-append "Externals/" dir)))
fab8d41c 140 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
85280804 141 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
fab8d41c 142 "miniupnpc" "zlib"))
85280804
EF
143 ;; Clean up source.
144 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
145 #t))
e5f9ec8b
RH
146 (sha256
147 (base32
1f51f0d9 148 "0aszfdfvs7yg4bmrd3qxwsiz7hx3mrj29f4aw86bz7h9j7hkh57f"))))
e5f9ec8b
RH
149 (build-system cmake-build-system)
150 (arguments
151 '(#:tests? #f
e5f9ec8b
RH
152 #:phases
153 (modify-phases %standard-phases
cbf58afa
RH
154 (add-before 'configure 'fixgcc7
155 (lambda _
156 (unsetenv "C_INCLUDE_PATH")
124e9d6e
RH
157 (unsetenv "CPLUS_INCLUDE_PATH")
158 #t))
6bebad77 159 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
e5f9ec8b
RH
160 (lambda* (#:key inputs outputs #:allow-other-keys)
161 (let ((fontfile
162 (string-append (assoc-ref inputs "font-wqy-microhei")
6bebad77
RH
163 "/share/fonts/truetype/wqy-microhei.ttc"))
164 (libvulkan
e6fcf903 165 (string-append (assoc-ref inputs "vulkan-loader")
6bebad77 166 "/lib/libvulkan.so")))
e5f9ec8b
RH
167 (chdir "docs")
168 (invoke "bash" "-c" "g++ -O2 -std=c++11 $(freetype-config \
169--cflags --libs) gc-font-tool.cpp -o gc-font-tool")
170 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
171 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
172 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
173 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
174 (chdir "..")
6bebad77
RH
175 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
176 (("libvulkan.so") libvulkan))
e5f9ec8b
RH
177 #t))))
178
fab8d41c
RH
179 ;; The FindGTK2 cmake script only checks hardcoded directories for
180 ;; glib/gtk headers.
181
e5f9ec8b 182 #:configure-flags
fab8d41c 183 (list (string-append "-DX11_INCLUDE_DIR="
e5f9ec8b
RH
184 (assoc-ref %build-inputs "libx11")
185 "/include")
186 (string-append "-DX11_LIBRARIES="
187 (assoc-ref %build-inputs "libx11")
188 "/lib/libX11.so")
189 "-DX11_FOUND=1")))
e5f9ec8b
RH
190 (native-inputs
191 `(("pkg-config" ,pkg-config)
cbf58afa 192 ("gcc" ,gcc-7) ; Building with gcc@5 doesn't work anymore.
e5f9ec8b
RH
193 ("gettext" ,gnu-gettext)))
194 (inputs
195 `(("alsa-lib" ,alsa-lib)
196 ("ao" ,ao)
197 ("bluez" ,bluez)
198 ("curl" ,curl)
199 ("eudev" ,eudev)
e7039f10 200 ("ffmpeg" ,ffmpeg)
e5f9ec8b
RH
201 ("font-wqy-microhei" ,font-wqy-microhei)
202 ("freetype" ,freetype)
203 ("glew" ,glew)
204 ("glib" ,glib)
205 ("glu" ,glu)
206 ("gtk+" ,gtk+-2)
207 ("hidapi" ,hidapi)
208 ("libevdev" ,libevdev)
209 ("libpng" ,libpng)
210 ("libusb" ,libusb)
211 ("libx11" ,libx11)
212 ("libxi" ,libxi)
213 ("libxrandr" ,libxrandr)
214 ("lzo" ,lzo)
215 ("mbedtls-apache" ,mbedtls-apache)
216 ("mesa" ,mesa)
217 ("miniupnpc" ,miniupnpc)
218 ("openal" ,openal)
fab8d41c 219 ("pugixml" ,pugixml)
e5f9ec8b
RH
220 ("pulseaudio" ,pulseaudio)
221 ("qtbase" ,qtbase)
222 ("sdl2" ,sdl2)
223 ("sfml" ,sfml)
224 ("soil" ,soil)
225 ("soundtouch" ,soundtouch)
e6fcf903 226 ("vulkan-loader" ,vulkan-loader)
e5f9ec8b
RH
227 ("zlib" ,zlib)))
228 (home-page "https://dolphin-emu.org/")
229 (synopsis "Nintendo Wii and GameCube emulator")
230 (description
231 "Dolphin is an emulator for two Nintendo video game consoles: the
232GameCube and the Wii. It provides compatibility with all PC controllers,
233turbo speed, networked multiplayer, and graphical enhancements.")
e89bfc2d 234 (supported-systems '("x86_64-linux" "aarch64-linux"))
e5f9ec8b
RH
235 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
236 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
9af704c5
RH
237
238(define-public dosbox
239 (package
240 (name "dosbox")
478040d4 241 (version "0.74-2")
9af704c5 242 (source (origin
478040d4
RH
243 (method url-fetch)
244 (uri (string-append "https://sourceforge.net/projects/dosbox"
245 "/files/dosbox/" version "/dosbox-"
246 version ".tar.gz/download"))
247 (file-name (string-append name "-" version ".tar.gz"))
9af704c5
RH
248 (sha256
249 (base32
478040d4 250 "1ksp1b5szi0vy4x55rm3j1y9wq5mlslpy8llpg87rpdyjlsk0xvh"))))
9af704c5
RH
251 (build-system gnu-build-system)
252 (arguments
253 `(#:phases (modify-phases %standard-phases
254 (add-after
255 'unpack 'autogen.sh
256 (lambda _
478040d4 257 (invoke "sh" "autogen.sh"))))))
9af704c5
RH
258 (native-inputs
259 `(("autoconf" ,autoconf)
260 ("automake" ,automake)))
261 (inputs
262 `(("sdl" ,sdl)
263 ("libpng" ,libpng)
264 ("zlib" ,zlib)
265 ("alsa-lib" ,alsa-lib)
266 ("glu" ,glu)
267 ("mesa" ,mesa)))
268 (home-page "http://www.dosbox.com")
269 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
270 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
271also emulates CPU:286/386 realmode/protected mode, Directory
272FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
273SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
274older games.")
275 (license license:gpl2+)))
276
277(define-public emulation-station
278 (let ((commit "646bede3d9ec0acf0ae378415edac136774a66c5"))
279 (package
280 (name "emulation-station")
281 (version "2.0.1")
282 (source (origin
283 (method git-fetch) ; no tarball available
284 (uri (git-reference
285 (url "https://github.com/Aloshi/EmulationStation.git")
286 (commit commit))) ; no version tag
287 (file-name (string-append name "-" version "-checkout"))
288 (sha256
289 (base32
290 "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v"))))
291 (build-system cmake-build-system)
292 (arguments
293 '(#:tests? #f)) ; no tests
294 (inputs
295 `(("alsa-lib" ,alsa-lib)
296 ("boost" ,boost)
297 ("curl" ,curl)
298 ("eigin" ,eigen)
299 ("freeimage" ,freeimage)
300 ("freetype" ,freetype)
301 ("mesa" ,mesa)
302 ("sdl2" ,sdl2)))
303 (synopsis "Video game console emulator front-end")
304 (description "EmulationStation provides a graphical front-end to a large
305number of video game console emulators. It features an interface that is
306usable with any game controller that has at least 4 buttons, theming support,
307and a game metadata scraper.")
308 (home-page "http://www.emulationstation.org")
309 (license license:expat))))
310
311(define-public higan
312 (package
313 (name "higan")
314 (version "106")
315 (source
316 (origin
317 (method url-fetch)
318 (uri (string-append
319 "https://gitlab.com/higan/higan/repository/archive.tar.gz?ref=v"
320 version))
321 (file-name (string-append name "-" version ".tar.gz"))
322 (sha256
323 (base32 "0y42pra0dxzlbkyzcp3r8a39pji2bj3p9fl40425f60af2igr4rw"))
324 (patches (search-patches "higan-remove-march-native-flag.patch"))))
325 (build-system gnu-build-system)
326 (native-inputs
327 `(("pkg-config" ,pkg-config)))
328 (inputs
329 `(("alsa-lib" ,alsa-lib)
330 ("ao" ,ao)
331 ("eudev" ,eudev)
332 ("gtk+" ,gtk+-2)
333 ("gtksourceview-2" ,gtksourceview-2)
334 ("libxv" ,libxv)
335 ("mesa" ,mesa)
336 ("openal" ,openal)
337 ("pulseaudio" ,pulseaudio)
338 ("sdl" ,sdl)))
339 (arguments
340 '(#:phases
341 (let ((build-phase (assoc-ref %standard-phases 'build))
342 (install-phase (assoc-ref %standard-phases 'install)))
343 (modify-phases %standard-phases
344 ;; The higan build system has no configure phase.
345 (delete 'configure)
346 (add-before 'build 'chdir-to-higan
347 (lambda _
348 (chdir "higan")))
349 (add-before 'install 'create-/share/applications
350 (lambda* (#:key outputs #:allow-other-keys)
351 (let ((out (assoc-ref outputs "out")))
352 ;; It seems the author forgot to do this in the Makefile.
353 (mkdir-p (string-append out "/share/applications")))))
354 (add-after 'install 'chdir-to-icarus
355 (lambda _
356 (chdir "../icarus")))
357 (add-after 'chdir-to-icarus 'build-icarus build-phase)
358 (add-after 'build-icarus 'install-icarus install-phase)
359 (add-after 'install-icarus 'wrap-higan-executable
360 (lambda* (#:key inputs outputs #:allow-other-keys)
361 (let* ((out (assoc-ref outputs "out"))
362 (bin (string-append out "/bin"))
363 (higan (string-append bin "/higan"))
364 (higan-original (string-append higan "-original"))
365 (bash (string-append (assoc-ref inputs "bash")
366 "/bin/bash"))
367 (coreutils (assoc-ref inputs "coreutils"))
368 (mkdir (string-append coreutils "/bin/mkdir"))
369 (cp (string-append coreutils "/bin/cp"))
370 (cp-r (string-append cp " -r --no-preserve=mode")))
371 ;; First, have the executable make sure ~/.local/share/higan
372 ;; contains up to date files. Higan insists on looking there
373 ;; for these data files.
374 (rename-file higan higan-original)
375 (with-output-to-file higan
376 (lambda ()
377 (display
378 (string-append
379 "#!" bash "\n"
380 ;; higan doesn't respect $XDG_DATA_HOME
381 mkdir " -p ~/.local/share\n"
382 cp-r " " out "/share/higan ~/.local/share\n"
383 "exec " higan-original))))
384 (chmod higan #o555)
385 ;; Second, make sure higan will find icarus in PATH.
386 (wrap-program higan
387 `("PATH" ":" prefix (,bin))))))))
388 #:make-flags
389 (list "compiler=g++"
390 (string-append "prefix=" (assoc-ref %outputs "out")))
391 ;; There is no test suite.
392 #:tests? #f))
393 (home-page "http://byuu.org/emulation/higan/")
394 (synopsis "Nintendo multi-system emulator")
395 (description
396 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
397consoles, including the Nintendo Entertainment System (NES/Famicom), Super
398Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
399Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
400Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
401 ;; As noted in these files among more:
402 ;; - icarus/icarus.cpp
403 ;; - higan/emulator/emulator.hpp
404 (license license:gpl3)))
405
406(define-public mgba
407 (package
408 (name "mgba")
6ea1c6fc 409 (version "0.7.0")
9af704c5 410 (source (origin
6ea1c6fc
RH
411 (method git-fetch)
412 (uri (git-reference
413 (url "https://github.com/mgba-emu/mgba.git")
414 (commit version)))
415 (file-name (git-file-name name version))
9af704c5
RH
416 (sha256
417 (base32
6ea1c6fc 418 "0s4dl4pi8rxqahvzxnh37xdgsfax36cn5wlh1srdcmabwsrfpb3w"))
9af704c5
RH
419 (modules '((guix build utils)))
420 (snippet
421 ;; Make sure we don't use the bundled software.
6cbee49d
MW
422 '(begin
423 (for-each
424 (lambda (subdir)
425 (let ((lib-subdir (string-append "src/third-party/" subdir)))
426 (delete-file-recursively lib-subdir)))
427 '("libpng" "lzma" "sqlite3" "zlib"))
428 #t))))
9af704c5
RH
429 (build-system cmake-build-system)
430 (arguments
431 `(#:tests? #f ;no "test" target
432 #:configure-flags
433 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
6ea1c6fc 434 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
9af704c5
RH
435 (native-inputs `(("pkg-config" ,pkg-config)))
436 (inputs `(("ffmpeg" ,ffmpeg)
437 ("imagemagick" ,imagemagick)
438 ("libedit" ,libedit)
439 ("libepoxy" ,libepoxy)
440 ("libpng" ,libpng)
441 ("mesa" ,mesa)
442 ("minizip" ,minizip)
443 ("ncurses" ,ncurses)
444 ("qtbase" ,qtbase)
445 ("qtmultimedia" ,qtmultimedia)
446 ("qttools" ,qttools)
447 ("sdl2" ,sdl2)
448 ("sqlite" ,sqlite)
449 ("zlib" ,zlib)))
450 (home-page "https://mgba.io")
451 (synopsis "Game Boy Advance emulator")
452 (description
453 "mGBA is an emulator for running Game Boy Advance games. It aims to be
454faster and more accurate than many existing Game Boy Advance emulators, as
455well as adding features that other emulators lack. It also supports Game Boy
456and Game Boy Color games.")
457 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c" is
458 ;; BSD-3.
459 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
460
461(define-public mupen64plus-core
462 (package
463 (name "mupen64plus-core")
464 (version "2.5")
465 (source
466 (origin
467 (method url-fetch)
468 (uri (string-append
469 "https://github.com/mupen64plus/mupen64plus-core/archive/"
470 version ".tar.gz"))
471 (file-name (string-append name "-" version ".tar.gz"))
472 (sha256
473 (base32 "0dg2hksm5qni2hcha93k7n4fqr92888p946f7phb0ndschzfh9kk"))))
474 (build-system gnu-build-system)
475 (native-inputs
476 `(("pkg-config" ,pkg-config)
477 ("which" ,which)))
478 (inputs
479 `(("freetype" ,freetype)
480 ("glu" ,glu)
481 ("libpng" ,libpng)
482 ("mesa" ,mesa)
483 ("sdl2" ,sdl2)
484 ("zlib" ,zlib)))
485 (arguments
486 '(#:phases
487 (modify-phases %standard-phases
488 ;; The mupen64plus build system has no configure phase.
489 (delete 'configure)
490 ;; Makefile is in a subdirectory.
491 (add-before
492 'build 'cd-to-project-dir
493 (lambda _
494 (chdir "projects/unix"))))
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 "http://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 url-fetch)
516 (uri (string-append
517 "https://github.com/mupen64plus/mupen64plus-audio-sdl/archive/"
518 version ".tar.gz"))
519 (file-name (string-append name "-" version ".tar.gz"))
520 (sha256
521 (base32 "0ss6w92n2rpfnazhg9lbq0nvs3fqx93nliz3k3wjxdlx4dpi7h3a"))))
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 "http://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 url-fetch)
562 (uri (string-append
563 "https://github.com/mupen64plus/mupen64plus-input-sdl/archive/"
564 version ".tar.gz"))
565 (file-name (string-append name "-" version ".tar.gz"))
566 (sha256
567 (base32 "11sj5dbalp2nrlmki34vy7wy28vc175pnnkdk65p8599hnyq37ri"))))
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 "http://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 url-fetch)
607 (uri (string-append
608 "https://github.com/mupen64plus/mupen64plus-rsp-hle/archive/"
609 version ".tar.gz"))
610 (file-name (string-append name "-" version ".tar.gz"))
611 (sha256
612 (base32 "15h7mgz6xd2zjzm6l3f96sbs8kwr3xvbwzgikhnka79m6c69hsxv"))))
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 "http://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 url-fetch)
649 (uri (string-append
650 "https://github.com/mupen64plus/mupen64plus-rsp-z64/archive/"
651 version ".tar.gz"))
652 (file-name (string-append name "-" version ".tar.gz"))
653 (sha256
654 (base32 "10jz1w2dhx5slhyk4m8mdqlpsd6cshchslr1fckb2ayzb1ls3ghi"))))
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 "http://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 url-fetch)
691 (uri (string-append
692 "https://github.com/mupen64plus/mupen64plus-video-arachnoid/archive/"
693 version ".tar.gz"))
694 (file-name (string-append name "-" version ".tar.gz"))
695 (sha256
696 (base32 "0jjwf144rihznm4lnqbhgigxw664v3v32wy94adaa6imk8z6gslh"))))
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 "http://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 url-fetch)
737 (uri (string-append
738 "https://github.com/mupen64plus/mupen64plus-video-glide64/archive/"
739 version ".tar.gz"))
740 (file-name (string-append name "-" version ".tar.gz"))
741 (sha256
742 (base32 "1rm55dbf6xgsq1blbzs6swa2ajv0qkn38acbljj346abnk6s3dla"))))
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 "http://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 url-fetch)
791 (uri (string-append
792 "https://github.com/mupen64plus/mupen64plus-video-glide64mk2/archive/"
793 version ".tar.gz"))
794 (file-name (string-append name "-" version ".tar.gz"))
795 (sha256
796 (base32 "1ihl4q293d6svba26b4mhapjcdg12p90gibz79b4mx423jlcxxj9"))))
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 "http://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 url-fetch)
841 (uri (string-append
842 "https://github.com/mupen64plus/mupen64plus-video-rice/archive/"
843 version ".tar.gz"))
844 (file-name (string-append name "-" version ".tar.gz"))
845 (sha256
846 (base32 "0rd2scjmh285w61aj3mgx71whg5rqrjbry3cdgicczrnyvf8wdvk"))))
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 "http://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 url-fetch)
889 (uri (string-append
890 "https://github.com/mupen64plus/mupen64plus-video-z64/archive/"
891 version ".tar.gz"))
892 (file-name (string-append name "-" version ".tar.gz"))
893 (sha256
fdb61400
MR
894 (base32 "1x7wsjs5gx2iwx20p4cjcbf696zsjlh31qxmghwv0ifrq8x58s1b"))
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))
929 (home-page "http://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 url-fetch)
944 (uri (string-append
945 "https://github.com/mupen64plus/mupen64plus-ui-console/archive/"
946 version ".tar.gz"))
947 (file-name (string-append name "-" version ".tar.gz"))
948 (sha256
949 (base32 "04qkpd8ic7xsgnqz7spl00wxdygf79m7d1k8rabbygjk5lg6p8z2"))
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 "http://www.mupen64plus.org/")
994 (synopsis "Mupen64Plus SDL input plugin")
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")
9af704c5
RH
1006 (source (origin
1007 (method url-fetch)
1008 (uri (string-append
1009 "https://github.com/rdanbrook/nestopia/archive/"
1010 version ".tar.gz"))
1011 (file-name (string-append name "-" version ".tar.gz"))
1012 (sha256
1013 (base32
9d39c300 1014 "184y05z4k4a4m4022niy625kan0rklh8gcxyynxli1fss2sjjrpv"))
9af704c5
RH
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")
6cbee49d 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")
45267af1 1056 (version "1.7.6")
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
45267af1 1065 (base32 "122c6cqax92qk2mhm9ywnwhw3qkv8f1ybma9gal5w6i2gsmp0s0s"))))
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"
1087 "libretro-common/streams/trans_stream_zlib.c"
1088 "network/httpserver/httpserver.c")
1089 (("<compat/zlib.h>") "<zlib.h>"))
9af704c5
RH
1090 ;; The configure script does not yet accept the extra arguments
1091 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
f21967a4
EF
1092 (invoke
1093 "./configure"
1094 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1095 (%current-system)))
1096 '("--enable-neon" "--enable-floathard")
1097 '())
1098 (string-append "--prefix=" out)
1099 (string-append "--global-config-dir=" etc))))))))
9af704c5
RH
1100 (inputs
1101 `(("alsa-lib" ,alsa-lib)
1102 ("ffmpeg" ,ffmpeg)
1103 ("freetype" ,freetype)
1104 ("libxinerama" ,libxinerama)
1105 ("libxkbcommon" ,libxkbcommon)
1106 ("libxml2" ,libxml2)
45267af1 1107 ("libxrandr" ,libxrandr)
9af704c5
RH
1108 ("libxv" ,libxv)
1109 ("mesa" ,mesa)
1110 ("openal" ,openal)
1111 ("pulseaudio" ,pulseaudio)
1112 ("python" ,python)
76b7d8fd 1113 ("qtbase" ,qtbase)
9af704c5
RH
1114 ("sdl" ,sdl2)
1115 ("udev" ,eudev)
e6fcf903 1116 ("vulkan-loader" ,vulkan-loader)
c695fb76 1117 ("wayland" ,wayland)
9af704c5
RH
1118 ("zlib" ,zlib)))
1119 (native-inputs
1120 `(("pkg-config" ,pkg-config)
12a3abc6 1121 ("wayland-protocols" ,wayland-protocols)
9af704c5
RH
1122 ("which" ,which)))
1123 (home-page "https://www.libretro.com/")
1124 (synopsis "Reference frontend for the libretro API")
1125 (description
1126 "Libretro is a simple but powerful development interface that allows for
1127the easy creation of emulators, games and multimedia applications that can plug
1128straight into any libretro-compatible frontend. RetroArch is the official
1129reference frontend for the libretro API, currently used by most as a modular
1130multi-system game/emulator system.")
1131 (license license:gpl3+)))
4c40ed9d
NG
1132
1133(define-public scummvm
1134 (package
1135 (name "scummvm")
1136 (version "2.0.0")
1137 (source
1138 (origin
1139 (method url-fetch)
1140 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1141 "/scummvm-" version ".tar.xz"))
1142 (sha256
1143 (base32
1144 "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
1145 (build-system gnu-build-system)
1146 (arguments
1147 `(#:tests? #f ;require "git"
1148 #:configure-flags (list "--enable-release") ;for optimizations
1149 #:phases
1150 (modify-phases %standard-phases
1151 (replace 'configure
1152 ;; configure does not work followed by both "SHELL=..." and
1153 ;; "CONFIG_SHELL=..."; set environment variables instead
1154 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1155 (let* ((out (assoc-ref outputs "out"))
1156 (bash (which "bash"))
1157 (flags `(,(string-append "--prefix=" out)
1158 ,@configure-flags)))
1159 (setenv "SHELL" bash)
1160 (setenv "CONFIG_SHELL" bash)
1161 (apply invoke "./configure" flags)))))))
1162 (native-inputs
1163 `(("pkg-config" ,pkg-config)))
1164 (inputs
1165 `(("alsa-lib" ,alsa-lib)
1166 ("faad2" ,faad2)
1167 ("fluidsynth" ,fluidsynth)
1168 ("freetype" ,freetype)
1169 ("libflac" ,flac)
1170 ("libjpeg-turbo" ,libjpeg-turbo)
1171 ("libmad" ,libmad)
1172 ("libmpeg2" ,libmpeg2)
1173 ("libogg" ,libogg)
1174 ("libpng" ,libpng)
1175 ("libtheora" ,libtheora)
1176 ("libvorbis" ,libvorbis)
1177 ("nasm" ,nasm)
1178 ("sdl2" ,sdl2)
1179 ("zlib" ,zlib)))
1180 (home-page "https://www.scummvm.org/")
1181 (synopsis "Engine for several graphical adventure games")
1182 (description "ScummVM is a program which allows you to run certain
1183classic graphical point-and-click adventure games, provided you
1184already have their data files. The clever part about this: ScummVM
1185just replaces the executables shipped with the games, allowing you to
1186play them on systems for which they were never designed!")
1187 (license license:gpl2+)))
c8b2fd28
NG
1188
1189(define-public mame
1190 (package
1191 (name "mame")
2e484e78 1192 (version "0.206")
c8b2fd28
NG
1193 (source
1194 (origin
1195 (method git-fetch)
1196 (uri (git-reference
1197 (url "https://github.com/mamedev/mame.git")
1198 (commit (apply string-append "mame" (string-split version #\.)))))
1199 (file-name (git-file-name name version))
1200 (sha256
1201 (base32
2e484e78 1202 "0i01h5ars1yd96ndmzhk47931hf261m8frqz1ha7s2gy52f0q86y"))
c8b2fd28
NG
1203 (modules '((guix build utils)))
1204 (snippet
1205 ;; Remove bundled libraries.
1206 '(begin
1207 (with-directory-excursion "3rdparty"
1208 (for-each delete-file-recursively
1209 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1210 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1211 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1212 #t))))
1213 (build-system gnu-build-system)
1214 (arguments
1215 `(#:make-flags
1216 (cons*
1217 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1218 (string-append "SDL_INI_PATH="
1219 (assoc-ref %outputs "out")
1220 "/share/mame/ini")
1221 (map (lambda (lib)
1222 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1223 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1224 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1225 #:tests? #f ;no test in regular release
1226 #:phases
1227 (modify-phases %standard-phases
1228 (delete 'configure)
1229 (add-after 'build 'build-documentation
1230 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1231 (replace 'install
1232 ;; Upstream does not provide an installation phase.
1233 (lambda* (#:key outputs #:allow-other-keys)
1234 (let* ((out (assoc-ref outputs "out"))
1235 (share (string-append out "/share/mame")))
1236 ;; Install data.
1237 (for-each (lambda (dir)
1238 (copy-recursively dir (string-append share "/" dir)))
1239 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1240 "plugins" "samples"))
1241 (let ((keymaps (string-append share "/keymaps")))
1242 (for-each (lambda (file) (install-file file keymaps))
1243 (find-files "keymaps" ".*LINUX\\.map")))
1244 (let ((fonts (string-append share "/fonts")))
1245 (install-file "uismall.bdf" fonts))
6921e95a
EF
1246 (when (file-exists? "mame64")
1247 (rename-file "mame64" "mame"))
c8b2fd28
NG
1248 (install-file "mame" (string-append out "/bin")))
1249 #t))
1250 (add-after 'install 'install-documentation
1251 (lambda* (#:key outputs #:allow-other-keys)
1252 (let* ((out (assoc-ref outputs "out"))
1253 (man (string-append out "/share/man/man1"))
1254 (info (string-append out "/share/info")))
1255 (install-file "docs/build/man/MAME.1" man)
1256 (install-file "docs/build/texinfo/MAME.info" info))
1257 #t))
1258 (add-after 'install 'install-ini-file
1259 ;; Generate an ini file so as to set some directories (e.g., roms)
1260 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1261 ;;
1262 ;; XXX: We need to insert absolute references to the store. It can
1263 ;; be an issue if they leak into user's home directory, e.g., with
1264 ;; "mame -createconfig" and the package is later GC'ed.
1265 (lambda* (#:key outputs #:allow-other-keys)
1266 (let* ((out (assoc-ref outputs "out"))
1267 (share (string-append out "/share/mame"))
1268 (ini (string-append share "/ini")))
1269 (with-output-to-file (string-append ini "/mame.ini")
1270 (lambda _
1271 (format #t
1272 "inipath $HOME/.mame;~a/ini~@
1273 homepath $HOME/mame~@
1274 rompath $HOME/mame/roms~@
1275 samplepath $HOME/mame/samples;~a/samples~@
1276 cheatpath $HOME/mame/cheat~@
1277 artpath $HOME/mame/artwork;~a/artwork~@
1278 crosshairpath $HOME/mame/crosshair~@
1279 snapshot_directory $HOME/mame/snapshots~@
1280 hashpath ~a/hash~@
1281 fontpath $HOME/mame/fonts;~a/fonts~@
1282 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1283 bgfx_path ~a/bgfx~@
1284 pluginspath $HOME/mame/plugins;~a/plugins~@
1285 languagepath ~a/language~@
1286 cfg_directory $HOME/.mame/cfg~@
1287 nvram_directory $HOME/.mame/nvram~@
1288 input_directory $HOME/.mame/inp~@
1289 state_directory $HOME/.mame/sta~@
1290 diff_directory $HOME/.mame/diff~@
1291 comment_directory $HOME/.mame/comments~%"
1292 share share share share share share share share
1293 share)))
1294 (with-output-to-file (string-append ini "/ui.ini")
1295 (lambda _
1296 (format #t
1297 "historypath $HOME/mame/history~@
1298 categorypath $HOME/mame/folders~@
1299 cabinets_directory $HOME/mame/cabinets~@
1300 cpanels_directory $HOME/mame/cpanel~@
1301 pcbs_directory $HOME/mame/pcb~@
1302 flyers_directory $HOME/mame/flyers~@
1303 titles_directory $HOME/mame/titles~@
1304 ends_directory $HOME/mame/ends~@
1305 marquees_directory $HOME/mame/marquees~@
1306 artwork_preview_directory $HOME/mame/artpreview~@
1307 bosses_directory $HOME/mame/bosses~@
1308 logos_directory $HOME/mame/logo~@
1309 scores_directory $HOME/mame/scores~@
1310 versus_directory $HOME/mame/versus~@
1311 gameover_directory $HOME/mame/gameover~@
1312 howto_directory $HOME/mame/howto~@
1313 select_directory $HOME/mame/select~@
1314 icons_directory $HOME/mame/icons~@
1315 covers_directory $HOME/mame/covers~@
1316 ui_path $HOME/.mame/ui~%")))
1317 #t)))
1318 (add-after 'install 'install-desktop-file
1319 (lambda* (#:key outputs #:allow-other-keys)
1320 (let* ((out (assoc-ref outputs "out"))
1321 (desktop (string-append out "/share/applications"))
1322 (executable (string-append out "/bin/mame")))
1323 (mkdir-p desktop)
1324 (with-output-to-file (string-append desktop "/mame.desktop")
1325 (lambda _
1326 (format #t
1327 "[Desktop Entry]~@
1328 Name=mame~@
1329 Comment=Multi-purpose emulation framework~@
1330 Exec=~a~@
1331 TryExec=~@*~a~@
1332 Terminal=false~@
1333 Type=Application~@
1334 Categories=Game;Emulator;~@
1335 Keywords=Game;Emulator;Arcade;~%"
1336 executable)))
1337 #t))))))
1338 (native-inputs
1339 `(("pkg-config" ,pkg-config)
1340 ("pugixml" ,pugixml)
1341 ("python-sphinx" ,python-sphinx)
1342 ("texinfo" ,texinfo)))
1343 (inputs
1344 `(("alsa-lib" ,alsa-lib)
1345 ("asio" ,asio)
1346 ("expat" ,expat)
1347 ("flac" ,flac)
1348 ("fontconfig" ,fontconfig)
1349 ("glm" ,glm)
1350 ("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
1351 ("libxinerama" ,libxinerama)
1352 ("lua" ,lua)
1353 ("portaudio" ,portaudio)
1354 ("portmidi" ,portmidi)
1355 ("python-wrapper" ,python-wrapper)
1356 ("qtbase" ,qtbase)
1357 ("rapidjson" ,rapidjson)
1358 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1359 ("sqlite" ,sqlite)
1360 ("utf8proc" ,utf8proc)
1361 ("zlib" ,zlib)))
1362 (home-page "http://mamedev.org/")
1363 (synopsis "Multi-purpose emulation framework")
1364 (description "MAME's purpose is to preserve decades of software
1365history. As electronic technology continues to rush forward, MAME
1366prevents this important @emph{vintage} software from being lost and
1367forgotten. This is achieved by documenting the hardware and how it
1368functions. The source code to MAME serves as this documentation.")
1369 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1370 ;; However, over 90% of the files are under Expat license. Also, artwork,
1371 ;; keymaps, languages and samples are under CC0.
1372 (license (list license:gpl2+ license:expat license:cc0))))