Skip to content

Commit

Permalink
Merge pull request #324444 from atorres1985-contrib/emulationstation
Browse files Browse the repository at this point in the history
emulationstation: refactor
  • Loading branch information
thiagokokada authored Jul 28, 2024
2 parents 51e48f1 + b88906a commit 9d21d8a
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 32 deletions.
71 changes: 39 additions & 32 deletions pkgs/by-name/em/emulationstation/package.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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;
};
})
}
35 changes: 35 additions & 0 deletions pkgs/by-name/em/emulationstation/sources.nix
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 9d21d8a

Please sign in to comment.