56 hashesFile = lib.importJSON ./hashes.json;
58 getCore = repo: (lib.getAttr repo hashesFile);
62 inherit (getCore repo) src fetcher;
64 inherit fetchFromGitHub;
65 }.${fetcher} or (throw "Unknown fetcher: ${fetcher}");
69 getCoreVersion = repo: (getCore repo).version;
72 # Sometimes core name != repo name, so you may need to set them differently
74 # - core: used by the resulting core library name, e.g.:
75 # `${core}_libretro.so`. Needs to match their respectful core info file
76 # (see https://github.com/libretro/libretro-core-info/)
77 # - repo: the repository name on GitHub
78 # See `update_cores.py` for instruction on how to add a new core.
81 , src ? (getCoreSrc repo)
82 , version ? (getCoreVersion repo)
85 import ./mkLibretroCore.nix ({
86 inherit lib stdenv core repo src version makeWrapper retroarch zlib;
90 inherit mkLibretroCore;
92 atari800 = mkLibretroCore {
94 makefile = "Makefile";
95 makeFlags = [ "GIT_VERSION=" ];
97 description = "Port of Atari800 to libretro";
98 license = lib.licenses.gpl2Only;
102 beetle-gba = mkLibretroCore {
103 core = "mednafen-gba";
105 makefile = "Makefile";
107 description = "Port of Mednafen's GameBoy Advance core to libretro";
108 license = lib.licenses.gpl2Only;
112 beetle-lynx = mkLibretroCore {
113 core = "mednafen-lynx";
114 repo = "beetle-lynx";
115 makefile = "Makefile";
117 description = "Port of Mednafen's Lynx core to libretro";
118 license = lib.licenses.gpl2Only;
122 beetle-ngp = mkLibretroCore {
123 core = "mednafen-ngp";
125 makefile = "Makefile";
127 description = "Port of Mednafen's NeoGeo Pocket core to libretro";
128 license = lib.licenses.gpl2Only;
132 beetle-pce = mkLibretroCore {
133 core = "mednafen-pce";
135 makefile = "Makefile";
137 description = "Port of Mednafen's PC Engine core to libretro";
138 license = lib.licenses.gpl2Only;
142 beetle-pce-fast = mkLibretroCore {
143 core = "mednafen-pce-fast";
144 repo = "beetle-pce-fast";
145 makefile = "Makefile";
147 description = "Port of Mednafen's PC Engine fast core to libretro";
148 license = lib.licenses.gpl2Only;
152 beetle-pcfx = mkLibretroCore {
153 core = "mednafen-pcfx";
154 repo = "beetle-pcfx";
155 makefile = "Makefile";
157 description = "Port of Mednafen's PCFX core to libretro";
158 license = lib.licenses.gpl2Only;
162 beetle-psx = mkLibretroCore {
163 core = "mednafen-psx";
165 makefile = "Makefile";
166 makeFlags = [ "HAVE_HW=0" "HAVE_LIGHTREC=1" ];
168 description = "Port of Mednafen's PSX Engine core to libretro";
169 license = lib.licenses.gpl2Only;
173 beetle-psx-hw = mkLibretroCore {
174 core = "mednafen-psx-hw";
176 extraBuildInputs = [ libGL libGLU ];
177 makefile = "Makefile";
178 makeFlags = [ "HAVE_VULKAN=1" "HAVE_OPENGL=1" "HAVE_HW=1" "HAVE_LIGHTREC=1" ];
180 description = "Port of Mednafen's PSX Engine (with HW accel) core to libretro";
181 license = lib.licenses.gpl2Only;
185 beetle-saturn = mkLibretroCore {
186 core = "mednafen-saturn";
187 repo = "beetle-saturn";
188 makefile = "Makefile";
190 description = "Port of Mednafen's Saturn core to libretro";
191 license = lib.licenses.gpl2Only;
192 platforms = [ "aarch64-linux" "x86_64-linux" ];
196 beetle-supafaust = mkLibretroCore {
197 core = "mednafen-supafaust";
198 repo = "beetle-supafaust";
199 makefile = "Makefile";
201 description = "Port of Mednafen's experimental snes_faust core to libretro";
202 license = lib.licenses.gpl2Plus;
206 beetle-supergrafx = mkLibretroCore {
207 core = "mednafen-supergrafx";
208 repo = "beetle-supergrafx";
209 makefile = "Makefile";
211 description = "Port of Mednafen's SuperGrafx core to libretro";
212 license = lib.licenses.gpl2Only;
216 beetle-vb = mkLibretroCore {
217 core = "mednafen-vb";
219 makefile = "Makefile";
221 description = "Port of Mednafen's VirtualBoy core to libretro";
222 license = lib.licenses.gpl2Only;
226 beetle-wswan = mkLibretroCore {
227 core = "mednafen-wswan";
228 repo = "beetle-wswan";
229 makefile = "Makefile";
231 description = "Port of Mednafen's WonderSwan core to libretro";
232 license = lib.licenses.gpl2Only;
236 blastem = mkLibretroCore {
239 description = "Port of BlastEm to libretro";
240 license = lib.licenses.gpl3Only;
241 platforms = lib.platforms.x86;
245 bluemsx = mkLibretroCore {
248 description = "Port of BlueMSX to libretro";
249 license = lib.licenses.gpl2Only;
253 bsnes = mkLibretroCore {
255 makefile = "Makefile";
257 description = "Port of bsnes to libretro";
258 license = lib.licenses.gpl3Only;
262 bsnes-hd = mkLibretroCore {
263 core = "bsnes-hd-beta";
265 makefile = "GNUmakefile";
269 # https://github.com/DerKoun/bsnes-hd/blob/f0b6cf34e9780d53516977ed2de64137a8bcc3c5/bsnes/GNUmakefile#L37
270 platform = if stdenv.hostPlatform.isDarwin then "macos" else "linux";
276 "platform=${platform}"
278 extraBuildInputs = [ xorg.libX11 xorg.libXext ];
279 postBuild = "cd bsnes/out";
281 description = "Port of bsnes-hd to libretro";
282 license = lib.licenses.gpl3Only;
286 bsnes-mercury = mkLibretroCore {
287 core = "bsnes-mercury-accuracy";
288 repo = "bsnes-mercury";
289 makefile = "Makefile";
290 makeFlags = [ "PROFILE=accuracy" ];
292 description = "Fork of bsnes with HLE DSP emulation restored (accuracy profile)";
293 license = lib.licenses.gpl3Only;
297 bsnes-mercury-balanced = mkLibretroCore {
298 core = "bsnes-mercury-balanced";
299 repo = "bsnes-mercury";
300 makefile = "Makefile";
301 makeFlags = [ "PROFILE=balanced" ];
303 description = "Fork of bsnes with HLE DSP emulation restored (balanced profile)";
304 license = lib.licenses.gpl3Only;
308 bsnes-mercury-performance = mkLibretroCore {
309 core = "bsnes-mercury-performance";
310 repo = "bsnes-mercury";
311 makefile = "Makefile";
312 makeFlags = [ "PROFILE=performance" ];
314 description = "Fork of bsnes with HLE DSP emulation restored (performance profile)";
315 license = lib.licenses.gpl3Only;
319 citra = mkLibretroCore rec {
321 extraBuildInputs = [ libGLU libGL boost ffmpeg nasm ];
322 makefile = "Makefile";
324 "HAVE_FFMPEG_STATIC=0"
325 # https://github.com/libretro/citra/blob/1a66174355b5ed948de48ef13c0ed508b6d6169f/Makefile#L87-L90
326 "GIT_REV=${(getCoreSrc core).rev}"
327 "GIT_DESC=${lib.substring 0 8 (getCoreSrc core).rev}"
329 "BUILD_DATE=01/01/1970_00:00"
331 # FIXME: build fail with GCC13:
332 # error: 'mic_device_name' has incomplete type
333 stdenv = gcc12Stdenv;
335 description = "Port of Citra to libretro";
336 license = lib.licenses.gpl2Plus;
340 desmume = mkLibretroCore {
342 preBuild = "cd desmume/src/frontend/libretro";
343 extraBuildInputs = [ libpcap libGLU libGL xorg.libX11 ];
344 makeFlags = lib.optional stdenv.hostPlatform.isAarch32 "platform=armv-unix"
345 ++ lib.optional (!stdenv.hostPlatform.isx86) "DESMUME_JIT=0";
347 description = "Port of DeSmuME to libretro";
348 license = lib.licenses.gpl2Plus;
352 desmume2015 = mkLibretroCore {
353 core = "desmume2015";
354 extraBuildInputs = [ libpcap libGLU libGL xorg.libX11 ];
355 makeFlags = lib.optional stdenv.hostPlatform.isAarch32 "platform=armv-unix"
356 ++ lib.optional (!stdenv.hostPlatform.isx86) "DESMUME_JIT=0";
357 preBuild = "cd desmume";
359 description = "Port of DeSmuME ~2015 to libretro";
360 license = lib.licenses.gpl2Plus;
364 dolphin = mkLibretroCore {
366 extraNativeBuildInputs = [ cmake curl pkg-config ];
376 ] ++ (with xorg; [ libSM libX11 libXi libpthreadstubs libxcb xcbutil libXext libXrandr libXinerama libXxf86vm ]);
377 makefile = "Makefile";
380 "-DLIBRETRO_STATIC=1"
384 "-DUSE_DISCORD_PRESENCE=OFF"
386 dontUseCmakeBuildDir = true;
388 description = "Port of Dolphin to libretro";
389 license = lib.licenses.gpl2Plus;
393 dosbox = mkLibretroCore {
395 CXXFLAGS = "-std=gnu++11";
397 description = "Port of DOSBox to libretro";
398 license = lib.licenses.gpl2Only;
402 dosbox-pure = mkLibretroCore {
403 core = "dosbox-pure";
404 CXXFLAGS = "-std=gnu++11";
405 hardeningDisable = [ "format" ];
406 makefile = "Makefile";
408 description = "Port of DOSBox to libretro aiming for simplicity and ease of use";
409 license = lib.licenses.gpl2Only;
413 easyrpg = mkLibretroCore {
415 extraNativeBuildInputs = [ cmake pkg-config ];
416 extraBuildInputs = [ fmt freetype harfbuzz liblcf libpng libsndfile libvorbis libxmp mpg123 opusfile pcre pixman speexdsp ];
418 # The following patch is shared with easyrpg-player.
419 # Update when new versions of liblcf and easyrpg-player are released.
420 # See pkgs/games/easyrpg-player/default.nix for details.
422 name = "0001-Fix-building-with-fmtlib-10.patch";
423 url = "https://github.com/EasyRPG/Player/commit/ab6286f6d01bada649ea52d1f0881dde7db7e0cf.patch";
424 hash = "sha256-GdSdVFEG1OJCdf2ZIzTP+hSrz+ddhTMBvOPjvYQHy54=";
428 "-DBUILD_SHARED_LIBS=ON"
429 "-DPLAYER_TARGET_PLATFORM=libretro"
430 "-DCMAKE_INSTALL_DATADIR=${placeholder "out"}/share"
432 makefile = "Makefile";
434 description = "EasyRPG Player libretro port";
435 license = lib.licenses.gpl3Only;
439 eightyone = mkLibretroCore {
443 description = "Port of EightyOne to libretro";
444 license = lib.licenses.gpl3Only;
448 fbalpha2012 = mkLibretroCore {
449 core = "fbalpha2012";
450 makefile = "makefile.libretro";
451 preBuild = "cd svn-current/trunk";
453 description = "Port of Final Burn Alpha ~2012 to libretro";
454 # Non-commercial clause
455 license = lib.licenses.unfreeRedistributable;
459 fbneo = mkLibretroCore {
461 makefile = "Makefile";
462 preBuild = "cd src/burner/libretro";
464 description = "Port of FBNeo to libretro";
465 # Non-commercial clause
466 license = lib.licenses.unfreeRedistributable;
470 fceumm = mkLibretroCore {
473 description = "FCEUmm libretro port";
474 license = lib.licenses.gpl2Only;
478 flycast = mkLibretroCore {
480 extraNativeBuildInputs = [ cmake ];
481 extraBuildInputs = [ libGL libGLU ];
482 cmakeFlags = [ "-DLIBRETRO=ON" ];
483 makefile = "Makefile";
485 description = "Flycast libretro port";
486 license = lib.licenses.gpl2Only;
487 platforms = [ "aarch64-linux" "x86_64-linux" ];
491 fmsx = mkLibretroCore {
493 makefile = "Makefile";
495 description = "FMSX libretro port";
496 # Non-commercial clause
497 license = lib.licenses.unfreeRedistributable;
501 freeintv = mkLibretroCore {
503 makefile = "Makefile";
505 description = "FreeIntv libretro port";
506 license = lib.licenses.gpl3Only;
510 fuse = mkLibretroCore {
513 description = "Port of the Fuse Unix Spectrum Emulator to libretro";
514 license = lib.licenses.gpl3Only;
518 gambatte = mkLibretroCore {
521 description = "Gambatte libretro port";
522 license = lib.licenses.gpl2Only;
526 genesis-plus-gx = mkLibretroCore {
527 core = "genesis-plus-gx";
529 description = "Enhanced Genesis Plus libretro port";
530 # Non-commercial clause
531 license = lib.licenses.unfreeRedistributable;
535 gpsp = mkLibretroCore {
537 makefile = "Makefile";
539 description = "Port of gpSP to libretro";
540 license = lib.licenses.gpl2Only;
544 gw = mkLibretroCore {
546 makefile = "Makefile";
548 description = "Port of Game and Watch to libretro";
549 license = lib.licenses.zlib;
553 handy = mkLibretroCore {
555 makefile = "Makefile";
557 description = "Port of Handy to libretro";
558 license = lib.licenses.zlib;
562 hatari = mkLibretroCore {
564 extraNativeBuildInputs = [ which ];
565 dontConfigure = true;
566 # zlib is already included in mkLibretroCore as buildInputs
567 makeFlags = [ "EXTERNAL_ZLIB=1" ];
569 description = "Port of Hatari to libretro";
570 license = lib.licenses.gpl2Only;
574 mame = mkLibretroCore {
576 extraNativeBuildInputs = [ python3 ];
577 extraBuildInputs = [ alsa-lib libGLU libGL ];
578 # Setting this is breaking compilation of src/3rdparty/genie for some reason
579 makeFlags = [ "ARCH=" ];
581 description = "Port of MAME to libretro";
582 license = with lib.licenses; [ bsd3 gpl2Plus ];
586 mame2000 = mkLibretroCore {
588 makefile = "Makefile";
589 makeFlags = lib.optional (!stdenv.hostPlatform.isx86) "IS_X86=0";
591 description = "Port of MAME ~2000 to libretro, compatible with MAME 0.37b5 sets";
592 # MAME license, non-commercial clause
593 license = lib.licenses.unfreeRedistributable;
597 mame2003 = mkLibretroCore {
599 makefile = "Makefile";
601 description = "Port of MAME ~2003 to libretro, compatible with MAME 0.78 sets";
602 # MAME license, non-commercial clause
603 license = lib.licenses.unfreeRedistributable;
607 mame2003-plus = mkLibretroCore {
608 core = "mame2003-plus";
609 makefile = "Makefile";
611 description = "Port of MAME ~2003+ to libretro, compatible with MAME 0.78 sets";
612 # MAME license, non-commercial clause
613 license = lib.licenses.unfreeRedistributable;
617 mame2010 = mkLibretroCore {
619 makefile = "Makefile";
620 makeFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "PTR64=1" "ARM_ENABLED=1" "X86_SH2DRC=0" "FORCE_DRC_C_BACKEND=1" ];
622 description = "Port of MAME ~2010 to libretro, compatible with MAME 0.139 sets";
623 # MAME license, non-commercial clause
624 license = lib.licenses.unfreeRedistributable;
628 mame2015 = mkLibretroCore {
630 patches = [ ./patches/mame2015-python311.patch ];
631 makeFlags = [ "PYTHON=python3" ];
632 extraNativeBuildInputs = [ python3 ];
633 extraBuildInputs = [ alsa-lib ];
634 makefile = "Makefile";
635 # Build failures when this is set to a bigger number
638 description = "Port of MAME ~2015 to libretro, compatible with MAME 0.160 sets";
639 # MAME license, non-commercial clause
640 license = lib.licenses.unfreeRedistributable;
644 mame2016 = mkLibretroCore {
646 patches = [ ./patches/mame2016-python311.patch ];
647 extraNativeBuildInputs = [ python3 ];
648 extraBuildInputs = [ alsa-lib ];
649 makeFlags = [ "PYTHON_EXECUTABLE=python3" ];
650 # Build failures when this is set to a bigger number
652 # Fix build errors in GCC13
653 NIX_CFLAGS_COMPILE = "-Wno-error -fpermissive";
655 description = "Port of MAME ~2016 to libretro, compatible with MAME 0.174 sets";
656 license = with lib.licenses; [ bsd3 gpl2Plus ];
660 melonds = mkLibretroCore {
662 extraBuildInputs = [ libGL libGLU ];
663 makefile = "Makefile";
665 description = "Port of MelonDS to libretro";
666 license = lib.licenses.gpl3Only;
670 mesen = mkLibretroCore {
672 makefile = "Makefile";
673 preBuild = "cd Libretro";
675 description = "Port of Mesen to libretro";
676 license = lib.licenses.gpl3Only;
680 mesen-s = mkLibretroCore {
682 makefile = "Makefile";
683 preBuild = "cd Libretro";
684 normalizeCore = false;
686 description = "Port of Mesen-S to libretro";
687 license = lib.licenses.gpl3Only;
691 meteor = mkLibretroCore {
693 makefile = "Makefile";
694 preBuild = "cd libretro";
696 description = "Port of Meteor to libretro";
697 license = lib.licenses.gpl3Only;
701 mgba = mkLibretroCore {
704 description = "Port of mGBA to libretro";
705 license = lib.licenses.mpl20;
709 mrboom = mkLibretroCore {
711 makefile = "Makefile";
713 description = "Port of Mr.Boom to libretro";
714 license = lib.licenses.mit;
718 mupen64plus = mkLibretroCore {
719 core = "mupen64plus-next";
720 repo = "mupen64plus";
721 extraBuildInputs = [ libGLU libGL libpng nasm xorg.libX11 ];
722 makefile = "Makefile";
724 "HAVE_PARALLEL_RDP=1"
725 "HAVE_PARALLEL_RSP=1"
728 "WITH_DYNAREC=${stdenv.hostPlatform.parsed.cpu.name}"
731 description = "Libretro port of Mupen64 Plus, GL only";
732 license = lib.licenses.gpl3Only;
736 neocd = mkLibretroCore {
738 makefile = "Makefile";
740 description = "NeoCD libretro port";
741 license = lib.licenses.lgpl3Only;
745 nestopia = mkLibretroCore {
747 makefile = "Makefile";
748 preBuild = "cd libretro";
750 description = "Nestopia libretro port";
751 license = lib.licenses.gpl2Only;
755 nxengine = mkLibretroCore {
757 makefile = "Makefile";
759 description = "NXEngine libretro port";
760 license = lib.licenses.gpl3Only;
764 np2kai = mkLibretroCore rec {
767 # See https://github.com/AZO234/NP2kai/tags
768 "NP2KAI_VERSION=rev.22"
769 "NP2KAI_HASH=${(getCoreSrc core).rev}"
773 description = "Neko Project II kai libretro port";
774 license = lib.licenses.mit;
778 o2em = mkLibretroCore {
780 makefile = "Makefile";
782 description = "Port of O2EM to libretro";
783 license = lib.licenses.artistic1;
787 opera = mkLibretroCore {
789 makefile = "Makefile";
790 makeFlags = [ "CC_PREFIX=${stdenv.cc.targetPrefix}" ];
792 description = "Opera is a port of 4DO/libfreedo to libretro";
793 # Non-commercial clause
794 license = lib.licenses.unfreeRedistributable;
798 parallel-n64 = mkLibretroCore {
799 core = "parallel-n64";
800 extraBuildInputs = [ libGLU libGL libpng ];
801 makefile = "Makefile";
804 "HAVE_PARALLEL_RSP=1"
805 "ARCH=${stdenv.hostPlatform.parsed.cpu.name}"
807 postPatch = lib.optionalString stdenv.hostPlatform.isAarch64 ''
808 sed -i -e '1 i\CPUFLAGS += -DARM_FIX -DNO_ASM -DARM_ASM -DDONT_WANT_ARM_OPTIMIZATIONS -DARM64' Makefile \
809 && sed -i -e 's,CPUFLAGS :=,,g' Makefile
812 description = "Parallel Mupen64plus rewrite for libretro";
813 license = lib.licenses.gpl3Only;
817 pcsx2 = mkLibretroCore {
819 extraNativeBuildInputs = [
834 makefile = "Makefile";
835 cmakeFlags = [ "-DLIBRETRO=ON" ];
838 substituteInPlace CMakeLists.txt --replace "ccache" ""
840 postBuild = "cd pcsx2";
841 # causes redefinition of _FORTIFY_SOURCE
842 hardeningDisable = [ "fortify3" ];
843 # FIXME: multiple build errors with GCC13.
844 # Unlikely to be fixed until we switch to libretro/pcsx2 that is a more
845 # up-to-date port (but still WIP).
846 stdenv = gcc12Stdenv;
848 description = "Port of PCSX2 to libretro";
849 license = lib.licenses.gpl3Plus;
850 platforms = lib.platforms.x86;
854 pcsx-rearmed = mkLibretroCore {
855 core = "pcsx_rearmed";
856 dontConfigure = true;
858 description = "Port of PCSX ReARMed with GNU lightning to libretro";
859 license = lib.licenses.gpl2Only;
863 picodrive = mkLibretroCore {
865 dontConfigure = true;
867 description = "Fast MegaDrive/MegaCD/32X emulator";
868 # Non-commercial clause
869 license = lib.licenses.unfreeRedistributable;
873 play = mkLibretroCore {
875 extraBuildInputs = [ boost bzip2 curl openssl icu libGL libGLU xorg.libX11 ];
876 extraNativeBuildInputs = [ cmake ];
877 makefile = "Makefile";
878 cmakeFlags = [ "-DBUILD_PLAY=OFF" "-DBUILD_LIBRETRO_CORE=ON" ];
879 postBuild = "cd Source/ui_libretro";
880 # FIXME: workaround the following GCC 13 error:
881 # error: 'printf' was not declared in this scop
882 CXXFLAGS = "-include cstdio";
884 description = "Port of Play! to libretro";
885 license = lib.licenses.bsd2;
889 ppsspp = mkLibretroCore {
891 extraNativeBuildInputs = [ cmake pkg-config python3 ];
892 extraBuildInputs = [ libGLU libGL libzip snappy xorg.libX11 ];
893 makefile = "Makefile";
896 # USE_SYSTEM_FFMPEG=ON causes several glitches during video playback
897 # See: https://github.com/NixOS/nixpkgs/issues/304616
898 "-DUSE_SYSTEM_FFMPEG=OFF"
899 "-DUSE_SYSTEM_SNAPPY=ON"
900 "-DUSE_SYSTEM_LIBZIP=ON"
901 "-DOpenGL_GL_PREFERENCE=GLVND"
903 postBuild = "cd lib";
905 description = "ppsspp libretro port";
906 license = lib.licenses.gpl2Plus;
910 prboom = mkLibretroCore {
912 makefile = "Makefile";
914 description = "Prboom libretro port";
915 license = lib.licenses.gpl2Only;
919 prosystem = mkLibretroCore {
921 makefile = "Makefile";
923 description = "Port of ProSystem to libretro";
924 license = lib.licenses.gpl2Only;
928 puae = mkLibretroCore {
930 makefile = "Makefile";
932 description = "Amiga emulator based on WinUAE";
933 license = lib.licenses.gpl2Only;
937 quicknes = mkLibretroCore {
939 makefile = "Makefile";
941 description = "QuickNES libretro port";
942 license = lib.licenses.lgpl21Plus;
946 sameboy = mkLibretroCore {
948 extraNativeBuildInputs = [ which hexdump ];
949 preBuild = "cd libretro";
950 makefile = "Makefile";
952 description = "SameBoy libretro port";
953 license = lib.licenses.mit;
957 same_cdi = mkLibretroCore {
959 extraNativeBuildInputs = [ python3 ];
960 extraBuildInputs = [ alsa-lib libGLU libGL portaudio xorg.libX11 ];
961 # FIXME: build fail with GCC13:
962 # error: 'uint8_t' in namespace 'std' does not name a type; did you mean 'wint_t'?
963 stdenv = gcc12Stdenv;
965 description = "SAME_CDI is a libretro core to play CD-i games";
966 license = with lib.licenses; [ bsd3 gpl2Plus ];
970 scummvm = mkLibretroCore {
972 extraBuildInputs = [ fluidsynth libjpeg libvorbis libGLU libGL ];
973 makefile = "Makefile";
974 preConfigure = "cd backends/platform/libretro/build";
976 description = "Libretro port of ScummVM";
977 license = lib.licenses.gpl2Only;
981 smsplus-gx = mkLibretroCore {
985 description = "SMS Plus GX libretro port";
986 license = lib.licenses.gpl2Plus;
990 snes9x = mkLibretroCore {
992 makefile = "Makefile";
993 preBuild = "cd libretro";
995 description = "Port of SNES9x git to libretro";
996 # Non-commercial clause
997 license = lib.licenses.unfreeRedistributable;
1001 snes9x2002 = mkLibretroCore {
1002 core = "snes9x2002";
1003 makefile = "Makefile";
1005 description = "Optimized port/rewrite of SNES9x 1.39 to Libretro";
1006 # Non-commercial clause
1007 license = lib.licenses.unfreeRedistributable;
1011 snes9x2005 = mkLibretroCore {
1012 core = "snes9x2005";
1013 makefile = "Makefile";
1015 description = "Optimized port/rewrite of SNES9x 1.43 to Libretro";
1016 # Non-commercial clause
1017 license = lib.licenses.unfreeRedistributable;
1021 snes9x2005-plus = mkLibretroCore {
1022 core = "snes9x2005-plus";
1023 repo = "snes9x2005";
1024 makefile = "Makefile";
1025 makeFlags = [ "USE_BLARGG_APU=1" ];
1027 description = "Optimized port/rewrite of SNES9x 1.43 to Libretro, with Blargg's APU";
1028 # Non-commercial clause
1029 license = lib.licenses.unfreeRedistributable;
1033 snes9x2010 = mkLibretroCore {
1034 core = "snes9x2010";
1036 description = "Optimized port/rewrite of SNES9x 1.52+ to Libretro";
1037 # Non-commercial clause
1038 license = lib.licenses.unfreeRedistributable;
1042 stella = mkLibretroCore {
1044 makefile = "Makefile";
1045 preBuild = "cd src/os/libretro";
1046 dontConfigure = true;
1048 description = "Port of Stella to libretro";
1049 license = lib.licenses.gpl2Only;
1053 stella2014 = mkLibretroCore {
1054 core = "stella2014";
1055 makefile = "Makefile";
1057 description = "Port of Stella ~2014 to libretro";
1058 license = lib.licenses.gpl2Only;
1062 swanstation = mkLibretroCore {
1063 core = "swanstation";
1064 extraNativeBuildInputs = [ cmake ];
1065 makefile = "Makefile";
1067 "-DBUILD_LIBRETRO_CORE=ON"
1070 description = "Port of SwanStation (a fork of DuckStation) to libretro";
1071 license = lib.licenses.gpl3Only;
1075 tgbdual = mkLibretroCore {
1077 makefile = "Makefile";
1079 description = "Port of TGBDual to libretro";
1080 license = lib.licenses.gpl2Only;
1084 thepowdertoy = mkLibretroCore {
1085 core = "thepowdertoy";
1086 extraNativeBuildInputs = [ cmake ];
1087 makefile = "Makefile";
1088 postBuild = "cd src";
1090 description = "Port of The Powder Toy to libretro";
1091 license = lib.licenses.gpl3Only;
1095 tic80 = mkLibretroCore {
1097 extraNativeBuildInputs = [ cmake pkg-config ];
1098 makefile = "Makefile";
1100 "-DBUILD_LIBRETRO=ON"
1101 "-DBUILD_DEMO_CARTS=OFF"
1103 "-DBUILD_PLAYER=OFF"
1107 preConfigure = "cd core";
1108 postBuild = "cd lib";
1110 description = "Port of TIC-80 to libretro";
1111 license = lib.licenses.mit;
1115 twenty-fortyeight = mkLibretroCore {
1118 description = "Port of 2048 puzzle game to the libretro API";
1119 license = lib.licenses.unlicense;
1123 vba-m = mkLibretroCore {
1126 makefile = "Makefile";
1127 preBuild = "cd src/libretro";
1129 description = "vanilla VBA-M libretro port";
1130 license = lib.licenses.gpl2Only;
1134 vba-next = mkLibretroCore {
1137 description = "VBA-M libretro port with modifications for speed";
1138 license = lib.licenses.gpl2Only;
1142 vecx = mkLibretroCore {
1144 extraBuildInputs = [ libGL libGLU ];
1146 description = "Port of Vecx to libretro";
1147 license = lib.licenses.gpl3Only;
1151 virtualjaguar = mkLibretroCore {
1152 core = "virtualjaguar";
1153 makefile = "Makefile";
1155 description = "Port of VirtualJaguar to libretro";
1156 license = lib.licenses.gpl3Only;
1160 yabause = mkLibretroCore {
1162 makefile = "Makefile";
1163 # Disable SSE for non-x86. DYNAREC doesn't build on aarch64.
1164 makeFlags = lib.optional (!stdenv.hostPlatform.isx86) "HAVE_SSE=0";
1165 preBuild = "cd yabause/src/libretro";
1167 description = "Port of Yabause to libretro";
1168 license = lib.licenses.gpl2Only;