emulators.scm 99 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539
  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, 2021 Sou Bunnbu <iyzsong@member.fsf.org>
  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, 2020 Efraim Flashner <efraim@flashner.co.il>
  9. ;;; Copyright © 2017, 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  10. ;;; Copyright © 2017, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
  11. ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
  12. ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
  13. ;;; Copyright © 2019 David Wilson <david@daviwil.com>
  14. ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
  15. ;;; Copyright © 2020 Christopher Howard <christopher@librehacker.com>
  16. ;;; Copyright © 2021 Felipe Balbi <balbi@kernel.org>
  17. ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
  18. ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  19. ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
  20. ;;;
  21. ;;; This file is part of GNU Guix.
  22. ;;;
  23. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  24. ;;; under the terms of the GNU General Public License as published by
  25. ;;; the Free Software Foundation; either version 3 of the License, or (at
  26. ;;; your option) any later version.
  27. ;;;
  28. ;;; GNU Guix is distributed in the hope that it will be useful, but
  29. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  30. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  31. ;;; GNU General Public License for more details.
  32. ;;;
  33. ;;; You should have received a copy of the GNU General Public License
  34. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  35. (define-module (gnu packages emulators)
  36. #:use-module (ice-9 match)
  37. #:use-module ((guix licenses) #:prefix license:)
  38. #:use-module (guix packages)
  39. #:use-module (guix download)
  40. #:use-module (guix git-download)
  41. #:use-module (guix svn-download)
  42. #:use-module (guix hg-download)
  43. #:use-module (guix utils)
  44. #:use-module (gnu packages)
  45. #:use-module (gnu packages algebra)
  46. #:use-module (gnu packages assembly)
  47. #:use-module (gnu packages audio)
  48. #:use-module (gnu packages autogen)
  49. #:use-module (gnu packages autotools)
  50. #:use-module (gnu packages backup)
  51. #:use-module (gnu packages base)
  52. #:use-module (gnu packages bison)
  53. #:use-module (gnu packages boost)
  54. #:use-module (gnu packages build-tools)
  55. #:use-module (gnu packages cdrom)
  56. #:use-module (gnu packages check)
  57. #:use-module (gnu packages compression)
  58. #:use-module (gnu packages cross-base)
  59. #:use-module (gnu packages curl)
  60. #:use-module (gnu packages digest)
  61. #:use-module (gnu packages elf)
  62. #:use-module (gnu packages flex)
  63. #:use-module (gnu packages fltk)
  64. #:use-module (gnu packages fonts)
  65. #:use-module (gnu packages fontutils)
  66. #:use-module (gnu packages freedesktop)
  67. #:use-module (gnu packages fribidi)
  68. #:use-module (gnu packages game-development)
  69. #:use-module (gnu packages gcc)
  70. #:use-module (gnu packages gettext)
  71. #:use-module (gnu packages gl)
  72. #:use-module (gnu packages glib)
  73. #:use-module (gnu packages gtk)
  74. #:use-module (gnu packages image)
  75. #:use-module (gnu packages libedit)
  76. #:use-module (gnu packages libusb)
  77. #:use-module (gnu packages linux)
  78. #:use-module (gnu packages lua)
  79. #:use-module (gnu packages maths)
  80. #:use-module (gnu packages mp3)
  81. #:use-module (gnu packages music)
  82. #:use-module (gnu packages ncurses)
  83. #:use-module (gnu packages networking)
  84. #:use-module (gnu packages pkg-config)
  85. #:use-module (gnu packages pulseaudio)
  86. #:use-module (gnu packages python)
  87. #:use-module (gnu packages qt)
  88. #:use-module (gnu packages sdl)
  89. #:use-module (gnu packages sphinx)
  90. #:use-module (gnu packages sqlite)
  91. #:use-module (gnu packages texinfo)
  92. #:use-module (gnu packages textutils)
  93. #:use-module (gnu packages tls)
  94. #:use-module (gnu packages upnp)
  95. #:use-module (gnu packages video)
  96. #:use-module (gnu packages vulkan)
  97. #:use-module (gnu packages wxwidgets)
  98. #:use-module (gnu packages xdisorg)
  99. #:use-module (gnu packages xiph)
  100. #:use-module (gnu packages xml)
  101. #:use-module (gnu packages xorg)
  102. #:use-module (gnu packages web)
  103. #:use-module (guix build-system cmake)
  104. #:use-module (guix build-system glib-or-gtk)
  105. #:use-module (guix build-system gnu)
  106. #:use-module (guix build-system meson)
  107. #:use-module (guix build-system python))
  108. (define-public vice
  109. (package
  110. (name "vice")
  111. (version "3.5")
  112. (source
  113. (origin
  114. (method url-fetch)
  115. (uri (string-append "mirror://sourceforge/vice-emu/releases/"
  116. "vice-" version ".tar.gz"))
  117. (sha256
  118. (base32
  119. "03nwcldg2h7dxj6aa77ggqc0442hqc1lsq5x69h8kcmqmvx7ifan"))))
  120. (build-system gnu-build-system)
  121. (arguments
  122. `(#:configure-flags '("--disable-pdf-docs")))
  123. (native-inputs
  124. `(("bison" ,bison)
  125. ("dos2unix" ,dos2unix)
  126. ("flex" ,flex)
  127. ("glib" ,glib "bin") ; for glib-genmarshal, etc.
  128. ("pkg-config" ,pkg-config)))
  129. (inputs
  130. `(("alsa-lib" ,alsa-lib)
  131. ("glew" ,glew)
  132. ("glib" ,glib)
  133. ("gtk+" ,gtk+)
  134. ("pulseaudio" ,pulseaudio)
  135. ("sdl" ,sdl)
  136. ("sdl-image" ,sdl-image)
  137. ("xa" ,xa)))
  138. (home-page "https://vice-emu.sourceforge.io/")
  139. (synopsis "The versatile Commodore emulator")
  140. (description
  141. "VICE is a program that emulates the C64, the C64DTV, the C128, the
  142. VIC20, practically all PET models, the PLUS4 and the CBM-II (aka
  143. C610/C510). An extra emulator is provided for C64 expanded with the CMD
  144. SuperCPU.")
  145. (license license:gpl2+)))
  146. (define-public blastem
  147. (package
  148. (name "blastem")
  149. (version "0.6.2")
  150. (source (origin
  151. (method hg-fetch)
  152. (uri (hg-reference
  153. (url "https://www.retrodev.com/repos/blastem")
  154. (changeset (string-append "v" version))))
  155. (file-name (string-append name "-" version "-checkout"))
  156. (sha256
  157. (base32
  158. "08ycfisivh9rb9vmijlrpdryaw8spd81ck48960p15cnf8h2535q"))
  159. (modules '((guix build utils)))
  160. (snippet
  161. '(begin
  162. ;; TODO: Separately package and unbundle nuklear
  163. (delete-file-recursively "zlib")))))
  164. (build-system gnu-build-system)
  165. (arguments
  166. `(#:make-flags (list (string-append "CC=" ,(cc-for-target))
  167. "HOST_ZLIB=1"
  168. "HAS_PROC=-DHAS_PROC"
  169. (string-append "CONFIG_PATH="
  170. %output "/share/blastem")
  171. (string-append "DATA_PATH="
  172. %output "/share/blastem"))
  173. #:tests? #f ; No check target and custom tests don't seem to build
  174. #:imported-modules
  175. ((guix build copy-build-system)
  176. ,@%gnu-build-system-modules)
  177. #:modules
  178. (((guix build copy-build-system)
  179. #:prefix copy:)
  180. (guix build gnu-build-system)
  181. (guix build utils))
  182. #:phases
  183. (modify-phases %standard-phases
  184. (add-after 'unpack 'fix-source
  185. (lambda _
  186. (substitute* (find-files "." ".*\\.[ch]")
  187. (("\"zlib/zlib.h\"") "<zlib.h>"))
  188. (substitute* "Makefile"
  189. (("CFLAGS:=-std=gnu99" all)
  190. (string-append all " -fcommon")))))
  191. (delete 'configure)
  192. (replace 'install
  193. (lambda* args
  194. (apply (assoc-ref copy:%standard-phases 'install)
  195. #:install-plan
  196. '(("." "bin" #:include ("blastem" "vgmplay"))
  197. ("." "share/blastem"
  198. #:include ("default.cfg" "rom.db")
  199. #:exclude ("android"))
  200. ("shaders" "share/blastem/shaders"))
  201. args))))))
  202. (inputs
  203. `(("glew" ,glew)
  204. ("mesa" ,mesa)
  205. ("sdl2" ,sdl2)
  206. ("zlib" ,zlib)))
  207. (native-inputs
  208. `(("pkg-config" ,pkg-config)))
  209. (home-page "https://www.retrodev.com/blastem/")
  210. (synopsis "Genesis/Mega Drive emulator")
  211. (description "Blastem is an emulator for the Sega Genesis/Mega Drive
  212. console.")
  213. (license license:gpl3+)))
  214. (define-public desmume
  215. (package
  216. (name "desmume")
  217. (version "0.9.11")
  218. (source
  219. (origin
  220. (method url-fetch)
  221. (uri (string-append
  222. "mirror://sourceforge/desmume/desmume/"
  223. version "/desmume-" version ".tar.gz"))
  224. (sha256
  225. (base32
  226. "15l8wdw3q61fniy3h93d84dnm6s4pyadvh95a0j6d580rjk4pcrs"))
  227. (patches (search-patches "desmume-gcc6-fixes.patch"
  228. "desmume-gcc7-fixes.patch"))))
  229. (build-system gnu-build-system)
  230. (arguments
  231. ;; Enable support for WiFi and microphone.
  232. `(#:configure-flags '("--enable-wifi"
  233. "--enable-openal")))
  234. (native-inputs
  235. `(("pkg-config" ,pkg-config)
  236. ("intltool" ,intltool)))
  237. (inputs
  238. `(("zlib" ,zlib)
  239. ("sdl" ,sdl)
  240. ("glib" ,glib)
  241. ("gtk+" ,gtk+-2)
  242. ("glu" ,glu)))
  243. (home-page "http://desmume.org/")
  244. (synopsis "Nintendo DS emulator")
  245. (description
  246. "DeSmuME is an emulator for the Nintendo DS handheld gaming console.")
  247. (license license:gpl2)))
  248. ;; Building from recent Git because the official 5.0 release no longer builds.
  249. ;; Following commits and revision numbers of beta versions listed at
  250. ;; https://dolphin-emu.org/download/.
  251. (define-public dolphin-emu
  252. (let ((commit "a34823df61df65168aa40ef5e82e44defd4a0138")
  253. (revision "13178"))
  254. (package
  255. (name "dolphin-emu")
  256. (version (git-version "5.0" revision commit))
  257. (source
  258. (origin
  259. (method git-fetch)
  260. (uri (git-reference
  261. (url "https://github.com/dolphin-emu/dolphin")
  262. (commit commit)))
  263. (file-name (git-file-name name version))
  264. (modules '((guix build utils)))
  265. (snippet
  266. '(begin
  267. ;; Remove external stuff we don't need.
  268. (for-each (lambda (dir)
  269. (delete-file-recursively
  270. (string-append "Externals/" dir)))
  271. '("LZO" "OpenAL" "Qt" "SFML" "curl" "ffmpeg"
  272. "gettext" "hidapi" "libpng" "libusb" "mbedtls"
  273. "miniupnpc" "MoltenVK" "zlib"))
  274. ;; Clean up source.
  275. (for-each delete-file (find-files "." ".*\\.(bin|dsy|exe|jar|rar)$"))
  276. #t))
  277. (sha256
  278. (base32
  279. "0j6hnj60iai366kl0kdbn1jkwc183l02g65mp2vq4qb2yd4399l1"))))
  280. (build-system cmake-build-system)
  281. (arguments
  282. '(#:tests? #f
  283. #:phases
  284. (modify-phases %standard-phases
  285. (add-before 'configure 'generate-fonts&hardcore-libvulkan-path
  286. (lambda* (#:key inputs outputs #:allow-other-keys)
  287. (let ((fontfile
  288. (search-input-file inputs
  289. "/share/fonts/truetype/wqy-microhei.ttc"))
  290. (libvulkan
  291. (search-input-file inputs "/lib/libvulkan.so")))
  292. (chdir "docs")
  293. (invoke "bash" "-c" "g++ -O2 $(freetype-config \
  294. --cflags --libs) gc-font-tool.cpp -o gc-font-tool")
  295. (invoke "./gc-font-tool" "a" fontfile "font_western.bin")
  296. (invoke "./gc-font-tool" "s" fontfile "font_japanese.bin")
  297. (copy-file "font_japanese.bin" "../Data/Sys/GC/font_japanese.bin")
  298. (copy-file "font_western.bin" "../Data/Sys/GC/font_western.bin")
  299. (chdir "..")
  300. (substitute* "Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp"
  301. (("\"vulkan\", 1") (string-append "\"vulkan\""))
  302. (("\"vulkan\"") (string-append "\"" libvulkan "\""))
  303. (("Common::DynamicLibrary::GetVersionedFilename") ""))
  304. #t))))
  305. ;; The FindGTK2 cmake script only checks hardcoded directories for
  306. ;; glib/gtk headers.
  307. #:configure-flags
  308. (list (string-append "-DX11_INCLUDE_DIR="
  309. (assoc-ref %build-inputs "libx11")
  310. "/include")
  311. (string-append "-DX11_LIBRARIES="
  312. (assoc-ref %build-inputs "libx11")
  313. "/lib/libX11.so")
  314. "-DX11_FOUND=1")))
  315. (native-inputs
  316. `(("pkg-config" ,pkg-config)
  317. ("gettext" ,gettext-minimal)))
  318. (inputs
  319. `(("alsa-lib" ,alsa-lib)
  320. ("ao" ,ao)
  321. ("bluez" ,bluez)
  322. ("curl" ,curl)
  323. ("eudev" ,eudev)
  324. ("ffmpeg" ,ffmpeg)
  325. ("font-wqy-microhei" ,font-wqy-microhei)
  326. ("freetype" ,freetype)
  327. ("glew" ,glew)
  328. ("glib" ,glib)
  329. ("glu" ,glu)
  330. ("gtk+" ,gtk+-2)
  331. ("hidapi" ,hidapi)
  332. ("libevdev" ,libevdev)
  333. ("libpng" ,libpng)
  334. ("libusb" ,libusb)
  335. ("libx11" ,libx11)
  336. ("libxi" ,libxi)
  337. ("libxrandr" ,libxrandr)
  338. ("lzo" ,lzo)
  339. ("mbedtls-apache" ,mbedtls-apache)
  340. ("mesa" ,mesa)
  341. ("miniupnpc" ,miniupnpc)
  342. ("openal" ,openal)
  343. ("pugixml" ,pugixml)
  344. ("pulseaudio" ,pulseaudio)
  345. ("qtbase" ,qtbase-5)
  346. ("sdl2" ,sdl2)
  347. ("sfml" ,sfml)
  348. ("soil" ,soil)
  349. ("soundtouch" ,soundtouch)
  350. ("vulkan-loader" ,vulkan-loader)
  351. ("zlib" ,zlib)))
  352. (home-page "https://dolphin-emu.org/")
  353. (synopsis "Nintendo Wii and GameCube emulator")
  354. (description
  355. "Dolphin is an emulator for two Nintendo video game consoles: the
  356. GameCube and the Wii. It provides compatibility with all PC controllers,
  357. turbo speed, networked multiplayer, and graphical enhancements.")
  358. (supported-systems '("x86_64-linux" "aarch64-linux"))
  359. ; dolphin/Data/Sys/GC/font_*.bin: Licensed under ASL2.0.
  360. (license (list license:gpl2+ license:asl2.0 license:fdl1.2+)))))
  361. (define-public dosbox
  362. (package
  363. (name "dosbox")
  364. (version "0.74-3")
  365. (source (origin
  366. (method url-fetch)
  367. (uri (string-append "https://sourceforge.net/projects/dosbox"
  368. "/files/dosbox/" version "/dosbox-"
  369. version ".tar.gz/download"))
  370. (file-name (string-append name "-" version ".tar.gz"))
  371. (sha256
  372. (base32
  373. "02i648i50dwicv1vaql15rccv4g8h5blf5g6inv67lrfxpbkvlf0"))))
  374. (build-system gnu-build-system)
  375. (native-inputs
  376. `(("autoconf" ,autoconf)
  377. ("automake" ,automake)))
  378. (inputs
  379. `(("sdl" ,sdl)
  380. ("libpng" ,libpng)
  381. ("zlib" ,zlib)
  382. ("alsa-lib" ,alsa-lib)
  383. ("glu" ,glu)
  384. ("mesa" ,mesa)))
  385. (home-page "https://www.dosbox.com")
  386. (synopsis "X86 emulator with CGA/EGA/VGA/etc. graphics and sound")
  387. (description "DOSBox is a DOS-emulator that uses the SDL library. DOSBox
  388. also emulates CPU:286/386 realmode/protected mode, Directory
  389. FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a
  390. SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with
  391. older games.")
  392. (license license:gpl2+)))
  393. (define-public dosbox-staging
  394. ;; This is not a patch staging area for DOSBox, but an unaffiliated fork.
  395. (package
  396. (name "dosbox-staging")
  397. (version "0.77.1")
  398. (source
  399. (origin
  400. (method git-fetch)
  401. (uri (git-reference
  402. (url "https://github.com/dosbox-staging/dosbox-staging")
  403. (commit (string-append "v" version))))
  404. (file-name (git-file-name name version))
  405. (sha256
  406. (base32 "07jwmmm1bhfxavlhl854cj8l5iy5hqx5hpwkkjbcwqg7yh9jfs2x"))))
  407. (build-system meson-build-system)
  408. (arguments
  409. `(#:configure-flags
  410. ;; These both try to git clone subprojects.
  411. (list "-Dunit_tests=disabled" ; gtest
  412. "-Duse_mt32emu=false"))) ; mt32emu
  413. (native-inputs
  414. `(("pkg-config" ,pkg-config)))
  415. (inputs
  416. `(("alsa-lib" ,alsa-lib)
  417. ("fluidsynth" ,fluidsynth)
  418. ("libpng" ,libpng)
  419. ("mesa" ,mesa)
  420. ("opusfile" ,opusfile)
  421. ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
  422. ("zlib" ,zlib)))
  423. (home-page "https://dosbox-staging.github.io")
  424. (synopsis "DOS/x86 PC emulator focusing on ease of use")
  425. (description
  426. "The DOSBox Staging project attempts to modernize DOSBox.
  427. DOSBox emulates an Intel x86 personal computer running an IBM PC compatible disk
  428. operating system (@dfn{DOS}) in both real and protected modes. It was primarily
  429. designed to run old DOS games, but aims to be fully compatible with all DOS
  430. programs and replicate the experience as accurately as possible.
  431. This fork fixes some perceived issues with DOSBox and adds new features such as
  432. Wayland support, PowerPC/POWER dynamic recompilation, and FluidSynth MIDI.
  433. Other features may be removed: for example, physical CDs can no longer be
  434. played, only emulated media.
  435. Graphical emulation includes contemporary text mode, Hercules, CGA, EGA, VGA,
  436. VESA, S3@tie{}Trio@tie{}64, and Tandy hardware.
  437. Emulated legacy sound devices range from a rudimentary `PC speaker' buzzer to
  438. the once state-of-the-art Gravis Utrasound sampling sound card. The default is
  439. a SoundBlaster 16 providing 16-bit stereo sound. MIDI is forwarded to the host
  440. through an emulated MPU-401.
  441. An emulated hardware modem is also included, letting one host or dial a
  442. @acronym{BBS, Bulletin Board System} across the Internet, network over IPX, and
  443. emulate a serial nullmodem over TCP/IP.")
  444. (license license:gpl3+)))
  445. (define-public qtmips
  446. (package
  447. (name "qtmips")
  448. (version "0.7.5")
  449. (source (origin
  450. (method git-fetch)
  451. (uri (git-reference
  452. (url "https://github.com/cvut/QtMips")
  453. (commit (string-append "v" version))))
  454. (file-name (git-file-name name version))
  455. (sha256
  456. (base32
  457. "1fal7a8y5g0rqqjrk795jh1l50ihz01ppjnrfjrk9vkjbd59szbp"))))
  458. (build-system cmake-build-system)
  459. (arguments
  460. '(#:phases
  461. (modify-phases %standard-phases
  462. (replace 'configure
  463. (lambda* (#:key outputs #:allow-other-keys)
  464. (invoke "qmake"
  465. (string-append "PREFIX=" (assoc-ref outputs "out"))
  466. "qtmips.pro")))
  467. (replace 'check
  468. (lambda* (#:key tests? #:allow-other-keys)
  469. (substitute* "tests/test.sh"
  470. (("qtchooser.*") ""))
  471. (substitute* '("tests/cpu_trap/test.sh"
  472. "tests/registers/test.sh")
  473. (("sub-qtmips_cli") "qtmips_cli"))
  474. (if tests?
  475. (invoke "tests/run-all.sh")
  476. #t)))
  477. (replace 'install
  478. ;; There is no install target.
  479. (lambda* (#:key outputs #:allow-other-keys)
  480. (let* ((out (assoc-ref outputs "out"))
  481. (bin (string-append out "/bin"))
  482. (apps (string-append out "/share/applications"))
  483. (icons (string-append out "/share/icons/hicolor")))
  484. (install-file "qtmips_gui/qtmips_gui" bin)
  485. (install-file "qtmips_cli/qtmips_cli" bin)
  486. (install-file "data/qtmips.desktop" apps)
  487. (install-file "data/icons/qtmips_gui.svg"
  488. (string-append icons "/scalable/apps"))
  489. (install-file "data/icons/qtmips_gui.png"
  490. (string-append icons "/48x48/apps"))
  491. #t))))
  492. #:tests? #f)) ; test suite wants mips toolchain
  493. (inputs
  494. `(("elfutils" ,elfutils)
  495. ("qtbase" ,qtbase-5)))
  496. (home-page "https://github.com/cvut/QtMips")
  497. (synopsis "MIPS CPU emulator")
  498. (description "This package contains a MIPS CPU emulator. The simulator
  499. accepts ELF statically linked executables compiled for 32-bit big-endian
  500. MIPS target, targeting mips-linux-gnu or mips-elf.")
  501. (license license:gpl2+))) ; License file says GPL3
  502. (define-public emulation-station
  503. ;; No release for a long time, new commits fix build issues
  504. (let ((commit "9cc42adff67946175d2b7e25c6ae69cc374e98a0")
  505. (revision "1"))
  506. (package
  507. (name "emulation-station")
  508. (version (git-version "2.0.1" revision commit))
  509. (source (origin
  510. (method git-fetch) ; no tarball available
  511. (uri (git-reference
  512. (url "https://github.com/Aloshi/EmulationStation")
  513. (commit commit))) ; no version tag
  514. (file-name (git-file-name name version))
  515. (sha256
  516. (base32
  517. "1cva0ns650v17lfn8in095zci6lc43d23f1x3mlzc41qfqa6mbd1"))))
  518. (build-system cmake-build-system)
  519. (arguments
  520. '(#:tests? #f)) ; no tests
  521. (inputs
  522. `(("alsa-lib" ,alsa-lib)
  523. ("boost" ,boost)
  524. ("curl" ,curl)
  525. ("eigin" ,eigen)
  526. ("freeimage" ,freeimage)
  527. ("freetype" ,freetype)
  528. ("mesa" ,mesa)
  529. ("sdl2" ,sdl2)))
  530. (synopsis "Video game console emulator front-end")
  531. (description "EmulationStation provides a graphical front-end to a large
  532. number of video game console emulators. It features an interface that is
  533. usable with any game controller that has at least 4 buttons, theming support,
  534. and a game metadata scraper.")
  535. (home-page "https://emulationstation.org")
  536. (license license:expat))))
  537. (define-public higan
  538. (package
  539. (name "higan")
  540. (version "110")
  541. (source
  542. (origin
  543. (method git-fetch)
  544. (uri (git-reference
  545. (url "https://github.com/higan-emu/higan")
  546. (commit (string-append "v" version))))
  547. (file-name (git-file-name name version))
  548. (sha256
  549. (base32 "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2"))))
  550. (build-system gnu-build-system)
  551. (native-inputs
  552. `(("pkg-config" ,pkg-config)))
  553. (inputs
  554. `(("alsa-lib" ,alsa-lib)
  555. ("ao" ,ao)
  556. ("eudev" ,eudev)
  557. ("gtk+" ,gtk+-2)
  558. ("gtksourceview-2" ,gtksourceview-2)
  559. ("libxrandr" ,libxrandr)
  560. ("libxv" ,libxv)
  561. ("mesa" ,mesa)
  562. ("openal" ,openal)
  563. ("pulseaudio" ,pulseaudio)
  564. ("sdl2" ,sdl2)))
  565. (arguments
  566. '(#:phases
  567. (let ((build-phase (assoc-ref %standard-phases 'build))
  568. (install-phase (assoc-ref %standard-phases 'install)))
  569. (modify-phases %standard-phases
  570. ;; The higan build system has no configure phase.
  571. (delete 'configure)
  572. (add-before 'build 'chdir-to-higan
  573. (lambda _
  574. (chdir "higan")
  575. #t))
  576. (add-before 'install 'create-/share/applications
  577. (lambda* (#:key outputs #:allow-other-keys)
  578. (let ((out (assoc-ref outputs "out")))
  579. ;; It seems the author forgot to do this in the Makefile.
  580. (mkdir-p (string-append out "/share/applications"))
  581. #t)))
  582. (add-after 'install 'chdir-to-icarus
  583. (lambda _
  584. (chdir "../icarus")
  585. #t))
  586. (add-after 'chdir-to-icarus 'build-icarus build-phase)
  587. (add-after 'build-icarus 'install-icarus install-phase)
  588. (add-after 'install-icarus 'wrap-higan-executable
  589. (lambda* (#:key inputs outputs #:allow-other-keys)
  590. (let* ((out (assoc-ref outputs "out"))
  591. (bin (string-append out "/bin"))
  592. (higan (string-append bin "/higan"))
  593. (higan-original (string-append higan "-original"))
  594. (bash (search-input-file inputs "/bin/bash"))
  595. (coreutils (assoc-ref inputs "coreutils"))
  596. (mkdir (string-append coreutils "/bin/mkdir"))
  597. (cp (string-append coreutils "/bin/cp"))
  598. (cp-r (string-append cp " -r --no-preserve=mode")))
  599. ;; First, have the executable make sure ~/.local/share/higan
  600. ;; contains up to date files. Higan insists on looking there
  601. ;; for these data files.
  602. (rename-file higan higan-original)
  603. (with-output-to-file higan
  604. (lambda ()
  605. (display
  606. (string-append
  607. "#!" bash "\n"
  608. ;; higan doesn't respect $XDG_DATA_HOME
  609. mkdir " -p ~/.local/share\n"
  610. cp-r " " out "/share/higan ~/.local/share\n"
  611. "exec " higan-original))))
  612. (chmod higan #o555)
  613. ;; Second, make sure higan will find icarus in PATH.
  614. (wrap-program higan
  615. `("PATH" ":" prefix (,bin)))
  616. #t)))))
  617. #:make-flags
  618. (list "compiler=g++"
  619. (string-append "prefix=" (assoc-ref %outputs "out")))
  620. ;; There is no test suite.
  621. #:tests? #f))
  622. (home-page "https://github.com/higan-emu/higan/")
  623. (synopsis "Multi-system emulator")
  624. (description
  625. "higan is a multi-system emulator with an uncompromising focus on
  626. accuracy and code readability.
  627. It currently emulates the following systems: Famicom, Famicom Disk System,
  628. Super Famicom, Super Game Boy, Game Boy, Game Boy Color, Game Boy Advance,
  629. Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive, Mega
  630. CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket, Neo Geo
  631. Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge
  632. V2.")
  633. (license license:gpl3+)))
  634. (define-public mednafen
  635. (package
  636. (name "mednafen")
  637. (version "1.27.1")
  638. (source
  639. (origin
  640. (method url-fetch)
  641. (uri (string-append "https://mednafen.github.io/releases/files/"
  642. "mednafen-" version ".tar.xz"))
  643. (sha256
  644. (base32 "1ysmb56wzr17ki6f1b486r2dzjr11igd021qb4r3437l68prpa7k"))))
  645. (build-system gnu-build-system)
  646. (arguments
  647. `(#:configure-flags
  648. (list
  649. ;; "--with-external-mpcdec"
  650. "--with-external-lzo")))
  651. (native-inputs
  652. `(("pkg-config" ,pkg-config)))
  653. (inputs
  654. `(("alsa" ,alsa-lib)
  655. ("flac" ,flac)
  656. ;; ("libmpcdec" ,libmpcdec) FIXME: not recognized.
  657. ("libsndfile" ,libsndfile)
  658. ("lzo" ,lzo)
  659. ("sdl2" ,sdl2)
  660. ("zlib" ,zlib)))
  661. (home-page "https://mednafen.github.io/")
  662. (synopsis "Multi-system emulator utilizing OpenGL and SDL")
  663. (description
  664. "Mednafen is a portable, utilizing OpenGL and SDL, argument-driven
  665. multi-system emulator. Mednafen has the ability to remap hotkey functions and
  666. virtual system inputs to a keyboard, a joystick, or both simultaneously. Save
  667. states are supported, as is real-time game rewinding. Screen snapshots may be
  668. taken, in the PNG file format, at the press of a button. Mednafen can record
  669. audiovisual movies in the QuickTime file format, with several different
  670. lossless codecs supported.
  671. The following systems are supported:
  672. @itemize
  673. @item Apple II/II+
  674. @item Atari Lynx
  675. @item Neo Geo Pocket (Color)
  676. @item WonderSwan
  677. @item GameBoy (Color)
  678. @item GameBoy Advance
  679. @item Nintendo Entertainment System
  680. @item Super Nintendo Entertainment System/Super Famicom
  681. @item Virtual Boy
  682. @item PC Engine/TurboGrafx 16 (CD)
  683. @item SuperGrafx
  684. @item PC-FX
  685. @item Sega Game Gear
  686. @item Sega Genesis/Megadrive
  687. @item Sega Master System
  688. @item Sega Saturn (experimental, x86_64 only)
  689. @item Sony PlayStation
  690. @end itemize")
  691. ;; Main license is GPL2+. Some parts are BSD-3.
  692. (license (list license:gpl2+ license:bsd-3))))
  693. (define-public mgba
  694. (package
  695. (name "mgba")
  696. (version "0.9.2")
  697. (source
  698. (origin
  699. (method git-fetch)
  700. (uri (git-reference
  701. (url "https://github.com/mgba-emu/mgba")
  702. (commit version)))
  703. (file-name (git-file-name name version))
  704. (sha256
  705. (base32 "16kngkzf08jflqxwbgafb47091vqqb9pbhazg9cd94cy81ahz3q3"))
  706. (modules '((guix build utils)))
  707. (snippet
  708. ;; Make sure we don't use the bundled software.
  709. '(begin
  710. (for-each
  711. (lambda (subdir)
  712. (let ((lib-subdir (string-append "src/third-party/" subdir)))
  713. (delete-file-recursively lib-subdir)))
  714. '("libpng" "lzma" "sqlite3" "zlib"))))))
  715. (build-system cmake-build-system)
  716. (arguments
  717. `(#:tests? #f ;no "test" target
  718. #:configure-flags
  719. (list "-DUSE_LZMA=OFF" ;do not use bundled LZMA
  720. "-DUSE_LIBZIP=OFF"))) ;use "zlib" instead
  721. (native-inputs
  722. `(("pkg-config" ,pkg-config)
  723. ("qttools" ,qttools)))
  724. (inputs
  725. `(("ffmpeg" ,ffmpeg)
  726. ("libedit" ,libedit)
  727. ("libelf" ,libelf)
  728. ("libepoxy" ,libepoxy)
  729. ("libpng" ,libpng)
  730. ("mesa" ,mesa)
  731. ("minizip" ,minizip)
  732. ("ncurses" ,ncurses)
  733. ("qtbase" ,qtbase-5)
  734. ("qtmultimedia" ,qtmultimedia)
  735. ("sdl2" ,sdl2)
  736. ("sqlite" ,sqlite)
  737. ("zlib" ,zlib)))
  738. (home-page "https://mgba.io")
  739. (synopsis "Game Boy Advance emulator")
  740. (description
  741. "mGBA is an emulator for running Game Boy Advance games. It aims to be
  742. faster and more accurate than many existing Game Boy Advance emulators, as
  743. well as adding features that other emulators lack. It also supports Game Boy
  744. and Game Boy Color games.")
  745. ;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+, "inih.c" is
  746. ;; BSD-3, and "discord-rpc" is Expat.
  747. (license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3 license:expat))))
  748. (define-public sameboy
  749. (package
  750. (name "sameboy")
  751. (version "0.14.5")
  752. (source
  753. (origin
  754. (method git-fetch)
  755. (uri (git-reference
  756. (url "https://github.com/LIJI32/SameBoy")
  757. (commit (string-append "v" version))))
  758. (file-name (git-file-name name version))
  759. (sha256
  760. (base32 "0qqribyksm51fhq923rdhrzb9c4yf16szymprbw8fsz0nzv8frm3"))))
  761. (build-system gnu-build-system)
  762. (native-inputs
  763. `(("rgbds" ,rgbds)
  764. ("pkg-config" ,pkg-config)))
  765. (inputs
  766. `(("sdl2" ,sdl2)))
  767. (arguments
  768. `(#:tests? #f ; There are no tests
  769. #:make-flags `(,(string-append "CC=" ,(cc-for-target))
  770. "NATIVE_CC=gcc" "CONF=release"
  771. ,(string-append "DATA_DIR="
  772. (assoc-ref %outputs "out")
  773. "/share/sameboy/"))
  774. #:phases
  775. (modify-phases %standard-phases
  776. (delete 'configure)
  777. (replace 'install
  778. (lambda* (#:key outputs #:allow-other-keys)
  779. (let* ((out (assoc-ref outputs "out"))
  780. (bin (string-append out "/bin"))
  781. (data (string-append out "/share/sameboy/")))
  782. (with-directory-excursion "build/bin/SDL"
  783. (install-file "sameboy" bin)
  784. (delete-file "sameboy")
  785. (copy-recursively "." data))))))))
  786. (home-page "https://sameboy.github.io/")
  787. (synopsis "Accurate Game Boy, Game Boy Color and Super Game Boy emulator")
  788. (description "SameBoy is a user friendly Game Boy, Game Boy Color
  789. and Super Game Boy emulator. SameBoy is accurate and includes a wide
  790. range of debugging features. It has all the features one would expect
  791. from an emulator---from save states to scaling filters.")
  792. (license license:expat)))
  793. (define-public mupen64plus-core
  794. (package
  795. (name "mupen64plus-core")
  796. (version "2.5")
  797. (source
  798. (origin
  799. (method git-fetch)
  800. (uri (git-reference
  801. (url "https://github.com/mupen64plus/mupen64plus-core")
  802. (commit version)))
  803. (file-name (git-file-name name version))
  804. (sha256
  805. (base32 "116fndl6652zrp1r6ag4xv3dzp1x52mlvadj8xwflq07fd5rhri1"))))
  806. (build-system gnu-build-system)
  807. (native-inputs
  808. `(("pkg-config" ,pkg-config)
  809. ("which" ,which)))
  810. (inputs
  811. `(("freetype" ,freetype)
  812. ("glu" ,glu)
  813. ("libpng" ,libpng)
  814. ("mesa" ,mesa)
  815. ("sdl2" ,sdl2)
  816. ("zlib" ,zlib)))
  817. (arguments
  818. '(#:phases
  819. (modify-phases %standard-phases
  820. ;; The mupen64plus build system has no configure phase.
  821. (delete 'configure)
  822. ;; Makefile is in a subdirectory.
  823. (add-before
  824. 'build 'chdir-to-project-directory
  825. (lambda _
  826. (chdir "projects/unix")
  827. #t)))
  828. #:make-flags (let ((out (assoc-ref %outputs "out")))
  829. (list "all" (string-append "PREFIX=" out)))
  830. ;; There are no tests.
  831. #:tests? #f))
  832. ;; As per the Makefile (in projects/unix/Makefile):
  833. (supported-systems '("i686-linux" "x86_64-linux"))
  834. (home-page "https://www.mupen64plus.org/")
  835. (synopsis "Nintendo 64 emulator core library")
  836. (description
  837. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  838. which is capable of accurately playing many games. This package contains the
  839. core library.")
  840. (license license:gpl2+)))
  841. (define-public mupen64plus-audio-sdl
  842. (package
  843. (name "mupen64plus-audio-sdl")
  844. (version "2.5")
  845. (source
  846. (origin
  847. (method git-fetch)
  848. (uri (git-reference
  849. (url "https://github.com/mupen64plus/mupen64plus-audio-sdl")
  850. (commit version)))
  851. (file-name (git-file-name name version))
  852. (sha256
  853. (base32 "0z19amfg9vr2pqjjri1ipc7hs681fzjcnb0f9y7bjhp5n8d7p6bb"))))
  854. (build-system gnu-build-system)
  855. (native-inputs
  856. `(("pkg-config" ,pkg-config)
  857. ("which" ,which)))
  858. (inputs
  859. `(("mupen64plus-core" ,mupen64plus-core)
  860. ("sdl2" ,sdl2)))
  861. (arguments
  862. '(#:phases
  863. (modify-phases %standard-phases
  864. ;; The mupen64plus build system has no configure phase.
  865. (delete 'configure)
  866. ;; Makefile is in a subdirectory.
  867. (add-before
  868. 'build 'cd-to-project-dir
  869. (lambda _
  870. (chdir "projects/unix"))))
  871. #:make-flags
  872. (let ((out (assoc-ref %outputs "out"))
  873. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  874. (list "all"
  875. (string-append "PREFIX=" out)
  876. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  877. ;; There are no tests.
  878. #:tests? #f))
  879. (home-page "https://www.mupen64plus.org/")
  880. (synopsis "Mupen64Plus SDL input plugin")
  881. (description
  882. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  883. which is capable of accurately playing many games. This package contains the
  884. SDL audio plugin.")
  885. (license license:gpl2+)))
  886. (define-public mupen64plus-input-sdl
  887. (package
  888. (name "mupen64plus-input-sdl")
  889. (version "2.5")
  890. (source
  891. (origin
  892. (method git-fetch)
  893. (uri (git-reference
  894. (url "https://github.com/mupen64plus/mupen64plus-input-sdl")
  895. (commit version)))
  896. (file-name (git-file-name name version))
  897. (sha256
  898. (base32 "1dyazfbdjycdfslq8jixqiqhziw0rlkvach2r9dz91229jmkyc9c"))))
  899. (build-system gnu-build-system)
  900. (native-inputs
  901. `(("which" ,which)))
  902. (inputs
  903. `(("mupen64plus-core" ,mupen64plus-core)
  904. ("sdl2" ,sdl2)))
  905. (arguments
  906. '(#:phases
  907. (modify-phases %standard-phases
  908. ;; The mupen64plus build system has no configure phase.
  909. (delete 'configure)
  910. ;; Makefile is in a subdirectory.
  911. (add-before
  912. 'build 'cd-to-project-dir
  913. (lambda _
  914. (chdir "projects/unix"))))
  915. #:make-flags
  916. (let ((out (assoc-ref %outputs "out"))
  917. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  918. (list "all"
  919. (string-append "PREFIX=" out)
  920. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  921. ;; There are no tests.
  922. #:tests? #f))
  923. (home-page "https://www.mupen64plus.org/")
  924. (synopsis "Mupen64Plus SDL input plugin")
  925. (description
  926. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  927. which is capable of accurately playing many games. This package contains the
  928. SDL input plugin.")
  929. (license license:gpl2+)))
  930. (define-public mupen64plus-rsp-hle
  931. (package
  932. (name "mupen64plus-rsp-hle")
  933. (version "2.5")
  934. (source
  935. (origin
  936. (method git-fetch)
  937. (uri (git-reference
  938. (url "https://github.com/mupen64plus/mupen64plus-rsp-hle")
  939. (commit version)))
  940. (file-name (git-file-name name version))
  941. (sha256
  942. (base32 "0pi31qzjjp7aypdvvnz6ms18g09c4gqzxi6328zj8sji94b75gf0"))))
  943. (build-system gnu-build-system)
  944. (inputs
  945. `(("mupen64plus-core" ,mupen64plus-core)))
  946. (arguments
  947. '(#:phases
  948. (modify-phases %standard-phases
  949. ;; The mupen64plus build system has no configure phase.
  950. (delete 'configure)
  951. ;; Makefile is in a subdirectory.
  952. (add-before
  953. 'build 'cd-to-project-dir
  954. (lambda _
  955. (chdir "projects/unix"))))
  956. #:make-flags
  957. (let ((out (assoc-ref %outputs "out"))
  958. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  959. (list "all"
  960. (string-append "PREFIX=" out)
  961. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  962. ;; There are no tests.
  963. #:tests? #f))
  964. (home-page "https://www.mupen64plus.org/")
  965. (synopsis "Mupen64Plus SDL input plugin")
  966. (description
  967. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  968. which is capable of accurately playing many games. This package contains the
  969. high-level emulation (HLE) RSP processor plugin.")
  970. (license license:gpl2+)))
  971. (define-public mupen64plus-rsp-z64
  972. (package
  973. (name "mupen64plus-rsp-z64")
  974. (version "2.0.0")
  975. (source
  976. (origin
  977. (method git-fetch)
  978. (uri (git-reference
  979. (url "https://github.com/mupen64plus/mupen64plus-rsp-z64")
  980. (commit version)))
  981. (file-name (git-file-name name version))
  982. (sha256
  983. (base32 "0nfyjns9k8xbg3aqs7593nfaxvlj72h3l8h467442xlk8ajfcylx"))))
  984. (build-system gnu-build-system)
  985. (inputs
  986. `(("mupen64plus-core" ,mupen64plus-core)))
  987. (arguments
  988. '(#:phases
  989. (modify-phases %standard-phases
  990. ;; The mupen64plus build system has no configure phase.
  991. (delete 'configure)
  992. ;; Makefile is in a subdirectory.
  993. (add-before
  994. 'build 'cd-to-project-dir
  995. (lambda _
  996. (chdir "projects/unix"))))
  997. #:make-flags
  998. (let ((out (assoc-ref %outputs "out"))
  999. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  1000. (list "all"
  1001. (string-append "PREFIX=" out)
  1002. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  1003. ;; There are no tests.
  1004. #:tests? #f))
  1005. (home-page "https://www.mupen64plus.org/")
  1006. (synopsis "Mupen64Plus SDL input plugin")
  1007. (description
  1008. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  1009. which is capable of accurately playing many games. This package contains the
  1010. Z64 RSP processor plugin.")
  1011. (license license:gpl2+)))
  1012. (define-public mupen64plus-video-arachnoid
  1013. (package
  1014. (name "mupen64plus-video-arachnoid")
  1015. (version "2.0.0")
  1016. (source
  1017. (origin
  1018. (method git-fetch)
  1019. (uri (git-reference
  1020. (url "https://github.com/mupen64plus/mupen64plus-video-arachnoid")
  1021. (commit version)))
  1022. (file-name (git-file-name name version))
  1023. (sha256
  1024. (base32 "1v9fqwpb6pawr8z5cm2ki7bqkks4iyr5c4jy4v5khj6h8zcv55gc"))))
  1025. (build-system gnu-build-system)
  1026. (native-inputs
  1027. `(("pkg-config" ,pkg-config)
  1028. ("which" ,which)))
  1029. (inputs
  1030. `(("mesa" ,mesa)
  1031. ("mupen64plus-core" ,mupen64plus-core)))
  1032. (arguments
  1033. '(#:phases
  1034. (modify-phases %standard-phases
  1035. ;; The mupen64plus build system has no configure phase.
  1036. (delete 'configure)
  1037. ;; Makefile is in a subdirectory.
  1038. (add-before
  1039. 'build 'cd-to-project-dir
  1040. (lambda _
  1041. (chdir "projects/unix"))))
  1042. #:make-flags
  1043. (let ((out (assoc-ref %outputs "out"))
  1044. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  1045. (list "all"
  1046. (string-append "PREFIX=" out)
  1047. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  1048. ;; There are no tests.
  1049. #:tests? #f))
  1050. (home-page "https://www.mupen64plus.org/")
  1051. (synopsis "Mupen64Plus Rice Video plugin")
  1052. (description
  1053. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  1054. which is capable of accurately playing many games. This package contains the
  1055. Arachnoid video plugin.")
  1056. (license license:gpl2+)))
  1057. (define-public mupen64plus-video-glide64
  1058. (package
  1059. (name "mupen64plus-video-glide64")
  1060. (version "2.0.0")
  1061. (source
  1062. (origin
  1063. (method git-fetch)
  1064. (uri (git-reference
  1065. (url "https://github.com/mupen64plus/mupen64plus-video-glide64")
  1066. (commit version)))
  1067. (file-name (git-file-name name version))
  1068. (sha256
  1069. (base32 "0qn5za7g7796kh2ag3xpmhbqg0yf71g9liz6ks0rha8pz73lgs01"))))
  1070. (build-system gnu-build-system)
  1071. (native-inputs
  1072. `(("pkg-config" ,pkg-config)
  1073. ("which" ,which)))
  1074. (inputs
  1075. `(("mesa" ,mesa)
  1076. ("mupen64plus-core" ,mupen64plus-core)
  1077. ("sdl2" ,sdl2)))
  1078. (arguments
  1079. '(#:phases
  1080. (modify-phases %standard-phases
  1081. ;; The mupen64plus build system has no configure phase.
  1082. (delete 'configure)
  1083. ;; Makefile is in a subdirectory.
  1084. (add-before
  1085. 'build 'cd-to-project-dir
  1086. (lambda _
  1087. (chdir "projects/unix")))
  1088. ;; XXX Should be unnecessary with the next release.
  1089. (add-before
  1090. 'build 'use-sdl2
  1091. (lambda _
  1092. (substitute* "Makefile"
  1093. (("SDL_CONFIG = (.*)sdl-config" all prefix)
  1094. (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
  1095. #:make-flags
  1096. (let ((out (assoc-ref %outputs "out"))
  1097. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  1098. (list "all"
  1099. (string-append "PREFIX=" out)
  1100. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  1101. ;; There are no tests.
  1102. #:tests? #f))
  1103. (home-page "https://www.mupen64plus.org/")
  1104. (synopsis "Mupen64Plus Rice Video plugin")
  1105. (description
  1106. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  1107. which is capable of accurately playing many games. This package contains the
  1108. Glide64 video plugin.")
  1109. (license license:gpl2+)))
  1110. (define-public mupen64plus-video-glide64mk2
  1111. (package
  1112. (name "mupen64plus-video-glide64mk2")
  1113. (version "2.5")
  1114. (source
  1115. (origin
  1116. (method git-fetch)
  1117. (uri (git-reference
  1118. (url "https://github.com/mupen64plus/mupen64plus-video-glide64mk2")
  1119. (commit version)))
  1120. (file-name (git-file-name name version))
  1121. (sha256
  1122. (base32 "08pm28a36dpr0cvr8pzw0n5ksdazp7jqvlmqfy2lwb4dm0cwhkqd"))))
  1123. (build-system gnu-build-system)
  1124. (native-inputs
  1125. `(("pkg-config" ,pkg-config)
  1126. ("which" ,which)))
  1127. (inputs
  1128. `(("boost" ,boost)
  1129. ("libpng" ,libpng)
  1130. ("mesa" ,mesa)
  1131. ("mupen64plus-core" ,mupen64plus-core)
  1132. ("sdl2" ,sdl2)
  1133. ("zlib" ,zlib)))
  1134. (arguments
  1135. '(#:phases
  1136. (modify-phases %standard-phases
  1137. ;; The mupen64plus build system has no configure phase.
  1138. (delete 'configure)
  1139. ;; Makefile is in a subdirectory.
  1140. (add-before
  1141. 'build 'cd-to-project-dir
  1142. (lambda _
  1143. (chdir "projects/unix"))))
  1144. #:make-flags
  1145. (let ((out (assoc-ref %outputs "out"))
  1146. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  1147. (list "all"
  1148. (string-append "PREFIX=" out)
  1149. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  1150. ;; There are no tests.
  1151. #:tests? #f))
  1152. (home-page "https://www.mupen64plus.org/")
  1153. (synopsis "Mupen64Plus Rice Video plugin")
  1154. (description
  1155. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  1156. which is capable of accurately playing many games. This package contains the
  1157. Glide64MK2 video plugin.")
  1158. (license license:gpl2+)))
  1159. (define-public mupen64plus-video-rice
  1160. (package
  1161. (name "mupen64plus-video-rice")
  1162. (version "2.5")
  1163. (source
  1164. (origin
  1165. (method git-fetch)
  1166. (uri (git-reference
  1167. (url "https://github.com/mupen64plus/mupen64plus-video-rice")
  1168. (commit version)))
  1169. (file-name (git-file-name name version))
  1170. (sha256
  1171. (base32 "0rpmbcq67gsj5h5jjis146378qc1mskskvx20y1ikx59yhbamh13"))))
  1172. (build-system gnu-build-system)
  1173. (native-inputs
  1174. `(("pkg-config" ,pkg-config)
  1175. ("which" ,which)))
  1176. (inputs
  1177. `(("libpng" ,libpng)
  1178. ("mesa" ,mesa)
  1179. ("mupen64plus-core" ,mupen64plus-core)
  1180. ("sdl2" ,sdl2)))
  1181. (arguments
  1182. '(#:phases
  1183. (modify-phases %standard-phases
  1184. ;; The mupen64plus build system has no configure phase.
  1185. (delete 'configure)
  1186. ;; Makefile is in a subdirectory.
  1187. (add-before
  1188. 'build 'cd-to-project-dir
  1189. (lambda _
  1190. (chdir "projects/unix"))))
  1191. #:make-flags
  1192. (let ((out (assoc-ref %outputs "out"))
  1193. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  1194. (list "all"
  1195. (string-append "PREFIX=" out)
  1196. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  1197. ;; There are no tests.
  1198. #:tests? #f))
  1199. (home-page "https://www.mupen64plus.org/")
  1200. (synopsis "Mupen64Plus Rice Video plugin")
  1201. (description
  1202. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  1203. which is capable of accurately playing many games. This package contains the
  1204. Rice Video plugin.")
  1205. (license license:gpl2+)))
  1206. (define-public mupen64plus-video-z64
  1207. (package
  1208. (name "mupen64plus-video-z64")
  1209. (version "2.0.0")
  1210. (source
  1211. (origin
  1212. (method git-fetch)
  1213. (uri (git-reference
  1214. (url "https://github.com/mupen64plus/mupen64plus-video-z64")
  1215. (commit version)))
  1216. (file-name (git-file-name name version))
  1217. (sha256
  1218. (base32 "04qa2fdd6dakpk2v0d4l80xh9b4h8gm71g80c0wyyxdhmhwk1r9c"))
  1219. (patches (search-patches "mupen64plus-video-z64-glew-correct-path.patch"))))
  1220. (build-system gnu-build-system)
  1221. (native-inputs
  1222. `(("pkg-config" ,pkg-config)
  1223. ("which" ,which)))
  1224. (inputs
  1225. `(("glew" ,glew)
  1226. ("mupen64plus-core" ,mupen64plus-core)
  1227. ("sdl2" ,sdl2)))
  1228. (arguments
  1229. '(#:phases
  1230. (modify-phases %standard-phases
  1231. ;; The mupen64plus build system has no configure phase.
  1232. (delete 'configure)
  1233. ;; Makefile is in a subdirectory.
  1234. (add-before
  1235. 'build 'cd-to-project-dir
  1236. (lambda _
  1237. (chdir "projects/unix")))
  1238. ;; XXX Should be unnecessary with the next release.
  1239. (add-before
  1240. 'build 'use-sdl2
  1241. (lambda _
  1242. (substitute* "Makefile"
  1243. (("SDL_CONFIG = (.*)sdl-config" all prefix)
  1244. (string-append "SDL_CONFIG = " prefix "sdl2-config"))))))
  1245. #:make-flags
  1246. (let ((out (assoc-ref %outputs "out"))
  1247. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  1248. (list "all"
  1249. (string-append "PREFIX=" out)
  1250. (string-append "APIDIR=" m64p "/include/mupen64plus")))
  1251. ;; There are no tests.
  1252. #:tests? #f))
  1253. (home-page "https://www.mupen64plus.org/")
  1254. (synopsis "Mupen64Plus Z64 video plugin")
  1255. (description
  1256. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  1257. which is capable of accurately playing many games. This package contains the
  1258. Z64 video plugin.")
  1259. (license license:gpl2+)))
  1260. (define-public mupen64plus-ui-console
  1261. (package
  1262. (name "mupen64plus-ui-console")
  1263. (version "2.5")
  1264. (source
  1265. (origin
  1266. (method git-fetch)
  1267. (uri (git-reference
  1268. (url "https://github.com/mupen64plus/mupen64plus-ui-console")
  1269. (commit version)))
  1270. (file-name (git-file-name name version))
  1271. (sha256
  1272. (base32 "0vrf98qa6a0y3647kslsv644fag233dxh5dcr1yncjiiwickcr5a"))
  1273. (patches (search-patches "mupen64plus-ui-console-notice.patch"))))
  1274. (build-system gnu-build-system)
  1275. (native-inputs
  1276. `(("pkg-config" ,pkg-config)
  1277. ("which" ,which)))
  1278. (inputs
  1279. `(("sdl2" ,sdl2)))
  1280. ;; Mupen64Plus supports a single data directory and a single plugin
  1281. ;; directory in its configuration, yet we need data and plugin files from
  1282. ;; a variety of packages. The best way to deal with this is to install
  1283. ;; all packages from which data and plugin files are needed into one's
  1284. ;; profile, and point the configuration there. Hence, propagate the most
  1285. ;; important packages here to save the user from the bother. The patch
  1286. ;; mupen64plus-ui-console-notice also gives users instructions on what
  1287. ;; they need to do in order to point the configuration to their profile.
  1288. (propagated-inputs
  1289. `(("mupen64plus-core" ,mupen64plus-core)
  1290. ("mupen64plus-audio-sdl" ,mupen64plus-audio-sdl)
  1291. ("mupen64plus-input-sdl" ,mupen64plus-input-sdl)
  1292. ("mupen64plus-rsp-hle" ,mupen64plus-rsp-hle)
  1293. ("mupen64plus-video-glide64" ,mupen64plus-video-glide64)
  1294. ("mupen64plus-video-glide64mk2" ,mupen64plus-video-glide64mk2)
  1295. ("mupen64plus-video-rice" ,mupen64plus-video-rice)))
  1296. (arguments
  1297. '(#:phases
  1298. (modify-phases %standard-phases
  1299. ;; The mupen64plus build system has no configure phase.
  1300. (delete 'configure)
  1301. ;; Makefile is in a subdirectory.
  1302. (add-before
  1303. 'build 'cd-to-project-dir
  1304. (lambda _
  1305. (chdir "projects/unix"))))
  1306. #:make-flags
  1307. (let ((out (assoc-ref %outputs "out"))
  1308. (m64p (assoc-ref %build-inputs "mupen64plus-core")))
  1309. (list "all"
  1310. (string-append "PREFIX=" out)
  1311. (string-append "APIDIR=" m64p "/include/mupen64plus")
  1312. ;; Trailing slash matters here.
  1313. (string-append "COREDIR=" m64p "/lib/")))
  1314. ;; There are no tests.
  1315. #:tests? #f))
  1316. (home-page "https://www.mupen64plus.org/")
  1317. (synopsis "Mupen64Plus command line user interface")
  1318. (description
  1319. "Mupen64Plus is a cross-platform plugin-based Nintendo 64 (N64) emulator
  1320. which is capable of accurately playing many games. This package contains the
  1321. command line user interface. Installing this package is the easiest way
  1322. towards a working Mupen64Plus for casual users.")
  1323. (license license:gpl2+)))
  1324. (define-public nestopia-ue
  1325. (package
  1326. (name "nestopia-ue")
  1327. (version "1.51.1")
  1328. (source
  1329. (origin
  1330. (method git-fetch)
  1331. (uri (git-reference
  1332. (url "https://github.com/rdanbrook/nestopia")
  1333. (commit version)))
  1334. (file-name (git-file-name name version))
  1335. (sha256
  1336. (base32 "1g19gz33jav00rwzkpcnynf5ps41vl64a9qx0xjd6lva4bgn8s57"))))
  1337. (build-system gnu-build-system)
  1338. (native-inputs
  1339. `(("autoconf" ,autoconf)
  1340. ("autoconf-archive" ,autoconf-archive)
  1341. ("automake" ,automake)
  1342. ("pkg-config" ,pkg-config)))
  1343. (inputs
  1344. `(("fltk" ,fltk)
  1345. ("fontconfig", fontconfig)
  1346. ("libarchive" ,libarchive)
  1347. ("libepoxy" ,libepoxy)
  1348. ("libxft" ,libxft)
  1349. ("libxrender" ,libxrender)
  1350. ("sdl2" ,sdl2)
  1351. ("zlib" ,zlib)))
  1352. (arguments
  1353. '(;; There are no tests.
  1354. #:tests? #f))
  1355. (home-page "http://0ldsk00l.ca/nestopia/")
  1356. (synopsis "Nintendo Entertainment System (NES/Famicom) emulator")
  1357. (description
  1358. "Nestopia UE (Undead Edition) is a fork of the Nintendo Entertainment
  1359. System (NES/Famicom) emulator Nestopia, with enhancements from members of the
  1360. emulation community. It provides highly accurate emulation.")
  1361. (license license:gpl2+)))
  1362. (define-public libretro-lowresnx
  1363. (package
  1364. (name "libretro-lowresnx")
  1365. (version "1.2")
  1366. (source (origin
  1367. (method git-fetch)
  1368. (uri (git-reference
  1369. (url "https://github.com/timoinutilis/lowres-nx")
  1370. (commit (string-append "v" version))))
  1371. (file-name (git-file-name name version))
  1372. (sha256
  1373. (base32
  1374. "0b0vg3iz342dpkffvf7frsnqh8inj8yzi8550bsx8vnbpq5r2ay5"))))
  1375. (build-system gnu-build-system)
  1376. (arguments
  1377. `(#:tests? #f ; no tests
  1378. #:make-flags (list "-C" "platform/LibRetro"
  1379. (string-append "CC=" ,(cc-for-target)))
  1380. #:phases
  1381. (modify-phases %standard-phases
  1382. (delete 'configure) ; no configure script
  1383. (replace 'install
  1384. (lambda* (#:key outputs #:allow-other-keys)
  1385. (let* ((out (assoc-ref outputs "out"))
  1386. (libretrodir (string-append out "/lib/libretro")))
  1387. (install-file "platform/LibRetro/lowresnx_libretro.so"
  1388. libretrodir)
  1389. #t))))))
  1390. (home-page "https://lowresnx.inutilis.com/")
  1391. (synopsis "Libretro core for LowRES NX")
  1392. (description "LowRES NX is a simulated retro game console, which can be
  1393. programmed in the classic BASIC language. This package provides a libretro
  1394. core allowing the lowRES NX programs to be used with libretro frontends such
  1395. as RetroArch.")
  1396. (license license:zlib)))
  1397. (define-public retroarch
  1398. (package
  1399. (name "retroarch")
  1400. (version "1.9.11")
  1401. (source
  1402. (origin
  1403. (method git-fetch)
  1404. (uri (git-reference
  1405. (url "https://github.com/libretro/RetroArch")
  1406. (commit (string-append "v" version))))
  1407. (file-name (git-file-name name version))
  1408. (sha256
  1409. (base32 "0hd77kw1f655s40qcz1righdhd9czqyy40rf7gigdag1bkchdx6z"))
  1410. (patches
  1411. (search-patches "retroarch-LIBRETRO_DIRECTORY.patch"))))
  1412. (build-system gnu-build-system)
  1413. (arguments
  1414. `(#:tests? #f ; no tests
  1415. #:phases
  1416. (modify-phases %standard-phases
  1417. (replace 'configure
  1418. (lambda* (#:key inputs outputs #:allow-other-keys)
  1419. (let* ((out (assoc-ref outputs "out"))
  1420. (etc (string-append out "/etc"))
  1421. (vulkan (assoc-ref inputs "vulkan-loader"))
  1422. (wayland-protocols (assoc-ref inputs "wayland-protocols")))
  1423. ;; Hard-code some store file names.
  1424. (substitute* "gfx/common/vulkan_common.c"
  1425. (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
  1426. (substitute* "gfx/common/wayland/generate_wayland_protos.sh"
  1427. (("/usr/local/share/wayland-protocols")
  1428. (string-append wayland-protocols "/share/wayland-protocols")))
  1429. (substitute* "qb/qb.libs.sh"
  1430. (("/bin/true") (which "true")))
  1431. ;; Use shared zlib.
  1432. (substitute* '("libretro-common/file/archive_file_zlib.c"
  1433. "libretro-common/streams/trans_stream_zlib.c")
  1434. (("<compat/zlib.h>") "<zlib.h>"))
  1435. ;; The configure script does not yet accept the extra arguments
  1436. ;; (like ‘CONFIG_SHELL=’) passed by the default configure phase.
  1437. (invoke
  1438. "./configure"
  1439. ,@(if (string-prefix? "armhf" (or (%current-target-system)
  1440. (%current-system)))
  1441. '("--enable-neon" "--enable-floathard")
  1442. '())
  1443. (string-append "--prefix=" out)
  1444. ;; Non-free software are available through the core updater,
  1445. ;; disable it. See <https://issues.guix.gnu.org/38360>.
  1446. "--disable-update_cores"
  1447. "--disable-builtinminiupnpc")))))))
  1448. (inputs
  1449. `(("alsa-lib" ,alsa-lib)
  1450. ("ffmpeg" ,ffmpeg)
  1451. ("freetype" ,freetype)
  1452. ("libxinerama" ,libxinerama)
  1453. ("libxkbcommon" ,libxkbcommon)
  1454. ("libxml2" ,libxml2)
  1455. ("libxrandr" ,libxrandr)
  1456. ("libxv" ,libxv)
  1457. ("mesa" ,mesa)
  1458. ("miniupnpc" ,miniupnpc)
  1459. ("openal" ,openal)
  1460. ("pulseaudio" ,pulseaudio)
  1461. ("python" ,python)
  1462. ("qtbase" ,qtbase-5)
  1463. ("sdl" ,sdl2)
  1464. ("udev" ,eudev)
  1465. ("vulkan-loader" ,vulkan-loader)
  1466. ("wayland" ,wayland)
  1467. ("zlib" ,zlib)))
  1468. (native-inputs
  1469. `(("pkg-config" ,pkg-config)
  1470. ("wayland-protocols" ,wayland-protocols)
  1471. ("which" ,which)))
  1472. (native-search-paths
  1473. (list (search-path-specification
  1474. (variable "LIBRETRO_DIRECTORY")
  1475. (separator #f) ; single entry
  1476. (files '("lib/libretro")))))
  1477. (home-page "https://www.libretro.com/")
  1478. (synopsis "Reference frontend for the libretro API")
  1479. (description
  1480. "Libretro is a simple but powerful development interface that allows for
  1481. the easy creation of emulators, games and multimedia applications that can plug
  1482. straight into any libretro-compatible frontend. RetroArch is the official
  1483. reference frontend for the libretro API, currently used by most as a modular
  1484. multi-system game/emulator system.")
  1485. (license license:gpl3+)))
  1486. (define-public scummvm
  1487. (package
  1488. (name "scummvm")
  1489. (version "2.5.0")
  1490. (source
  1491. (origin
  1492. (method url-fetch)
  1493. (uri (string-append "https://downloads.scummvm.org/frs/scummvm/" version
  1494. "/scummvm-" version ".tar.xz"))
  1495. (sha256
  1496. (base32 "08ynw1cmld41p4bwrw84gb1nv229va70i91qiqsjr3c2jnqy8zml"))))
  1497. (build-system gnu-build-system)
  1498. (arguments
  1499. `(#:tests? #f ;require "git"
  1500. #:configure-flags (list "--enable-release") ;for optimizations
  1501. #:phases
  1502. (modify-phases %standard-phases
  1503. (replace 'configure
  1504. ;; configure does not work followed by both "SHELL=..." and
  1505. ;; "CONFIG_SHELL=..."; set environment variables instead
  1506. (lambda* (#:key outputs configure-flags #:allow-other-keys)
  1507. (let* ((out (assoc-ref outputs "out"))
  1508. (bash (which "bash"))
  1509. (flags `(,(string-append "--prefix=" out)
  1510. ,@configure-flags)))
  1511. (setenv "SHELL" bash)
  1512. (setenv "CONFIG_SHELL" bash)
  1513. (apply invoke "./configure" flags)))))))
  1514. (native-inputs
  1515. `(("nasm" ,nasm)
  1516. ("pkg-config" ,pkg-config)))
  1517. (inputs
  1518. `(("alsa-lib" ,alsa-lib)
  1519. ("faad2" ,faad2)
  1520. ("fluidsynth" ,fluidsynth)
  1521. ("freetype" ,freetype)
  1522. ("fribidi" ,fribidi)
  1523. ("glew" ,glew)
  1524. ("giflib" ,giflib)
  1525. ("liba52" ,liba52)
  1526. ("libflac" ,flac)
  1527. ("libjpeg-turbo" ,libjpeg-turbo)
  1528. ("libmad" ,libmad)
  1529. ("libmpeg2" ,libmpeg2)
  1530. ("libogg" ,libogg)
  1531. ("libpng" ,libpng)
  1532. ("libtheora" ,libtheora)
  1533. ("libvorbis" ,libvorbis)
  1534. ("sdl2" ,(sdl-union (list sdl2 sdl2-net)))
  1535. ("zlib" ,zlib)))
  1536. (home-page "https://www.scummvm.org/")
  1537. (synopsis "Engine for several graphical adventure games")
  1538. (description "ScummVM is a program which allows you to run certain
  1539. classic graphical point-and-click adventure games, provided you
  1540. already have their data files. The clever part about this: ScummVM
  1541. just replaces the executables shipped with the games, allowing you to
  1542. play them on systems for which they were never designed!")
  1543. (license license:gpl2+)))
  1544. (define-public libticables2
  1545. (package
  1546. (name "libticables2")
  1547. (version "1.3.5")
  1548. (source (origin
  1549. (method url-fetch)
  1550. (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
  1551. (sha256
  1552. (base32
  1553. "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
  1554. (build-system gnu-build-system)
  1555. (arguments
  1556. `(#:configure-flags (list "--enable-libusb10")
  1557. #:phases
  1558. (modify-phases %standard-phases
  1559. (replace 'unpack
  1560. (lambda* (#:key source #:allow-other-keys)
  1561. (invoke "tar" "xvkf" source)
  1562. (invoke "tar" "xvkf"
  1563. (string-append "tilibs2/libticables2-"
  1564. ,version ".tar.bz2"))
  1565. (chdir (string-append "libticables2-" ,version))
  1566. #t)))))
  1567. (native-inputs
  1568. `(("autoconf" ,autoconf)
  1569. ("autogen" ,autogen)
  1570. ("automake" ,automake)
  1571. ("gettext" ,gnu-gettext)
  1572. ("libtool" ,libtool)
  1573. ("pkg-config" ,pkg-config)))
  1574. (inputs
  1575. `(("glib" ,glib)
  1576. ("libusb" ,libusb)))
  1577. (synopsis "Link cable library for TI calculators")
  1578. (description
  1579. "This package contains libticables, a library for operations on
  1580. @acronym{TI, Texas Instruments} calculator link cables.
  1581. This is a part of the TiLP project.")
  1582. (home-page "http://lpg.ticalc.org/prj_tilp/")
  1583. (license license:gpl2+)))
  1584. (define-public libticonv
  1585. (package
  1586. (name "libticonv")
  1587. (version "1.1.5")
  1588. (source (origin
  1589. (method url-fetch)
  1590. (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
  1591. (sha256
  1592. (base32
  1593. "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
  1594. (build-system gnu-build-system)
  1595. (arguments
  1596. ;; build fails with out --enable-iconv (...?)
  1597. `(#:configure-flags (list "--enable-iconv")
  1598. #:phases
  1599. (modify-phases %standard-phases
  1600. (replace 'unpack
  1601. (lambda* (#:key source #:allow-other-keys)
  1602. (invoke "tar" "xvkf" source)
  1603. (invoke "tar" "xvkf"
  1604. (string-append "tilibs2/libticonv-"
  1605. ,version ".tar.bz2"))
  1606. (chdir (string-append "libticonv-" ,version))
  1607. #t)))))
  1608. (native-inputs
  1609. `(("autoconf" ,autoconf)
  1610. ("automake" ,automake)
  1611. ("libtool" ,libtool)
  1612. ("pkg-config" ,pkg-config)))
  1613. (inputs
  1614. `(("glib" ,glib)))
  1615. (synopsis "Character conversion library for TI calculators")
  1616. (description
  1617. "This package contains libticonv, a library to support working with
  1618. @acronym{TI, Texas Instruments} calculator charsets.
  1619. This is a part of the TiLP project.")
  1620. (home-page "http://lpg.ticalc.org/prj_tilp/")
  1621. (license license:gpl2+)))
  1622. (define-public libtifiles2
  1623. (package
  1624. (name "libtifiles2")
  1625. (version "1.1.7")
  1626. (source (origin
  1627. (method url-fetch)
  1628. (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
  1629. (sha256
  1630. (base32
  1631. "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
  1632. (build-system gnu-build-system)
  1633. (arguments
  1634. `(#:phases
  1635. (modify-phases %standard-phases
  1636. (replace 'unpack
  1637. (lambda* (#:key source #:allow-other-keys)
  1638. (invoke "tar" "xvkf" source)
  1639. (invoke "tar" "xvkf"
  1640. (string-append "tilibs2/libtifiles2-"
  1641. ,version ".tar.bz2"))
  1642. (chdir (string-append "libtifiles2-" ,version))
  1643. #t)))))
  1644. (native-inputs
  1645. `(("autoconf" ,autoconf)
  1646. ("automake" ,automake)
  1647. ("gettext" ,gnu-gettext)
  1648. ("libtool" ,libtool)
  1649. ("pkg-config" ,pkg-config)))
  1650. (inputs
  1651. `(("glib" ,glib)
  1652. ("libarchive" ,libarchive)
  1653. ("libticonv" ,libticonv)))
  1654. (synopsis "File functions library for TI calculators")
  1655. (description
  1656. "This package contains libticonv, a library to support working with
  1657. @acronym{TI, Texas Instruments} calculator files.
  1658. This is a part of the TiLP project.")
  1659. (home-page "http://lpg.ticalc.org/prj_tilp/")
  1660. (license license:gpl2+)))
  1661. (define-public libticalcs2
  1662. (package
  1663. (name "libticalcs2")
  1664. (version "1.1.9")
  1665. (source (origin
  1666. (method url-fetch)
  1667. (uri "https://www.ticalc.org/pub/unix/tilibs.tar.gz")
  1668. (sha256
  1669. (base32
  1670. "07cfwwlidgx4fx88whnlch6y1342x16h15lkvkkdlp2y26sn2yxg"))))
  1671. (build-system gnu-build-system)
  1672. (arguments
  1673. `(#:phases
  1674. (modify-phases %standard-phases
  1675. (replace 'unpack
  1676. (lambda* (#:key source #:allow-other-keys)
  1677. (invoke "tar" "xvkf" source)
  1678. (invoke "tar" "xvkf"
  1679. (string-append "tilibs2/libticalcs2-"
  1680. ,version ".tar.bz2"))
  1681. (chdir (string-append "libticalcs2-" ,version))
  1682. #t)))))
  1683. (native-inputs
  1684. `(("autoconf" ,autoconf)
  1685. ("automake" ,automake)
  1686. ("gettext" ,gnu-gettext)
  1687. ("libtool" ,libtool)
  1688. ("pkg-config" ,pkg-config)))
  1689. (inputs
  1690. `(("glib" ,glib)
  1691. ("libarchive" ,libarchive)
  1692. ("libticables2" ,libticables2)
  1693. ("libticonv" ,libticonv)
  1694. ("libtifiles2" ,libtifiles2)))
  1695. (synopsis "Support library for TI calculators")
  1696. (description
  1697. "This project aims to develop a multi-platform linking program for use
  1698. with all @acronym{TI, Texas Instruments} graphing calculators (TI73 to
  1699. V200PLT).
  1700. This is a part of the TiLP project.")
  1701. (home-page "http://lpg.ticalc.org/prj_tilp/")
  1702. (license license:gpl2+)))
  1703. (define-public mame
  1704. (package
  1705. (name "mame")
  1706. (version "0.236")
  1707. (source
  1708. (origin
  1709. (method git-fetch)
  1710. (uri (git-reference
  1711. (url "https://github.com/mamedev/mame")
  1712. (commit (apply string-append "mame" (string-split version #\.)))))
  1713. (file-name (git-file-name name version))
  1714. (sha256
  1715. (base32 "0pxvvdirbwakl5cy7lp0zib6z176ckxx8c3mazsd7q1ddxxd3l8x"))
  1716. (modules '((guix build utils)))
  1717. (snippet
  1718. ;; Remove bundled libraries.
  1719. '(begin
  1720. (with-directory-excursion "3rdparty"
  1721. (for-each delete-file-recursively
  1722. '("asio" "expat" "glm" "libflac" "libjpeg" "lua"
  1723. "portaudio" "portmidi" "pugixml" "rapidjson" "SDL2"
  1724. "SDL2-override" "sqlite3" "utf8proc" "zlib")))))))
  1725. (build-system gnu-build-system)
  1726. (arguments
  1727. `(#:make-flags
  1728. (cons*
  1729. ;; A 'strict-overflow' error pops up on i686 so disable '-Werror'.
  1730. "NOWERROR=1"
  1731. (string-append "QT_HOME=" (assoc-ref %build-inputs "qtbase"))
  1732. (string-append "SDL_INI_PATH="
  1733. (assoc-ref %outputs "out")
  1734. "/share/mame/ini")
  1735. (map (lambda (lib)
  1736. (string-append "USE_SYSTEM_LIB_" (string-upcase lib) "=1"))
  1737. '("asio" "expat" "flac" "glm" "jpeg" "lua" "portaudio" "portmidi"
  1738. "pugixml" "rapidjson" "sqlite3" "utf8proc" "zlib")))
  1739. #:tests? #f ;no test in regular release
  1740. #:phases
  1741. (modify-phases %standard-phases
  1742. (delete 'configure)
  1743. (add-after 'build 'build-documentation
  1744. (lambda _ (invoke "make" "-C" "docs" "man" "info")))
  1745. (replace 'install
  1746. ;; Upstream does not provide an installation phase.
  1747. (lambda* (#:key outputs #:allow-other-keys)
  1748. (let* ((out (assoc-ref outputs "out"))
  1749. (share (string-append out "/share/mame")))
  1750. ;; Install data.
  1751. (for-each (lambda (dir)
  1752. (copy-recursively dir (string-append share "/" dir)))
  1753. '("artwork" "bgfx" "ctrlr" "hash" "ini" "language"
  1754. "plugins" "samples"))
  1755. (let ((keymaps (string-append share "/keymaps")))
  1756. (for-each (lambda (file) (install-file file keymaps))
  1757. (find-files "keymaps" ".*LINUX\\.map")))
  1758. (let ((fonts (string-append share "/fonts")))
  1759. (install-file "uismall.bdf" fonts))
  1760. (when (file-exists? "mame64")
  1761. (rename-file "mame64" "mame"))
  1762. (install-file "mame" (string-append out "/bin")))))
  1763. (add-after 'install 'install-documentation
  1764. (lambda* (#:key outputs #:allow-other-keys)
  1765. (let* ((out (assoc-ref outputs "out"))
  1766. (man (string-append out "/share/man/man1"))
  1767. (info (string-append out "/share/info")))
  1768. (install-file "docs/build/man/MAME.1" man)
  1769. (install-file "docs/build/texinfo/MAME.info" info))))
  1770. (add-after 'install 'install-ini-file
  1771. ;; Generate an ini file so as to set some directories (e.g., roms)
  1772. ;; to a writable location, i.e., "$HOME/.mame/" and "$HOME/mame/".
  1773. ;;
  1774. ;; XXX: We need to insert absolute references to the store. It can
  1775. ;; be an issue if they leak into user's home directory, e.g., with
  1776. ;; "mame -createconfig" and the package is later GC'ed.
  1777. (lambda* (#:key outputs #:allow-other-keys)
  1778. (let* ((out (assoc-ref outputs "out"))
  1779. (share (string-append out "/share/mame"))
  1780. (ini (string-append share "/ini")))
  1781. (with-output-to-file (string-append ini "/mame.ini")
  1782. (lambda _
  1783. (format #t
  1784. "inipath $HOME/.mame;~a/ini~@
  1785. homepath $HOME/mame~@
  1786. rompath $HOME/mame/roms~@
  1787. samplepath $HOME/mame/samples;~a/samples~@
  1788. cheatpath $HOME/mame/cheat~@
  1789. artpath $HOME/mame/artwork;~a/artwork~@
  1790. crosshairpath $HOME/mame/crosshair~@
  1791. snapshot_directory $HOME/mame/snapshots~@
  1792. hashpath ~a/hash~@
  1793. fontpath $HOME/mame/fonts;~a/fonts~@
  1794. ctrlrpath $HOME/mame/ctrlr;~a/ctrlr~@
  1795. bgfx_path ~a/bgfx~@
  1796. pluginspath $HOME/mame/plugins;~a/plugins~@
  1797. languagepath ~a/language~@
  1798. cfg_directory $HOME/.mame/cfg~@
  1799. nvram_directory $HOME/.mame/nvram~@
  1800. input_directory $HOME/.mame/inp~@
  1801. state_directory $HOME/.mame/sta~@
  1802. diff_directory $HOME/.mame/diff~@
  1803. comment_directory $HOME/.mame/comments~%"
  1804. share share share share share share share share
  1805. share)))
  1806. (with-output-to-file (string-append ini "/ui.ini")
  1807. (lambda _
  1808. (format #t
  1809. "historypath $HOME/mame/history~@
  1810. categorypath $HOME/mame/folders~@
  1811. cabinets_directory $HOME/mame/cabinets~@
  1812. cpanels_directory $HOME/mame/cpanel~@
  1813. pcbs_directory $HOME/mame/pcb~@
  1814. flyers_directory $HOME/mame/flyers~@
  1815. titles_directory $HOME/mame/titles~@
  1816. ends_directory $HOME/mame/ends~@
  1817. marquees_directory $HOME/mame/marquees~@
  1818. artwork_preview_directory $HOME/mame/artpreview~@
  1819. bosses_directory $HOME/mame/bosses~@
  1820. logos_directory $HOME/mame/logo~@
  1821. scores_directory $HOME/mame/scores~@
  1822. versus_directory $HOME/mame/versus~@
  1823. gameover_directory $HOME/mame/gameover~@
  1824. howto_directory $HOME/mame/howto~@
  1825. select_directory $HOME/mame/select~@
  1826. icons_directory $HOME/mame/icons~@
  1827. covers_directory $HOME/mame/covers~@
  1828. ui_path $HOME/.mame/ui~%"))))))
  1829. (add-after 'install 'install-desktop-file
  1830. (lambda* (#:key outputs #:allow-other-keys)
  1831. (let* ((out (assoc-ref outputs "out"))
  1832. (desktop (string-append out "/share/applications"))
  1833. (executable (string-append out "/bin/mame")))
  1834. (mkdir-p desktop)
  1835. (with-output-to-file (string-append desktop "/mame.desktop")
  1836. (lambda _
  1837. (format #t
  1838. "[Desktop Entry]~@
  1839. Name=mame~@
  1840. Comment=Multi-purpose emulation framework~@
  1841. Exec=~a~@
  1842. TryExec=~@*~a~@
  1843. Terminal=false~@
  1844. Type=Application~@
  1845. Categories=Game;Emulator;~@
  1846. Keywords=Game;Emulator;Arcade;~%"
  1847. executable)))))))))
  1848. (native-inputs
  1849. `(("pkg-config" ,pkg-config)
  1850. ("sphinx" ,python-sphinx)
  1851. ("sphinxcontrib-svg2pdfconverter" ,python-sphinxcontrib-svg2pdfconverter)
  1852. ("texinfo" ,texinfo)))
  1853. (inputs
  1854. `(("alsa-lib" ,alsa-lib)
  1855. ("asio" ,asio-1.12) ;the bundled copy is at 1.11
  1856. ("expat" ,expat)
  1857. ("flac" ,flac)
  1858. ("fontconfig" ,fontconfig)
  1859. ("glm" ,glm)
  1860. ("libjpeg" ,libjpeg-turbo)
  1861. ("libxi" ,libxi)
  1862. ("libxinerama" ,libxinerama)
  1863. ("lua" ,lua)
  1864. ("portaudio" ,portaudio)
  1865. ("portmidi" ,portmidi)
  1866. ("pugixml" ,pugixml)
  1867. ("pulseaudio" ,pulseaudio)
  1868. ("python-wrapper" ,python-wrapper)
  1869. ("qtbase" ,qtbase-5)
  1870. ("rapidjson" ,rapidjson)
  1871. ("sdl" ,(sdl-union (list sdl2 sdl2-ttf)))
  1872. ("sqlite" ,sqlite)
  1873. ("utf8proc" ,utf8proc)
  1874. ("zlib" ,zlib)))
  1875. (home-page "https://www.mamedev.org")
  1876. (synopsis "Multi-purpose emulation framework")
  1877. (description "MAME's purpose is to preserve decades of software
  1878. history. As electronic technology continues to rush forward, MAME
  1879. prevents this important @emph{vintage} software from being lost and
  1880. forgotten. This is achieved by documenting the hardware and how it
  1881. functions. The source code to MAME serves as this documentation.")
  1882. ;; The MAME project as a whole is distributed under the terms of GPL2+.
  1883. ;; However, over 90% of the files are under Expat license. Also, artwork,
  1884. ;; keymaps, languages and samples are under CC0.
  1885. (license (list license:gpl2+ license:expat license:cc0))))
  1886. (define-public gnome-arcade
  1887. (package
  1888. (name "gnome-arcade")
  1889. (version "0.218.2")
  1890. (source
  1891. (origin
  1892. (method git-fetch)
  1893. (uri (git-reference
  1894. (url "https://github.com/strippato/gnome-arcade")
  1895. (commit (string-append "v." version))))
  1896. (file-name (git-file-name name version))
  1897. (sha256
  1898. (base32
  1899. "1qc01a62p65qb6mwjfmxqsd6n3rglsfwrjhsp25nr7q54107n55l"))))
  1900. (build-system cmake-build-system)
  1901. (arguments
  1902. `(#:tests? #f ; No tests.
  1903. #:configure-flags (list
  1904. (string-append "-DMAME_BIN=\""
  1905. (assoc-ref %build-inputs "mame")
  1906. "/bin/mame\"")
  1907. (string-append "-DAPP_RES=\""
  1908. (assoc-ref %outputs "out")
  1909. "/share/gnome-arcade/\""))
  1910. #:phases
  1911. (modify-phases %standard-phases
  1912. (add-before 'build 'fix-paths
  1913. (lambda* (#:key outputs #:allow-other-keys)
  1914. (let ((out (assoc-ref outputs "out")))
  1915. (pk 'cwd (getcwd))
  1916. (substitute* "../source/src/config.c"
  1917. (("/usr/share") (string-append out "/share"))))
  1918. #t))
  1919. (replace 'install
  1920. (lambda* (#:key outputs #:allow-other-keys)
  1921. (let* ((out (assoc-ref outputs "out"))
  1922. (bin (string-append out "/bin"))
  1923. (rom (string-append out "/share/gnome-arcade/data/rom"))
  1924. (tile (string-append out "/share/gnome-arcade/data/tile")))
  1925. (mkdir-p bin)
  1926. (install-file "../gnome-arcade" bin)
  1927. (copy-recursively "../source/res"
  1928. (string-append out "/share/gnome-arcade/res"))
  1929. (mkdir-p rom)
  1930. (install-file "../source/data/rom/ROM.TXT" rom)
  1931. (mkdir-p tile)
  1932. (install-file "../source/data/tile/TILE.TXT" tile))
  1933. #t)))))
  1934. (native-inputs
  1935. `(("pkg-config" ,pkg-config)))
  1936. (inputs
  1937. `(("mame" ,mame)
  1938. ("gtk" ,gtk+)
  1939. ("libevdev" ,libevdev)
  1940. ("libvlc" ,vlc)
  1941. ("libarchive" ,libarchive)))
  1942. (home-page "https://github.com/strippato/gnome-arcade")
  1943. (synopsis "Minimal MAME frontend")
  1944. (description
  1945. "A minimal GTK+ frontend for MAME, the multi-purpose arcade and console
  1946. emulator.")
  1947. (license license:gpl3+)))
  1948. (define-public pcsxr
  1949. ;; No release since 2017.
  1950. (let ((commit "6484236cb0281e8040ff6c8078c87899a3407534"))
  1951. (package
  1952. (name "pcsxr")
  1953. ;; Version is tagged here: https://github.com/frealgagu/PCSX-Reloaded
  1954. (version "1.9.95")
  1955. (source
  1956. (origin
  1957. (method git-fetch)
  1958. (uri (git-reference
  1959. (url "https://github.com/pcsxr/PCSX-Reloaded")
  1960. (commit commit)))
  1961. (sha256
  1962. (base32
  1963. "138mayp7zi9v4l3lm5f6xxkds619w1fgg769zm8s45c84jbz7dza"))
  1964. (file-name (git-file-name name commit))))
  1965. (build-system cmake-build-system)
  1966. (arguments
  1967. `(#:tests? #f ;no "test" target
  1968. #:configure-flags
  1969. (list "-DSND_BACKEND=pulse"
  1970. "-DENABLE_CCDDA='ON'"
  1971. "-DUSE_LIBARCHIVE='ON'"
  1972. "-DUSE_LIBCDIO='ON'")
  1973. #:phases
  1974. (modify-phases %standard-phases
  1975. (add-after 'unpack 'cd-subdir
  1976. (lambda _ (chdir "pcsxr") #t))
  1977. (add-before 'configure 'fix-cdio-lookup
  1978. (lambda* (#:key inputs #:allow-other-keys)
  1979. (substitute* "cmake/FindCdio.cmake"
  1980. (("/usr/include/cdio")
  1981. (search-input-directory inputs "/include/cdio")))))
  1982. (add-after 'install 'wrap-program
  1983. (lambda* (#:key inputs outputs #:allow-other-keys)
  1984. (wrap-program (string-append (assoc-ref outputs "out")
  1985. "/bin/pcsxr")
  1986. ;; For GtkFileChooserDialog.
  1987. `("GSETTINGS_SCHEMA_DIR" =
  1988. (,(string-append (assoc-ref inputs "gtk+")
  1989. "/share/glib-2.0/schemas"))))
  1990. #t)))))
  1991. (native-inputs
  1992. `(("pkg-config" ,pkg-config)
  1993. ("intltool" ,intltool)
  1994. ("glib" ,glib "bin")))
  1995. (inputs
  1996. `(("libcdio" ,libcdio)
  1997. ("sdl2" ,sdl2)
  1998. ("gtk+" ,gtk+)
  1999. ("ffmpeg" ,ffmpeg)
  2000. ("libxv" ,libxv)
  2001. ("libarchive" ,libarchive)
  2002. ("pulseaudio" ,pulseaudio)))
  2003. (home-page "https://archive.codeplex.com/?p=pcsxr")
  2004. (synopsis "PlayStation emulator")
  2005. (description
  2006. "A PlayStation emulator based on PCSX-df Project with bugfixes and
  2007. improvements.")
  2008. (license license:gpl2+))))
  2009. (define-public gens-gs
  2010. (package
  2011. (name "gens-gs")
  2012. (version "7")
  2013. (source
  2014. (origin
  2015. (method url-fetch)
  2016. (uri (string-append "https://retrocdn.net/images/6/6d/Gens-gs-r"
  2017. version ".tar.gz"))
  2018. (sha256
  2019. (base32
  2020. "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
  2021. (build-system glib-or-gtk-build-system)
  2022. (arguments
  2023. `(#:system "i686-linux"
  2024. #:phases
  2025. (modify-phases %standard-phases
  2026. (add-after 'unpack 'fix-CFLAGS
  2027. (lambda* _
  2028. ;; Remove GTK API deprecation flags that cause build errors.
  2029. (substitute* "configure"
  2030. (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
  2031. #t)))))
  2032. (native-inputs
  2033. `(("pkg-config" ,pkg-config)
  2034. ("nasm" ,nasm)))
  2035. (inputs
  2036. `(("sdl" ,sdl)
  2037. ("gtk" ,gtk+-2)))
  2038. (home-page "https://segaretro.org/Gens/GS")
  2039. (synopsis "Emulator for Sega Genesis/Mega Drive systems")
  2040. (description
  2041. "Gens/GS is an emulator for the Mega Drive (also known as Sega Genesis),
  2042. derived from Gens. Project goals include clean source code, combined features
  2043. from various forks of Gens, and improved platform portability.")
  2044. (supported-systems '("i686-linux" "x86_64-linux"))
  2045. (license license:gpl2+)))
  2046. (define-public bsnes
  2047. (package
  2048. (name "bsnes")
  2049. (version "115")
  2050. (source
  2051. (origin
  2052. (method git-fetch)
  2053. (uri (git-reference
  2054. (url "https://github.com/bsnes-emu/bsnes")
  2055. (commit (string-append "v" version))))
  2056. (file-name (git-file-name name version))
  2057. (sha256
  2058. (base32
  2059. "0j054x38fwai61vj36sc04r3zkzay5acq2cgd9zqv5hs51s36g5b"))))
  2060. (build-system gnu-build-system)
  2061. (arguments
  2062. `(#:make-flags (list "-C" "bsnes"
  2063. ;; Remove march=native
  2064. "local=false"
  2065. (string-append "prefix=" (assoc-ref %outputs "out")))
  2066. #:tests? #f ; No tests.
  2067. #:phases (modify-phases %standard-phases
  2068. (delete 'configure))))
  2069. (native-inputs
  2070. `(("pkg-config" ,pkg-config)))
  2071. (inputs
  2072. `(("alsa-lib" ,alsa-lib)
  2073. ("ao" ,ao)
  2074. ("cairo" ,cairo)
  2075. ("eudev" ,eudev)
  2076. ("gtksourceview-2" ,gtksourceview-2)
  2077. ("libxrandr" ,libxrandr)
  2078. ("libxv" ,libxv)
  2079. ("openal" ,openal)
  2080. ("pulseaudio" ,pulseaudio)
  2081. ("sdl2" ,sdl2)))
  2082. (home-page "https://bsnes.dev/")
  2083. (synopsis "Emulator for the Super Nintendo / Super Famicom systems")
  2084. (description
  2085. "bsnes is a Super Nintendo / Super Famicom emulator that focuses on
  2086. performance, features, and ease of use.")
  2087. (license license:gpl3)))
  2088. ;; python-pwntools requires a -rc release of unicorn
  2089. (define-public unicorn
  2090. (let ((unless-x86
  2091. (lambda (code)
  2092. (if (member (%current-system) '("x86_64-linux" "i686-linux"))
  2093. '()
  2094. code))))
  2095. (package
  2096. (name "unicorn")
  2097. (version "1.0.2-rc4")
  2098. ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
  2099. (source
  2100. (origin
  2101. (method git-fetch)
  2102. (uri (git-reference
  2103. (url "https://github.com/unicorn-engine/unicorn")
  2104. (commit version)))
  2105. (file-name (git-file-name name version))
  2106. (sha256
  2107. (base32
  2108. "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy"))))
  2109. (outputs '("out" "python"))
  2110. ;; The main library is not written in Python, but the build process has
  2111. ;; little in common with any defined build system, so we might as well
  2112. ;; build on top of python-build-system and make use of all
  2113. ;; the Python-specific phases that can be reused.
  2114. (build-system python-build-system)
  2115. (arguments
  2116. `(#:modules ((srfi srfi-26)
  2117. (guix build python-build-system)
  2118. (guix build utils))
  2119. #:phases
  2120. (modify-phases %standard-phases
  2121. (add-before 'build 'build-library
  2122. (lambda* (#:key inputs #:allow-other-keys)
  2123. (invoke "make"
  2124. "-j" (number->string (parallel-job-count))
  2125. "UNICORN_STATIC=no"
  2126. "CC=gcc")))
  2127. (add-after 'build-library 'install-library
  2128. (lambda* (#:key outputs #:allow-other-keys)
  2129. (invoke "make" "install"
  2130. "UNICORN_STATIC=no"
  2131. (string-append
  2132. "PREFIX="
  2133. (assoc-ref outputs "out")))))
  2134. (add-before 'build 'prepare-bindings
  2135. (lambda* (#:key outputs #:allow-other-keys)
  2136. (chdir "bindings/python")
  2137. ;; Set this environment variable so that the Python bindings
  2138. ;; don't build their own copy of the shared object, but use
  2139. ;; a dummy value such that the bindings test suite uses the
  2140. ;; same mechanism for loading the library as any other user.
  2141. (setenv "LIBUNICORN_PATH" "1")
  2142. (substitute* "unicorn/unicorn.py"
  2143. (("_path_list = \\[.*")
  2144. (string-append
  2145. "_path_list = [\""
  2146. (assoc-ref outputs "out")
  2147. ;; eat the rest of the list
  2148. "/lib\"] + 0*[")))
  2149. #t))
  2150. (add-before 'check 'check-library
  2151. (lambda* (#:key outputs #:allow-other-keys)
  2152. (for-each
  2153. (lambda (suite)
  2154. (with-directory-excursion
  2155. (string-append "../../tests/" suite)
  2156. (invoke "make" "test" "CC=gcc"
  2157. ,@(unless-x86
  2158. '("AS=i686-unknown-linux-gnu-as"
  2159. "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
  2160. '("unit" "regress"))
  2161. #t))
  2162. (add-after 'install 'install-samples
  2163. (lambda* (#:key outputs #:allow-other-keys)
  2164. (let* ((python-samples (find-files "." "sample_.*"))
  2165. (c-samples (find-files "../../samples" ".*\\.c"))
  2166. (python-docdir
  2167. (string-append (assoc-ref outputs "python")
  2168. "/share/doc/unicorn/samples"))
  2169. (c-docdir
  2170. (string-append (assoc-ref outputs "out")
  2171. "/share/doc/unicorn/samples")))
  2172. (for-each (cut install-file <> c-docdir) c-samples)
  2173. (for-each (cut install-file <> python-docdir) python-samples)
  2174. #t))))))
  2175. (native-inputs
  2176. ;; NOTE: cross-binutils needs to be wrapped with unless-x86, as otherwise
  2177. ;; the linker provided by the package will be used, circumventing the ld-wrapper.
  2178. `(,@(unless-x86
  2179. `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
  2180. ("cmocka" ,cmocka)
  2181. ("hexdump-for-tests" ,util-linux)))
  2182. (home-page "https://www.unicorn-engine.org")
  2183. (synopsis "Unicorn CPU emulator framework")
  2184. (description
  2185. "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
  2186. framework based on QEMU.")
  2187. (license license:gpl2+))))
  2188. (define-public ppsspp
  2189. ;; Use a recent commit as fixes for ffmpeg 4.4 haven't been released as of
  2190. ;; 1.11.3.
  2191. (let ((commit "69fa20744958aef8da9ca052ba7675fdc1636e46")
  2192. (revision "1"))
  2193. (package
  2194. (name "ppsspp")
  2195. (version (git-version "1.11.3" revision commit))
  2196. (source
  2197. (origin
  2198. (method git-fetch)
  2199. (uri (git-reference
  2200. (url "https://github.com/hrydgard/ppsspp")
  2201. (commit commit)))
  2202. (sha256
  2203. (base32 "0r8w4hllhn6zsfxlajxw3sn3f8vsri45srr4mdwsffzcb4hvl0cr"))
  2204. (file-name (git-file-name name version))
  2205. (patches
  2206. (search-patches "ppsspp-disable-upgrade-and-gold.patch"))
  2207. (modules '((guix build utils)))
  2208. (snippet
  2209. `(begin
  2210. ;; The following is quite a heavy-handed way of unbundling PPSSPP.
  2211. ;; There are still a number of external sources, that we don't
  2212. ;; remove here. Some may be packaged, others are not.
  2213. ;; First, we patch existing sources to include the right headers.
  2214. (substitute* (append (find-files "Common" ".*\\.(h|cpp)")
  2215. (find-files "Core" ".*\\.(h|cpp)")
  2216. (find-files "GPU" ".*\\.(h|cpp)")
  2217. (find-files "SDL" ".*\\.(h|cpp)")
  2218. (find-files "UI" ".*\\.(h|cpp)"))
  2219. ;; These headers are all hard-coded in the original source.
  2220. (("ext/cityhash/") "")
  2221. (("ext/glslang/glslang/") "glslang/")
  2222. (("ext/glslang/") "glslang/")
  2223. (("ext/miniupnp/") "")
  2224. (("ext/SPIRV-Cross/") "spirv_cross/")
  2225. (("ext/vulkan/") "vulkan/")
  2226. (("ext/xxhash.h") "xxhash.h")
  2227. ;; These definitions do not actually exist in the Vulkan headers,
  2228. ;; but PPSSPP defines them in ext/vulkan.
  2229. (("VK_FORMAT_BEGIN_RANGE") "VK_FORMAT_UNDEFINED")
  2230. (("VK_FORMAT_END_RANGE") "VK_FORMAT_ASTC_12x12_SRGB_BLOCK"))
  2231. ;; Next, we patch CMakeLists.
  2232. (substitute* "CMakeLists.txt"
  2233. ;; Drop unnecessary includes and targets.
  2234. (("include_directories\\(ext/glslang\\)") "")
  2235. (("include_directories\\(ext/xxhash\\)") "")
  2236. (("include_directories\\(ext/cityhash\\)") "")
  2237. (("include_directories\\(ext/zstd.*") "")
  2238. (("libzstd_static") "zstd")
  2239. (("set_target_properties\\(cityhash .*\\)") "")
  2240. ;; Fix linking to GLEW.
  2241. (("TARGET Ext::GLEW") "true")
  2242. (("target_link_libraries\\(native Ext::GLEW\\)")
  2243. "find_package(GLEW)\ntarget_link_libraries(native GLEW::GLEW)")
  2244. (("Ext::Snappy") "snappy")
  2245. ;; Don't search for cityhash/xxhash, we already have them.
  2246. (("add_library\\((city|xx)hash STATIC") "if()\nendif(")
  2247. (("ext/xxhash\\.[ch]") "")
  2248. (("ext/cityhash/.*\\.(cpp|h)") "")
  2249. (("if\\(USE_MINIUPNPC\\)" all)
  2250. (string-append all "
  2251. find_package(miniupnpc)
  2252. target_link_libraries(${CoreLibName} miniupnpc ${LDLIBS})
  2253. elseif(FALSE)"))
  2254. ;; Link all of spirv-cross.
  2255. (("spirv-cross-glsl" all)
  2256. (string-append all
  2257. " spirv-cross-core spirv-cross-cpp"
  2258. " spirv-cross-reflect spirv-cross-util")))
  2259. (substitute* "ext/CMakeLists.txt"
  2260. (("add_subdirectory\\(glew.*") "")
  2261. (("add_subdirectory\\(glslang.*") "")
  2262. (("add_subdirectory\\(snappy.*") "")
  2263. (("add_subdirectory\\(SPIRV-Cross-build.*") "")
  2264. (("add_subdirectory\\(zstd.*") ""))
  2265. ;; Finally, we can delete the bundled sources.
  2266. (for-each delete-file-recursively
  2267. '("MoltenVK"
  2268. "ext/cmake"
  2269. "ext/glew"
  2270. "ext/glslang" "ext/glslang-build"
  2271. "ext/miniupnp" "ext/miniupnp-build"
  2272. "ext/native"
  2273. "ext/snappy"
  2274. "ext/SPIRV-Cross" "ext/SPIRV-Cross-build"
  2275. "ext/vulkan"
  2276. "ext/xxhash.c"
  2277. "ext/xxhash.h"
  2278. "ext/zlib"
  2279. "ext/zstd"))
  2280. ;; Since we are not including git as an input, PPSSPP is confused
  2281. ;; about its version. Let's fix that here.
  2282. (substitute* "git-version.cmake"
  2283. (("unknown") ,version))))))
  2284. (build-system cmake-build-system)
  2285. (native-inputs
  2286. `(("pkg-config" ,pkg-config)
  2287. ("python" ,python)))
  2288. (inputs
  2289. `(("cityhash" ,cityhash)
  2290. ;; ppsspp doesn't yet build with ffmpeg 4.4 (see:
  2291. ("ffmpeg" ,ffmpeg)
  2292. ("glew" ,glew)
  2293. ("glslang" ,glslang)
  2294. ("libpng" ,libpng)
  2295. ("libzip" ,libzip)
  2296. ("mesa" ,mesa)
  2297. ("miniupnpc" ,miniupnpc)
  2298. ("sdl2" ,sdl2)
  2299. ("snappy" ,snappy)
  2300. ("spirv-cross" ,spirv-cross)
  2301. ("vulkan-headers" ,vulkan-headers)
  2302. ("vulkan-loader" ,vulkan-loader)
  2303. ("xxhash" ,xxhash)
  2304. ("zlib" ,zlib)
  2305. ("zstd" ,zstd "lib")
  2306. ; ("zstd" ,zstd "static")
  2307. ;; TODO: unbundle armips.
  2308. ("armips-source" ,(package-source armips))
  2309. ("lang"
  2310. ,(let ((commit "6bd5b4bc983917ea8402f73c726b46e36f3de0b4"))
  2311. (origin
  2312. (method git-fetch)
  2313. (uri (git-reference
  2314. (url "https://github.com/hrydgard/ppsspp-lang")
  2315. (commit commit)))
  2316. (sha256
  2317. (base32 "08npr3a4xskf85gnlxidl4ksc3rhc7m5rgnj7vsbjvhvw5ap02qx"))
  2318. (file-name (git-file-name "ppsspp-lang" commit)))))
  2319. ("tests"
  2320. ,(let ((commit "1047400eaec6bcbdb2a64d326375ef6a6617c4ac"))
  2321. (origin
  2322. (method git-fetch)
  2323. (uri (git-reference
  2324. (url "https://github.com/hrydgard/pspautotests")
  2325. (commit commit)))
  2326. (sha256
  2327. (base32 "0nxv1lskcr8zbg6nrfai21mxsw0n5vaqhbsa41c3cxfyx5c4w2pg"))
  2328. (file-name (git-file-name "pspautotests" commit)))))))
  2329. (arguments
  2330. `(#:out-of-source? #f
  2331. #:configure-flags (list "-DUSE_DISCORD=OFF"
  2332. "-DUSE_SYSTEM_FFMPEG=ON"
  2333. "-DUSE_SYSTEM_LIBZIP=ON"
  2334. ;; for testing
  2335. "-DUNITTEST=ON" "-DHEADLESS=ON")
  2336. #:phases
  2337. (modify-phases %standard-phases
  2338. (add-after 'unpack 'add-external-sources
  2339. (lambda* (#:key inputs #:allow-other-keys)
  2340. ;; TODO: unbundle armips.
  2341. (copy-recursively (assoc-ref inputs "armips-source")
  2342. "ext/armips")
  2343. ;; Some tests are externalised, so we add them here.
  2344. (copy-recursively (assoc-ref inputs "tests")
  2345. "pspautotests")
  2346. ;; i18n is externalised, so we add it here.
  2347. (copy-recursively (assoc-ref inputs "lang")
  2348. "assets/lang")
  2349. #t))
  2350. (add-after 'unpack 'fix-unittest-build
  2351. (lambda _
  2352. (substitute* "CMakeLists.txt"
  2353. (("unittest/TestVertexJit.cpp" all)
  2354. (string-append all " unittest/TestShaderGenerators.cpp")))
  2355. (substitute* "unittest/TestVertexJit.cpp"
  2356. (("#include \"unittest/UnitTest.h\"" all)
  2357. (string-append all "\n#include <cmath>")))
  2358. #t))
  2359. (replace 'check
  2360. (lambda _
  2361. (for-each
  2362. (lambda (t) (invoke "./unitTest" t))
  2363. '("Arm64Emitter" "ArmEmitter" "X64Emitter" "VertexJit" "Asin"
  2364. "SinCos" #|"VFPUSinCos" SIGSEGV|# "MathUtil" "Parsers" "Jit"
  2365. "MatrixTranspose" "ParseLBN" "QuickTexHash" "CLZ"
  2366. #|"ShaderGenerators"|#))
  2367. (invoke "python3" "test.py" "-g")
  2368. #t))
  2369. (replace 'install
  2370. (lambda* (#:key inputs outputs #:allow-other-keys)
  2371. (let* ((out (assoc-ref outputs "out"))
  2372. (bin/ppsspp (string-append out "/bin/ppsspp"))
  2373. (share (string-append out "/share/ppsspp")))
  2374. (copy-recursively "icons/hicolor"
  2375. (string-append out "/share/icons/hicolor"))
  2376. (install-file "PPSSPPSDL" share)
  2377. (copy-recursively "assets" (string-append share "/assets"))
  2378. (make-desktop-entry-file
  2379. (string-append out "/share/applications/ppsspp.desktop")
  2380. #:name "PPSSPP"
  2381. #:exec (string-append share "/PPSSPPSDL")
  2382. #:icon "ppsspp")
  2383. (mkdir-p (string-append out "/bin"))
  2384. (with-output-to-file bin/ppsspp
  2385. (lambda ()
  2386. (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\""
  2387. (which "sh") share)))
  2388. (chmod bin/ppsspp #o755)
  2389. #t))))))
  2390. (home-page "https://www.ppsspp.org/")
  2391. (synopsis "PSP emulator")
  2392. (description
  2393. "PPSSPP is a ``high-level'' emulator simulating the PSP operating
  2394. system.")
  2395. (license license:gpl2+))))
  2396. (define-public exomizer
  2397. (package
  2398. (name "exomizer")
  2399. (version "3.1.1")
  2400. (source (origin
  2401. (method git-fetch)
  2402. (uri (git-reference
  2403. (url "https://bitbucket.org/magli143/exomizer.git")
  2404. (commit "6a152b5605648f7a41eadd4b011a93ec92f74dd8")))
  2405. (file-name (string-append name "-" version "-checkout"))
  2406. (sha256
  2407. (base32
  2408. "1ynhkb5p2dypkikipc3krzif264l9rmx1wnjzzgw8n88i4zkymzg"))))
  2409. (build-system gnu-build-system)
  2410. (arguments
  2411. `(#:tests? #f ; No target exists
  2412. #:phases
  2413. (modify-phases %standard-phases
  2414. (add-after 'unpack 'chdir
  2415. (lambda _
  2416. (delete-file-recursively "exodecrs")
  2417. (delete-file-recursively "rawdecrs")
  2418. (chdir "src")
  2419. ;; Those will be regenerated.
  2420. (delete-file "asm.tab.h")
  2421. (delete-file "asm.tab.c")
  2422. (delete-file "lex.yy.c")
  2423. #t))
  2424. (replace 'configure
  2425. (lambda _
  2426. (setenv "CC" ,(cc-for-target))
  2427. #t))
  2428. (replace 'install
  2429. (lambda* (#:key outputs #:allow-other-keys)
  2430. (let ((out-bin (string-append (assoc-ref outputs "out") "/bin")))
  2431. (install-file "exomizer" out-bin)
  2432. (install-file "exobasic" out-bin))
  2433. #t)))))
  2434. (native-inputs
  2435. `(("flex" ,flex)
  2436. ("bison" ,bison)))
  2437. (synopsis "Compressor for use on Commodore home computers")
  2438. (description "This program compresses files in a way that tries to be as
  2439. efficient as possible but still allows them to be decompressed in environments
  2440. where CPU speed and RAM are limited. It also generate a self-extractor for use
  2441. on a Commodore C64, C128 etc.")
  2442. (home-page "https://bitbucket.org/magli143/exomizer/wiki/Home")
  2443. ;; Some files are LGPL 2.1--but we aren't building from or installing those.
  2444. ;; zlib license with an (non-)advertising clause.
  2445. (license license:zlib)))
  2446. (define-public cc65
  2447. (package
  2448. (name "cc65")
  2449. (version "2.19")
  2450. (source (origin
  2451. (method git-fetch)
  2452. (uri (git-reference
  2453. (url "https://github.com/cc65/cc65.git")
  2454. (commit (string-append "V" version))))
  2455. (file-name (string-append name "-" version "-checkout"))
  2456. (sha256
  2457. (base32
  2458. "01a15yvs455qp20hri2pbg2wqvcip0d50kb7dibi9427hqk9cnj4"))))
  2459. (build-system gnu-build-system)
  2460. (arguments
  2461. `(#:tests? #f ; No target exists.
  2462. #:make-flags
  2463. (list "BUILD_ID=V2.18 - Git 55528249"
  2464. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  2465. #:phases
  2466. (modify-phases %standard-phases
  2467. (replace 'configure
  2468. (lambda* (#:key source #:allow-other-keys)
  2469. ;; We include $SOURCE/include in C_INCLUDE_PATH. Remove it.
  2470. (setenv "C_INCLUDE_PATH"
  2471. (string-join
  2472. (filter (lambda (name)
  2473. (not (string=? name (string-append source "/include"))))
  2474. (string-split (getenv "C_INCLUDE_PATH") #\:))
  2475. ":"))
  2476. #t)))))
  2477. (synopsis "Development environment for 6502 systems")
  2478. (description "This package provides a development environment for 6502 systems, including macro assembler, C compiler, linker, librarian and several other tools.")
  2479. (home-page "https://cc65.github.io/")
  2480. (license license:zlib)))