gnu: mupen64plus-core: Use HTTPS home page.
[jackhill/guix/guix.git] / gnu / packages / emulators.scm
... / ...
CommitLineData
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
3;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
4;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
5;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
6;;; Copyright © 2015, 2018 David Thompson <dthompson2@worcester.edu>
7;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
8;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
9;;; Copyright © 2017, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
10;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
11;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
12;;;
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
233GameCube and the Wii. It provides compatibility with all PC controllers,
234turbo 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
266also emulates CPU:286/386 realmode/protected mode, Directory
267FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
268SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
269older 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
300number of video game console emulators. It features an interface that is
301usable with any game controller that has at least 4 buttons, theming support,
302and 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
392consoles, including the Nintendo Entertainment System (NES/Famicom), Super
393Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
394Color (GBC), and Game Boy Advance (GBA). It also supports the subsystems
395Super 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
450faster and more accurate than many existing Game Boy Advance emulators, as
451well as adding features that other emulators lack. It also supports Game Boy
452and 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 'chdir-to-project-directory
489 (lambda _
490 (chdir "projects/unix")
491 #t)))
492 #:make-flags (let ((out (assoc-ref %outputs "out")))
493 (list "all" (string-append "PREFIX=" out)))
494 ;; There are no tests.
495 #:tests? #f))
496 ;; As per the Makefile (in projects/unix/Makefile):
497 (supported-systems '("i686-linux" "x86_64-linux"))
498 (home-page "https://www.mupen64plus.org/")
499 (synopsis "Nintendo 64 emulator core library")
500 (description
501 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
502which is capable of accurately playing many games. This package contains the
503core library.")
504 (license license:gpl2+)))
505
506(define-public mupen64plus-audio-sdl
507 (package
508 (name "mupen64plus-audio-sdl")
509 (version "2.5")
510 (source
511 (origin
512 (method git-fetch)
513 (uri (git-reference
514 (url "https://github.com/mupen64plus/mupen64plus-audio-sdl.git")
515 (commit version)))
516 (file-name (git-file-name name version))
517 (sha256
518 (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
519 (build-system gnu-build-system)
520 (native-inputs
521 `(("pkg-config" ,pkg-config)
522 ("which" ,which)))
523 (inputs
524 `(("mupen64plus-core" ,mupen64plus-core)
525 ("sdl2" ,sdl2)))
526 (arguments
527 '(#:phases
528 (modify-phases %standard-phases
529 ;; The mupen64plus build system has no configure phase.
530 (delete 'configure)
531 ;; Makefile is in a subdirectory.
532 (add-before
533 'build 'cd-to-project-dir
534 (lambda _
535 (chdir "projects/unix"))))
536 #:make-flags
537 (let ((out (assoc-ref %outputs "out"))
538 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
539 (list "all"
540 (string-append "PREFIX=" out)
541 (string-append "APIDIR=" m64p "/include/mupen64plus")))
542 ;; There are no tests.
543 #:tests? #f))
544 (home-page "http://www.mupen64plus.org/")
545 (synopsis "Mupen64Plus SDL input plugin")
546 (description
547 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
548which is capable of accurately playing many games. This package contains the
549SDL audio plugin.")
550 (license license:gpl2+)))
551
552(define-public mupen64plus-input-sdl
553 (package
554 (name "mupen64plus-input-sdl")
555 (version "2.5")
556 (source
557 (origin
558 (method git-fetch)
559 (uri (git-reference
560 (url "https://github.com/mupen64plus/mupen64plus-input-sdl.git")
561 (commit version)))
562 (file-name (git-file-name name version))
563 (sha256
564 (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
565 (build-system gnu-build-system)
566 (native-inputs
567 `(("which" ,which)))
568 (inputs
569 `(("mupen64plus-core" ,mupen64plus-core)
570 ("sdl2" ,sdl2)))
571 (arguments
572 '(#:phases
573 (modify-phases %standard-phases
574 ;; The mupen64plus build system has no configure phase.
575 (delete 'configure)
576 ;; Makefile is in a subdirectory.
577 (add-before
578 'build 'cd-to-project-dir
579 (lambda _
580 (chdir "projects/unix"))))
581 #:make-flags
582 (let ((out (assoc-ref %outputs "out"))
583 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
584 (list "all"
585 (string-append "PREFIX=" out)
586 (string-append "APIDIR=" m64p "/include/mupen64plus")))
587 ;; There are no tests.
588 #:tests? #f))
589 (home-page "http://www.mupen64plus.org/")
590 (synopsis "Mupen64Plus SDL input plugin")
591 (description
592 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
593which is capable of accurately playing many games. This package contains the
594SDL input plugin.")
595 (license license:gpl2+)))
596
597(define-public mupen64plus-rsp-hle
598 (package
599 (name "mupen64plus-rsp-hle")
600 (version "2.5")
601 (source
602 (origin
603 (method git-fetch)
604 (uri (git-reference
605 (url "https://github.com/mupen64plus/mupen64plus-rsp-hle.git")
606 (commit version)))
607 (file-name (git-file-name name version))
608 (sha256
609 (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
610 (build-system gnu-build-system)
611 (inputs
612 `(("mupen64plus-core" ,mupen64plus-core)))
613 (arguments
614 '(#:phases
615 (modify-phases %standard-phases
616 ;; The mupen64plus build system has no configure phase.
617 (delete 'configure)
618 ;; Makefile is in a subdirectory.
619 (add-before
620 'build 'cd-to-project-dir
621 (lambda _
622 (chdir "projects/unix"))))
623 #:make-flags
624 (let ((out (assoc-ref %outputs "out"))
625 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
626 (list "all"
627 (string-append "PREFIX=" out)
628 (string-append "APIDIR=" m64p "/include/mupen64plus")))
629 ;; There are no tests.
630 #:tests? #f))
631 (home-page "http://www.mupen64plus.org/")
632 (synopsis "Mupen64Plus SDL input plugin")
633 (description
634 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
635which is capable of accurately playing many games. This package contains the
636high-level emulation (HLE) RSP processor plugin.")
637 (license license:gpl2+)))
638
639(define-public mupen64plus-rsp-z64
640 (package
641 (name "mupen64plus-rsp-z64")
642 (version "2.0.0")
643 (source
644 (origin
645 (method git-fetch)
646 (uri (git-reference
647 (url "https://github.com/mupen64plus/mupen64plus-rsp-z64.git")
648 (commit version)))
649 (file-name (git-file-name name version))
650 (sha256
651 (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
652 (build-system gnu-build-system)
653 (inputs
654 `(("mupen64plus-core" ,mupen64plus-core)))
655 (arguments
656 '(#:phases
657 (modify-phases %standard-phases
658 ;; The mupen64plus build system has no configure phase.
659 (delete 'configure)
660 ;; Makefile is in a subdirectory.
661 (add-before
662 'build 'cd-to-project-dir
663 (lambda _
664 (chdir "projects/unix"))))
665 #:make-flags
666 (let ((out (assoc-ref %outputs "out"))
667 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
668 (list "all"
669 (string-append "PREFIX=" out)
670 (string-append "APIDIR=" m64p "/include/mupen64plus")))
671 ;; There are no tests.
672 #:tests? #f))
673 (home-page "http://www.mupen64plus.org/")
674 (synopsis "Mupen64Plus SDL input plugin")
675 (description
676 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
677which is capable of accurately playing many games. This package contains the
678Z64 RSP processor plugin.")
679 (license license:gpl2+)))
680
681(define-public mupen64plus-video-arachnoid
682 (package
683 (name "mupen64plus-video-arachnoid")
684 (version "2.0.0")
685 (source
686 (origin
687 (method git-fetch)
688 (uri (git-reference
689 (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid.git")
690 (commit version)))
691 (file-name (git-file-name name version))
692 (sha256
693 (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
694 (build-system gnu-build-system)
695 (native-inputs
696 `(("pkg-config" ,pkg-config)
697 ("which" ,which)))
698 (inputs
699 `(("mesa" ,mesa)
700 ("mupen64plus-core" ,mupen64plus-core)))
701 (arguments
702 '(#:phases
703 (modify-phases %standard-phases
704 ;; The mupen64plus build system has no configure phase.
705 (delete 'configure)
706 ;; Makefile is in a subdirectory.
707 (add-before
708 'build 'cd-to-project-dir
709 (lambda _
710 (chdir "projects/unix"))))
711 #:make-flags
712 (let ((out (assoc-ref %outputs "out"))
713 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
714 (list "all"
715 (string-append "PREFIX=" out)
716 (string-append "APIDIR=" m64p "/include/mupen64plus")))
717 ;; There are no tests.
718 #:tests? #f))
719 (home-page "https://www.mupen64plus.org/")
720 (synopsis "Mupen64Plus Rice Video plugin")
721 (description
722 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
723which is capable of accurately playing many games. This package contains the
724Arachnoid video plugin.")
725 (license license:gpl2+)))
726
727(define-public mupen64plus-video-glide64
728 (package
729 (name "mupen64plus-video-glide64")
730 (version "2.0.0")
731 (source
732 (origin
733 (method git-fetch)
734 (uri (git-reference
735 (url "https://github.com/mupen64plus/mupen64plus-video-glide64.git")
736 (commit version)))
737 (file-name (git-file-name name version))
738 (sha256
739 (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
740 (build-system gnu-build-system)
741 (native-inputs
742 `(("pkg-config" ,pkg-config)
743 ("which" ,which)))
744 (inputs
745 `(("mesa" ,mesa)
746 ("mupen64plus-core" ,mupen64plus-core)
747 ("sdl2" ,sdl2)))
748 (arguments
749 '(#:phases
750 (modify-phases %standard-phases
751 ;; The mupen64plus build system has no configure phase.
752 (delete 'configure)
753 ;; Makefile is in a subdirectory.
754 (add-before
755 'build 'cd-to-project-dir
756 (lambda _
757 (chdir "projects/unix")))
758 ;; XXX Should be unnecessary with the next release.
759 (add-before
760 'build 'use-sdl2
761 (lambda _
762 (substitute* "Makefile"
763 (("SDL_CONFIG = (.*)sdl-config" all prefix)
764 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
765 #:make-flags
766 (let ((out (assoc-ref %outputs "out"))
767 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
768 (list "all"
769 (string-append "PREFIX=" out)
770 (string-append "APIDIR=" m64p "/include/mupen64plus")))
771 ;; There are no tests.
772 #:tests? #f))
773 (home-page "https://www.mupen64plus.org/")
774 (synopsis "Mupen64Plus Rice Video plugin")
775 (description
776 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
777which is capable of accurately playing many games. This package contains the
778Glide64 video plugin.")
779 (license license:gpl2+)))
780
781(define-public mupen64plus-video-glide64mk2
782 (package
783 (name "mupen64plus-video-glide64mk2")
784 (version "2.5")
785 (source
786 (origin
787 (method git-fetch)
788 (uri (git-reference
789 (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2.git")
790 (commit version)))
791 (file-name (git-file-name name version))
792 (sha256
793 (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
794 (build-system gnu-build-system)
795 (native-inputs
796 `(("pkg-config" ,pkg-config)
797 ("which" ,which)))
798 (inputs
799 `(("boost" ,boost)
800 ("libpng" ,libpng)
801 ("mesa" ,mesa)
802 ("mupen64plus-core" ,mupen64plus-core)
803 ("sdl2" ,sdl2)
804 ("zlib" ,zlib)))
805 (arguments
806 '(#:phases
807 (modify-phases %standard-phases
808 ;; The mupen64plus build system has no configure phase.
809 (delete 'configure)
810 ;; Makefile is in a subdirectory.
811 (add-before
812 'build 'cd-to-project-dir
813 (lambda _
814 (chdir "projects/unix"))))
815 #:make-flags
816 (let ((out (assoc-ref %outputs "out"))
817 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
818 (list "all"
819 (string-append "PREFIX=" out)
820 (string-append "APIDIR=" m64p "/include/mupen64plus")))
821 ;; There are no tests.
822 #:tests? #f))
823 (home-page "https://www.mupen64plus.org/")
824 (synopsis "Mupen64Plus Rice Video plugin")
825 (description
826 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
827which is capable of accurately playing many games. This package contains the
828Glide64MK2 video plugin.")
829 (license license:gpl2+)))
830
831(define-public mupen64plus-video-rice
832 (package
833 (name "mupen64plus-video-rice")
834 (version "2.5")
835 (source
836 (origin
837 (method git-fetch)
838 (uri (git-reference
839 (url "https://github.com/mupen64plus/mupen64plus-video-rice.git")
840 (commit version)))
841 (file-name (git-file-name name version))
842 (sha256
843 (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
844 (build-system gnu-build-system)
845 (native-inputs
846 `(("pkg-config" ,pkg-config)
847 ("which" ,which)))
848 (inputs
849 `(("libpng" ,libpng)
850 ("mesa" ,mesa)
851 ("mupen64plus-core" ,mupen64plus-core)
852 ("sdl2" ,sdl2)))
853 (arguments
854 '(#:phases
855 (modify-phases %standard-phases
856 ;; The mupen64plus build system has no configure phase.
857 (delete 'configure)
858 ;; Makefile is in a subdirectory.
859 (add-before
860 'build 'cd-to-project-dir
861 (lambda _
862 (chdir "projects/unix"))))
863 #:make-flags
864 (let ((out (assoc-ref %outputs "out"))
865 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
866 (list "all"
867 (string-append "PREFIX=" out)
868 (string-append "APIDIR=" m64p "/include/mupen64plus")))
869 ;; There are no tests.
870 #:tests? #f))
871 (home-page "https://www.mupen64plus.org/")
872 (synopsis "Mupen64Plus Rice Video plugin")
873 (description
874 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
875which is capable of accurately playing many games. This package contains the
876Rice Video plugin.")
877 (license license:gpl2+)))
878
879(define-public mupen64plus-video-z64
880 (package
881 (name "mupen64plus-video-z64")
882 (version "2.0.0")
883 (source
884 (origin
885 (method git-fetch)
886 (uri (git-reference
887 (url "https://github.com/mupen64plus/mupen64plus-video-z64.git")
888 (commit version)))
889 (file-name (git-file-name name version))
890 (sha256
891 (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
892 (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
893 (build-system gnu-build-system)
894 (native-inputs
895 `(("pkg-config" ,pkg-config)
896 ("which" ,which)))
897 (inputs
898 `(("glew" ,glew)
899 ("mupen64plus-core" ,mupen64plus-core)
900 ("sdl2" ,sdl2)))
901 (arguments
902 '(#:phases
903 (modify-phases %standard-phases
904 ;; The mupen64plus build system has no configure phase.
905 (delete 'configure)
906 ;; Makefile is in a subdirectory.
907 (add-before
908 'build 'cd-to-project-dir
909 (lambda _
910 (chdir "projects/unix")))
911 ;; XXX Should be unnecessary with the next release.
912 (add-before
913 'build 'use-sdl2
914 (lambda _
915 (substitute* "Makefile"
916 (("SDL_CONFIG = (.*)sdl-config" all prefix)
917 (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
918 #:make-flags
919 (let ((out (assoc-ref %outputs "out"))
920 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
921 (list "all"
922 (string-append "PREFIX=" out)
923 (string-append "APIDIR=" m64p "/include/mupen64plus")))
924 ;; There are no tests.
925 #:tests? #f))
926 (home-page "https://www.mupen64plus.org/")
927 (synopsis "Mupen64Plus Z64 video plugin")
928 (description
929 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
930which is capable of accurately playing many games. This package contains the
931Z64 video plugin.")
932 (license license:gpl2+)))
933
934(define-public mupen64plus-ui-console
935 (package
936 (name "mupen64plus-ui-console")
937 (version "2.5")
938 (source
939 (origin
940 (method git-fetch)
941 (uri (git-reference
942 (url "https://github.com/mupen64plus/mupen64plus-ui-console.git")
943 (commit version)))
944 (file-name (git-file-name name version))
945 (sha256
946 (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
947 (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
948 (build-system gnu-build-system)
949 (native-inputs
950 `(("pkg-config" ,pkg-config)
951 ("which" ,which)))
952 (inputs
953 `(("sdl2" ,sdl2)))
954 ;; Mupen64Plus supports a single data directory and a single plugin
955 ;; directory in its configuration, yet we need data and plugin files from
956 ;; a variety of packages. The best way to deal with this is to install
957 ;; all packages from which data and plugin files are needed into one's
958 ;; profile, and point the configuration there. Hence, propagate the most
959 ;; important packages here to save the user from the bother. The patch
960 ;; mupen64plus-ui-console-notice also gives users instructions on what
961 ;; they need to do in order to point the configuration to their profile.
962 (propagated-inputs
963 `(("mupen64plus-core" ,mupen64plus-core)
964 ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
965 ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
966 ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
967 ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
968 ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
969 ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
970 (arguments
971 '(#:phases
972 (modify-phases %standard-phases
973 ;; The mupen64plus build system has no configure phase.
974 (delete 'configure)
975 ;; Makefile is in a subdirectory.
976 (add-before
977 'build 'cd-to-project-dir
978 (lambda _
979 (chdir "projects/unix"))))
980 #:make-flags
981 (let ((out (assoc-ref %outputs "out"))
982 (m64p (assoc-ref %build-inputs "mupen64plus-core")))
983 (list "all"
984 (string-append "PREFIX=" out)
985 (string-append "APIDIR=" m64p "/include/mupen64plus")
986 ;; Trailing slash matters here.
987 (string-append "COREDIR=" m64p "/lib/")))
988 ;; There are no tests.
989 #:tests? #f))
990 (home-page "https://www.mupen64plus.org/")
991 (synopsis "Mupen64Plus command line user interface")
992 (description
993 "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
994which is capable of accurately playing many games. This package contains the
995command line user interface. Installing this package is the easiest way
996towards a working Mupen64Plus for casual users.")
997 (license license:gpl2+)))
998
999(define-public nestopia-ue
1000 (package
1001 (name "nestopia-ue")
1002 (version "1.48")
1003 (source
1004 (origin
1005 (method git-fetch)
1006 (uri (git-reference
1007 (url "https://github.com/rdanbrook/nestopia.git")
1008 (commit version)))
1009 (file-name (git-file-name name version))
1010 (sha256
1011 (base32 "19c8vx5yxbysl0sszk5blfngwacshdgwbf44g1qaxvq8ywiyxmb4"))
1012 (modules '((guix build utils)))
1013 (snippet
1014 '(begin
1015 ;; We don't need libretro for the GNU/Linux build.
1016 (delete-file-recursively "libretro")
1017 #t))))
1018 (build-system cmake-build-system)
1019 (native-inputs
1020 `(("pkg-config" ,pkg-config)))
1021 (inputs
1022 `(("ao" ,ao)
1023 ("gtk+" ,gtk+)
1024 ("libarchive" ,libarchive)
1025 ("libepoxy" ,libepoxy)
1026 ("sdl2" ,sdl2)
1027 ("zlib" ,zlib)))
1028 (arguments
1029 '(#:phases
1030 (modify-phases %standard-phases
1031 ;; This fixes the file chooser crash that happens with GTK 3.
1032 (add-after 'install 'wrap-program
1033 (lambda* (#:key inputs outputs #:allow-other-keys)
1034 (let* ((out (assoc-ref outputs "out"))
1035 (nestopia (string-append out "/bin/nestopia"))
1036 (gtk (assoc-ref inputs "gtk+"))
1037 (gtk-share (string-append gtk "/share")))
1038 (wrap-program nestopia
1039 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))))))
1040 ;; There are no tests.
1041 #:tests? #f))
1042 (home-page "http://0ldsk00l.ca/nestopia/")
1043 (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
1044 (description
1045 "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
1046System (NES/Famicom) emulator Nestopia, with enhancements from members of the
1047emulation community. It provides highly accurate emulation.")
1048 (license license:gpl2+)))
1049
1050(define-public retroarch
1051 (package
1052 (name "retroarch")
1053 (version "1.7.8")
1054 (source
1055 (origin
1056 (method git-fetch)
1057 (uri (git-reference
1058 (url "https://github.com/libretro/RetroArch.git")
1059 (commit (string-append "v" version))))
1060 (file-name (git-file-name name version))
1061 (sha256
1062 (base32 "0xxd9nhqiclpkdd9crymvba37fl0xs5mikwhya68nfzcgar7w480"))))
1063 (build-system gnu-build-system)
1064 (arguments
1065 `(#:tests? #f ; no tests
1066 #:phases
1067 (modify-phases %standard-phases
1068 (replace 'configure
1069 (lambda* (#:key inputs outputs #:allow-other-keys)
1070 (let* ((out (assoc-ref outputs "out"))
1071 (etc (string-append out "/etc"))
1072 (vulkan (assoc-ref inputs "vulkan-loader"))
1073 (wayland-protocols (assoc-ref inputs "wayland-protocols")))
1074 ;; Hard-code the path to libvulkan.so.
1075 (substitute* "gfx/common/vulkan_common.c"
1076 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
1077 (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
1078 (("/usr/local/share/wayland-protocols")
1079 (string-append wayland-protocols "/share/wayland-protocols")))
1080 (substitute* "qb/qb.libs.sh"
1081 (("/bin/true") (which "true")))
1082 ;; Use shared zlib.
1083 (substitute* '("libretro-common/file/archive_file_zlib.c"
1084 "libretro-common/streams/trans_stream_zlib.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
1123the easy creation of emulators, games and multimedia applications that can plug
1124straight into any libretro-compatible frontend. RetroArch is the official
1125reference frontend for the libretro API, currently used by most as a modular
1126multi-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
1179classic graphical point-and-click adventure games, provided you
1180already have their data files. The clever part about this: ScummVM
1181just replaces the executables shipped with the games, allowing you to
1182play 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
1367history. As electronic technology continues to rush forward, MAME
1368prevents this important @emph{vintage} software from being lost and
1369forgotten. This is achieved by documenting the hardware and how it
1370functions. 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))))