From 34b52aa8dad4d1a91dd7c90580ac6831f9e06292 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 3 Jul 2024 21:48:22 -0300 Subject: [PATCH] emulationstation: detach sources acquisition --- pkgs/by-name/em/emulationstation/package.nix | 57 ++++++++++---------- pkgs/by-name/em/emulationstation/sources.nix | 21 ++++++++ 2 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 pkgs/by-name/em/emulationstation/sources.nix diff --git a/pkgs/by-name/em/emulationstation/package.nix b/pkgs/by-name/em/emulationstation/package.nix index 1447d7e70afe..f82c43437901 100644 --- a/pkgs/by-name/em/emulationstation/package.nix +++ b/pkgs/by-name/em/emulationstation/package.nix @@ -1,31 +1,26 @@ -{ 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"; - - src = fetchFromGitHub { - owner = "RetroPie"; - repo = "EmulationStation"; - rev = "v${finalAttrs.version}"; - fetchSubmodules = true; - hash = "sha256-J5h/578FVe4DXJx/AvpRnCIUpqBeFtmvFhUDYH5SErQ="; - }; +let + sources = callPackage ./sources.nix { }; +in +stdenv.mkDerivation { + inherit (sources.emulationstation) pname version src; nativeBuildInputs = [ SDL2 @@ -46,12 +41,12 @@ stdenv.mkDerivation (finalAttrs: { rapidjson ]; - strictDeps = true; - cmakeFlags = [ (lib.cmakeBool "GL" true) ]; + strictDeps = true; + installPhase = '' runHook preInstall @@ -70,6 +65,10 @@ 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)"; @@ -78,4 +77,4 @@ stdenv.mkDerivation (finalAttrs: { 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 000000000000..e73601cff73e --- /dev/null +++ b/pkgs/by-name/em/emulationstation/sources.nix @@ -0,0 +1,21 @@ +{ + fetchFromGitHub, +}: + +{ + emulationstation = let + self = { + pname = "emulationstation"; + version = "2.11.2"; + + src = fetchFromGitHub { + owner = "RetroPie"; + repo = "EmulationStation"; + rev = "v${self.version}"; + fetchSubmodules = true; + hash = "sha256-J5h/578FVe4DXJx/AvpRnCIUpqBeFtmvFhUDYH5SErQ="; + }; + }; + in + self; +}