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