From b657d8d7c8986762b34ebfa3953537140af1ddf4 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 3 Jul 2024 21:02:45 -0300 Subject: [PATCH 1/4] emulationstation: fix a ridiculous typo Found by https://github.com/NixOS/nixpkgs/commit/af039eb7c612e55cb7ed3141c3ae20587aafcf0f#r143796136 --- pkgs/by-name/em/emulationstation/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/em/emulationstation/package.nix b/pkgs/by-name/em/emulationstation/package.nix index 62a3537cc5cd..1447d7e70afe 100644 --- a/pkgs/by-name/em/emulationstation/package.nix +++ b/pkgs/by-name/em/emulationstation/package.nix @@ -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 From 34b52aa8dad4d1a91dd7c90580ac6831f9e06292 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 3 Jul 2024 21:48:22 -0300 Subject: [PATCH 2/4] 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; +} From 985e8f46740a3c2e3a32989c33223bf9af46aeec Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 3 Jul 2024 22:51:19 -0300 Subject: [PATCH 3/4] emulationstation: get rid of fetchSubmodules Mental note: I need to automate this! --- pkgs/by-name/em/emulationstation/package.nix | 7 +++++++ pkgs/by-name/em/emulationstation/sources.nix | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/em/emulationstation/package.nix b/pkgs/by-name/em/emulationstation/package.nix index f82c43437901..d51db8b96571 100644 --- a/pkgs/by-name/em/emulationstation/package.nix +++ b/pkgs/by-name/em/emulationstation/package.nix @@ -22,6 +22,13 @@ in stdenv.mkDerivation { inherit (sources.emulationstation) pname version src; + postUnpack = '' + pushd $sourceRoot/external/pugixml + cp --verbose --archive ${sources.pugixml.src}/* . + chmod --recursive 744 . + popd + ''; + nativeBuildInputs = [ SDL2 cmake diff --git a/pkgs/by-name/em/emulationstation/sources.nix b/pkgs/by-name/em/emulationstation/sources.nix index e73601cff73e..ca15e296f4d2 100644 --- a/pkgs/by-name/em/emulationstation/sources.nix +++ b/pkgs/by-name/em/emulationstation/sources.nix @@ -12,8 +12,22 @@ owner = "RetroPie"; repo = "EmulationStation"; rev = "v${self.version}"; - fetchSubmodules = true; - hash = "sha256-J5h/578FVe4DXJx/AvpRnCIUpqBeFtmvFhUDYH5SErQ="; + 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 From b88906ab32d6a81dcad83f79b4af8381ac056560 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 24 Jul 2024 21:51:46 -0300 Subject: [PATCH 4/4] emulationstation: nixfmt-rfc-style --- pkgs/by-name/em/emulationstation/package.nix | 9 ++-- pkgs/by-name/em/emulationstation/sources.nix | 50 ++++++++++---------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/pkgs/by-name/em/emulationstation/package.nix b/pkgs/by-name/em/emulationstation/package.nix index d51db8b96571..8be475d885fc 100644 --- a/pkgs/by-name/em/emulationstation/package.nix +++ b/pkgs/by-name/em/emulationstation/package.nix @@ -48,9 +48,7 @@ stdenv.mkDerivation { rapidjson ]; - cmakeFlags = [ - (lib.cmakeBool "GL" true) - ]; + cmakeFlags = [ (lib.cmakeBool "GL" true) ]; strictDeps = true; @@ -81,7 +79,10 @@ stdenv.mkDerivation { 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 index ca15e296f4d2..88273e845fee 100644 --- a/pkgs/by-name/em/emulationstation/sources.nix +++ b/pkgs/by-name/em/emulationstation/sources.nix @@ -1,35 +1,35 @@ -{ - fetchFromGitHub, -}: +{ fetchFromGitHub }: { - emulationstation = let - self = { - pname = "emulationstation"; - version = "2.11.2"; + emulationstation = + let + self = { + pname = "emulationstation"; + version = "2.11.2"; - src = fetchFromGitHub { - owner = "RetroPie"; - repo = "EmulationStation"; - rev = "v${self.version}"; - hash = "sha256-f2gRkp+3Pp2qnvg2RBzaHPpzhAnwx0+5x1Pe3kD90xE="; + src = fetchFromGitHub { + owner = "RetroPie"; + repo = "EmulationStation"; + rev = "v${self.version}"; + hash = "sha256-f2gRkp+3Pp2qnvg2RBzaHPpzhAnwx0+5x1Pe3kD90xE="; + }; }; - }; - in + in self; - pugixml = let - self = { - pname = "pugixml"; - version = "1.8.1"; + 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="; + src = fetchFromGitHub { + owner = "zeux"; + repo = "pugixml"; + rev = "v${self.version}"; + hash = "sha256-LbjTN1hnIbqI79C+gCdwuDG0+B/5yXf7hg0Q+cDFIf4="; + }; }; - }; - in + in self; }