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