push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
# Libretro
[libretro cores](https://docs.libretro.com/guides/core-list/) and related
packages.
## Adding new cores
The basic steps to add a new core are:
1. Add a new core using `mkLibretroCore` function (use one of the existing
cores as an example)
2. Add your new core to [`default.nix`](./default.nix) file
3. Try to build your core with `nix-build -A libretro.<core>`
## Using RetroArch with cores
To create a custom RetroArch derivation with the cores you want (instead of
using `retroarch-full` that includes all cores), you can use `.withCores` like
this:
```nix
{ pkgs, ... }:
let
retroarchWithCores = (
pkgs.retroarch.withCores (
cores: with cores; [
bsnes
mgba
quicknes
]
)
);
in
{
environment.systemPackages = [ retroarchWithCores ];
}
```
For advanced customization, see `wrapRetroArch` wrapper.

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore rec {
core = "atari800";
version = "0-unstable-2024-10-31";
src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-atari800";
rev = "6a18cb23cc4a7cecabd9b16143d2d7332ae8d44b";
hash = "sha256-+cZXHtaXnpU/zCwiDtjkyNMFGDahiHzqV2FoTCRnUWE=";
};
makefile = "Makefile";
makeFlags = [ "GIT_VERSION=${builtins.substring 0 7 src.rev}" ];
meta = {
description = "Port of Atari800 to libretro";
homepage = "https://github.com/libretro/libretro-atari800";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-gba";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-gba-libretro";
rev = "6cee80685f735ea6c2373db2622a1f1ee9f39d39";
hash = "sha256-a3XgExXVCUFw3GLCUkEl6now2L8qVdNOaXvrDMcT1ZE=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's GameBoy Advance core to libretro";
homepage = "https://github.com/libretro/beetle-gba-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-lynx";
version = "0-unstable-2025-05-10";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-lynx-libretro";
rev = "efd1797c7aa5a83c354507b1b61ac24222ebaa58";
hash = "sha256-K+VZYqNl3G1eE7dSlfmZFCoS5bKIyGSNNu2i737bKnM=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's Lynx core to libretro";
homepage = "https://github.com/libretro/beetle-lynx-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-ngp";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-ngp-libretro";
rev = "139fe34c8dfc5585d6ee1793a7902bca79d544de";
hash = "sha256-ruWnCgMxfpPHTWQ7vgNUczmGRzNKKhoZTNlUcNgm4T8=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's NeoGeo Pocket core to libretro";
homepage = "https://github.com/libretro/beetle-ngp-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-pce-fast";
version = "0-unstable-2025-09-26";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-pce-fast-libretro";
rev = "6c89e833b1aa0e0c5cd894f90a2dd09b579ffa4d";
hash = "sha256-R7qSeCRWoMe3mMpHZy4GWatlVS8x+4vn8bughHdaVb0=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's PC Engine fast core to libretro";
homepage = "https://github.com/libretro/beetle-pce-fast-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-pce";
version = "0-unstable-2025-06-22";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-pce-libretro";
rev = "9a301c0773c53702a882bbaa42ee9cbc6d523787";
hash = "sha256-RS5omi6LthQy8fFfouSEpYtaeD7QDlRENm0YuqHzUc0=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's PC Engine core to libretro";
homepage = "https://github.com/libretro/beetle-pce-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-pcfx";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-pcfx-libretro";
rev = "dd04cef9355286488a1d78ff18c4c848a1575540";
hash = "sha256-oFBuriCbJWjgPH9RRAM/XUvkW0gKXnvs7lmBpJpWewo=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's PCFX core to libretro";
homepage = "https://github.com/libretro/beetle-pcfx-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
libGL,
libGLU,
fetchFromGitHub,
mkLibretroCore,
withHw ? false,
}:
mkLibretroCore {
core = "mednafen-psx" + lib.optionalString withHw "-hw";
version = "0-unstable-2025-10-03";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-psx-libretro";
rev = "4968db4255bd8853137132c5d0809becd7638026";
hash = "sha256-MVcz+c5ExZZuda5ene4nhidd/zZNvXcAg+wCinQisME=";
};
extraBuildInputs = lib.optionals withHw [
libGL
libGLU
];
makefile = "Makefile";
makeFlags = [
"HAVE_HW=${if withHw then "1" else "0"}"
"HAVE_LIGHTREC=1"
];
meta = {
description =
"Port of Mednafen's PSX Engine core to libretro"
+ lib.optionalString withHw " (with hardware acceleration support)";
homepage = "https://github.com/libretro/beetle-psx-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-saturn";
version = "0-unstable-2025-07-01";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-saturn-libretro";
rev = "ccba5265f60f8e64a1984c9d14d383606193ea6a";
hash = "sha256-Ixjduv67sPJmf0BH8GaJyyTdpDV/e1UCWCeOb7vLggo=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's Saturn core to libretro";
homepage = "https://github.com/libretro/beetle-saturn-libretro";
license = lib.licenses.gpl2Only;
platforms = [
"aarch64-linux"
"x86_64-linux"
];
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-supafaust";
version = "0-unstable-2024-09-30";
src = fetchFromGitHub {
owner = "libretro";
repo = "supafaust";
rev = "e25f66765938d33f9ad5850e8d6cd597e55b7299";
hash = "sha256-ZgOXHhEHt54J2B1q6uA8v6uOK53g7idJlgoC4guTGow=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's experimental snes_faust core to libretro";
homepage = "https://github.com/libretro/supafaust";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-supergrafx";
version = "0-unstable-2024-11-15";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-supergrafx-libretro";
rev = "a776133c34ae8da5daf7d9ccb43e3e292e2b07b0";
hash = "sha256-FemWW4EPQCwhrS7YEytf6fEeimdTTfzaDdyRNDIBQyk=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's SuperGrafx core to libretro";
homepage = "https://github.com/libretro/beetle-supergrafx-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-vb";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-vb-libretro";
rev = "8f837ebc077afdd6652efb2827fd8308a07113ca";
hash = "sha256-eAnBubNhj78G4r8OHVqwFXGOSA9wEYI6ZwNyiwDW8W8=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's VirtualBoy core to libretro";
homepage = "https://github.com/libretro/beetle-vb-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mednafen-wswan";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "beetle-wswan-libretro";
rev = "2aeb47d3a58bf0360c686f842d9bb5bd201306fe";
hash = "sha256-LrF9p5tPtUamVLC41bJxcYDKvHmhVfwMieyIAdHaGmU=";
};
makefile = "Makefile";
meta = {
description = "Port of Mednafen's WonderSwan core to libretro";
homepage = "https://github.com/libretro/beetle-wswan-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,23 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "blastem";
version = "0-unstable-2022-07-26";
src = fetchFromGitHub {
owner = "libretro";
repo = "blastem";
rev = "277e4a62668597d4f59cadda1cbafb844f981d45";
hash = "sha256-EHvKElPw8V5Z6LnMaQXBCdM4niLIlF3aBm8dRbeYXHs=";
};
meta = {
description = "Port of BlastEm to libretro";
homepage = "https://github.com/libretro/blastem";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.x86;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "bluemsx";
version = "0-unstable-2025-09-27";
src = fetchFromGitHub {
owner = "libretro";
repo = "bluemsx-libretro";
rev = "7074551cf50ebdae78c8cce4e77560f9fc4575ca";
hash = "sha256-kmG0LCvWG+4wM+hwZ8TYQid12nZuQpNbaljym+glbz4=";
};
meta = {
description = "Port of BlueMSX to libretro";
homepage = "https://github.com/libretro/blueMSX-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
xorg,
}:
mkLibretroCore {
core = "bsnes-hd-beta";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "DerKoun";
repo = "bsnes-hd";
rev = "0bb7b8645e22ea2476cabd58f32e987b14686601";
hash = "sha256-YzWSZMn6v5hWIHnp6KmmpevCsf35Vi2BCcmFMnrFPH0=";
};
extraBuildInputs = [
xorg.libX11
xorg.libXext
];
makefile = "GNUmakefile";
makeFlags = [
"-C"
"bsnes"
"target=libretro"
"platform=linux"
];
postBuild = "cd bsnes/out";
meta = {
description = "Port of bsnes-hd to libretro";
homepage = "https://github.com/DerKoun/bsnes-hd";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
withProfile ? "accuracy",
}:
mkLibretroCore {
core = "bsnes-mercury-${withProfile}";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "bsnes-mercury";
rev = "0f35d044bf2f2b879018a0500e676447e93a1db1";
hash = "sha256-skVREKYITZn+gKKSZmwuBCWrG0jb/pifwIgat8VyQ8U=";
};
makefile = "Makefile";
makeFlags = [ "PROFILE=${withProfile}" ];
meta = {
description = "Fork of bsnes with HLE DSP emulation restored (${withProfile} profile)";
homepage = "https://github.com/libretro/bsnes-mercury";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "bsnes";
version = "0-unstable-2025-10-03";
src = fetchFromGitHub {
owner = "libretro";
repo = "bsnes-libretro";
rev = "e0e6cef46582a436e8b08a339f4751411dc5bd63";
hash = "sha256-fIlTIF1042oWIHxqD7h7MdUfb6QDfIP0jqVlBNOTBmY=";
};
makefile = "Makefile";
meta = {
description = "Port of bsnes to libretro";
homepage = "https://github.com/libretro/bsnes-libretro";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,51 @@
{
lib,
cmake,
fetchFromGitHub,
libGL,
libGLU,
libX11,
mkLibretroCore,
}:
mkLibretroCore {
core = "citra";
version = "0-unstable-2025-08-17";
src = fetchFromGitHub {
owner = "libretro";
repo = "citra";
rev = "5263fae3344e5e9af43036e0e38bec2d10fb2407";
hash = "sha256-66kbE1taODjxXDhO3uV5R212nikyXfHwCHC/zamZuL0=";
fetchSubmodules = true;
};
makefile = "Makefile";
extraBuildInputs = [
libGL
libGLU
libX11
];
extraNativeBuildInputs = [ cmake ];
# https://github.com/libretro/citra/blob/a31aff7e1a3a66f525b9ea61633d2c5e5b0c8b31/.gitlab-ci.yml#L6
cmakeFlags = [
(lib.cmakeBool "ENABLE_TESTS" false)
(lib.cmakeBool "ENABLE_DEDICATED_ROOM" false)
(lib.cmakeBool "ENABLE_SDL2" false)
(lib.cmakeBool "ENABLE_QT" false)
(lib.cmakeBool "ENABLE_WEB_SERVICE" false)
(lib.cmakeBool "ENABLE_SCRIPTING" false)
(lib.cmakeBool "ENABLE_OPENAL" false)
(lib.cmakeBool "ENABLE_LIBUSB" false)
(lib.cmakeBool "CITRA_ENABLE_BUNDLE_TARGET" false)
(lib.cmakeBool "CITRA_WARNINGS_AS_ERRORS" false)
];
meta = {
description = "Port of Citra to libretro";
homepage = "https://github.com/libretro/citra";
license = lib.licenses.gpl2Plus;
};
}

View File

@@ -0,0 +1,40 @@
{
lib,
stdenv,
fetchFromGitHub,
mkLibretroCore,
libpcap,
libGLU,
libGL,
xorg,
}:
mkLibretroCore {
core = "desmume";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "desmume";
rev = "7f05a8d447b00acd9e0798aee97b4f72eb505ef9";
hash = "sha256-BttWMunVbfPOTGx+DV+3QyOwW+55tgXKVIn99DZhbBI=";
};
extraBuildInputs = [
libpcap
libGLU
libGL
xorg.libX11
];
makeFlags =
lib.optional stdenv.hostPlatform.isAarch32 "platform=armv-unix"
++ lib.optional (!stdenv.hostPlatform.isx86) "DESMUME_JIT=0";
preBuild = "cd desmume/src/frontend/libretro";
meta = {
description = "Port of DeSmuME to libretro";
homepage = "https://github.com/libretro/desmume";
license = lib.licenses.gpl2Plus;
};
}

View File

@@ -0,0 +1,40 @@
{
lib,
stdenv,
fetchFromGitHub,
mkLibretroCore,
libpcap,
libGLU,
libGL,
xorg,
}:
mkLibretroCore {
core = "desmume2015";
version = "0-unstable-2022-04-05";
src = fetchFromGitHub {
owner = "libretro";
repo = "desmume2015";
rev = "af397ff3d1f208c27f3922cc8f2b8e08884ba893";
hash = "sha256-kEb+og4g7rJvCinBZKcb42geZO6W8ynGsTG9yqYgI+U=";
};
extraBuildInputs = [
libpcap
libGLU
libGL
xorg.libX11
];
makeFlags =
lib.optional stdenv.hostPlatform.isAarch32 "platform=armv-unix"
++ lib.optional (!stdenv.hostPlatform.isx86) "DESMUME_JIT=0";
preBuild = "cd desmume";
meta = {
description = "Port of DeSmuME ~2015 to libretro";
homepage = "https://github.com/libretro/desmume2015";
license = lib.licenses.gpl2Plus;
};
}

View File

@@ -0,0 +1,71 @@
{
lib,
fetchFromGitHub,
cmake,
curl,
gettext,
hidapi,
libGL,
libGLU,
libevdev,
mkLibretroCore,
pcre,
pkg-config,
sfml,
udev,
xorg,
}:
mkLibretroCore {
core = "dolphin";
version = "0-unstable-2025-08-05";
src = fetchFromGitHub {
owner = "libretro";
repo = "dolphin";
rev = "83438f9b1a2c832319876a1fda130a5e33d4ef87";
hash = "sha256-q4y+3uJ1tQ2OvlEvi/JNyIO/RfuWNIEKfVZ6xEWKFCg=";
};
extraNativeBuildInputs = [
cmake
curl
pkg-config
];
extraBuildInputs = [
gettext
hidapi
libGL
libGLU
libevdev
pcre
sfml
udev
xorg.libSM
xorg.libX11
xorg.libXext
xorg.libXi
xorg.libXinerama
xorg.libXrandr
xorg.libXxf86vm
xorg.libpthreadstubs
xorg.libxcb
xorg.xcbutil
];
makefile = "Makefile";
cmakeFlags = [
"-DLIBRETRO=ON"
"-DLIBRETRO_STATIC=1"
"-DENABLE_QT=OFF"
"-DENABLE_LTO=OFF"
"-DUSE_UPNP=OFF"
"-DUSE_DISCORD_PRESENCE=OFF"
];
dontUseCmakeBuildDir = true;
meta = {
description = "Port of Dolphin to libretro";
homepage = "https://github.com/libretro/dolphin";
license = lib.licenses.gpl2Plus;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "dosbox-pure";
version = "0-unstable-2025-09-28";
src = fetchFromGitHub {
owner = "schellingb";
repo = "dosbox-pure";
rev = "150a8e02ec53bfd5fc571587dab902c075f9e291";
hash = "sha256-3l566sa5sCjeppUD06chpTZ21CnfEzdRpZKM7jxkS2M=";
};
hardeningDisable = [ "format" ];
makefile = "Makefile";
meta = {
description = "Port of DOSBox to libretro aiming for simplicity and ease of use";
homepage = "https://github.com/schellingb/dosbox-pure";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "dosbox";
version = "0-unstable-2022-07-18";
src = fetchFromGitHub {
owner = "libretro";
repo = "dosbox-libretro";
rev = "b7b24262c282c0caef2368c87323ff8c381b3102";
hash = "sha256-PG2eElenlEpu0U/NIh53p0uLqewnEdaq6Aoak5E1P3I=";
};
env.CXXFLAGS = "-std=gnu++11";
meta = {
description = "Port of DOSBox to libretro";
homepage = "https://github.com/libretro/dosbox-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,88 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
nix-update-script,
asciidoctor,
cmake,
doxygen,
pkg-config,
flac,
fluidsynth,
fmt,
freetype,
glib,
harfbuzz,
lhasa,
liblcf,
libpng,
libsndfile,
libsysprof-capture,
libvorbis,
libxmp,
mpg123,
nlohmann_json,
opusfile,
pcre2,
pixman,
speexdsp,
wildmidi,
}:
mkLibretroCore rec {
core = "easyrpg";
# liblcf needs to be updated before this.
version = "0.8.1.1";
src = fetchFromGitHub {
owner = "EasyRPG";
repo = "Player";
rev = version;
hash = "sha256-2a8IdYP6Suc8a+Np5G+xoNzuPxkk9gAgR+sjdKUf89M=";
fetchSubmodules = true;
};
extraNativeBuildInputs = [
asciidoctor
cmake
doxygen
pkg-config
];
extraBuildInputs = [
flac # needed by libsndfile
fluidsynth
fmt
freetype
glib
harfbuzz
lhasa
liblcf
libpng
libsndfile
libsysprof-capture # needed by glib
libvorbis
libxmp
mpg123
nlohmann_json
opusfile
pcre2 # needed by glib
pixman
speexdsp
wildmidi
];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DPLAYER_TARGET_PLATFORM=libretro"
"-DCMAKE_INSTALL_DATADIR=${placeholder "out"}/share"
];
makefile = "Makefile";
# Since liblcf needs to be updated before this, we should not
# use the default unstableGitUpdater.
passthru.updateScript = nix-update-script { };
meta = {
description = "EasyRPG Player libretro port";
homepage = "https://github.com/EasyRPG/Player";
license = lib.licenses.gpl3Plus;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "81";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "81-libretro";
rev = "ffc99f27f092addc9ddd34dd0e3a3d4d1c053cbf";
hash = "sha256-3AIXk3LJHZHWIojMeo2BJHWYDHQ17WVbkwjFhXM14ZE=";
};
meta = {
description = "Port of EightyOne to libretro";
homepage = "https://github.com/libretro/81-libretro";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
runCommand,
zlib,
}:
mkLibretroCore rec {
core = "fbalpha2012";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "fbalpha2012";
rev = "77167cea72e808384c136c8c163a6b4975ce7a84";
hash = "sha256-giEV09dT/e82bmDlRkxpkW04JcsEZc/enIPecqYtg3c=";
};
sourceRoot = "${src.name}/svn-current/trunk";
# unvendor zlib and broken minizip code
postPatch =
let
minizip-src = runCommand "minizip-src" { } ''
mkdir $out
unpackFile ${zlib.src}
cp */contrib/minizip/{unzip.*,ioapi.*,crypt.h} $out/
'';
in
''
substituteInPlace ${makefile} \
--replace-fail '-I$(FBA_LIB_DIR)/zlib' ""
cp ${minizip-src}/* src/burner
'';
buildInputs = [ zlib ];
makeFlags = [ "EXTERNAL_ZLIB=1" ];
makefile = "makefile.libretro";
meta = {
description = "Port of Final Burn Alpha ~2012 to libretro";
homepage = "https://github.com/libretro/fbalpha2012";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "fbneo";
version = "0-unstable-2025-09-30";
src = fetchFromGitHub {
owner = "libretro";
repo = "fbneo";
rev = "9726100ba22a558290860a2648e1e6a8b8719478";
hash = "sha256-mhXuHPwXtvuA8ltaLF3uOsBwLE0evJ2RiCrNX5hnRXM=";
};
makefile = "Makefile";
preBuild = "cd src/burner/libretro";
meta = {
description = "Port of FBNeo to libretro";
homepage = "https://github.com/libretro/fbneo";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "fceumm";
version = "0-unstable-2025-09-13";
src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-fceumm";
rev = "5cd4a43e16a7f3cd35628d481c347a0a98cfdfa2";
hash = "sha256-/FvXQlp20QMFg1uPmj2HSJFXhzBunygOmGEtGNGJyxk=";
};
meta = {
description = "FCEUmm libretro port";
homepage = "https://github.com/libretro/libretro-fceumm";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
cmake,
libGL,
libGLU,
}:
mkLibretroCore {
core = "flycast";
version = "0-unstable-2025-10-03";
src = fetchFromGitHub {
owner = "flyinghead";
repo = "flycast";
rev = "af5f67c15d52b16d35e95671a5b74502288c4397";
hash = "sha256-eMkyNwGdgyYDmwqYy3xzzSTYqUcoKpQkDYFP8bQdz58=";
fetchSubmodules = true;
};
extraNativeBuildInputs = [ cmake ];
extraBuildInputs = [
libGL
libGLU
];
cmakeFlags = [ "-DLIBRETRO=ON" ];
makefile = "Makefile";
meta = {
description = "Flycast libretro port";
homepage = "https://github.com/flyinghead/flycast";
license = lib.licenses.gpl2Only;
platforms = [
"aarch64-linux"
"x86_64-linux"
];
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "fmsx";
version = "0-unstable-2025-07-31";
src = fetchFromGitHub {
owner = "libretro";
repo = "fmsx-libretro";
rev = "fbe4dfc4c3e3f7eb27089def3d663a905b181845";
hash = "sha256-1hZQO16SDB8n1wdTP67Kpns3izg/nPGl5M7wjFDBjGc=";
};
makefile = "Makefile";
meta = {
description = "FMSX libretro port";
homepage = "https://github.com/libretro/fmsx-libretro";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "freeintv";
version = "0-unstable-2025-03-05";
src = fetchFromGitHub {
owner = "libretro";
repo = "freeintv";
rev = "6efc4b8fd4c7423ec1f5ff1913b854529135b565";
hash = "sha256-B5GEzI/U/F0IsppdOx5znu+4LdZOxQLcGAez+oR2PCI=";
};
makefile = "Makefile";
meta = {
description = "FreeIntv libretro port";
homepage = "https://github.com/libretro/freeintv";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "fuse";
version = "0-unstable-2024-11-24";
src = fetchFromGitHub {
owner = "libretro";
repo = "fuse-libretro";
rev = "cad85b7b1b864c65734f71aa4a510b6f6536881c";
hash = "sha256-SdwdcR9szJJoUxQ4y8rh40Bdnn5ZI2qV4OcS39BFViQ=";
};
meta = {
description = "Port of the Fuse Unix Spectrum Emulator to libretro";
homepage = "https://github.com/libretro/fuse-libretro";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "gambatte";
version = "0-unstable-2025-09-18";
src = fetchFromGitHub {
owner = "libretro";
repo = "gambatte-libretro";
rev = "0092232a0aaef0ded0ead1c2003ccf7a85ccdfc0";
hash = "sha256-baiTlYArNSBz79Cm16Sg3VZEp909zMkF/ExqhrPYN80=";
};
meta = {
description = "Gambatte libretro port";
homepage = "https://github.com/libretro/gambatte-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "genesis-plus-gx";
version = "0-unstable-2025-10-06";
src = fetchFromGitHub {
owner = "libretro";
repo = "Genesis-Plus-GX";
rev = "252a94c0c40047b52d9ecced567846a9dd5b2020";
hash = "sha256-Eys3iDJfi3bRuPjWRK34CEAN5o5MC+of1ktT7z2DdAI=";
};
meta = {
description = "Enhanced Genesis Plus libretro port";
homepage = "https://github.com/libretro/Genesis-Plus-GX";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "gpsp";
version = "0-unstable-2025-09-17";
src = fetchFromGitHub {
owner = "libretro";
repo = "gpsp";
rev = "a545aafaf4e654a488f4588f4f302d8413a58066";
hash = "sha256-94J5WqlvBgfF/0aj0Pu61psG5pbhJVsZOiIbMdZ+ryQ=";
};
makefile = "Makefile";
meta = {
description = "Port of gpSP to libretro";
homepage = "https://github.com/libretro/gpsp";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "gw";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "gw-libretro";
rev = "435e5cfd4bf6aea03a84259e9b8dba3daf3ff5bd";
hash = "sha256-csaOqrZMSk9xZUlGAKgypV38q9XE7K6hLLdBC10g9Ao=";
};
makefile = "Makefile";
meta = {
description = "Port of Game and Watch to libretro";
homepage = "https://github.com/libretro/gw-libretro";
license = lib.licenses.zlib;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "handy";
version = "0-unstable-2025-06-16";
src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-handy";
rev = "fca239207e9c111da3e85d2faf0b1b9d7524e498";
hash = "sha256-8RpRhGgW5JWY6TZa9CEaXF66WpbjcjprorVqu+FGYu0=";
};
makefile = "Makefile";
meta = {
description = "Port of Handy to libretro";
homepage = "https://github.com/libretro/libretro-handy";
license = lib.licenses.zlib;
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
which,
}:
mkLibretroCore {
core = "hatari";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "hatari";
rev = "7008194d3f951a157997f67a820578f56f7feee0";
hash = "sha256-ZPzwUBaxs2ivE9n9cb5XB5mhixY9b6qIlq7OiVSLbqg=";
};
extraNativeBuildInputs = [ which ];
dontConfigure = true;
# zlib is already included in mkLibretroCore as buildInputs
makeFlags = [ "EXTERNAL_ZLIB=1" ];
meta = {
description = "Port of Hatari to libretro";
homepage = "https://github.com/libretro/hatari";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,39 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
python3,
alsa-lib,
libGLU,
libGL,
}:
mkLibretroCore {
core = "mame";
version = "0-unstable-2025-09-26";
src = fetchFromGitHub {
owner = "libretro";
repo = "mame";
rev = "61743c76180f1ad454227ed1be0261a071d37d67";
hash = "sha256-R7zBl8Y5tnG+CkFgyTdwlGlCLwG/9Svs3hsJJp12fOY=";
fetchSubmodules = true;
};
extraNativeBuildInputs = [ python3 ];
extraBuildInputs = [
alsa-lib
libGLU
libGL
];
# Setting this is breaking compilation of src/3rdparty/genie for some reason
makeFlags = [ "ARCH=" ];
meta = {
description = "Port of MAME to libretro";
homepage = "https://github.com/libretro/mame";
license = with lib.licenses; [
bsd3
gpl2Plus
];
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
stdenv,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mame2000";
version = "0-unstable-2024-07-01";
src = fetchFromGitHub {
owner = "libretro";
repo = "mame2000-libretro";
rev = "2ec60f6e1078cf9ba173e80432cc28fd4eea200f";
hash = "sha256-AYZj7bvO9oc7wmEBbj6DPRzpQFHl8diIcunSSpD4Vok=";
};
makefile = "Makefile";
makeFlags = lib.optional (!stdenv.hostPlatform.isx86) "IS_X86=0";
meta = {
description = "Port of MAME ~2000 to libretro, compatible with MAME 0.37b5 sets";
homepage = "https://github.com/libretro/mame2000-libretro";
# MAME license, non-commercial clause
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mame2003-plus";
version = "0-unstable-2025-09-30";
src = fetchFromGitHub {
owner = "libretro";
repo = "mame2003-plus-libretro";
rev = "59b8a9fb06a47a3ce6aecd09b07f3f001e3d9b08";
hash = "sha256-hfC/6UqUSDd2FWpcCVcw4pkAtyHJGCgvG4UKlkM+fpk=";
};
makefile = "Makefile";
meta = {
description = "Port of MAME ~2003+ to libretro, compatible with MAME 0.78 sets";
homepage = "https://github.com/libretro/mame2003-plus-libretro";
# MAME license, non-commercial clause
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mame2003";
version = "0-unstable-2025-08-26";
src = fetchFromGitHub {
owner = "libretro";
repo = "mame2003-libretro";
rev = "dfddf4db86a3acd5997ce9419c7afd00ff6587a0";
hash = "sha256-GJRawFdlHCfBRiErJJ3ZvZDF1gvYVkuQvKXV1qUCCRQ=";
};
# Fix build with GCC 14
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
makefile = "Makefile";
meta = {
description = "Port of MAME ~2003 to libretro, compatible with MAME 0.78 sets";
homepage = "https://github.com/libretro/mame2003-libretro";
# MAME license, non-commercial clause
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
stdenv,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mame2010";
version = "0-unstable-2024-10-23";
src = fetchFromGitHub {
owner = "libretro";
repo = "mame2010-libretro";
rev = "c5b413b71e0a290c57fc351562cd47ba75bac105";
hash = "sha256-p+uEhxjr/07YJxInhW7oJDr8KurD36JxnSfJo17FOxM=";
};
makefile = "Makefile";
makeFlags = lib.optionals stdenv.hostPlatform.isAarch64 [
"PTR64=1"
"ARM_ENABLED=1"
"X86_SH2DRC=0"
"FORCE_DRC_C_BACKEND=1"
];
meta = {
description = "Port of MAME ~2010 to libretro, compatible with MAME 0.139 sets";
homepage = "https://github.com/libretro/mame2010-libretro";
# MAME license, non-commercial clause
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
alsa-lib,
fetchFromGitHub,
mkLibretroCore,
python3,
}:
mkLibretroCore {
core = "mame2015";
version = "0-unstable-2023-10-31";
src = fetchFromGitHub {
owner = "libretro";
repo = "mame2015-libretro";
rev = "316cd06349f2b34b4719f04f7c0d07569a74c764";
hash = "sha256-CBN04Jf26SIk8mKWlui5spQGokBvgFUCvFiC8NoBGw0=";
};
patches = [ ./patches/mame2015-python311.patch ];
makeFlags = [ "PYTHON=python3" ];
extraNativeBuildInputs = [ python3 ];
extraBuildInputs = [ alsa-lib ];
makefile = "Makefile";
# Build failures when this is set to a bigger number
NIX_BUILD_CORES = 8;
meta = {
description = "Port of MAME ~2015 to libretro, compatible with MAME 0.160 sets";
homepage = "https://github.com/libretro/mame2015-libretro";
# MAME license, non-commercial clause
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
alsa-lib,
fetchFromGitHub,
mkLibretroCore,
python3,
rapidjson,
}:
mkLibretroCore {
core = "mame2016";
version = "0-unstable-2022-04-06";
src = fetchFromGitHub {
owner = "libretro";
repo = "mame2016-libretro";
rev = "01058613a0109424c4e7211e49ed83ac950d3993";
hash = "sha256-IsM7f/zlzvomVOYlinJVqZllUhDfy4NNTeTPtNmdVak=";
};
postPatch = ''
rm -r 3rdparty/rapidjson
ln -s ${lib.getInclude rapidjson} 3rdparty/rapidjson
'';
patches = [ ./patches/mame2016-python311.patch ];
extraNativeBuildInputs = [ python3 ];
extraBuildInputs = [ alsa-lib ];
makeFlags = [ "PYTHON_EXECUTABLE=python3" ];
env = {
# Build failures when this is set to a bigger number
NIX_BUILD_CORES = 8;
# Fix build errors in GCC 13
NIX_CFLAGS_COMPILE = "-Wno-error -fpermissive";
};
meta = {
description = "Port of MAME ~2016 to libretro, compatible with MAME 0.174 sets";
homepage = "https://github.com/libretro/mame2016-libretro";
license = with lib.licenses; [
bsd3
gpl2Plus
];
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
libGLU,
libGL,
}:
mkLibretroCore {
core = "melonds";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "melonds";
rev = "7a3c11ff970cd36ca806961fae6db94b30dd5401";
hash = "sha256-YGkRdth7qdATcZpJkBd5MGOJFG1AbeJhAnyir+ssZYA=";
};
extraBuildInputs = [
libGLU
libGL
];
makefile = "Makefile";
meta = {
description = "Port of MelonDS to libretro";
homepage = "https://github.com/libretro/melonds";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mesen-s";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "mesen-s";
rev = "d4fca31a6004041d99b02199688f84c009c55967";
hash = "sha256-mGGTLBRJCsNJg57LWSFndIv/LLzEmVRnv6gNbllkV/Y=";
};
makefile = "Makefile";
preBuild = "cd Libretro";
normalizeCore = false;
meta = {
description = "Port of Mesen-S to libretro";
homepage = "https://github.com/libretro/mesen-s";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mesen";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "mesen";
rev = "791c5e8153ee6e29691d45b5df2cf1151ff416f9";
hash = "sha256-PEEGJsyT+D/JwBxH2H9OY2MwaGt1i+1kmDZUT6zROic=";
};
makefile = "Makefile";
preBuild = "cd Libretro";
meta = {
description = "Port of Mesen to libretro";
homepage = "https://github.com/libretro/mesen";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "meteor";
version = "0-unstable-2020-12-28";
src = fetchFromGitHub {
owner = "libretro";
repo = "meteor-libretro";
rev = "e533d300d0561564451bde55a2b73119c768453c";
hash = "sha256-zMkgzUz2rk0SD5ojY4AqaDlNM4k4QxuUxVBRBcn6TqQ=";
};
makefile = "Makefile";
preBuild = "cd libretro";
meta = {
description = "Port of Meteor to libretro";
homepage = "https://github.com/libretro/meteor";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "mgba";
version = "0-unstable-2025-07-24";
src = fetchFromGitHub {
owner = "libretro";
repo = "mgba";
rev = "affc86e4c07b6e1e8363e0bc1c5ffb813a2e32c9";
hash = "sha256-4nKghnpMI1LuKOKc0vSknTuq+bA0wpBux/a5mGCyev8=";
};
meta = {
description = "Port of mGBA to libretro";
homepage = "https://github.com/libretro/mgba";
license = lib.licenses.mpl20;
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore rec {
core = "mrboom";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "Javanaise";
repo = "mrboom-libretro";
rev = "d011acfbdb2d93ed38bd684ccfa0db79bda1c932";
hash = "sha256-DjTSrp38MwdEtUZPTgZYEZHWgv48IN1oHkKsVqmOwII=";
fetchSubmodules = true;
};
makefile = "Makefile";
makeFlags = [ "GIT_VERSION=${builtins.substring 0 7 src.rev}" ];
meta = {
description = "Port of Mr.Boom to libretro";
homepage = "https://github.com/Javanaise/mrboom-libretro";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,67 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch2,
libGL,
libGLU,
libpng,
mkLibretroCore,
nasm,
xorg,
}:
mkLibretroCore {
core = "mupen64plus-next";
version = "0-unstable-2025-08-20";
src = fetchFromGitHub {
owner = "libretro";
repo = "mupen64plus-libretro-nx";
rev = "222acbd3f98391458a047874d0372fe78e14fe94";
hash = "sha256-esssh/0nxNUDW/eMDQbWEdcSPuqLjnKLkK4mKN17HjQ=";
};
# Fix for GCC 14
# https://github.com/libretro/mupen64plus-libretro-nx/pull/526
patches = [
(fetchpatch2 {
name = "minizip-avoid_trying_to_compile_problematic_code.patch";
url = "https://github.com/libretro/mupen64plus-libretro-nx/commit/2b05477dd9cd99e7f9425f58cb544f454fc0d813.patch?full_index=1";
hash = "sha256-Q0yymeS6taeFRt6BH6IX5q1SDUMh2Zn3mFpdJguyk9M=";
})
(fetchpatch2 {
name = "EmuThread-align_with_co_create()_and_pthread_create().patch";
url = "https://github.com/libretro/mupen64plus-libretro-nx/commit/26dfd670ffdd5ed6a03e6704dc73f82c13d81dd9.patch?full_index=1";
hash = "sha256-BraCR/b8DTmVAWrUxiXp9nxBYvTpTW9OQAt8TP1eusI=";
})
(fetchpatch2 {
name = "Fix_compilation_of_bundled_libzlib.patch";
url = "https://github.com/libretro/mupen64plus-libretro-nx/commit/3c3e7fbc70b8f533c09c964cf468ba5e8d61351c.patch?full_index=1";
hash = "sha256-PCJLNYhhccnWLcnPaHL6tz+5qdjogJRYfzZIh3r+Vlk=";
})
];
extraNativeBuildInputs = [
nasm
];
extraBuildInputs = [
libGLU
libGL
libpng
xorg.libX11
];
makefile = "Makefile";
makeFlags = [
"HAVE_PARALLEL_RDP=1"
"HAVE_PARALLEL_RSP=1"
"HAVE_THR_AL=1"
"LLE=1"
"WITH_DYNAREC=${stdenv.hostPlatform.parsed.cpu.name}"
];
meta = {
description = "Libretro port of Mupen64 Plus";
homepage = "https://github.com/libretro/mupen64plus-libretro-nx";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "neocd";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "neocd_libretro";
rev = "5eca2c8fd567b5261251c65ecafa8cf5b179d1d2";
hash = "sha256-72tmPCb7AXsamaQsMAPiYpgDR8DER2GTz4hcbN8wy7g=";
};
makefile = "Makefile";
meta = {
description = "NeoCD libretro port";
homepage = "https://github.com/libretro/neocd_libretro";
license = lib.licenses.lgpl3Only;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "nestopia";
version = "0-unstable-2025-08-14";
src = fetchFromGitHub {
owner = "libretro";
repo = "nestopia";
rev = "51ad831fcd9f10a02dcb0cbf398c2cd1b028765e";
hash = "sha256-4TMJfD9KUBo5qJNOdnSEq2oEftL8Fpak6tHOP+tuG2U=";
};
makefile = "Makefile";
preBuild = "cd libretro";
meta = {
description = "Nestopia libretro port";
homepage = "https://github.com/libretro/nestopia";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore rec {
core = "np2kai";
version = "0-unstable-2024-11-03";
src = fetchFromGitHub {
owner = "AZO234";
repo = "NP2kai";
rev = "4b109eaac4f79b04065ff5025319fce51537e04d";
hash = "sha256-tRFvK8d5Y/umy/b1BKN85ZSaDWyK95hII4RVng7A5uU=";
fetchSubmodules = true;
};
makeFlags = [
# See https://github.com/AZO234/NP2kai/tags
"NP2KAI_VERSION=rev.22"
"NP2KAI_HASH=${builtins.substring 0 7 src.rev}"
];
# Fix build with GCC 14
env.NIX_CFLAGS_COMPILE = toString [
"-Wno-error=incompatible-pointer-types"
"-Wno-error=int-conversion"
];
preBuild = "cd sdl";
meta = {
description = "Neko Project II kai libretro port";
homepage = "https://github.com/AZO234/NP2kai";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "nxengine";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "nxengine-libretro";
rev = "9adc032a5f6aa913d71d22042bb72cb11cf0f4a2";
hash = "sha256-8XjZp18lQU3xFNDjIuNsSHn7Mhba8Lze/IeRsy8/U1U=";
};
makefile = "Makefile";
meta = {
description = "NXEngine libretro port";
homepage = "https://github.com/libretro/nxengine-libretro";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "o2em";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-o2em";
rev = "3ba4231c1dc8dcdf487428712856b790d2e4b8f3";
hash = "sha256-HhTkFm9Jte4wDPxTcXRgCg2tCfdQvo0M3nHRhlPmz/w=";
};
makefile = "Makefile";
meta = {
description = "Port of O2EM to libretro";
homepage = "https://github.com/libretro/libretro-o2em";
license = lib.licenses.artistic1;
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
stdenv,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "opera";
version = "0-unstable-2024-10-16";
src = fetchFromGitHub {
owner = "libretro";
repo = "opera-libretro";
rev = "67a29e60a4d194b675c9272b21b61eaa022f3ba3";
hash = "sha256-8896EWNbzVyr3MS1jtWD3pLur7ZvAhhJmrwkW3ayzkU=";
};
makefile = "Makefile";
makeFlags = [ "CC_PREFIX=${stdenv.cc.targetPrefix}" ];
meta = {
description = "Opera is a port of 4DO/libfreedo to libretro";
homepage = "https://github.com/libretro/libretro-o2em";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchFromGitHub,
libGL,
libGLU,
libpng,
mkLibretroCore,
}:
mkLibretroCore {
core = "parallel-n64";
version = "0-unstable-2025-08-05";
src = fetchFromGitHub {
owner = "libretro";
repo = "parallel-n64";
rev = "50d3ddd55b5774da643d90d7ad1e3cbd2c618883";
hash = "sha256-l42EKrZH1JwTxpkjl8vTrMsd2NJCeKV9Owgj+EB81eM=";
};
extraBuildInputs = [
libGLU
libGL
libpng
];
makefile = "Makefile";
makeFlags = [
"HAVE_PARALLEL=1"
"HAVE_PARALLEL_RSP=1"
"ARCH=${stdenv.hostPlatform.parsed.cpu.name}"
];
postPatch = lib.optionalString stdenv.hostPlatform.isAarch64 ''
sed -i -e '1 i\CPUFLAGS += -DARM_FIX -DNO_ASM -DARM_ASM -DDONT_WANT_ARM_OPTIMIZATIONS -DARM64' Makefile \
&& sed -i -e 's,CPUFLAGS :=,,g' Makefile
'';
meta = {
description = "Parallel Mupen64plus rewrite for libretro";
homepage = "https://github.com/libretro/parallel-n64";
license = lib.licenses.gpl3Only;
badPlatforms = [
# ./mupen64plus-core/src/r4300/new_dynarec/arm64/linkage_aarch64.o: in function `.E12':
# (.text+0x5b4): relocation truncated to fit: R_AARCH64_CONDBR19 against symbol `invalidate_block' defined in .text section in ./mupen64plus-core/src/r4300/new_dynarec/new_dynarec_64.o
# collect2: error: ld returned 1 exit status
"aarch64-linux"
];
};
}

View File

@@ -0,0 +1,61 @@
diff --git a/src/emu/cpu/m6502/m6502make.py b/src/emu/cpu/m6502/m6502make.py
index da29fc722a..3de641dd69 100755
--- a/src/emu/cpu/m6502/m6502make.py
+++ b/src/emu/cpu/m6502/m6502make.py
@@ -16,7 +16,7 @@ def load_opcodes(fname):
opcodes = []
logging.info("load_opcodes: %s", fname)
try:
- f = open(fname, "rU")
+ f = open(fname, "r")
except Exception:
err = sys.exc_info()[1]
logging.error("cannot read opcodes file %s [%s]", fname, err)
@@ -39,7 +39,7 @@ def load_disp(fname):
logging.info("load_disp: %s", fname)
states = []
try:
- f = open(fname, "rU")
+ f = open(fname, "r")
except Exception:
err = sys.exc_info()[1]
logging.error("cannot read display file %s [%s]", fname, err)
diff --git a/src/emu/cpu/m6809/m6809make.py b/src/emu/cpu/m6809/m6809make.py
index c3d5b0f66e..79f6f90cdd 100644
--- a/src/emu/cpu/m6809/m6809make.py
+++ b/src/emu/cpu/m6809/m6809make.py
@@ -14,7 +14,7 @@ def load_file(fname, lines):
if path != "":
path += '/'
try:
- f = open(fname, "rU")
+ f = open(fname, "r")
except Exception:
err = sys.exc_info()[1]
sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
diff --git a/src/emu/cpu/mcs96/mcs96make.py b/src/emu/cpu/mcs96/mcs96make.py
index ec5ec37a78..7ab806a653 100644
--- a/src/emu/cpu/mcs96/mcs96make.py
+++ b/src/emu/cpu/mcs96/mcs96make.py
@@ -71,7 +71,7 @@ def __init__(self, fname, is_196):
self.ea = {}
self.macros = {}
try:
- f = open(fname, "rU")
+ f = open(fname, "r")
except Exception:
err = sys.exc_info()[1]
sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
diff --git a/src/emu/cpu/tms57002/tmsmake.py b/src/emu/cpu/tms57002/tmsmake.py
index 62092097d9..78f9fe43cd 100755
--- a/src/emu/cpu/tms57002/tmsmake.py
+++ b/src/emu/cpu/tms57002/tmsmake.py
@@ -326,7 +326,7 @@ def ins_cmp_dasm(a, b):
def LoadLst(filename):
instructions = []
ins = None
- for n, line in enumerate(open(filename, "rU")):
+ for n, line in enumerate(open(filename, "r")):
line = line.rstrip()
if not line and ins:
# new lines separate intructions

View File

@@ -0,0 +1,74 @@
diff --git a/scripts/build/verinfo.py b/scripts/build/verinfo.py
index a73d8ad268..82a80c0984 100644
--- a/scripts/build/verinfo.py
+++ b/scripts/build/verinfo.py
@@ -63,7 +63,7 @@ def extract_version(input):
build, outfmt, srcfile, dstfile = parse_args()
try:
- fp = open(srcfile, 'rU')
+ fp = open(srcfile, 'r')
except IOError:
sys.stderr.write("Unable to open source file '%s'\n" % srcfile)
sys.exit(1)
diff --git a/src/devices/cpu/m6502/m6502make.py b/src/devices/cpu/m6502/m6502make.py
index 8bcd85f8e2..557b175966 100755
--- a/src/devices/cpu/m6502/m6502make.py
+++ b/src/devices/cpu/m6502/m6502make.py
@@ -18,7 +18,7 @@ def load_opcodes(fname):
opcodes = []
logging.info("load_opcodes: %s", fname)
try:
- f = open(fname, "rU")
+ f = open(fname, "r")
except Exception:
err = sys.exc_info()[1]
logging.error("cannot read opcodes file %s [%s]", fname, err)
@@ -41,7 +41,7 @@ def load_disp(fname):
logging.info("load_disp: %s", fname)
states = []
try:
- f = open(fname, "rU")
+ f = open(fname, "r")
except Exception:
err = sys.exc_info()[1]
logging.error("cannot read display file %s [%s]", fname, err)
diff --git a/src/devices/cpu/m6809/m6809make.py b/src/devices/cpu/m6809/m6809make.py
index 8838b96019..e1ea25db06 100644
--- a/src/devices/cpu/m6809/m6809make.py
+++ b/src/devices/cpu/m6809/m6809make.py
@@ -16,7 +16,7 @@ def load_file(fname, lines):
if path != "":
path += '/'
try:
- f = open(fname, "rU")
+ f = open(fname, "r")
except Exception:
err = sys.exc_info()[1]
sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
diff --git a/src/devices/cpu/mcs96/mcs96make.py b/src/devices/cpu/mcs96/mcs96make.py
index b4844942e3..207208d2b6 100644
--- a/src/devices/cpu/mcs96/mcs96make.py
+++ b/src/devices/cpu/mcs96/mcs96make.py
@@ -73,7 +73,7 @@ def __init__(self, fname, is_196):
self.ea = {}
self.macros = {}
try:
- f = open(fname, "rU")
+ f = open(fname, "r")
except Exception:
err = sys.exc_info()[1]
sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err))
diff --git a/src/devices/cpu/tms57002/tmsmake.py b/src/devices/cpu/tms57002/tmsmake.py
index e2e12b5a4b..942ec09537 100755
--- a/src/devices/cpu/tms57002/tmsmake.py
+++ b/src/devices/cpu/tms57002/tmsmake.py
@@ -323,7 +323,7 @@ def AddInfo(self, line):
def LoadLst(filename):
instructions = []
ins = None
- for n, line in enumerate(open(filename, "rU")):
+ for n, line in enumerate(open(filename, "r")):
line = line.rstrip()
if not line and ins:
# new lines separate intructions

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "pcsx-rearmed";
version = "0-unstable-2025-08-16";
src = fetchFromGitHub {
owner = "libretro";
repo = "pcsx_rearmed";
rev = "228c14e10e9a8fae0ead8adf30daad2cdd8655b9";
hash = "sha256-89/1axjha8Pv2MVWIr1P3TGq43HwhHeUZRUHkes52tk=";
};
dontConfigure = true;
meta = {
description = "Port of PCSX ReARMed to libretro";
homepage = "https://github.com/libretro/pcsx_rearmed";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,62 @@
{
lib,
cmake,
fetchFromGitHub,
libGL,
libGLU,
mkLibretroCore,
perl,
pkg-config,
xz,
}:
mkLibretroCore {
core = "pcsx2";
version = "0-unstable-2025-09-29";
src = fetchFromGitHub {
owner = "libretro";
repo = "ps2";
rev = "9485a53fa5aa2bff17e04518116107f81a8c82e3";
hash = "sha256-xkRPESbLNX9AFOIdEA9iW4Xn7hdJXfdi+TEbegC8KXA=";
fetchSubmodules = true;
};
extraNativeBuildInputs = [
cmake
pkg-config
];
extraBuildInputs = [
libGL
libGLU
perl
xz
];
cmakeFlags = with lib.strings; [
# Workaround the following error:
# > CMake Error at 3rdparty/libzip/libzip/CMakeLists.txt:1 (cmake_minimum_required):
# > Compatibility with CMake < 3.5 has been removed from CMake.
#
# > Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
# > to tell CMake that the project requires at least <min> but has been updated
# > to work with policies introduced by <max> or earlier.
#
# > Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
(cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5")
# Explicitly set ARCH_FLAG to avoid -march=native
# https://github.com/libretro/ps2/blob/9485a53fa5aa2bff17e04518116107f81a8c82e3/cmake/BuildParameters.cmake#L106-L117
(cmakeFeature "ARCH_FLAG" "-msse4.1")
];
makefile = "Makefile";
preInstall = "cd bin";
meta = {
description = "Port of PCSX2 to libretro";
homepage = "https://github.com/libretro/ps2";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.x86;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "picodrive";
version = "0-unstable-2025-05-31";
src = fetchFromGitHub {
owner = "libretro";
repo = "picodrive";
rev = "975cdafb613e84e305f87b43e70d1e19df7e60e0";
hash = "sha256-hRM3DtaTVz35QEkUrPoNXHdS7TgazWIFKU1e+jjfigg=";
fetchSubmodules = true;
};
dontConfigure = true;
meta = {
description = "Fast MegaDrive/MegaCD/32X emulator";
homepage = "https://github.com/libretro/picodrive";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,53 @@
{
lib,
boost,
bzip2,
cmake,
curl,
fetchFromGitHub,
icu,
libGL,
libGLU,
mkLibretroCore,
openssl,
xorg,
}:
mkLibretroCore {
core = "play";
version = "0-unstable-2025-09-22";
src = fetchFromGitHub {
owner = "jpd002";
repo = "Play-";
rev = "a3d84f977b721cda752299739fec525addce1ef9";
hash = "sha256-NVuz52c0zt/c8b3uoJWpKO2TMM9PFh/thQt8CfRFZhk=";
fetchSubmodules = true;
};
extraBuildInputs = [
boost
bzip2
curl
openssl
icu
libGL
libGLU
xorg.libX11
];
extraNativeBuildInputs = [ cmake ];
makefile = "Makefile";
cmakeFlags = [
"-DBUILD_PLAY=OFF"
"-DBUILD_LIBRETRO_CORE=ON"
];
postBuild = "cd Source/ui_libretro";
# FIXME: workaround the following GCC 13 error:
# error: 'printf' was not declared in this scop
env.CXXFLAGS = "-include cstdio";
meta = {
description = "Port of Play! to libretro";
homepage = "https://github.com/jpd002/Play-";
license = lib.licenses.bsd2;
};
}

View File

@@ -0,0 +1,59 @@
{
lib,
cmake,
fetchFromGitHub,
libGL,
libGLU,
libzip,
mkLibretroCore,
pkg-config,
python3,
snappy,
xorg,
}:
mkLibretroCore {
core = "ppsspp";
version = "0-unstable-2025-09-30";
src = fetchFromGitHub {
owner = "hrydgard";
repo = "ppsspp";
rev = "2f4b1adc98d36a4d3fdd0a413d65a7a0b306ed4c";
hash = "sha256-9azuw2uCwc1cpqnrqCBGp4uS2AHOc2gBJIaOTSullvs=";
fetchSubmodules = true;
};
extraNativeBuildInputs = [
cmake
pkg-config
python3
];
extraBuildInputs = [
libGLU
libGL
libzip
snappy
xorg.libX11
];
makefile = "Makefile";
cmakeFlags = [
"-DLIBRETRO=ON"
# USE_SYSTEM_FFMPEG=ON causes several glitches during video playback
# See: https://github.com/NixOS/nixpkgs/issues/304616
"-DUSE_SYSTEM_FFMPEG=OFF"
"-DUSE_SYSTEM_SNAPPY=ON"
"-DUSE_SYSTEM_LIBZIP=ON"
"-DOpenGL_GL_PREFERENCE=GLVND"
];
postBuild = "cd lib";
meta = {
description = "PPSSPP libretro port";
homepage = "https://github.com/hrydgard/ppsspp";
license = lib.licenses.gpl2Plus;
badPlatforms = [
# error: cannot convert 'uint32x4_t' to 'int' in initialization
"aarch64-linux"
];
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "prboom";
version = "0-unstable-2024-12-27";
src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-prboom";
rev = "b3e5f8b2e8855f9c6fc7ff7a0036e4e61379177d";
hash = "sha256-FtPn54s/QUu8fjeUBaAQMZ6EWAixV+gawuCv2eM+qrs=";
};
makefile = "Makefile";
meta = {
description = "Prboom libretro port";
homepage = "https://github.com/libretro/libretro-prboom";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "prosystem";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "prosystem-libretro";
rev = "acae250da8d98b8b9707cd499e2a0bf6d8500652";
hash = "sha256-AGF3K3meZEEsnzHmMTCsFXBGNvWVELH8a8qET07kP0o=";
};
makefile = "Makefile";
meta = {
description = "Port of ProSystem to libretro";
homepage = "https://github.com/libretro/prosystem-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "puae";
version = "0-unstable-2025-08-19";
src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-uae";
rev = "9e2aa770a9b6b0a4e1f4fc05eb0db6c8e7aba8ee";
hash = "sha256-YTS0OgYJCGawpsDHvU79dDA+iePna5Fcab2Le3vdVSk=";
};
makefile = "Makefile";
meta = {
description = "Amiga emulator based on WinUAE";
homepage = "https://github.com/libretro/libretro-uae";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "quicknes";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "QuickNES_Core";
rev = "dbf19f73e3eb9701d1c7f5898f57c097e05c9fbd";
hash = "sha256-oFQUMp1imc8JCsQYCy1BtIUmTC+u0VcoYHpWzUpKNb4=";
};
makefile = "Makefile";
meta = {
description = "QuickNES libretro port";
homepage = "https://github.com/libretro/QuickNES_Core";
license = lib.licenses.lgpl21Plus;
};
}

View File

@@ -0,0 +1,50 @@
{
lib,
alsa-lib,
fetchFromGitHub,
fetchpatch2,
libGL,
libGLU,
mkLibretroCore,
portaudio,
python3,
xorg,
}:
mkLibretroCore {
core = "same_cdi";
version = "0-unstable-2025-01-31";
src = fetchFromGitHub {
owner = "libretro";
repo = "same_cdi";
rev = "7ee1d8e9cb4307b7cd44ee1dd757e9b3f48f41d5";
hash = "sha256-EGE3NuO0gpZ8MKPypH8rFwJiv4QsdKuIyLKVuKTcvws=";
};
patches = [
(fetchpatch2 {
# https://github.com/libretro/same_cdi/pull/19
name = "Fixes_compilation_errors_as_per_issue_9.patch";
url = "https://github.com/libretro/same_cdi/commit/bf3212315546cdd514118a4f3ea764fd9c401091.patch?full_index=1";
hash = "sha256-1vrMxnRtEWUt+6I/4PSfCPDIUAGKkXFd2UVr9473ngo=";
})
];
extraNativeBuildInputs = [ python3 ];
extraBuildInputs = [
alsa-lib
libGL
libGLU
portaudio
xorg.libX11
];
meta = {
description = "SAME_CDI is a libretro core to play CD-i games";
homepage = "https://github.com/libretro/same_cdi";
license = with lib.licenses; [
bsd3
gpl2Plus
];
};
}

View File

@@ -0,0 +1,31 @@
{
lib,
fetchFromGitHub,
hexdump,
mkLibretroCore,
which,
}:
mkLibretroCore {
core = "sameboy";
version = "0-unstable-2024-06-28";
src = fetchFromGitHub {
owner = "libretro";
repo = "sameboy";
rev = "51433012a871a44555492273fd22f29867d12655";
hash = "sha256-vPT2uRGbXmJ62yig/yk485/TxEEKHJeWdNrM2c0IjKw=";
};
extraNativeBuildInputs = [
which
hexdump
];
preBuild = "cd libretro";
makefile = "Makefile";
meta = {
description = "QuickNES libretro port";
homepage = "https://github.com/libretro/QuickNES_Core";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,63 @@
{
lib,
fetchFromGitHub,
libGL,
libGLU,
which,
zip,
mkLibretroCore,
}:
let
# https://github.com/libretro/scummvm/blob/master/backends/platform/libretro/dependencies.mk#L8-L14
libretro-common-src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-common";
rev = "70ed90c42ddea828f53dd1b984c6443ddb39dbd6";
hash = "sha256-ItsUNbJCK/m/3VprK/zHD2UF5MhPC8b7jM3qS/oHU2A=";
};
libretro-deps-src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-deps";
rev = "abf5246b016569759e7d1b0ea91bb98c2e34d160";
hash = "sha256-tdGytbSNMCfMuXIAUunOSVw9qFq2rRaruELhZwEmhWE=";
};
in
mkLibretroCore {
core = "scummvm";
version = "0-unstable-2025-07-03";
src = fetchFromGitHub {
owner = "libretro";
repo = "scummvm";
rev = "686cdd13719b92554fa46b264c512ca7deec7a96";
hash = "sha256-3w1rYVPX7ENGUgKdrFRQShWoEXfagxdtzd98m1hKeYU=";
};
extraBuildInputs = [
libGL
libGLU
zip
];
extraNativeBuildInputs = [ which ];
preConfigure = "cd backends/platform/libretro";
preBuild = ''
mkdir -p deps/libretro-{common,deps}
cp -a ${libretro-common-src}/* deps/libretro-common
cp -a ${libretro-deps-src}/* deps/libretro-deps
chmod -R u+w deps/
patchShebangs ./scripts/*
'';
makefile = "Makefile";
meta = {
description = "Libretro port of ScummVM";
homepage = "https://github.com/libretro/scummvm";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "smsplus";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "smsplus-gx";
rev = "c642bbd0680b5959180a420036108893d0aec961";
hash = "sha256-SHBrwzLyVZ4Tp/kVCnr4xj2B3pmdg+JUmZUM7hYao64=";
};
meta = {
description = "SMS Plus GX libretro port";
homepage = "https://github.com/libretro/smsplus-gx";
license = lib.licenses.gpl2Plus;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "snes9x";
version = "0-unstable-2025-09-24";
src = fetchFromGitHub {
owner = "snes9xgit";
repo = "snes9x";
rev = "94115094ead4da7342bd638bb4cc293ae7d297c0";
hash = "sha256-tXSQursZcV/gsLlydVRD1KUR8t2zztfby7cDno1xtHc=";
};
makefile = "Makefile";
preBuild = "cd libretro";
meta = {
description = "Port of SNES9x git to libretro";
homepage = "https://github.com/snes9xgit/snes9x";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "snes9x2002";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "snes9x2002";
rev = "a0709ec7dcd6de2fbebb43106bd757b649e3b7cf";
hash = "sha256-rrMPhXIsQ48fVvjgZgC3xeqm9k9kwe43oZNzs2d/h1Q=";
};
makefile = "Makefile";
meta = {
description = "Optimized port/rewrite of SNES9x 1.39 to Libretro";
homepage = "https://github.com/libretro/snes9x2002";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
withBlarggAPU ? false,
}:
mkLibretroCore {
core = "snes9x2005" + lib.optionalString withBlarggAPU "-plus";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "snes9x2005";
rev = "74d871db9b4dba6dbe6c5ecebc88cbf255be5349";
hash = "sha256-YlRMjSEo9sdLVRzWGSJlnBeqg6wUhZi8l3ffzUaKQIQ=";
};
makefile = "Makefile";
makeFlags = lib.optionals withBlarggAPU [ "USE_BLARGG_APU=1" ];
meta = {
description = "Optimized port/rewrite of SNES9x 1.43 to Libretro";
homepage = "https://github.com/libretro/snes9x2005";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore rec {
core = "snes9x2010";
version = "0-unstable-2024-11-19";
src = fetchFromGitHub {
owner = "libretro";
repo = "snes9x2010";
rev = "f9ae8fd28b13070a945a829ccf41cbf90a21d0f7";
hash = "sha256-nsExAYnzDenPvXzeN60jGykRTrCGMi/mRPV+vgS8ZtE=";
};
makeFlags = [ "GIT_VERSION=${builtins.substring 0 7 src.rev}" ];
meta = {
description = "Optimized port/rewrite of SNES9x 1.52+ to Libretro";
homepage = "https://github.com/libretro/snes9x2010";
license = lib.licenses.unfreeRedistributable;
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "stella";
version = "0-unstable-2025-08-28";
src = fetchFromGitHub {
owner = "stella-emu";
repo = "stella";
rev = "749a21f653cf85fcedf4fe514ac8df1ad308be8e";
hash = "sha256-N5E+Ci6cTvG9/Yqg5NdPZB00ThNKc6SS7qCWlmCYd6I=";
};
makefile = "Makefile";
preBuild = "cd src/os/libretro";
dontConfigure = true;
meta = {
description = "Port of Stella to libretro";
homepage = "https://github.com/stella-emu/stella";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "stella2014";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "stella2014-libretro";
rev = "3cc89f0d316d6c924a5e3f4011d17421df58e615";
hash = "sha256-2gnFWau7F45SdzoqDUlqYXfXVE1EUPozHZv7BhyRRIA=";
};
makefile = "Makefile";
meta = {
description = "Port of Stella ~2014 to libretro";
homepage = "https://github.com/libretro/stella2014-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
cmake,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "swanstation";
version = "0-unstable-2025-08-02";
src = fetchFromGitHub {
owner = "libretro";
repo = "swanstation";
rev = "4d309c05fd7bdc503d91d267bd542edb8d192b09";
hash = "sha256-v51xgsyVtyipss0VWqMTI69MLTJ4Eb37hJfbQfid/0Q=";
};
extraNativeBuildInputs = [ cmake ];
makefile = "Makefile";
cmakeFlags = [
"-DBUILD_LIBRETRO_CORE=ON"
];
meta = {
description = "Port of SwanStation (a fork of DuckStation) to libretro";
homepage = "https://github.com/libretro/swanstation";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "tgbdual";
version = "0-unstable-2025-05-10";
src = fetchFromGitHub {
owner = "libretro";
repo = "tgbdual-libretro";
rev = "933707c0ba8f12360f6d79712f735a917713709a";
hash = "sha256-58OLuF14aSJGhmXR0RGgPpuHLXYk9LOz7LX03AEFPr4=";
};
makefile = "Makefile";
meta = {
description = "Port of TGBDual to libretro";
homepage = "https://github.com/libretro/tgbdual-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
cmake,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "thepowdertoy";
version = "0-unstable-2025-09-16";
src = fetchFromGitHub {
owner = "libretro";
repo = "ThePowderToy";
rev = "cb3cd4c2e5beddb98b34e6b800fa24e8f96322d9";
hash = "sha256-k3XWkkSuQC3IBhhI96qkTrlGH/oJu941HaAvR28V5i0=";
};
extraNativeBuildInputs = [ cmake ];
makefile = "Makefile";
postBuild = "cd src";
meta = {
description = "Port of The Powder Toy to libretro";
homepage = "https://github.com/libretro/ThePowderToy";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
cmake,
fetchFromGitHub,
mkLibretroCore,
pkg-config,
}:
mkLibretroCore {
core = "tic80";
version = "0-unstable-2024-05-13";
src = fetchFromGitHub {
owner = "libretro";
repo = "tic-80";
rev = "6412f72d0f4725c153ce3d245729b829e713542e";
hash = "sha256-RFp8sTSRwD+cgW3EYk3nBeY+zVKgZVQI5mjtfe2a64Q=";
fetchSubmodules = true;
};
extraNativeBuildInputs = [
cmake
pkg-config
];
makefile = "Makefile";
cmakeFlags = [
"-DBUILD_LIBRETRO=ON"
"-DBUILD_DEMO_CARTS=OFF"
"-DBUILD_PRO=OFF"
"-DBUILD_PLAYER=OFF"
"-DBUILD_SDL=OFF"
"-DBUILD_SOKOL=OFF"
];
preConfigure = "cd core";
postBuild = "cd lib";
meta = {
description = "Port of TIC-80 to libretro";
homepage = "https://github.com/libretro/tic-80";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "2048";
version = "0-unstable-2024-12-27";
src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-2048";
rev = "86e02d3c2dd76858db7370f5df1ccfc33b3abee1";
hash = "sha256-k3te3XZCw86NkqXpjZaYWi4twUvh9UBkiPyqposLTEs=";
};
meta = {
description = "Port of 2048 puzzle game to libretro";
homepage = "https://github.com/libretro/libretro-2048";
license = lib.licenses.unlicense;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "vbam";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "vbam-libretro";
rev = "379dd97301458a51fb69dd93ba21b64f81e01ef2";
hash = "sha256-UbXSHdKfa91MpcYityo+aILbI0DfkLqZh8YfGcRx/BI=";
};
makefile = "Makefile";
preBuild = "cd src/libretro";
meta = {
description = "VBA-M libretro port";
homepage = "https://github.com/libretro/vbam-libretro";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "vba-next";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "vba-next";
rev = "d0ec7f3e209a91b903bb9d2c2397fef2bb3cca32";
hash = "sha256-g3Eb1bMGjt+H7awUlMCtKVu223+UvyQ2VBh8aQG1yo8=";
};
meta = {
description = "VBA-M libretro port with modifications for speed";
homepage = "https://github.com/libretro/vba-next";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
fetchFromGitHub,
libGL,
libGLU,
mkLibretroCore,
}:
mkLibretroCore {
core = "vecx";
version = "0-unstable-2025-04-12";
src = fetchFromGitHub {
owner = "libretro";
repo = "libretro-vecx";
rev = "841229a6a81a0461d08af6488f252dcec5266c6a";
hash = "sha256-bWhXXJCf/ax7n/sOfXibGvcFnCnmULcALoBR1uyIN+I=";
};
extraBuildInputs = [
libGL
libGLU
];
meta = {
description = "VBA-M libretro port with modifications for speed";
homepage = "https://github.com/libretro/libretro-vecx";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
type ? "x64",
}:
mkLibretroCore {
core = "vice-${type}";
version = "0-unstable-2025-07-30";
src = fetchFromGitHub {
owner = "libretro";
repo = "vice-libretro";
rev = "e9f8ac034ddef3025f0567768f7af8219f7cfdb8";
hash = "sha256-Rut9NyBF0yPFDYtFKzvSESaZL6CFhfcw6OFIHMeuzHk=";
};
makefile = "Makefile";
env = {
EMUTYPE = "${type}";
};
meta = {
description = "Port of vice to libretro";
homepage = "https://github.com/libretro/vice-libretro";
license = lib.licenses.gpl2;
};
}

View File

@@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "virtualjaguar";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "virtualjaguar-libretro";
rev = "48096c1f6f8b98cfff048a5cb4e6a86686631072";
hash = "sha256-DLBQQARHqupGGQS8YznDSSMuxQliyt5apGA4Ku2jlYo=";
};
makefile = "Makefile";
meta = {
description = "Port of VirtualJaguar to libretro";
homepage = "https://github.com/libretro/virtualjaguar-libretro";
license = lib.licenses.gpl3Only;
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
stdenv,
fetchFromGitHub,
mkLibretroCore,
}:
mkLibretroCore {
core = "yabause";
version = "0-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "libretro";
repo = "yabause";
rev = "c35712c5ed33e18d77097f2059a036e19d1d66f2";
hash = "sha256-4/gxWNPkGKBf4ti7ZF4GXgng6ZPyM9prrvK0S5tZ6V8=";
};
makefile = "Makefile";
# Disable SSE for non-x86. DYNAREC doesn't build on aarch64.
makeFlags = lib.optional (!stdenv.hostPlatform.isx86) "HAVE_SSE=0";
preBuild = "cd yabause/src/libretro";
meta = {
description = "Port of Yabause to libretro";
homepage = "https://github.com/libretro/yabause";
license = lib.licenses.gpl2Only;
};
}

View File

@@ -0,0 +1,215 @@
{
lib,
newScope,
}:
lib.makeScope newScope (self: {
mkLibretroCore = self.callPackage ./mkLibretroCore.nix { };
atari800 = self.callPackage ./cores/atari800.nix { };
beetle-gba = self.callPackage ./cores/beetle-gba.nix { };
beetle-lynx = self.callPackage ./cores/beetle-lynx.nix { };
beetle-ngp = self.callPackage ./cores/beetle-ngp.nix { };
beetle-pce = self.callPackage ./cores/beetle-pce.nix { };
beetle-pce-fast = self.callPackage ./cores/beetle-pce-fast.nix { };
beetle-pcfx = self.callPackage ./cores/beetle-pcfx.nix { };
beetle-psx = self.callPackage ./cores/beetle-psx.nix { };
beetle-psx-hw = self.beetle-psx.override { withHw = true; };
beetle-saturn = self.callPackage ./cores/beetle-saturn.nix { };
beetle-supafaust = self.callPackage ./cores/beetle-supafaust.nix { };
beetle-supergrafx = self.callPackage ./cores/beetle-supergrafx.nix { };
beetle-vb = self.callPackage ./cores/beetle-vb.nix { };
beetle-wswan = self.callPackage ./cores/beetle-wswan.nix { };
blastem = self.callPackage ./cores/blastem.nix { };
bluemsx = self.callPackage ./cores/bluemsx.nix { };
bsnes = self.callPackage ./cores/bsnes.nix { };
bsnes-hd = self.callPackage ./cores/bsnes-hd.nix { };
bsnes-mercury = self.callPackage ./cores/bsnes-mercury.nix { };
bsnes-mercury-balanced = self.bsnes-mercury.override { withProfile = "balanced"; };
bsnes-mercury-performance = self.bsnes-mercury.override { withProfile = "performance"; };
citra = self.callPackage ./cores/citra.nix { };
desmume = self.callPackage ./cores/desmume.nix { };
desmume2015 = self.callPackage ./cores/desmume2015.nix { };
dolphin = self.callPackage ./cores/dolphin.nix { };
dosbox = self.callPackage ./cores/dosbox.nix { };
dosbox-pure = self.callPackage ./cores/dosbox-pure.nix { };
easyrpg = self.callPackage ./cores/easyrpg.nix { };
eightyone = self.callPackage ./cores/eightyone.nix { };
fbalpha2012 = self.callPackage ./cores/fbalpha2012.nix { };
fbneo = self.callPackage ./cores/fbneo.nix { };
fceumm = self.callPackage ./cores/fceumm.nix { };
flycast = self.callPackage ./cores/flycast.nix { };
fmsx = self.callPackage ./cores/fmsx.nix { };
freeintv = self.callPackage ./cores/freeintv.nix { };
fuse = self.callPackage ./cores/fuse.nix { };
gambatte = self.callPackage ./cores/gambatte.nix { };
genesis-plus-gx = self.callPackage ./cores/genesis-plus-gx.nix { };
gpsp = self.callPackage ./cores/gpsp.nix { };
gw = self.callPackage ./cores/gw.nix { };
handy = self.callPackage ./cores/handy.nix { };
hatari = self.callPackage ./cores/hatari.nix { };
mame = self.callPackage ./cores/mame.nix { };
mame2000 = self.callPackage ./cores/mame2000.nix { };
mame2003 = self.callPackage ./cores/mame2003.nix { };
mame2003-plus = self.callPackage ./cores/mame2003-plus.nix { };
mame2010 = self.callPackage ./cores/mame2010.nix { };
mame2015 = self.callPackage ./cores/mame2015.nix { };
mame2016 = self.callPackage ./cores/mame2016.nix { };
melonds = self.callPackage ./cores/melonds.nix { };
mesen = self.callPackage ./cores/mesen.nix { };
mesen-s = self.callPackage ./cores/mesen-s.nix { };
meteor = self.callPackage ./cores/meteor.nix { };
mgba = self.callPackage ./cores/mgba.nix { };
mrboom = self.callPackage ./cores/mrboom.nix { };
mupen64plus = self.callPackage ./cores/mupen64plus.nix { };
neocd = self.callPackage ./cores/neocd.nix { };
nestopia = self.callPackage ./cores/nestopia.nix { };
np2kai = self.callPackage ./cores/np2kai.nix { };
nxengine = self.callPackage ./cores/nxengine.nix { };
o2em = self.callPackage ./cores/o2em.nix { };
opera = self.callPackage ./cores/opera.nix { };
parallel-n64 = self.callPackage ./cores/parallel-n64.nix { };
pcsx2 = self.callPackage ./cores/pcsx2.nix { };
pcsx-rearmed = self.callPackage ./cores/pcsx-rearmed.nix { };
pcsx_rearmed = lib.lowPrio (self.pcsx-rearmed); # added 2024-11-20
picodrive = self.callPackage ./cores/picodrive.nix { };
play = self.callPackage ./cores/play.nix { };
ppsspp = self.callPackage ./cores/ppsspp.nix { };
prboom = self.callPackage ./cores/prboom.nix { };
prosystem = self.callPackage ./cores/prosystem.nix { };
puae = self.callPackage ./cores/puae.nix { };
quicknes = self.callPackage ./cores/quicknes.nix { };
same_cdi = self.callPackage ./cores/same_cdi.nix { }; # the name is not a typo
sameboy = self.callPackage ./cores/sameboy.nix { };
scummvm = self.callPackage ./cores/scummvm.nix { };
smsplus-gx = self.callPackage ./cores/smsplus-gx.nix { };
snes9x = self.callPackage ./cores/snes9x.nix { };
snes9x2002 = self.callPackage ./cores/snes9x2002.nix { };
snes9x2005 = self.callPackage ./cores/snes9x2005.nix { };
snes9x2005-plus = self.snes9x2005.override { withBlarggAPU = true; };
snes9x2010 = self.callPackage ./cores/snes9x2010.nix { };
stella = self.callPackage ./cores/stella.nix { };
stella2014 = self.callPackage ./cores/stella2014.nix { };
swanstation = self.callPackage ./cores/swanstation.nix { };
tgbdual = self.callPackage ./cores/tgbdual.nix { };
thepowdertoy = self.callPackage ./cores/thepowdertoy.nix { };
tic80 = self.callPackage ./cores/tic80.nix { };
twenty-fortyeight = self.callPackage ./cores/twenty-fortyeight.nix { };
vba-m = self.callPackage ./cores/vba-m.nix { };
vba-next = self.callPackage ./cores/vba-next.nix { };
vecx = self.callPackage ./cores/vecx.nix { };
vice-x64 = self.callPackage ./cores/vice.nix { type = "x64"; };
vice-x128 = self.callPackage ./cores/vice.nix { type = "x128"; };
vice-x64dtv = self.callPackage ./cores/vice.nix { type = "x64dtv"; };
vice-x64sc = self.callPackage ./cores/vice.nix { type = "x64sc"; };
vice-xcbm2 = self.callPackage ./cores/vice.nix { type = "xcbm2"; };
vice-xcbm5x0 = self.callPackage ./cores/vice.nix { type = "xcbm5x0"; };
vice-xpet = self.callPackage ./cores/vice.nix { type = "xpet"; };
vice-xplus4 = self.callPackage ./cores/vice.nix { type = "xplus4"; };
vice-xscpu64 = self.callPackage ./cores/vice.nix { type = "xscpu64"; };
vice-xvic = self.callPackage ./cores/vice.nix { type = "xvic"; };
virtualjaguar = self.callPackage ./cores/virtualjaguar.nix { };
yabause = self.callPackage ./cores/yabause.nix { };
})

View File

@@ -0,0 +1,101 @@
{
# Deps
lib,
stdenv,
makeWrapper,
retroarch-bare,
unstableGitUpdater,
zlib,
}:
lib.extendMkDerivation {
constructDrv = stdenv.mkDerivation;
excludeDrvArgNames = [
"core"
"extraBuildInputs"
"extraNativeBuildInputs"
"libretroCore"
"normalizeCore"
];
extendDrvArgs =
finalAttrs:
{
core,
enableParallelBuilding ? true,
extraBuildInputs ? [ ],
extraNativeBuildInputs ? [ ],
makeFlags ? [ ],
makefile ? "Makefile.libretro",
meta ? { },
passthru ? { },
strictDeps ? true,
## Location of resulting RetroArch core on $out
libretroCore ? "/lib/retroarch/cores",
## The core filename is derived from the core name
## Setting `normalizeCore` to `true` will convert `-` to `_` on the core filename
normalizeCore ? true,
...
}:
let
d2u = if normalizeCore then (lib.replaceStrings [ "-" ] [ "_" ]) else (x: x);
coreDir = placeholder "out" + libretroCore;
coreFilename = "${d2u core}_libretro${stdenv.hostPlatform.extensions.sharedLibrary}";
mainProgram = "retroarch-${core}";
in
{
pname = "libretro-${core}";
buildInputs = [ zlib ] ++ extraBuildInputs;
nativeBuildInputs = [ makeWrapper ] ++ extraNativeBuildInputs;
inherit enableParallelBuilding makefile strictDeps;
makeFlags = [
"platform=${
{
linux = "unix";
darwin = "osx";
windows = "win";
}
.${stdenv.hostPlatform.parsed.kernel.name} or stdenv.hostPlatform.parsed.kernel.name
}"
"ARCH=${
{
armv7l = "arm";
armv6l = "arm";
aarch64 = "arm64";
i686 = "x86";
}
.${stdenv.hostPlatform.parsed.cpu.name} or stdenv.hostPlatform.parsed.cpu.name
}"
]
++ makeFlags;
installPhase = ''
runHook preInstall
install -Dt ${coreDir} ${coreFilename}
makeWrapper ${retroarch-bare}/bin/retroarch $out/bin/${mainProgram} \
--add-flags "-L ${coreDir}/${coreFilename}"
runHook postInstall
'';
passthru = {
inherit core libretroCore;
# libretro repos sometimes has a fake tag like "Current", ignore
# it by setting hardcodeZeroVersion
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
}
// passthru;
meta = {
inherit mainProgram;
inherit (retroarch-bare.meta) platforms;
teams = [ lib.teams.libretro ];
}
// meta;
};
}