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