From b8b32a6426fb60c711470b6a281b77f007305ea3 Mon Sep 17 00:00:00 2001 From: Ruin0x11 Date: Mon, 19 Feb 2024 15:59:05 +0000 Subject: [PATCH 1/2] libretro: add easyrpg core --- .../emulators/retroarch/cores.nix | 36 +++++++++++++++++++ .../emulators/retroarch/hashes.json | 11 ++++++ .../emulators/retroarch/update_cores.py | 1 + 3 files changed, 48 insertions(+) diff --git a/pkgs/applications/emulators/retroarch/cores.nix b/pkgs/applications/emulators/retroarch/cores.nix index c981f07114ab..72925c0acb79 100644 --- a/pkgs/applications/emulators/retroarch/cores.nix +++ b/pkgs/applications/emulators/retroarch/cores.nix @@ -7,10 +7,14 @@ , cmake , curl , fetchFromGitHub +, fetchpatch , ffmpeg , ffmpeg_4 , fluidsynth +, fmt +, freetype , gettext +, harfbuzz , hexdump , hidapi , icu @@ -19,21 +23,28 @@ , libGL , libGLU , libjpeg +, liblcf , libpcap , libpng +, libsndfile , libvorbis , libxml2 +, libxmp , libzip , makeWrapper +, mpg123 , nasm , openssl +, opusfile , pcre +, pixman , pkg-config , portaudio , python3 , retroarch , sfml , snappy +, speexdsp , udev , which , xorg @@ -400,6 +411,31 @@ in }; }; + easyrpg = mkLibretroCore { + core = "easyrpg"; + extraNativeBuildInputs = [ cmake pkg-config ]; + extraBuildInputs = [ fmt freetype harfbuzz liblcf libpng libsndfile libvorbis libxmp mpg123 opusfile pcre pixman speexdsp ]; + patches = [ + # Fixed compatibility with fmt > 9 + # Remove when version > 0.8 + (fetchpatch { + name = "0001-Fix-building-with-fmtlib-10.patch"; + url = "https://github.com/EasyRPG/Player/commit/ab6286f6d01bada649ea52d1f0881dde7db7e0cf.patch"; + hash = "sha256-GdSdVFEG1OJCdf2ZIzTP+hSrz+ddhTMBvOPjvYQHy54="; + }) + ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DPLAYER_TARGET_PLATFORM=libretro" + "-DCMAKE_INSTALL_DATADIR=${placeholder "out"}/share" + ]; + makefile = "Makefile"; + meta = { + description = "EasyRPG Player libretro port"; + license = lib.licenses.gpl3Only; + }; + }; + eightyone = mkLibretroCore { core = "81"; repo = "eightyone"; diff --git a/pkgs/applications/emulators/retroarch/hashes.json b/pkgs/applications/emulators/retroarch/hashes.json index 60bbcff311ad..4690bbf6fc8a 100644 --- a/pkgs/applications/emulators/retroarch/hashes.json +++ b/pkgs/applications/emulators/retroarch/hashes.json @@ -251,6 +251,17 @@ }, "version": "unstable-2023-12-29" }, + "easyrpg": { + "fetcher": "fetchFromGitHub", + "src": { + "owner": "EasyRPG", + "repo": "Player", + "rev": "f8e41f43b619413f95847536412b56f85307d378", + "hash": "sha256-nvWM4czTv/GxY9raomBEn7dmKBeLtSA9nvjMJxc3Q8s=", + "fetchSubmodules": true + }, + "version": "unstable-2023-04-29" + }, "eightyone": { "fetcher": "fetchFromGitHub", "src": { diff --git a/pkgs/applications/emulators/retroarch/update_cores.py b/pkgs/applications/emulators/retroarch/update_cores.py index 1795c0f70edc..e45f4464d6f6 100755 --- a/pkgs/applications/emulators/retroarch/update_cores.py +++ b/pkgs/applications/emulators/retroarch/update_cores.py @@ -50,6 +50,7 @@ CORES = { "dolphin": {"repo": "dolphin"}, "dosbox": {"repo": "dosbox-libretro"}, "dosbox-pure": {"repo": "dosbox-pure", "owner": "schellingb"}, + "easyrpg": {"repo": "Player", "owner": "EasyRPG", "fetch_submodules": True, "rev": "0.8"}, "eightyone": {"repo": "81-libretro"}, "fbalpha2012": {"repo": "fbalpha2012"}, "fbneo": {"repo": "fbneo"}, From bf5a14fb08a416e488ef110dfd7f2c95ebff50ee Mon Sep 17 00:00:00 2001 From: Ruin0x11 Date: Mon, 19 Feb 2024 18:29:35 +0000 Subject: [PATCH 2/2] libretro: add comments about easyrpg core build process --- pkgs/applications/emulators/retroarch/cores.nix | 5 +++-- pkgs/applications/emulators/retroarch/update_cores.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/emulators/retroarch/cores.nix b/pkgs/applications/emulators/retroarch/cores.nix index 72925c0acb79..b42966f5a10c 100644 --- a/pkgs/applications/emulators/retroarch/cores.nix +++ b/pkgs/applications/emulators/retroarch/cores.nix @@ -416,8 +416,9 @@ in extraNativeBuildInputs = [ cmake pkg-config ]; extraBuildInputs = [ fmt freetype harfbuzz liblcf libpng libsndfile libvorbis libxmp mpg123 opusfile pcre pixman speexdsp ]; patches = [ - # Fixed compatibility with fmt > 9 - # Remove when version > 0.8 + # The following patch is shared with easyrpg-player. + # Update when new versions of liblcf and easyrpg-player are released. + # See pkgs/games/easyrpg-player/default.nix for details. (fetchpatch { name = "0001-Fix-building-with-fmtlib-10.patch"; url = "https://github.com/EasyRPG/Player/commit/ab6286f6d01bada649ea52d1f0881dde7db7e0cf.patch"; diff --git a/pkgs/applications/emulators/retroarch/update_cores.py b/pkgs/applications/emulators/retroarch/update_cores.py index e45f4464d6f6..3b4ee5f77692 100755 --- a/pkgs/applications/emulators/retroarch/update_cores.py +++ b/pkgs/applications/emulators/retroarch/update_cores.py @@ -50,6 +50,10 @@ CORES = { "dolphin": {"repo": "dolphin"}, "dosbox": {"repo": "dosbox-libretro"}, "dosbox-pure": {"repo": "dosbox-pure", "owner": "schellingb"}, + # The EasyRPG core is pinned to 0.8 since it depends on version 0.8 of liblcf, which + # was released in April 2023. + # Update the version when a compatible liblcf is available. + # See pkgs/games/easyrpg-player/default.nix for details. "easyrpg": {"repo": "Player", "owner": "EasyRPG", "fetch_submodules": True, "rev": "0.8"}, "eightyone": {"repo": "81-libretro"}, "fbalpha2012": {"repo": "fbalpha2012"},