Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emulationstation: refactor #324444

Merged
merged 4 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}