Merge branch 'staging'
[jackhill/guix/guix.git] / gnu / packages / emulators.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
4 ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
5 ;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6 ;;; Copyright © 2015, 2018 David Thompson <dthompson2@worcester.edu>
7 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
8 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2017, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
12 ;;;
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)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix svn-download)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages algebra)
36 #:use-module (gnu packages assembly)
37 #:use-module (gnu packages audio)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages backup)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages curl)
44 #:use-module (gnu packages elf)
45 #:use-module (gnu packages fonts)
46 #:use-module (gnu packages fontutils)
47 #:use-module (gnu packages freedesktop)
48 #:use-module (gnu packages game-development)
49 #:use-module (gnu packages gcc)
50 #:use-module (gnu packages gettext)
51 #:use-module (gnu packages gl)
52 #:use-module (gnu packages glib)
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages image)
55 #:use-module (gnu packages imagemagick)
56 #:use-module (gnu packages libedit)
57 #:use-module (gnu packages libusb)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages lua)
60 #:use-module (gnu packages maths)
61 #:use-module (gnu packages mp3)
62 #:use-module (gnu packages music)
63 #:use-module (gnu packages ncurses)
64 #:use-module (gnu packages networking)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages pulseaudio)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages qt)
69 #:use-module (gnu packages sdl)
70 #:use-module (gnu packages sphinx)
71 #:use-module (gnu packages sqlite)
72 #:use-module (gnu packages texinfo)
73 #:use-module (gnu packages textutils)
74 #:use-module (gnu packages tls)
75 #:use-module (gnu packages upnp)
76 #:use-module (gnu packages video)
77 #:use-module (gnu packages vulkan)
78 #:use-module (gnu packages wxwidgets)
79 #:use-module (gnu packages xdisorg)
80 #:use-module (gnu packages xiph)
81 #:use-module (gnu packages xml)
82 #:use-module (gnu packages xorg)
83 #:use-module (gnu packages web)
84 #:use-module (guix build-system cmake)
85 #:use-module (guix build-system gnu))
86
87 (define-public desmume
88 (package
89 (name "desmume")
90 (version "0.9.11")
91 (source
92 (origin
93 (method url-fetch)
94 (uri (string-append
95 "mirror://sourceforge/desmume/desmume/"
96 version "/desmume-" version ".tar.gz"))
97 (sha256
98 (base32
99 "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))))
100 (build-system gnu-build-system)
101 (arguments
102 ;; Enable support for WiFi and microphone.
103 `(#:configure-flags '("--enable-wifi"
104 "--enable-openal")))
105 (native-inputs
106 `(("pkg-config" ,pkg-config)
107 ("intltool" ,intltool)))
108 (inputs
109 `(("zlib" ,zlib)
110 ("sdl" ,sdl)
111 ("glib" ,glib)
112 ("gtk+" ,gtk+-2)
113 ("glu" ,glu)))
114 (home-page "http://desmume.org/")
115 (synopsis "Nintendo DS emulator")
116 (description
117 "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
118 (license license:gpl2)))
119
120 ;; Building from recent Git because the official 5.0 release no longer builds.
121 (define-public dolphin-emu
122 (let ((commit "24718c1a389e4f51db974575cd15c372485b92e2")
123 (revision "6"))
124 (package
125 (name "dolphin-emu")
126 (version (git-version "5.0" revision commit))
127 (source
128 (origin
129 (method git-fetch)
130 (uri (git-reference
131 (url "https://github.com/dolphin-emu/dolphin.git")
132 (commit commit)))
133 (file-name (git-file-name name version))
134 (modules '((guix build utils)))
135 (snippet
136 '(begin
137 ;; Remove external stuff we don't need.
138 (for-each (lambda (dir)
139 (delete-file-recursively
140 (string-append "Externals/" dir)))
141 '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
142 "gettext" "hidapi" "libpng" "libusb" "mbedtls"
143 "miniupnpc" "zlib"))
144 ;; Clean up source.
145 (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
146 #t))
147 (sha256
148 (base32
149 "1d92rhnw307j3m6swk6bycb8fyc7vw2hfgakd5hpsc4qw65vxfq8"))))
150 (build-system cmake-build-system)
151 (arguments
152 '(#:tests? #f
153 #:phases
154 (modify-phases %standard-phases
155 (add-before 'configure 'fixgcc7
156 (lambda _
157 (unsetenv "C_INCLUDE_PATH")
158 (unsetenv "CPLUS_INCLUDE_PATH")
159 #t))
160 (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
161 (lambda* (#:key inputs outputs #:allow-other-keys)
162 (let ((fontfile
163 (string-append (assoc-ref inputs "font-wqy-microhei")
164 "/share/fonts/truetype/wqy-microhei.ttc"))
165 (libvulkan
166 (string-append (assoc-ref inputs "vulkan-loader")
167 "/lib/libvulkan.so")))
168 (chdir "docs")
169 (invoke "bash" "-c" "g++ -O2 -std=c++11 $(freetype-config \
170 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
171 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
172 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
173 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
174 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
175 (chdir "..")
176 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
177 (("libvulkan.so") libvulkan))
178 #t))))
179
180 ;; The FindGTK2 cmake script only checks hardcoded directories for
181 ;; glib/gtk headers.
182
183 #:configure-flags
184 (list (string-append "-DX11_INCLUDE_DIR="
185 (assoc-ref %build-inputs "libx11")
186 "/include")
187 (string-append "-DX11_LIBRARIES="
188 (assoc-ref %build-inputs "libx11")
189 "/lib/libX11.so")
190 "-DX11_FOUND=1")))
191 (native-inputs
192 `(("pkg-config" ,pkg-config)
193 ("gcc" ,gcc-7) ; Building with gcc@5 doesn't work anymore.
194 ("gettext" ,gnu-gettext)))
195 (inputs
196 `(("alsa-lib" ,alsa-lib)
197 ("ao" ,ao)
198 ("bluez" ,bluez)
199 ("curl" ,curl)
200 ("eudev" ,eudev)
201 ("ffmpeg" ,ffmpeg)
202 ("font-wqy-microhei" ,font-wqy-microhei)
203 ("freetype" ,freetype)
204 ("glew" ,glew)
205 ("glib" ,glib)
206 ("glu" ,glu)
207 ("gtk+" ,gtk+-2)
208 ("hidapi" ,hidapi)
209 ("libevdev" ,libevdev)
210 ("libpng" ,libpng)
211 ("libusb" ,libusb)
212 ("libx11" ,libx11)
213 ("libxi" ,libxi)
214 ("libxrandr" ,libxrandr)
215 ("lzo" ,lzo)
216 ("mbedtls-apache" ,mbedtls-apache)
217 ("mesa" ,mesa)
218 ("miniupnpc" ,miniupnpc)
219 ("openal" ,openal)
220 ("pugixml" ,pugixml)
221 ("pulseaudio" ,pulseaudio)
222 ("qtbase" ,qtbase)
223 ("sdl2" ,sdl2)
224 ("sfml" ,sfml)
225 ("soil" ,soil)
226 ("soundtouch" ,soundtouch)
227 ("vulkan-loader" ,vulkan-loader)
228 ("zlib" ,zlib)))
229 (home-page "https://dolphin-emu.org/")
230 (synopsis "Nintendo Wii and GameCube emulator")
231 (description
232 "Dolphin is an emulator for two Nintendo video game consoles: the
233 GameCube and the Wii. It provides compatibility with all PC controllers,
234 turbo speed, networked multiplayer, and graphical enhancements.")
235 (supported-systems '("x86_64-linux" "aarch64-linux"))
236 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
237 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
238
239 (define-public dosbox
240 (package
241 (name "dosbox")
242 (version "0.74-3")
243 (source (origin
244 (method url-fetch)
245 (uri (string-append "https://sourceforge.net/projects/dosbox"
246 "/files/dosbox/" version "/dosbox-"
247 version ".tar.gz/download"))
248 (file-name (string-append name "-" version ".tar.gz"))
249 (sha256
250 (base32
251 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
252 (build-system gnu-build-system)
253 (native-inputs
254 `(("autoconf" ,autoconf)
255 ("automake" ,automake)))
256 (inputs
257 `(("sdl" ,sdl)
258 ("libpng" ,libpng)
259 ("zlib" ,zlib)
260 ("alsa-lib" ,alsa-lib)
261 ("glu" ,glu)
262 ("mesa" ,mesa)))
263 (home-page "http://www.dosbox.com")
264 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
265 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
266 also emulates CPU:286/386 realmode/protected mode, Directory
267 FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
268 SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
269 older games.")
270 (license license:gpl2+)))
271
272 (define-public emulation-station
273 (let ((commit "646bede3d9ec0acf0ae378415edac136774a66c5"))
274 (package
275 (name "emulation-station")
276 (version "2.0.1")
277 (source (origin
278 (method git-fetch) ; no tarball available
279 (uri (git-reference
280 (url "https://github.com/Aloshi/EmulationStation.git")
281 (commit commit))) ; no version tag
282 (file-name (string-append name "-" version "-checkout"))
283 (sha256
284 (base32
285 "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v"))))
286 (build-system cmake-build-system)
287 (arguments
288 '(#:tests? #f)) ; no tests
289 (inputs
290 `(("alsa-lib" ,alsa-lib)
291 ("boost" ,boost)
292 ("curl" ,curl)
293 ("eigin" ,eigen)
294 ("freeimage" ,freeimage)
295 ("freetype" ,freetype)
296 ("mesa" ,mesa)
297 ("sdl2" ,sdl2)))
298 (synopsis "Video game console emulator front-end")
299 (description "EmulationStation provides a graphical front-end to a large
300 number of video game console emulators. It features an interface that is
301 usable with any game controller that has at least 4 buttons, theming support,
302 and a game metadata scraper.")
303 (home-page "http://www.emulationstation.org")
304 (license license:expat))))
305
306 (define-public higan
307 (package
308 (name "higan")
309 (version "106")
310 (source
311 (origin
312 (method url-fetch)
313 (uri (string-append
314 "https://gitlab.com/higan/higan/repository/archive.tar.gz?ref=v"
315 version))
316 (file-name (string-append name "-" version ".tar.gz"))
317 (sha256
318 (base32 "0y42pra0dxzlbkyzcp3r8a39pji2bj3p9fl40425f60af2igr4rw"))
319 (patches (search-patches "higan-remove-march-native-flag.patch"))))
320 (build-system gnu-build-system)
321 (native-inputs
322 `(("pkg-config" ,pkg-config)))
323 (inputs
324 `(("alsa-lib" ,alsa-lib)
325 ("ao" ,ao)
326 ("eudev" ,eudev)
327 ("gtk+" ,gtk+-2)
328 ("gtksourceview-2" ,gtksourceview-2)
329 ("libxv" ,libxv)
330 ("mesa" ,mesa)
331 ("openal" ,openal)
332 ("pulseaudio" ,pulseaudio)
333 ("sdl" ,sdl)))
334 (arguments
335 '(#:phases
336 (let ((build-phase (assoc-ref %standard-phases 'build))
337 (install-phase (assoc-ref %standard-phases 'install)))
338 (modify-phases %standard-phases
339 ;; The higan build system has no configure phase.
340 (delete 'configure)
341 (add-before 'build 'chdir-to-higan
342 (lambda _
343 (chdir "higan")))
344 (add-before 'install 'create-/share/applications
345 (lambda* (#:key outputs #:allow-other-keys)
346 (let ((out (assoc-ref outputs "out")))
347 ;; It seems the author forgot to do this in the Makefile.
348 (mkdir-p (string-append out "/share/applications")))))
349 (add-after 'install 'chdir-to-icarus
350 (lambda _
351 (chdir "../icarus")))
352 (add-after 'chdir-to-icarus 'build-icarus build-phase)
353 (add-after 'build-icarus 'install-icarus install-phase)
354 (add-after 'install-icarus 'wrap-higan-executable
355 (lambda* (#:key inputs outputs #:allow-other-keys)
356 (let* ((out (assoc-ref outputs "out"))
357 (bin (string-append out "/bin"))
358 (higan (string-append bin "/higan"))
359 (higan-original (string-append higan "-original"))
360 (bash (string-append (assoc-ref inputs "bash")
361 "/bin/bash"))
362 (coreutils (assoc-ref inputs "coreutils"))
363 (mkdir (string-append coreutils "/bin/mkdir"))
364 (cp (string-append coreutils "/bin/cp"))
365 (cp-r (string-append cp " -r --no-preserve=mode")))
366 ;; First, have the executable make sure ~/.local/share/higan
367 ;; contains up to date files. Higan insists on looking there
368 ;; for these data files.
369 (rename-file higan higan-original)
370 (with-output-to-file higan
371 (lambda ()
372 (display
373 (string-append
374 "#!" bash "\n"
375 ;; higan doesn't respect $XDG_DATA_HOME
376 mkdir " -p ~/.local/share\n"
377 cp-r " " out "/share/higan ~/.local/share\n"
378 "exec " higan-original))))
379 (chmod higan #o555)
380 ;; Second, make sure higan will find icarus in PATH.
381 (wrap-program higan
382 `("PATH" ":" prefix (,bin))))))))
383 #:make-flags
384 (list "compiler=g++"
385 (string-append "prefix=" (assoc-ref %outputs "out")))
386 ;; There is no test suite.
387 #:tests? #f))
388 (home-page "http://byuu.org/emulation/higan/")
389 (synopsis "Nintendo multi-system emulator")
390 (description
391 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
392 consoles, including the Nintendo Entertainment System (NES/Famicom), Super
393 Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
394 Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
395 Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
396 ;; As noted in these files among more:
397 ;; - icarus/icarus.cpp
398 ;; - higan/emulator/emulator.hpp
399 (license license:gpl3)))
400
401 (define-public mgba
402 (package
403 (name "mgba")
404 (version "0.7.2")
405 (source (origin
406 (method git-fetch)
407 (uri (git-reference
408 (url "https://github.com/mgba-emu/mgba.git")
409 (commit version)))
410 (file-name (git-file-name name version))
411 (sha256
412 (base32
413 "0g0xa1mzvan0sl1p5c784j2g5mcw9kd2b7wiahy06gy0c1nmbcnp"))
414 (modules '((guix build utils)))
415 (snippet
416 ;; Make sure we don't use the bundled software.
417 '(begin
418 (for-each
419 (lambda (subdir)
420 (let ((lib-subdir (string-append "src/third-party/" subdir)))
421 (delete-file-recursively lib-subdir)))
422 '("libpng" "lzma" "sqlite3" "zlib"))
423 #t))))
424 (build-system cmake-build-system)
425 (arguments
426 `(#:tests? #f ;no "test" target
427 #:configure-flags
428 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
429 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
430 (native-inputs `(("pkg-config" ,pkg-config)))
431 (inputs `(("ffmpeg" ,ffmpeg)
432 ("imagemagick" ,imagemagick)
433 ("libedit" ,libedit)
434 ("libelf" ,libelf)
435 ("libepoxy" ,libepoxy)
436 ("libpng" ,libpng)
437 ("mesa" ,mesa)
438 ("minizip" ,minizip)
439 ("ncurses" ,ncurses)
440 ("qtbase" ,qtbase)
441 ("qtmultimedia" ,qtmultimedia)
442 ("qttools" ,qttools)
443 ("sdl2" ,sdl2)
444 ("sqlite" ,sqlite)
445 ("zlib" ,zlib)))
446 (home-page "https://mgba.io")
447 (synopsis "Game Boy Advance emulator")
448 (description
449 "mGBA is an emulator for running Game Boy Advance games. It aims to be
450 faster and more accurate than many existing Game Boy Advance emulators, as
451 well as adding features that other emulators lack. It also supports Game Boy
452 and Game Boy Color games.")
453 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c" is
454 ;; BSD-3.
455 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
456
457 (define-public mupen64plus-core
458 (package
459 (name "mupen64plus-core")
460 (version "2.5")
461 (source
462 (origin
463 (method git-fetch)
464 (uri (git-reference
465 (url "https://github.com/mupen64plus/mupen64plus-core.git")
466 (commit version)))
467 (file-name (git-file-name name version))
468 (sha256
469 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
470 (build-system gnu-build-system)
471 (native-inputs
472 `(("pkg-config" ,pkg-config)
473 ("which" ,which)))
474 (inputs
475 `(("freetype" ,freetype)
476 ("glu" ,glu)
477 ("libpng" ,libpng)
478 ("mesa" ,mesa)
479 ("sdl2" ,sdl2)
480 ("zlib" ,zlib)))
481 (arguments
482 '(#:phases
483 (modify-phases %standard-phases
484 ;; The mupen64plus build system has no configure phase.
485 (delete 'configure)
486 ;; Makefile is in a subdirectory.
487 (add-before
488 'build 'cd-to-project-dir
489 (lambda _
490 (chdir "projects/unix"))))
491 #:make-flags (let ((out (assoc-ref %outputs "out")))
492 (list "all" (string-append "PREFIX=" out)))
493 ;; There are no tests.
494 #:tests? #f))
495 ;; As per the Makefile (in projects/unix/Makefile):
496 (supported-systems '("i686-linux" "x86_64-linux"))
497 (home-page "http://www.mupen64plus.org/")
498 (synopsis "Nintendo 64 emulator core library")
499 (description
500 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
501 which is capable of accurately playing many games. This package contains the
502 core library.")
503 (license license:gpl2+)))
504
505 (define-public mupen64plus-audio-sdl
506 (package
507 (name "mupen64plus-audio-sdl")
508 (version "2.5")
509 (source
510 (origin
511 (method git-fetch)
512 (uri (git-reference
513 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
514 (commit version)))
515 (file-name (git-file-name name version))
516 (sha256
517 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
518 (build-system gnu-build-system)
519 (native-inputs
520 `(("pkg-config" ,pkg-config)
521 ("which" ,which)))
522 (inputs
523 `(("mupen64plus-core" ,mupen64plus-core)
524 ("sdl2" ,sdl2)))
525 (arguments
526 '(#:phases
527 (modify-phases %standard-phases
528 ;; The mupen64plus build system has no configure phase.
529 (delete 'configure)
530 ;; Makefile is in a subdirectory.
531 (add-before
532 'build 'cd-to-project-dir
533 (lambda _
534 (chdir "projects/unix"))))
535 #:make-flags
536 (let ((out (assoc-ref %outputs "out"))
537 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
538 (list "all"
539 (string-append "PREFIX=" out)
540 (string-append "APIDIR=" m64p "/include/mupen64plus")))
541 ;; There are no tests.
542 #:tests? #f))
543 (home-page "http://www.mupen64plus.org/")
544 (synopsis "Mupen64Plus SDL input plugin")
545 (description
546 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
547 which is capable of accurately playing many games. This package contains the
548 SDL audio plugin.")
549 (license license:gpl2+)))
550
551 (define-public mupen64plus-input-sdl
552 (package
553 (name "mupen64plus-input-sdl")
554 (version "2.5")
555 (source
556 (origin
557 (method git-fetch)
558 (uri (git-reference
559 (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
560 (commit version)))
561 (file-name (git-file-name name version))
562 (sha256
563 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
564 (build-system gnu-build-system)
565 (native-inputs
566 `(("which" ,which)))
567 (inputs
568 `(("mupen64plus-core" ,mupen64plus-core)
569 ("sdl2" ,sdl2)))
570 (arguments
571 '(#:phases
572 (modify-phases %standard-phases
573 ;; The mupen64plus build system has no configure phase.
574 (delete 'configure)
575 ;; Makefile is in a subdirectory.
576 (add-before
577 'build 'cd-to-project-dir
578 (lambda _
579 (chdir "projects/unix"))))
580 #:make-flags
581 (let ((out (assoc-ref %outputs "out"))
582 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
583 (list "all"
584 (string-append "PREFIX=" out)
585 (string-append "APIDIR=" m64p "/include/mupen64plus")))
586 ;; There are no tests.
587 #:tests? #f))
588 (home-page "http://www.mupen64plus.org/")
589 (synopsis "Mupen64Plus SDL input plugin")
590 (description
591 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
592 which is capable of accurately playing many games. This package contains the
593 SDL input plugin.")
594 (license license:gpl2+)))
595
596 (define-public mupen64plus-rsp-hle
597 (package
598 (name "mupen64plus-rsp-hle")
599 (version "2.5")
600 (source
601 (origin
602 (method git-fetch)
603 (uri (git-reference
604 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
605 (commit version)))
606 (file-name (git-file-name name version))
607 (sha256
608 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
609 (build-system gnu-build-system)
610 (inputs
611 `(("mupen64plus-core" ,mupen64plus-core)))
612 (arguments
613 '(#:phases
614 (modify-phases %standard-phases
615 ;; The mupen64plus build system has no configure phase.
616 (delete 'configure)
617 ;; Makefile is in a subdirectory.
618 (add-before
619 'build 'cd-to-project-dir
620 (lambda _
621 (chdir "projects/unix"))))
622 #:make-flags
623 (let ((out (assoc-ref %outputs "out"))
624 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
625 (list "all"
626 (string-append "PREFIX=" out)
627 (string-append "APIDIR=" m64p "/include/mupen64plus")))
628 ;; There are no tests.
629 #:tests? #f))
630 (home-page "http://www.mupen64plus.org/")
631 (synopsis "Mupen64Plus SDL input plugin")
632 (description
633 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
634 which is capable of accurately playing many games. This package contains the
635 high-level emulation (HLE) RSP processor plugin.")
636 (license license:gpl2+)))
637
638 (define-public mupen64plus-rsp-z64
639 (package
640 (name "mupen64plus-rsp-z64")
641 (version "2.0.0")
642 (source
643 (origin
644 (method git-fetch)
645 (uri (git-reference
646 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
647 (commit version)))
648 (file-name (git-file-name name version))
649 (sha256
650 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
651 (build-system gnu-build-system)
652 (inputs
653 `(("mupen64plus-core" ,mupen64plus-core)))
654 (arguments
655 '(#:phases
656 (modify-phases %standard-phases
657 ;; The mupen64plus build system has no configure phase.
658 (delete 'configure)
659 ;; Makefile is in a subdirectory.
660 (add-before
661 'build 'cd-to-project-dir
662 (lambda _
663 (chdir "projects/unix"))))
664 #:make-flags
665 (let ((out (assoc-ref %outputs "out"))
666 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
667 (list "all"
668 (string-append "PREFIX=" out)
669 (string-append "APIDIR=" m64p "/include/mupen64plus")))
670 ;; There are no tests.
671 #:tests? #f))
672 (home-page "http://www.mupen64plus.org/")
673 (synopsis "Mupen64Plus SDL input plugin")
674 (description
675 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
676 which is capable of accurately playing many games. This package contains the
677 Z64 RSP processor plugin.")
678 (license license:gpl2+)))
679
680 (define-public mupen64plus-video-arachnoid
681 (package
682 (name "mupen64plus-video-arachnoid")
683 (version "2.0.0")
684 (source
685 (origin
686 (method git-fetch)
687 (uri (git-reference
688 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
689 (commit version)))
690 (file-name (git-file-name name version))
691 (sha256
692 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
693 (build-system gnu-build-system)
694 (native-inputs
695 `(("pkg-config" ,pkg-config)
696 ("which" ,which)))
697 (inputs
698 `(("mesa" ,mesa)
699 ("mupen64plus-core" ,mupen64plus-core)))
700 (arguments
701 '(#:phases
702 (modify-phases %standard-phases
703 ;; The mupen64plus build system has no configure phase.
704 (delete 'configure)
705 ;; Makefile is in a subdirectory.
706 (add-before
707 'build 'cd-to-project-dir
708 (lambda _
709 (chdir "projects/unix"))))
710 #:make-flags
711 (let ((out (assoc-ref %outputs "out"))
712 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
713 (list "all"
714 (string-append "PREFIX=" out)
715 (string-append "APIDIR=" m64p "/include/mupen64plus")))
716 ;; There are no tests.
717 #:tests? #f))
718 (home-page "http://www.mupen64plus.org/")
719 (synopsis "Mupen64Plus Rice Video plugin")
720 (description
721 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
722 which is capable of accurately playing many games. This package contains the
723 Arachnoid video plugin.")
724 (license license:gpl2+)))
725
726 (define-public mupen64plus-video-glide64
727 (package
728 (name "mupen64plus-video-glide64")
729 (version "2.0.0")
730 (source
731 (origin
732 (method git-fetch)
733 (uri (git-reference
734 (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
735 (commit version)))
736 (file-name (git-file-name name version))
737 (sha256
738 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
739 (build-system gnu-build-system)
740 (native-inputs
741 `(("pkg-config" ,pkg-config)
742 ("which" ,which)))
743 (inputs
744 `(("mesa" ,mesa)
745 ("mupen64plus-core" ,mupen64plus-core)
746 ("sdl2" ,sdl2)))
747 (arguments
748 '(#:phases
749 (modify-phases %standard-phases
750 ;; The mupen64plus build system has no configure phase.
751 (delete 'configure)
752 ;; Makefile is in a subdirectory.
753 (add-before
754 'build 'cd-to-project-dir
755 (lambda _
756 (chdir "projects/unix")))
757 ;; XXX Should be unnecessary with the next release.
758 (add-before
759 'build 'use-sdl2
760 (lambda _
761 (substitute* "Makefile"
762 (("SDL_CONFIG = (.*)sdl-config" all prefix)
763 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
764 #:make-flags
765 (let ((out (assoc-ref %outputs "out"))
766 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
767 (list "all"
768 (string-append "PREFIX=" out)
769 (string-append "APIDIR=" m64p "/include/mupen64plus")))
770 ;; There are no tests.
771 #:tests? #f))
772 (home-page "http://www.mupen64plus.org/")
773 (synopsis "Mupen64Plus Rice Video plugin")
774 (description
775 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
776 which is capable of accurately playing many games. This package contains the
777 Glide64 video plugin.")
778 (license license:gpl2+)))
779
780 (define-public mupen64plus-video-glide64mk2
781 (package
782 (name "mupen64plus-video-glide64mk2")
783 (version "2.5")
784 (source
785 (origin
786 (method git-fetch)
787 (uri (git-reference
788 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
789 (commit version)))
790 (file-name (git-file-name name version))
791 (sha256
792 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
793 (build-system gnu-build-system)
794 (native-inputs
795 `(("pkg-config" ,pkg-config)
796 ("which" ,which)))
797 (inputs
798 `(("boost" ,boost)
799 ("libpng" ,libpng)
800 ("mesa" ,mesa)
801 ("mupen64plus-core" ,mupen64plus-core)
802 ("sdl2" ,sdl2)
803 ("zlib" ,zlib)))
804 (arguments
805 '(#:phases
806 (modify-phases %standard-phases
807 ;; The mupen64plus build system has no configure phase.
808 (delete 'configure)
809 ;; Makefile is in a subdirectory.
810 (add-before
811 'build 'cd-to-project-dir
812 (lambda _
813 (chdir "projects/unix"))))
814 #:make-flags
815 (let ((out (assoc-ref %outputs "out"))
816 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
817 (list "all"
818 (string-append "PREFIX=" out)
819 (string-append "APIDIR=" m64p "/include/mupen64plus")))
820 ;; There are no tests.
821 #:tests? #f))
822 (home-page "http://www.mupen64plus.org/")
823 (synopsis "Mupen64Plus Rice Video plugin")
824 (description
825 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
826 which is capable of accurately playing many games. This package contains the
827 Glide64MK2 video plugin.")
828 (license license:gpl2+)))
829
830 (define-public mupen64plus-video-rice
831 (package
832 (name "mupen64plus-video-rice")
833 (version "2.5")
834 (source
835 (origin
836 (method git-fetch)
837 (uri (git-reference
838 (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
839 (commit version)))
840 (file-name (git-file-name name version))
841 (sha256
842 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
843 (build-system gnu-build-system)
844 (native-inputs
845 `(("pkg-config" ,pkg-config)
846 ("which" ,which)))
847 (inputs
848 `(("libpng" ,libpng)
849 ("mesa" ,mesa)
850 ("mupen64plus-core" ,mupen64plus-core)
851 ("sdl2" ,sdl2)))
852 (arguments
853 '(#:phases
854 (modify-phases %standard-phases
855 ;; The mupen64plus build system has no configure phase.
856 (delete 'configure)
857 ;; Makefile is in a subdirectory.
858 (add-before
859 'build 'cd-to-project-dir
860 (lambda _
861 (chdir "projects/unix"))))
862 #:make-flags
863 (let ((out (assoc-ref %outputs "out"))
864 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
865 (list "all"
866 (string-append "PREFIX=" out)
867 (string-append "APIDIR=" m64p "/include/mupen64plus")))
868 ;; There are no tests.
869 #:tests? #f))
870 (home-page "http://www.mupen64plus.org/")
871 (synopsis "Mupen64Plus Rice Video plugin")
872 (description
873 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
874 which is capable of accurately playing many games. This package contains the
875 Rice Video plugin.")
876 (license license:gpl2+)))
877
878 (define-public mupen64plus-video-z64
879 (package
880 (name "mupen64plus-video-z64")
881 (version "2.0.0")
882 (source
883 (origin
884 (method git-fetch)
885 (uri (git-reference
886 (url "https://github.com/mupen64plus/mupen64plus-video-z64.git")
887 (commit version)))
888 (file-name (git-file-name name version))
889 (sha256
890 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
891 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
892 (build-system gnu-build-system)
893 (native-inputs
894 `(("pkg-config" ,pkg-config)
895 ("which" ,which)))
896 (inputs
897 `(("glew" ,glew)
898 ("mupen64plus-core" ,mupen64plus-core)
899 ("sdl2" ,sdl2)))
900 (arguments
901 '(#:phases
902 (modify-phases %standard-phases
903 ;; The mupen64plus build system has no configure phase.
904 (delete 'configure)
905 ;; Makefile is in a subdirectory.
906 (add-before
907 'build 'cd-to-project-dir
908 (lambda _
909 (chdir "projects/unix")))
910 ;; XXX Should be unnecessary with the next release.
911 (add-before
912 'build 'use-sdl2
913 (lambda _
914 (substitute* "Makefile"
915 (("SDL_CONFIG = (.*)sdl-config" all prefix)
916 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
917 #:make-flags
918 (let ((out (assoc-ref %outputs "out"))
919 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
920 (list "all"
921 (string-append "PREFIX=" out)
922 (string-append "APIDIR=" m64p "/include/mupen64plus")))
923 ;; There are no tests.
924 #:tests? #f))
925 (home-page "http://www.mupen64plus.org/")
926 (synopsis "Mupen64Plus Z64 video plugin")
927 (description
928 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
929 which is capable of accurately playing many games. This package contains the
930 Z64 video plugin.")
931 (license license:gpl2+)))
932
933 (define-public mupen64plus-ui-console
934 (package
935 (name "mupen64plus-ui-console")
936 (version "2.5")
937 (source
938 (origin
939 (method git-fetch)
940 (uri (git-reference
941 (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
942 (commit version)))
943 (file-name (git-file-name name version))
944 (sha256
945 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
946 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
947 (build-system gnu-build-system)
948 (native-inputs
949 `(("pkg-config" ,pkg-config)
950 ("which" ,which)))
951 (inputs
952 `(("sdl2" ,sdl2)))
953 ;; Mupen64Plus supports a single data directory and a single plugin
954 ;; directory in its configuration, yet we need data and plugin files from
955 ;; a variety of packages. The best way to deal with this is to install
956 ;; all packages from which data and plugin files are needed into one's
957 ;; profile, and point the configuration there. Hence, propagate the most
958 ;; important packages here to save the user from the bother. The patch
959 ;; mupen64plus-ui-console-notice also gives users instructions on what
960 ;; they need to do in order to point the configuration to their profile.
961 (propagated-inputs
962 `(("mupen64plus-core" ,mupen64plus-core)
963 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
964 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
965 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
966 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
967 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
968 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
969 (arguments
970 '(#:phases
971 (modify-phases %standard-phases
972 ;; The mupen64plus build system has no configure phase.
973 (delete 'configure)
974 ;; Makefile is in a subdirectory.
975 (add-before
976 'build 'cd-to-project-dir
977 (lambda _
978 (chdir "projects/unix"))))
979 #:make-flags
980 (let ((out (assoc-ref %outputs "out"))
981 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
982 (list "all"
983 (string-append "PREFIX=" out)
984 (string-append "APIDIR=" m64p "/include/mupen64plus")
985 ;; Trailing slash matters here.
986 (string-append "COREDIR=" m64p "/lib/")))
987 ;; There are no tests.
988 #:tests? #f))
989 (home-page "http://www.mupen64plus.org/")
990 (synopsis "Mupen64Plus SDL input plugin")
991 (description
992 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
993 which is capable of accurately playing many games. This package contains the
994 command line user interface. Installing this package is the easiest way
995 towards a working Mupen64Plus for casual users.")
996 (license license:gpl2+)))
997
998 (define-public nestopia-ue
999 (package
1000 (name "nestopia-ue")
1001 (version "1.48")
1002 (source
1003 (origin
1004 (method git-fetch)
1005 (uri (git-reference
1006 (url "https://github.com/rdanbrook/nestopia.git")
1007 (commit version)))
1008 (file-name (git-file-name name version))
1009 (sha256
1010 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1011 (modules '((guix build utils)))
1012 (snippet
1013 '(begin
1014 ;; We don't need libretro for the GNU/Linux build.
1015 (delete-file-recursively "libretro")
1016 #t))))
1017 (build-system cmake-build-system)
1018 (native-inputs
1019 `(("pkg-config" ,pkg-config)))
1020 (inputs
1021 `(("ao" ,ao)
1022 ("gtk+" ,gtk+)
1023 ("libarchive" ,libarchive)
1024 ("libepoxy" ,libepoxy)
1025 ("sdl2" ,sdl2)
1026 ("zlib" ,zlib)))
1027 (arguments
1028 '(#:phases
1029 (modify-phases %standard-phases
1030 ;; This fixes the file chooser crash that happens with GTK 3.
1031 (add-after 'install 'wrap-program
1032 (lambda* (#:key inputs outputs #:allow-other-keys)
1033 (let* ((out (assoc-ref outputs "out"))
1034 (nestopia (string-append out "/bin/nestopia"))
1035 (gtk (assoc-ref inputs "gtk+"))
1036 (gtk-share (string-append gtk "/share")))
1037 (wrap-program nestopia
1038 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1039 ;; There are no tests.
1040 #:tests? #f))
1041 (home-page "http://0ldsk00l.ca/nestopia/")
1042 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1043 (description
1044 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1045 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1046 emulation community. It provides highly accurate emulation.")
1047 (license license:gpl2+)))
1048
1049 (define-public retroarch
1050 (package
1051 (name "retroarch")
1052 (version "1.7.7")
1053 (source
1054 (origin
1055 (method git-fetch)
1056 (uri (git-reference
1057 (url "https://github.com/libretro/RetroArch.git")
1058 (commit (string-append "v" version))))
1059 (file-name (git-file-name name version))
1060 (sha256
1061 (base32 "026720z0vpiwr4da7l2x2yinns09fmg6yxsib203xwnixj399azi"))))
1062 (build-system gnu-build-system)
1063 (arguments
1064 `(#:tests? #f ; no tests
1065 #:phases
1066 (modify-phases %standard-phases
1067 (replace 'configure
1068 (lambda* (#:key inputs outputs #:allow-other-keys)
1069 (let* ((out (assoc-ref outputs "out"))
1070 (etc (string-append out "/etc"))
1071 (vulkan (assoc-ref inputs "vulkan-loader"))
1072 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1073 ;; Hard-code the path to libvulkan.so.
1074 (substitute* "gfx/common/vulkan_common.c"
1075 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1076 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1077 (("/usr/local/share/wayland-protocols")
1078 (string-append wayland-protocols "/share/wayland-protocols")))
1079 (substitute* "qb/qb.libs.sh"
1080 (("/bin/true") (which "true")))
1081 ;; Use shared zlib.
1082 (substitute* '("libretro-common/file/archive_file_zlib.c"
1083 "libretro-common/streams/trans_stream_zlib.c"
1084 "network/httpserver/httpserver.c")
1085 (("<compat/zlib.h>") "<zlib.h>"))
1086 ;; The configure script does not yet accept the extra arguments
1087 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1088 (invoke
1089 "./configure"
1090 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1091 (%current-system)))
1092 '("--enable-neon" "--enable-floathard")
1093 '())
1094 (string-append "--prefix=" out)
1095 (string-append "--global-config-dir=" etc))))))))
1096 (inputs
1097 `(("alsa-lib" ,alsa-lib)
1098 ("ffmpeg" ,ffmpeg)
1099 ("freetype" ,freetype)
1100 ("libxinerama" ,libxinerama)
1101 ("libxkbcommon" ,libxkbcommon)
1102 ("libxml2" ,libxml2)
1103 ("libxrandr" ,libxrandr)
1104 ("libxv" ,libxv)
1105 ("mesa" ,mesa)
1106 ("openal" ,openal)
1107 ("pulseaudio" ,pulseaudio)
1108 ("python" ,python)
1109 ("qtbase" ,qtbase)
1110 ("sdl" ,sdl2)
1111 ("udev" ,eudev)
1112 ("vulkan-loader" ,vulkan-loader)
1113 ("wayland" ,wayland)
1114 ("zlib" ,zlib)))
1115 (native-inputs
1116 `(("pkg-config" ,pkg-config)
1117 ("wayland-protocols" ,wayland-protocols)
1118 ("which" ,which)))
1119 (home-page "https://www.libretro.com/")
1120 (synopsis "Reference frontend for the libretro API")
1121 (description
1122 "Libretro is a simple but powerful development interface that allows for
1123 the easy creation of emulators, games and multimedia applications that can plug
1124 straight into any libretro-compatible frontend. RetroArch is the official
1125 reference frontend for the libretro API, currently used by most as a modular
1126 multi-system game/emulator system.")
1127 (license license:gpl3+)))
1128
1129 (define-public scummvm
1130 (package
1131 (name "scummvm")
1132 (version "2.0.0")
1133 (source
1134 (origin
1135 (method url-fetch)
1136 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1137 "/scummvm-" version ".tar.xz"))
1138 (sha256
1139 (base32
1140 "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
1141 (build-system gnu-build-system)
1142 (arguments
1143 `(#:tests? #f ;require "git"
1144 #:configure-flags (list "--enable-release") ;for optimizations
1145 #:phases
1146 (modify-phases %standard-phases
1147 (replace 'configure
1148 ;; configure does not work followed by both "SHELL=..." and
1149 ;; "CONFIG_SHELL=..."; set environment variables instead
1150 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1151 (let* ((out (assoc-ref outputs "out"))
1152 (bash (which "bash"))
1153 (flags `(,(string-append "--prefix=" out)
1154 ,@configure-flags)))
1155 (setenv "SHELL" bash)
1156 (setenv "CONFIG_SHELL" bash)
1157 (apply invoke "./configure" flags)))))))
1158 (native-inputs
1159 `(("pkg-config" ,pkg-config)))
1160 (inputs
1161 `(("alsa-lib" ,alsa-lib)
1162 ("faad2" ,faad2)
1163 ("fluidsynth" ,fluidsynth)
1164 ("freetype" ,freetype)
1165 ("libflac" ,flac)
1166 ("libjpeg-turbo" ,libjpeg-turbo)
1167 ("libmad" ,libmad)
1168 ("libmpeg2" ,libmpeg2)
1169 ("libogg" ,libogg)
1170 ("libpng" ,libpng)
1171 ("libtheora" ,libtheora)
1172 ("libvorbis" ,libvorbis)
1173 ("nasm" ,nasm)
1174 ("sdl2" ,sdl2)
1175 ("zlib" ,zlib)))
1176 (home-page "https://www.scummvm.org/")
1177 (synopsis "Engine for several graphical adventure games")
1178 (description "ScummVM is a program which allows you to run certain
1179 classic graphical point-and-click adventure games, provided you
1180 already have their data files. The clever part about this: ScummVM
1181 just replaces the executables shipped with the games, allowing you to
1182 play them on systems for which they were never designed!")
1183 (license license:gpl2+)))
1184
1185 (define-public mame
1186 (package
1187 (name "mame")
1188 (version "0.212")
1189 (source
1190 (origin
1191 (method git-fetch)
1192 (uri (git-reference
1193 (url "https://github.com/mamedev/mame.git")
1194 (commit (apply string-append "mame" (string-split version #\.)))))
1195 (file-name (git-file-name name version))
1196 (sha256
1197 (base32
1198 "0p3zcb9l624dsy2gyv23ppp1k1iwd1vrg8cbn5v4fx1s44mx7f5c"))
1199 (patches
1200 ;; FIXME: Remove once 0.213 is out. Applied upstream as
1201 ;; 0b5b13cf1e28550b49c387dec93f9801f029e313.
1202 (search-patches "mame-rapidjson-fix.patch"))
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))
1246 (when (file-exists? "mame64")
1247 (rename-file "mame64" "mame"))
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 ("sphinx" ,python-sphinx)
1341 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
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 ("libxi" ,libxi)
1352 ("libxinerama" ,libxinerama)
1353 ("lua" ,lua)
1354 ("portaudio" ,portaudio)
1355 ("portmidi" ,portmidi)
1356 ("pugixml" ,pugixml)
1357 ("python-wrapper" ,python-wrapper)
1358 ("qtbase" ,qtbase)
1359 ("rapidjson" ,rapidjson)
1360 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1361 ("sqlite" ,sqlite)
1362 ("utf8proc" ,utf8proc)
1363 ("zlib" ,zlib)))
1364 (home-page "http://mamedev.org/")
1365 (synopsis "Multi-purpose emulation framework")
1366 (description "MAME's purpose is to preserve decades of software
1367 history. As electronic technology continues to rush forward, MAME
1368 prevents this important @emph{vintage} software from being lost and
1369 forgotten. This is achieved by documenting the hardware and how it
1370 functions. The source code to MAME serves as this documentation.")
1371 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1372 ;; However, over 90% of the files are under Expat license. Also, artwork,
1373 ;; keymaps, languages and samples are under CC0.
1374 (license (list license:gpl2+ license:expat license:cc0))))