diff --git a/pkgs/by-name/em/emulationstation/package.nix b/pkgs/by-name/em/emulationstation/package.nix index 62a3537cc5cd57b..8be475d885fca9b 100644 --- a/pkgs/by-name/em/emulationstation/package.nix +++ b/pkgs/by-name/em/emulationstation/package.nix @@ -1,31 +1,33 @@ -{ lib -, SDL2 -, alsa-lib -, boost -, cmake -, curl -, fetchFromGitHub -, freeimage -, freetype -, libGL -, libGLU -, libvlc -, pkg-config -, rapidjson -, stdenv +{ + lib, + SDL2, + alsa-lib, + boost, + callPackage, + cmake, + curl, + freeimage, + freetype, + libGL, + libGLU, + libvlc, + pkg-config, + rapidjson, + stdenv, }: -stdenv.mkDerivation (finalAttrs: { - pname = "emulationstation"; - version = "2.11.2"; +let + sources = callPackage ./sources.nix { }; +in +stdenv.mkDerivation { + inherit (sources.emulationstation) pname version src; - src = fetchFromGitHub { - owner = "RetroPie"; - repo = "EmulationStation"; - rev = "v${finalAttrs.version}"; - fetchSubmodules = true; - hash = "sha256-J5h/578FVe4DXJx/AvpRnCIUpqBeFtmvFhUDYH5SErQ="; - }; + postUnpack = '' + pushd $sourceRoot/external/pugixml + cp --verbose --archive ${sources.pugixml.src}/* . + chmod --recursive 744 . + popd + ''; nativeBuildInputs = [ SDL2 @@ -46,11 +48,9 @@ stdenv.mkDerivation (finalAttrs: { rapidjson ]; - strictDeps = true; + cmakeFlags = [ (lib.cmakeBool "GL" true) ]; - cmakeFlags = [ - (lib.cmakeBool "GL" true) - ]; + strictDeps = true; installPhase = '' runHook preInstall @@ -59,7 +59,7 @@ stdenv.mkDerivation (finalAttrs: { mkdir -p $out/share/emulationstation/ cp -r ../resources $out/share/emulationstation/ - runHook preInstall + runHook postInstall ''; # es-core/src/resources/ResourceManager.cpp: resources are searched at the @@ -70,12 +70,19 @@ stdenv.mkDerivation (finalAttrs: { popd ''; + passthru = { + inherit sources; + }; + meta = { homepage = "https://github.com/RetroPie/EmulationStation"; description = "Flexible emulator front-end supporting keyboardless navigation and custom system themes (forked by RetroPie)"; license = with lib.licenses; [ mit ]; mainProgram = "emulationstation"; - maintainers = with lib.maintainers; [ AndersonTorres edwtjo ]; + maintainers = with lib.maintainers; [ + AndersonTorres + edwtjo + ]; platforms = lib.platforms.linux; }; -}) +} diff --git a/pkgs/by-name/em/emulationstation/sources.nix b/pkgs/by-name/em/emulationstation/sources.nix new file mode 100644 index 000000000000000..88273e845fee93f --- /dev/null +++ b/pkgs/by-name/em/emulationstation/sources.nix @@ -0,0 +1,35 @@ +{ fetchFromGitHub }: + +{ + emulationstation = + let + self = { + pname = "emulationstation"; + version = "2.11.2"; + + src = fetchFromGitHub { + owner = "RetroPie"; + repo = "EmulationStation"; + rev = "v${self.version}"; + hash = "sha256-f2gRkp+3Pp2qnvg2RBzaHPpzhAnwx0+5x1Pe3kD90xE="; + }; + }; + in + self; + + pugixml = + let + self = { + pname = "pugixml"; + version = "1.8.1"; + + src = fetchFromGitHub { + owner = "zeux"; + repo = "pugixml"; + rev = "v${self.version}"; + hash = "sha256-LbjTN1hnIbqI79C+gCdwuDG0+B/5yXf7hg0Q+cDFIf4="; + }; + }; + in + self; +}