Merge branch 'master' into core-updates
[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 'generate-fonts&hardcore-libvulkan-path
156 (lambda* (#:key inputs outputs #:allow-other-keys)
157 (let ((fontfile
158 (string-append (assoc-ref inputs "font-wqy-microhei")
159 "/share/fonts/truetype/wqy-microhei.ttc"))
160 (libvulkan
161 (string-append (assoc-ref inputs "vulkan-loader")
162 "/lib/libvulkan.so")))
163 (chdir "docs")
164 (invoke "bash" "-c" "g++ -O2 -std=c++11 $(freetype-config \
165 --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
166 (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
167 (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
168 (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
169 (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
170 (chdir "..")
171 (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
172 (("libvulkan.so") libvulkan))
173 #t))))
174
175 ;; The FindGTK2 cmake script only checks hardcoded directories for
176 ;; glib/gtk headers.
177
178 #:configure-flags
179 (list (string-append "-DX11_INCLUDE_DIR="
180 (assoc-ref %build-inputs "libx11")
181 "/include")
182 (string-append "-DX11_LIBRARIES="
183 (assoc-ref %build-inputs "libx11")
184 "/lib/libX11.so")
185 "-DX11_FOUND=1")))
186 (native-inputs
187 `(("pkg-config" ,pkg-config)
188 ("gettext" ,gnu-gettext)))
189 (inputs
190 `(("alsa-lib" ,alsa-lib)
191 ("ao" ,ao)
192 ("bluez" ,bluez)
193 ("curl" ,curl)
194 ("eudev" ,eudev)
195 ("ffmpeg" ,ffmpeg)
196 ("font-wqy-microhei" ,font-wqy-microhei)
197 ("freetype" ,freetype)
198 ("glew" ,glew)
199 ("glib" ,glib)
200 ("glu" ,glu)
201 ("gtk+" ,gtk+-2)
202 ("hidapi" ,hidapi)
203 ("libevdev" ,libevdev)
204 ("libpng" ,libpng)
205 ("libusb" ,libusb)
206 ("libx11" ,libx11)
207 ("libxi" ,libxi)
208 ("libxrandr" ,libxrandr)
209 ("lzo" ,lzo)
210 ("mbedtls-apache" ,mbedtls-apache)
211 ("mesa" ,mesa)
212 ("miniupnpc" ,miniupnpc)
213 ("openal" ,openal)
214 ("pugixml" ,pugixml)
215 ("pulseaudio" ,pulseaudio)
216 ("qtbase" ,qtbase)
217 ("sdl2" ,sdl2)
218 ("sfml" ,sfml)
219 ("soil" ,soil)
220 ("soundtouch" ,soundtouch)
221 ("vulkan-loader" ,vulkan-loader)
222 ("zlib" ,zlib)))
223 (home-page "https://dolphin-emu.org/")
224 (synopsis "Nintendo Wii and GameCube emulator")
225 (description
226 "Dolphin is an emulator for two Nintendo video game consoles: the
227 GameCube and the Wii. It provides compatibility with all PC controllers,
228 turbo speed, networked multiplayer, and graphical enhancements.")
229 (supported-systems '("x86_64-linux" "aarch64-linux"))
230 ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
231 (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
232
233 (define-public dosbox
234 (package
235 (name "dosbox")
236 (version "0.74-3")
237 (source (origin
238 (method url-fetch)
239 (uri (string-append "https://sourceforge.net/projects/dosbox"
240 "/files/dosbox/" version "/dosbox-"
241 version ".tar.gz/download"))
242 (file-name (string-append name "-" version ".tar.gz"))
243 (sha256
244 (base32
245 "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
246 (build-system gnu-build-system)
247 (native-inputs
248 `(("autoconf" ,autoconf)
249 ("automake" ,automake)))
250 (inputs
251 `(("sdl" ,sdl)
252 ("libpng" ,libpng)
253 ("zlib" ,zlib)
254 ("alsa-lib" ,alsa-lib)
255 ("glu" ,glu)
256 ("mesa" ,mesa)))
257 (home-page "http://www.dosbox.com")
258 (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
259 (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
260 also emulates CPU:286/386 realmode/protected mode, Directory
261 FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
262 SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
263 older games.")
264 (license license:gpl2+)))
265
266 (define-public emulation-station
267 (let ((commit "646bede3d9ec0acf0ae378415edac136774a66c5"))
268 (package
269 (name "emulation-station")
270 (version "2.0.1")
271 (source (origin
272 (method git-fetch) ; no tarball available
273 (uri (git-reference
274 (url "https://github.com/Aloshi/EmulationStation.git")
275 (commit commit))) ; no version tag
276 (file-name (string-append name "-" version "-checkout"))
277 (sha256
278 (base32
279 "0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v"))))
280 (build-system cmake-build-system)
281 (arguments
282 '(#:tests? #f)) ; no tests
283 (inputs
284 `(("alsa-lib" ,alsa-lib)
285 ("boost" ,boost)
286 ("curl" ,curl)
287 ("eigin" ,eigen)
288 ("freeimage" ,freeimage)
289 ("freetype" ,freetype)
290 ("mesa" ,mesa)
291 ("sdl2" ,sdl2)))
292 (synopsis "Video game console emulator front-end")
293 (description "EmulationStation provides a graphical front-end to a large
294 number of video game console emulators. It features an interface that is
295 usable with any game controller that has at least 4 buttons, theming support,
296 and a game metadata scraper.")
297 (home-page "http://www.emulationstation.org")
298 (license license:expat))))
299
300 (define-public higan
301 (package
302 (name "higan")
303 (version "106")
304 (source
305 (origin
306 (method url-fetch)
307 (uri (string-append
308 "https://gitlab.com/higan/higan/repository/archive.tar.gz?ref=v"
309 version))
310 (file-name (string-append name "-" version ".tar.gz"))
311 (sha256
312 (base32 "0y42pra0dxzlbkyzcp3r8a39pji2bj3p9fl40425f60af2igr4rw"))
313 (patches (search-patches "higan-remove-march-native-flag.patch"))))
314 (build-system gnu-build-system)
315 (native-inputs
316 `(("pkg-config" ,pkg-config)))
317 (inputs
318 `(("alsa-lib" ,alsa-lib)
319 ("ao" ,ao)
320 ("eudev" ,eudev)
321 ("gtk+" ,gtk+-2)
322 ("gtksourceview-2" ,gtksourceview-2)
323 ("libxv" ,libxv)
324 ("mesa" ,mesa)
325 ("openal" ,openal)
326 ("pulseaudio" ,pulseaudio)
327 ("sdl" ,sdl)))
328 (arguments
329 '(#:phases
330 (let ((build-phase (assoc-ref %standard-phases 'build))
331 (install-phase (assoc-ref %standard-phases 'install)))
332 (modify-phases %standard-phases
333 ;; The higan build system has no configure phase.
334 (delete 'configure)
335 (add-before 'build 'chdir-to-higan
336 (lambda _
337 (chdir "higan")))
338 (add-before 'install 'create-/share/applications
339 (lambda* (#:key outputs #:allow-other-keys)
340 (let ((out (assoc-ref outputs "out")))
341 ;; It seems the author forgot to do this in the Makefile.
342 (mkdir-p (string-append out "/share/applications")))))
343 (add-after 'install 'chdir-to-icarus
344 (lambda _
345 (chdir "../icarus")))
346 (add-after 'chdir-to-icarus 'build-icarus build-phase)
347 (add-after 'build-icarus 'install-icarus install-phase)
348 (add-after 'install-icarus 'wrap-higan-executable
349 (lambda* (#:key inputs outputs #:allow-other-keys)
350 (let* ((out (assoc-ref outputs "out"))
351 (bin (string-append out "/bin"))
352 (higan (string-append bin "/higan"))
353 (higan-original (string-append higan "-original"))
354 (bash (string-append (assoc-ref inputs "bash")
355 "/bin/bash"))
356 (coreutils (assoc-ref inputs "coreutils"))
357 (mkdir (string-append coreutils "/bin/mkdir"))
358 (cp (string-append coreutils "/bin/cp"))
359 (cp-r (string-append cp " -r --no-preserve=mode")))
360 ;; First, have the executable make sure ~/.local/share/higan
361 ;; contains up to date files. Higan insists on looking there
362 ;; for these data files.
363 (rename-file higan higan-original)
364 (with-output-to-file higan
365 (lambda ()
366 (display
367 (string-append
368 "#!" bash "\n"
369 ;; higan doesn't respect $XDG_DATA_HOME
370 mkdir " -p ~/.local/share\n"
371 cp-r " " out "/share/higan ~/.local/share\n"
372 "exec " higan-original))))
373 (chmod higan #o555)
374 ;; Second, make sure higan will find icarus in PATH.
375 (wrap-program higan
376 `("PATH" ":" prefix (,bin))))))))
377 #:make-flags
378 (list "compiler=g++"
379 (string-append "prefix=" (assoc-ref %outputs "out")))
380 ;; There is no test suite.
381 #:tests? #f))
382 (home-page "http://byuu.org/emulation/higan/")
383 (synopsis "Nintendo multi-system emulator")
384 (description
385 "higan (formerly bsnes) is an emulator for multiple Nintendo video game
386 consoles, including the Nintendo Entertainment System (NES/Famicom), Super
387 Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
388 Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
389 Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
390 ;; As noted in these files among more:
391 ;; - icarus/icarus.cpp
392 ;; - higan/emulator/emulator.hpp
393 (license license:gpl3)))
394
395 (define-public mgba
396 (package
397 (name "mgba")
398 (version "0.7.2")
399 (source (origin
400 (method git-fetch)
401 (uri (git-reference
402 (url "https://github.com/mgba-emu/mgba.git")
403 (commit version)))
404 (file-name (git-file-name name version))
405 (sha256
406 (base32
407 "0g0xa1mzvan0sl1p5c784j2g5mcw9kd2b7wiahy06gy0c1nmbcnp"))
408 (modules '((guix build utils)))
409 (snippet
410 ;; Make sure we don't use the bundled software.
411 '(begin
412 (for-each
413 (lambda (subdir)
414 (let ((lib-subdir (string-append "src/third-party/" subdir)))
415 (delete-file-recursively lib-subdir)))
416 '("libpng" "lzma" "sqlite3" "zlib"))
417 #t))))
418 (build-system cmake-build-system)
419 (arguments
420 `(#:tests? #f ;no "test" target
421 #:configure-flags
422 (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
423 "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
424 (native-inputs `(("pkg-config" ,pkg-config)))
425 (inputs `(("ffmpeg" ,ffmpeg)
426 ("imagemagick" ,imagemagick)
427 ("libedit" ,libedit)
428 ("libelf" ,libelf)
429 ("libepoxy" ,libepoxy)
430 ("libpng" ,libpng)
431 ("mesa" ,mesa)
432 ("minizip" ,minizip)
433 ("ncurses" ,ncurses)
434 ("qtbase" ,qtbase)
435 ("qtmultimedia" ,qtmultimedia)
436 ("qttools" ,qttools)
437 ("sdl2" ,sdl2)
438 ("sqlite" ,sqlite)
439 ("zlib" ,zlib)))
440 (home-page "https://mgba.io")
441 (synopsis "Game Boy Advance emulator")
442 (description
443 "mGBA is an emulator for running Game Boy Advance games. It aims to be
444 faster and more accurate than many existing Game Boy Advance emulators, as
445 well as adding features that other emulators lack. It also supports Game Boy
446 and Game Boy Color games.")
447 ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c" is
448 ;; BSD-3.
449 (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
450
451 (define-public mupen64plus-core
452 (package
453 (name "mupen64plus-core")
454 (version "2.5")
455 (source
456 (origin
457 (method git-fetch)
458 (uri (git-reference
459 (url "https://github.com/mupen64plus/mupen64plus-core.git")
460 (commit version)))
461 (file-name (git-file-name name version))
462 (sha256
463 (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
464 (build-system gnu-build-system)
465 (native-inputs
466 `(("pkg-config" ,pkg-config)
467 ("which" ,which)))
468 (inputs
469 `(("freetype" ,freetype)
470 ("glu" ,glu)
471 ("libpng" ,libpng)
472 ("mesa" ,mesa)
473 ("sdl2" ,sdl2)
474 ("zlib" ,zlib)))
475 (arguments
476 '(#:phases
477 (modify-phases %standard-phases
478 ;; The mupen64plus build system has no configure phase.
479 (delete 'configure)
480 ;; Makefile is in a subdirectory.
481 (add-before
482 'build 'chdir-to-project-directory
483 (lambda _
484 (chdir "projects/unix")
485 #t)))
486 #:make-flags (let ((out (assoc-ref %outputs "out")))
487 (list "all" (string-append "PREFIX=" out)))
488 ;; There are no tests.
489 #:tests? #f))
490 ;; As per the Makefile (in projects/unix/Makefile):
491 (supported-systems '("i686-linux" "x86_64-linux"))
492 (home-page "https://www.mupen64plus.org/")
493 (synopsis "Nintendo 64 emulator core library")
494 (description
495 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
496 which is capable of accurately playing many games. This package contains the
497 core library.")
498 (license license:gpl2+)))
499
500 (define-public mupen64plus-audio-sdl
501 (package
502 (name "mupen64plus-audio-sdl")
503 (version "2.5")
504 (source
505 (origin
506 (method git-fetch)
507 (uri (git-reference
508 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
509 (commit version)))
510 (file-name (git-file-name name version))
511 (sha256
512 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
513 (build-system gnu-build-system)
514 (native-inputs
515 `(("pkg-config" ,pkg-config)
516 ("which" ,which)))
517 (inputs
518 `(("mupen64plus-core" ,mupen64plus-core)
519 ("sdl2" ,sdl2)))
520 (arguments
521 '(#:phases
522 (modify-phases %standard-phases
523 ;; The mupen64plus build system has no configure phase.
524 (delete 'configure)
525 ;; Makefile is in a subdirectory.
526 (add-before
527 'build 'cd-to-project-dir
528 (lambda _
529 (chdir "projects/unix"))))
530 #:make-flags
531 (let ((out (assoc-ref %outputs "out"))
532 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
533 (list "all"
534 (string-append "PREFIX=" out)
535 (string-append "APIDIR=" m64p "/include/mupen64plus")))
536 ;; There are no tests.
537 #:tests? #f))
538 (home-page "https://www.mupen64plus.org/")
539 (synopsis "Mupen64Plus SDL input plugin")
540 (description
541 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
542 which is capable of accurately playing many games. This package contains the
543 SDL audio plugin.")
544 (license license:gpl2+)))
545
546 (define-public mupen64plus-input-sdl
547 (package
548 (name "mupen64plus-input-sdl")
549 (version "2.5")
550 (source
551 (origin
552 (method git-fetch)
553 (uri (git-reference
554 (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
555 (commit version)))
556 (file-name (git-file-name name version))
557 (sha256
558 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
559 (build-system gnu-build-system)
560 (native-inputs
561 `(("which" ,which)))
562 (inputs
563 `(("mupen64plus-core" ,mupen64plus-core)
564 ("sdl2" ,sdl2)))
565 (arguments
566 '(#:phases
567 (modify-phases %standard-phases
568 ;; The mupen64plus build system has no configure phase.
569 (delete 'configure)
570 ;; Makefile is in a subdirectory.
571 (add-before
572 'build 'cd-to-project-dir
573 (lambda _
574 (chdir "projects/unix"))))
575 #:make-flags
576 (let ((out (assoc-ref %outputs "out"))
577 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
578 (list "all"
579 (string-append "PREFIX=" out)
580 (string-append "APIDIR=" m64p "/include/mupen64plus")))
581 ;; There are no tests.
582 #:tests? #f))
583 (home-page "https://www.mupen64plus.org/")
584 (synopsis "Mupen64Plus SDL input plugin")
585 (description
586 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
587 which is capable of accurately playing many games. This package contains the
588 SDL input plugin.")
589 (license license:gpl2+)))
590
591 (define-public mupen64plus-rsp-hle
592 (package
593 (name "mupen64plus-rsp-hle")
594 (version "2.5")
595 (source
596 (origin
597 (method git-fetch)
598 (uri (git-reference
599 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
600 (commit version)))
601 (file-name (git-file-name name version))
602 (sha256
603 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
604 (build-system gnu-build-system)
605 (inputs
606 `(("mupen64plus-core" ,mupen64plus-core)))
607 (arguments
608 '(#:phases
609 (modify-phases %standard-phases
610 ;; The mupen64plus build system has no configure phase.
611 (delete 'configure)
612 ;; Makefile is in a subdirectory.
613 (add-before
614 'build 'cd-to-project-dir
615 (lambda _
616 (chdir "projects/unix"))))
617 #:make-flags
618 (let ((out (assoc-ref %outputs "out"))
619 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
620 (list "all"
621 (string-append "PREFIX=" out)
622 (string-append "APIDIR=" m64p "/include/mupen64plus")))
623 ;; There are no tests.
624 #:tests? #f))
625 (home-page "https://www.mupen64plus.org/")
626 (synopsis "Mupen64Plus SDL input plugin")
627 (description
628 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
629 which is capable of accurately playing many games. This package contains the
630 high-level emulation (HLE) RSP processor plugin.")
631 (license license:gpl2+)))
632
633 (define-public mupen64plus-rsp-z64
634 (package
635 (name "mupen64plus-rsp-z64")
636 (version "2.0.0")
637 (source
638 (origin
639 (method git-fetch)
640 (uri (git-reference
641 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
642 (commit version)))
643 (file-name (git-file-name name version))
644 (sha256
645 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
646 (build-system gnu-build-system)
647 (inputs
648 `(("mupen64plus-core" ,mupen64plus-core)))
649 (arguments
650 '(#:phases
651 (modify-phases %standard-phases
652 ;; The mupen64plus build system has no configure phase.
653 (delete 'configure)
654 ;; Makefile is in a subdirectory.
655 (add-before
656 'build 'cd-to-project-dir
657 (lambda _
658 (chdir "projects/unix"))))
659 #:make-flags
660 (let ((out (assoc-ref %outputs "out"))
661 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
662 (list "all"
663 (string-append "PREFIX=" out)
664 (string-append "APIDIR=" m64p "/include/mupen64plus")))
665 ;; There are no tests.
666 #:tests? #f))
667 (home-page "https://www.mupen64plus.org/")
668 (synopsis "Mupen64Plus SDL input plugin")
669 (description
670 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
671 which is capable of accurately playing many games. This package contains the
672 Z64 RSP processor plugin.")
673 (license license:gpl2+)))
674
675 (define-public mupen64plus-video-arachnoid
676 (package
677 (name "mupen64plus-video-arachnoid")
678 (version "2.0.0")
679 (source
680 (origin
681 (method git-fetch)
682 (uri (git-reference
683 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
684 (commit version)))
685 (file-name (git-file-name name version))
686 (sha256
687 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
688 (build-system gnu-build-system)
689 (native-inputs
690 `(("pkg-config" ,pkg-config)
691 ("which" ,which)))
692 (inputs
693 `(("mesa" ,mesa)
694 ("mupen64plus-core" ,mupen64plus-core)))
695 (arguments
696 '(#:phases
697 (modify-phases %standard-phases
698 ;; The mupen64plus build system has no configure phase.
699 (delete 'configure)
700 ;; Makefile is in a subdirectory.
701 (add-before
702 'build 'cd-to-project-dir
703 (lambda _
704 (chdir "projects/unix"))))
705 #:make-flags
706 (let ((out (assoc-ref %outputs "out"))
707 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
708 (list "all"
709 (string-append "PREFIX=" out)
710 (string-append "APIDIR=" m64p "/include/mupen64plus")))
711 ;; There are no tests.
712 #:tests? #f))
713 (home-page "https://www.mupen64plus.org/")
714 (synopsis "Mupen64Plus Rice Video plugin")
715 (description
716 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
717 which is capable of accurately playing many games. This package contains the
718 Arachnoid video plugin.")
719 (license license:gpl2+)))
720
721 (define-public mupen64plus-video-glide64
722 (package
723 (name "mupen64plus-video-glide64")
724 (version "2.0.0")
725 (source
726 (origin
727 (method git-fetch)
728 (uri (git-reference
729 (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
730 (commit version)))
731 (file-name (git-file-name name version))
732 (sha256
733 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
734 (build-system gnu-build-system)
735 (native-inputs
736 `(("pkg-config" ,pkg-config)
737 ("which" ,which)))
738 (inputs
739 `(("mesa" ,mesa)
740 ("mupen64plus-core" ,mupen64plus-core)
741 ("sdl2" ,sdl2)))
742 (arguments
743 '(#:phases
744 (modify-phases %standard-phases
745 ;; The mupen64plus build system has no configure phase.
746 (delete 'configure)
747 ;; Makefile is in a subdirectory.
748 (add-before
749 'build 'cd-to-project-dir
750 (lambda _
751 (chdir "projects/unix")))
752 ;; XXX Should be unnecessary with the next release.
753 (add-before
754 'build 'use-sdl2
755 (lambda _
756 (substitute* "Makefile"
757 (("SDL_CONFIG = (.*)sdl-config" all prefix)
758 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
759 #:make-flags
760 (let ((out (assoc-ref %outputs "out"))
761 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
762 (list "all"
763 (string-append "PREFIX=" out)
764 (string-append "APIDIR=" m64p "/include/mupen64plus")))
765 ;; There are no tests.
766 #:tests? #f))
767 (home-page "https://www.mupen64plus.org/")
768 (synopsis "Mupen64Plus Rice Video plugin")
769 (description
770 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
771 which is capable of accurately playing many games. This package contains the
772 Glide64 video plugin.")
773 (license license:gpl2+)))
774
775 (define-public mupen64plus-video-glide64mk2
776 (package
777 (name "mupen64plus-video-glide64mk2")
778 (version "2.5")
779 (source
780 (origin
781 (method git-fetch)
782 (uri (git-reference
783 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
784 (commit version)))
785 (file-name (git-file-name name version))
786 (sha256
787 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
788 (build-system gnu-build-system)
789 (native-inputs
790 `(("pkg-config" ,pkg-config)
791 ("which" ,which)))
792 (inputs
793 `(("boost" ,boost)
794 ("libpng" ,libpng)
795 ("mesa" ,mesa)
796 ("mupen64plus-core" ,mupen64plus-core)
797 ("sdl2" ,sdl2)
798 ("zlib" ,zlib)))
799 (arguments
800 '(#:phases
801 (modify-phases %standard-phases
802 ;; The mupen64plus build system has no configure phase.
803 (delete 'configure)
804 ;; Makefile is in a subdirectory.
805 (add-before
806 'build 'cd-to-project-dir
807 (lambda _
808 (chdir "projects/unix"))))
809 #:make-flags
810 (let ((out (assoc-ref %outputs "out"))
811 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
812 (list "all"
813 (string-append "PREFIX=" out)
814 (string-append "APIDIR=" m64p "/include/mupen64plus")))
815 ;; There are no tests.
816 #:tests? #f))
817 (home-page "https://www.mupen64plus.org/")
818 (synopsis "Mupen64Plus Rice Video plugin")
819 (description
820 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
821 which is capable of accurately playing many games. This package contains the
822 Glide64MK2 video plugin.")
823 (license license:gpl2+)))
824
825 (define-public mupen64plus-video-rice
826 (package
827 (name "mupen64plus-video-rice")
828 (version "2.5")
829 (source
830 (origin
831 (method git-fetch)
832 (uri (git-reference
833 (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
834 (commit version)))
835 (file-name (git-file-name name version))
836 (sha256
837 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
838 (build-system gnu-build-system)
839 (native-inputs
840 `(("pkg-config" ,pkg-config)
841 ("which" ,which)))
842 (inputs
843 `(("libpng" ,libpng)
844 ("mesa" ,mesa)
845 ("mupen64plus-core" ,mupen64plus-core)
846 ("sdl2" ,sdl2)))
847 (arguments
848 '(#:phases
849 (modify-phases %standard-phases
850 ;; The mupen64plus build system has no configure phase.
851 (delete 'configure)
852 ;; Makefile is in a subdirectory.
853 (add-before
854 'build 'cd-to-project-dir
855 (lambda _
856 (chdir "projects/unix"))))
857 #:make-flags
858 (let ((out (assoc-ref %outputs "out"))
859 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
860 (list "all"
861 (string-append "PREFIX=" out)
862 (string-append "APIDIR=" m64p "/include/mupen64plus")))
863 ;; There are no tests.
864 #:tests? #f))
865 (home-page "https://www.mupen64plus.org/")
866 (synopsis "Mupen64Plus Rice Video plugin")
867 (description
868 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
869 which is capable of accurately playing many games. This package contains the
870 Rice Video plugin.")
871 (license license:gpl2+)))
872
873 (define-public mupen64plus-video-z64
874 (package
875 (name "mupen64plus-video-z64")
876 (version "2.0.0")
877 (source
878 (origin
879 (method git-fetch)
880 (uri (git-reference
881 (url "https://github.com/mupen64plus/mupen64plus-video-z64.git")
882 (commit version)))
883 (file-name (git-file-name name version))
884 (sha256
885 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
886 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
887 (build-system gnu-build-system)
888 (native-inputs
889 `(("pkg-config" ,pkg-config)
890 ("which" ,which)))
891 (inputs
892 `(("glew" ,glew)
893 ("mupen64plus-core" ,mupen64plus-core)
894 ("sdl2" ,sdl2)))
895 (arguments
896 '(#:phases
897 (modify-phases %standard-phases
898 ;; The mupen64plus build system has no configure phase.
899 (delete 'configure)
900 ;; Makefile is in a subdirectory.
901 (add-before
902 'build 'cd-to-project-dir
903 (lambda _
904 (chdir "projects/unix")))
905 ;; XXX Should be unnecessary with the next release.
906 (add-before
907 'build 'use-sdl2
908 (lambda _
909 (substitute* "Makefile"
910 (("SDL_CONFIG = (.*)sdl-config" all prefix)
911 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
912 #:make-flags
913 (let ((out (assoc-ref %outputs "out"))
914 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
915 (list "all"
916 (string-append "PREFIX=" out)
917 (string-append "APIDIR=" m64p "/include/mupen64plus")))
918 ;; There are no tests.
919 #:tests? #f))
920 (home-page "https://www.mupen64plus.org/")
921 (synopsis "Mupen64Plus Z64 video plugin")
922 (description
923 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
924 which is capable of accurately playing many games. This package contains the
925 Z64 video plugin.")
926 (license license:gpl2+)))
927
928 (define-public mupen64plus-ui-console
929 (package
930 (name "mupen64plus-ui-console")
931 (version "2.5")
932 (source
933 (origin
934 (method git-fetch)
935 (uri (git-reference
936 (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
937 (commit version)))
938 (file-name (git-file-name name version))
939 (sha256
940 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
941 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
942 (build-system gnu-build-system)
943 (native-inputs
944 `(("pkg-config" ,pkg-config)
945 ("which" ,which)))
946 (inputs
947 `(("sdl2" ,sdl2)))
948 ;; Mupen64Plus supports a single data directory and a single plugin
949 ;; directory in its configuration, yet we need data and plugin files from
950 ;; a variety of packages. The best way to deal with this is to install
951 ;; all packages from which data and plugin files are needed into one's
952 ;; profile, and point the configuration there. Hence, propagate the most
953 ;; important packages here to save the user from the bother. The patch
954 ;; mupen64plus-ui-console-notice also gives users instructions on what
955 ;; they need to do in order to point the configuration to their profile.
956 (propagated-inputs
957 `(("mupen64plus-core" ,mupen64plus-core)
958 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
959 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
960 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
961 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
962 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
963 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
964 (arguments
965 '(#:phases
966 (modify-phases %standard-phases
967 ;; The mupen64plus build system has no configure phase.
968 (delete 'configure)
969 ;; Makefile is in a subdirectory.
970 (add-before
971 'build 'cd-to-project-dir
972 (lambda _
973 (chdir "projects/unix"))))
974 #:make-flags
975 (let ((out (assoc-ref %outputs "out"))
976 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
977 (list "all"
978 (string-append "PREFIX=" out)
979 (string-append "APIDIR=" m64p "/include/mupen64plus")
980 ;; Trailing slash matters here.
981 (string-append "COREDIR=" m64p "/lib/")))
982 ;; There are no tests.
983 #:tests? #f))
984 (home-page "https://www.mupen64plus.org/")
985 (synopsis "Mupen64Plus command line user interface")
986 (description
987 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
988 which is capable of accurately playing many games. This package contains the
989 command line user interface. Installing this package is the easiest way
990 towards a working Mupen64Plus for casual users.")
991 (license license:gpl2+)))
992
993 (define-public nestopia-ue
994 (package
995 (name "nestopia-ue")
996 (version "1.48")
997 (source
998 (origin
999 (method git-fetch)
1000 (uri (git-reference
1001 (url "https://github.com/rdanbrook/nestopia.git")
1002 (commit version)))
1003 (file-name (git-file-name name version))
1004 (sha256
1005 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1006 (modules '((guix build utils)))
1007 (snippet
1008 '(begin
1009 ;; We don't need libretro for the GNU/Linux build.
1010 (delete-file-recursively "libretro")
1011 #t))))
1012 (build-system cmake-build-system)
1013 (native-inputs
1014 `(("pkg-config" ,pkg-config)))
1015 (inputs
1016 `(("ao" ,ao)
1017 ("gtk+" ,gtk+)
1018 ("libarchive" ,libarchive)
1019 ("libepoxy" ,libepoxy)
1020 ("sdl2" ,sdl2)
1021 ("zlib" ,zlib)))
1022 (arguments
1023 '(#:phases
1024 (modify-phases %standard-phases
1025 ;; This fixes the file chooser crash that happens with GTK 3.
1026 (add-after 'install 'wrap-program
1027 (lambda* (#:key inputs outputs #:allow-other-keys)
1028 (let* ((out (assoc-ref outputs "out"))
1029 (nestopia (string-append out "/bin/nestopia"))
1030 (gtk (assoc-ref inputs "gtk+"))
1031 (gtk-share (string-append gtk "/share")))
1032 (wrap-program nestopia
1033 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1034 ;; There are no tests.
1035 #:tests? #f))
1036 (home-page "http://0ldsk00l.ca/nestopia/")
1037 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1038 (description
1039 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1040 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1041 emulation community. It provides highly accurate emulation.")
1042 (license license:gpl2+)))
1043
1044 (define-public retroarch
1045 (package
1046 (name "retroarch")
1047 (version "1.7.8")
1048 (source
1049 (origin
1050 (method git-fetch)
1051 (uri (git-reference
1052 (url "https://github.com/libretro/RetroArch.git")
1053 (commit (string-append "v" version))))
1054 (file-name (git-file-name name version))
1055 (sha256
1056 (base32 "0xxd9nhqiclpkdd9crymvba37fl0xs5mikwhya68nfzcgar7w480"))))
1057 (build-system gnu-build-system)
1058 (arguments
1059 `(#:tests? #f ; no tests
1060 #:phases
1061 (modify-phases %standard-phases
1062 (replace 'configure
1063 (lambda* (#:key inputs outputs #:allow-other-keys)
1064 (let* ((out (assoc-ref outputs "out"))
1065 (etc (string-append out "/etc"))
1066 (vulkan (assoc-ref inputs "vulkan-loader"))
1067 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1068 ;; Hard-code the path to libvulkan.so.
1069 (substitute* "gfx/common/vulkan_common.c"
1070 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1071 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1072 (("/usr/local/share/wayland-protocols")
1073 (string-append wayland-protocols "/share/wayland-protocols")))
1074 (substitute* "qb/qb.libs.sh"
1075 (("/bin/true") (which "true")))
1076 ;; Use shared zlib.
1077 (substitute* '("libretro-common/file/archive_file_zlib.c"
1078 "libretro-common/streams/trans_stream_zlib.c")
1079 (("<compat/zlib.h>") "<zlib.h>"))
1080 ;; The configure script does not yet accept the extra arguments
1081 ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
1082 (invoke
1083 "./configure"
1084 ,@(if (string-prefix? "armhf" (or (%current-target-system)
1085 (%current-system)))
1086 '("--enable-neon" "--enable-floathard")
1087 '())
1088 (string-append "--prefix=" out)
1089 (string-append "--global-config-dir=" etc))))))))
1090 (inputs
1091 `(("alsa-lib" ,alsa-lib)
1092 ("ffmpeg" ,ffmpeg)
1093 ("freetype" ,freetype)
1094 ("libxinerama" ,libxinerama)
1095 ("libxkbcommon" ,libxkbcommon)
1096 ("libxml2" ,libxml2)
1097 ("libxrandr" ,libxrandr)
1098 ("libxv" ,libxv)
1099 ("mesa" ,mesa)
1100 ("openal" ,openal)
1101 ("pulseaudio" ,pulseaudio)
1102 ("python" ,python)
1103 ("qtbase" ,qtbase)
1104 ("sdl" ,sdl2)
1105 ("udev" ,eudev)
1106 ("vulkan-loader" ,vulkan-loader)
1107 ("wayland" ,wayland)
1108 ("zlib" ,zlib)))
1109 (native-inputs
1110 `(("pkg-config" ,pkg-config)
1111 ("wayland-protocols" ,wayland-protocols)
1112 ("which" ,which)))
1113 (home-page "https://www.libretro.com/")
1114 (synopsis "Reference frontend for the libretro API")
1115 (description
1116 "Libretro is a simple but powerful development interface that allows for
1117 the easy creation of emulators, games and multimedia applications that can plug
1118 straight into any libretro-compatible frontend. RetroArch is the official
1119 reference frontend for the libretro API, currently used by most as a modular
1120 multi-system game/emulator system.")
1121 (license license:gpl3+)))
1122
1123 (define-public scummvm
1124 (package
1125 (name "scummvm")
1126 (version "2.0.0")
1127 (source
1128 (origin
1129 (method url-fetch)
1130 (uri (string-append "http://www.scummvm.org/frs/scummvm/" version
1131 "/scummvm-" version ".tar.xz"))
1132 (sha256
1133 (base32
1134 "0q6aiw97wsrf8cjw9vjilzhqqsr2rw2lll99s8i5i9svan6l314p"))))
1135 (build-system gnu-build-system)
1136 (arguments
1137 `(#:tests? #f ;require "git"
1138 #:configure-flags (list "--enable-release") ;for optimizations
1139 #:phases
1140 (modify-phases %standard-phases
1141 (replace 'configure
1142 ;; configure does not work followed by both "SHELL=..." and
1143 ;; "CONFIG_SHELL=..."; set environment variables instead
1144 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1145 (let* ((out (assoc-ref outputs "out"))
1146 (bash (which "bash"))
1147 (flags `(,(string-append "--prefix=" out)
1148 ,@configure-flags)))
1149 (setenv "SHELL" bash)
1150 (setenv "CONFIG_SHELL" bash)
1151 (apply invoke "./configure" flags)))))))
1152 (native-inputs
1153 `(("pkg-config" ,pkg-config)))
1154 (inputs
1155 `(("alsa-lib" ,alsa-lib)
1156 ("faad2" ,faad2)
1157 ("fluidsynth" ,fluidsynth)
1158 ("freetype" ,freetype)
1159 ("libflac" ,flac)
1160 ("libjpeg-turbo" ,libjpeg-turbo)
1161 ("libmad" ,libmad)
1162 ("libmpeg2" ,libmpeg2)
1163 ("libogg" ,libogg)
1164 ("libpng" ,libpng)
1165 ("libtheora" ,libtheora)
1166 ("libvorbis" ,libvorbis)
1167 ("nasm" ,nasm)
1168 ("sdl2" ,sdl2)
1169 ("zlib" ,zlib)))
1170 (home-page "https://www.scummvm.org/")
1171 (synopsis "Engine for several graphical adventure games")
1172 (description "ScummVM is a program which allows you to run certain
1173 classic graphical point-and-click adventure games, provided you
1174 already have their data files. The clever part about this: ScummVM
1175 just replaces the executables shipped with the games, allowing you to
1176 play them on systems for which they were never designed!")
1177 (license license:gpl2+)))
1178
1179 (define-public mame
1180 (package
1181 (name "mame")
1182 (version "0.212")
1183 (source
1184 (origin
1185 (method git-fetch)
1186 (uri (git-reference
1187 (url "https://github.com/mamedev/mame.git")
1188 (commit (apply string-append "mame" (string-split version #\.)))))
1189 (file-name (git-file-name name version))
1190 (sha256
1191 (base32
1192 "0p3zcb9l624dsy2gyv23ppp1k1iwd1vrg8cbn5v4fx1s44mx7f5c"))
1193 (patches
1194 ;; FIXME: Remove once 0.213 is out. Applied upstream as
1195 ;; 0b5b13cf1e28550b49c387dec93f9801f029e313.
1196 (search-patches "mame-rapidjson-fix.patch"))
1197 (modules '((guix build utils)))
1198 (snippet
1199 ;; Remove bundled libraries.
1200 '(begin
1201 (with-directory-excursion "3rdparty"
1202 (for-each delete-file-recursively
1203 '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
1204 "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
1205 "SDL2-override" "sqlite3" "utf8proc" "zlib")))
1206 #t))))
1207 (build-system gnu-build-system)
1208 (arguments
1209 `(#:make-flags
1210 (cons*
1211 (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
1212 (string-append "SDL_INI_PATH="
1213 (assoc-ref %outputs "out")
1214 "/share/mame/ini")
1215 (map (lambda (lib)
1216 (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
1217 '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
1218 "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
1219 #:tests? #f ;no test in regular release
1220 #:phases
1221 (modify-phases %standard-phases
1222 (delete 'configure)
1223 (add-after 'build 'build-documentation
1224 (lambda _ (invoke "make" "-C" "docs" "man" "info")))
1225 (replace 'install
1226 ;; Upstream does not provide an installation phase.
1227 (lambda* (#:key outputs #:allow-other-keys)
1228 (let* ((out (assoc-ref outputs "out"))
1229 (share (string-append out "/share/mame")))
1230 ;; Install data.
1231 (for-each (lambda (dir)
1232 (copy-recursively dir (string-append share "/" dir)))
1233 '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
1234 "plugins" "samples"))
1235 (let ((keymaps (string-append share "/keymaps")))
1236 (for-each (lambda (file) (install-file file keymaps))
1237 (find-files "keymaps" ".*LINUX\\.map")))
1238 (let ((fonts (string-append share "/fonts")))
1239 (install-file "uismall.bdf" fonts))
1240 (when (file-exists? "mame64")
1241 (rename-file "mame64" "mame"))
1242 (install-file "mame" (string-append out "/bin")))
1243 #t))
1244 (add-after 'install 'install-documentation
1245 (lambda* (#:key outputs #:allow-other-keys)
1246 (let* ((out (assoc-ref outputs "out"))
1247 (man (string-append out "/share/man/man1"))
1248 (info (string-append out "/share/info")))
1249 (install-file "docs/build/man/MAME.1" man)
1250 (install-file "docs/build/texinfo/MAME.info" info))
1251 #t))
1252 (add-after 'install 'install-ini-file
1253 ;; Generate an ini file so as to set some directories (e.g., roms)
1254 ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
1255 ;;
1256 ;; XXX: We need to insert absolute references to the store. It can
1257 ;; be an issue if they leak into user's home directory, e.g., with
1258 ;; "mame -createconfig" and the package is later GC'ed.
1259 (lambda* (#:key outputs #:allow-other-keys)
1260 (let* ((out (assoc-ref outputs "out"))
1261 (share (string-append out "/share/mame"))
1262 (ini (string-append share "/ini")))
1263 (with-output-to-file (string-append ini "/mame.ini")
1264 (lambda _
1265 (format #t
1266 "inipath $HOME/.mame;~a/ini~@
1267 homepath $HOME/mame~@
1268 rompath $HOME/mame/roms~@
1269 samplepath $HOME/mame/samples;~a/samples~@
1270 cheatpath $HOME/mame/cheat~@
1271 artpath $HOME/mame/artwork;~a/artwork~@
1272 crosshairpath $HOME/mame/crosshair~@
1273 snapshot_directory $HOME/mame/snapshots~@
1274 hashpath ~a/hash~@
1275 fontpath $HOME/mame/fonts;~a/fonts~@
1276 ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
1277 bgfx_path ~a/bgfx~@
1278 pluginspath $HOME/mame/plugins;~a/plugins~@
1279 languagepath ~a/language~@
1280 cfg_directory $HOME/.mame/cfg~@
1281 nvram_directory $HOME/.mame/nvram~@
1282 input_directory $HOME/.mame/inp~@
1283 state_directory $HOME/.mame/sta~@
1284 diff_directory $HOME/.mame/diff~@
1285 comment_directory $HOME/.mame/comments~%"
1286 share share share share share share share share
1287 share)))
1288 (with-output-to-file (string-append ini "/ui.ini")
1289 (lambda _
1290 (format #t
1291 "historypath $HOME/mame/history~@
1292 categorypath $HOME/mame/folders~@
1293 cabinets_directory $HOME/mame/cabinets~@
1294 cpanels_directory $HOME/mame/cpanel~@
1295 pcbs_directory $HOME/mame/pcb~@
1296 flyers_directory $HOME/mame/flyers~@
1297 titles_directory $HOME/mame/titles~@
1298 ends_directory $HOME/mame/ends~@
1299 marquees_directory $HOME/mame/marquees~@
1300 artwork_preview_directory $HOME/mame/artpreview~@
1301 bosses_directory $HOME/mame/bosses~@
1302 logos_directory $HOME/mame/logo~@
1303 scores_directory $HOME/mame/scores~@
1304 versus_directory $HOME/mame/versus~@
1305 gameover_directory $HOME/mame/gameover~@
1306 howto_directory $HOME/mame/howto~@
1307 select_directory $HOME/mame/select~@
1308 icons_directory $HOME/mame/icons~@
1309 covers_directory $HOME/mame/covers~@
1310 ui_path $HOME/.mame/ui~%")))
1311 #t)))
1312 (add-after 'install 'install-desktop-file
1313 (lambda* (#:key outputs #:allow-other-keys)
1314 (let* ((out (assoc-ref outputs "out"))
1315 (desktop (string-append out "/share/applications"))
1316 (executable (string-append out "/bin/mame")))
1317 (mkdir-p desktop)
1318 (with-output-to-file (string-append desktop "/mame.desktop")
1319 (lambda _
1320 (format #t
1321 "[Desktop Entry]~@
1322 Name=mame~@
1323 Comment=Multi-purpose emulation framework~@
1324 Exec=~a~@
1325 TryExec=~@*~a~@
1326 Terminal=false~@
1327 Type=Application~@
1328 Categories=Game;Emulator;~@
1329 Keywords=Game;Emulator;Arcade;~%"
1330 executable)))
1331 #t))))))
1332 (native-inputs
1333 `(("pkg-config" ,pkg-config)
1334 ("sphinx" ,python-sphinx)
1335 ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
1336 ("texinfo" ,texinfo)))
1337 (inputs
1338 `(("alsa-lib" ,alsa-lib)
1339 ("asio" ,asio)
1340 ("expat" ,expat)
1341 ("flac" ,flac)
1342 ("fontconfig" ,fontconfig)
1343 ("glm" ,glm)
1344 ("libjpeg" ,libjpeg-8) ;jpeg_read_header argument error in libjpeg-9
1345 ("libxi" ,libxi)
1346 ("libxinerama" ,libxinerama)
1347 ("lua" ,lua)
1348 ("portaudio" ,portaudio)
1349 ("portmidi" ,portmidi)
1350 ("pugixml" ,pugixml)
1351 ("python-wrapper" ,python-wrapper)
1352 ("qtbase" ,qtbase)
1353 ("rapidjson" ,rapidjson)
1354 ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
1355 ("sqlite" ,sqlite)
1356 ("utf8proc" ,utf8proc)
1357 ("zlib" ,zlib)))
1358 (home-page "http://mamedev.org/")
1359 (synopsis "Multi-purpose emulation framework")
1360 (description "MAME's purpose is to preserve decades of software
1361 history. As electronic technology continues to rush forward, MAME
1362 prevents this important @emph{vintage} software from being lost and
1363 forgotten. This is achieved by documenting the hardware and how it
1364 functions. The source code to MAME serves as this documentation.")
1365 ;; The MAME project as a whole is distributed under the terms of GPL2+.
1366 ;; However, over 90% of the files are under Expat license. Also, artwork,
1367 ;; keymaps, languages and samples are under CC0.
1368 (license (list license:gpl2+ license:expat license:cc0))))