hoarder: 0.21.0 -> 0.22.0
[NixPkgs.git] / pkgs / by-name / re / retrofe / package.nix
blobadfeed89ed97d249217d4fe2f79db74e06840a49
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   glib,
7   gst_all_1,
8   makeWrapper,
9   pkg-config,
10   python3,
11   SDL2,
12   SDL2_image,
13   SDL2_mixer,
14   SDL2_ttf,
15   sqlite,
16   zlib,
17   runtimeShell,
20 stdenv.mkDerivation {
21   pname = "retrofe";
22   version = "0.10.31";
24   src = fetchFromGitHub {
25     owner = "phulshof";
26     repo = "RetroFE";
27     rev = "2ddd65a76210d241031c4ac9268255f311df25d1";
28     sha256 = "sha256-uBfECbU2Df/pPpEXXq62S7Ec0YU4lPIsZ8k5UmKD7xQ=";
29   };
31   nativeBuildInputs = [
32     cmake
33     makeWrapper
34     pkg-config
35     python3
36   ];
38   buildInputs =
39     [
40       glib
41       gst_all_1.gstreamer
42       SDL2
43       SDL2_image
44       SDL2_mixer
45       SDL2_ttf
46       sqlite
47       zlib
48     ]
49     ++ (with gst_all_1; [
50       gst-libav
51       gst-plugins-base
52       gst-plugins-good
53     ]);
55   configurePhase = ''
56     cmake RetroFE/Source -BRetroFE/Build -DCMAKE_BUILD_TYPE=Release \
57       -DVERSION_MAJOR=0 -DVERSION_MINOR=0 -DVERSION_BUILD=0 \
58   '';
60   buildPhase = ''
61     cmake --build RetroFE/Build
62     python Scripts/Package.py --os=linux --build=full
63   '';
65   installPhase = ''
66     mkdir -p $out/bin
67     mkdir -p $out/share/retrofe
68     cp -r Artifacts/linux/RetroFE $out/share/retrofe/example
69     mv $out/share/retrofe/example/retrofe $out/bin/
71     cat > $out/bin/retrofe-init << EOF
72     #!${runtimeShell}
74     echo "This will install retrofe's example files into this directory"
75     echo "Example files location: $out/share/retrofe/example/"
77     while true; do
78         read -p "Do you want to proceed? [yn] " yn
79         case \$yn in
80             [Yy]* ) cp -r --no-preserve=all $out/share/retrofe/example/* .; break;;
81             [Nn]* ) exit;;
82             * ) echo "Please answer with yes or no.";;
83         esac
84     done
85     EOF
87     chmod +x $out/bin/retrofe-init
89     runHook postInstall
90   '';
92   # retrofe will look for config files in its install path ($out/bin).
93   # When set it will use $RETROFE_PATH instead. Sadly this behaviour isn't
94   # documented well. To make it behave more like as expected it's set to
95   # $PWD by default here.
96   postInstall = ''
97     wrapProgram "$out/bin/retrofe" \
98       --prefix GST_PLUGIN_PATH : "$GST_PLUGIN_SYSTEM_PATH_1_0" \
99       --run 'export RETROFE_PATH=''${RETROFE_PATH:-$PWD}'
100   '';
102   meta = with lib; {
103     description = "Frontend for arcade cabinets and media PCs";
104     homepage = "http://retrofe.nl/";
105     license = licenses.gpl3Plus;
106     maintainers = with maintainers; [ hrdinka ];
107     platforms = with platforms; linux;
108   };