Unverified Commit 9d21d8ae authored by Thiago Kenji Okada's avatar Thiago Kenji Okada Committed by GitHub
Browse files

Merge pull request #324444 from atorres1985-contrib/emulationstation

emulationstation: refactor
parents 51e48f19 b88906ab
Loading
Loading
Loading
Loading
+39 −32
Original line number Diff line number Diff line
{ 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;
  };
})
}
+35 −0
Original line number Diff line number Diff line
{ 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;
}