diff --git a/pkgs/applications/emulators/libretro/cores/scummvm.nix b/pkgs/applications/emulators/libretro/cores/scummvm.nix index 6bb0e08778cb..edc40909e324 100644 --- a/pkgs/applications/emulators/libretro/cores/scummvm.nix +++ b/pkgs/applications/emulators/libretro/cores/scummvm.nix @@ -1,42 +1,63 @@ { lib, fetchFromGitHub, - fluidsynth, libGL, libGLU, - libjpeg, - libvorbis, + 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-2022-04-06"; + version = "0-unstable-2024-12-03"; - # This is the old source code before they upstreamed the source code, - # so now the libretro related code lives in the scummvm/scummvm repository. - # However this broke the old way we were doing builds, so for now point - # to a mirror with the old source code until this issue is fixed. - # TODO: switch to libretro/scummvm since this is more up-to-date src = fetchFromGitHub { - owner = "libretro-mirrors"; + owner = "libretro"; repo = "scummvm"; - rev = "2fb2e4c551c9c1510c56f6e890ee0300b7b3fca3"; - hash = "sha256-wrlFqu+ONbYH4xMFDByOgySobGrkhVc7kYWI4JzA4ew="; + rev = "7310d4e9f5d11553c6c5499911bd2f9b8ff3db3b"; + hash = "sha256-h+tnwayBhzBQrg5x1rxIJASAS43SP8emTATDG2N3ePk="; }; extraBuildInputs = [ - fluidsynth - libjpeg - libvorbis - libGLU 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"; - preConfigure = "cd backends/platform/libretro/build"; meta = { description = "Libretro port of ScummVM"; - homepage = "https://github.com/libretro-mirrors/scummvm"; + homepage = "https://github.com/libretro/scummvm"; license = lib.licenses.gpl2Only; }; }