summary refs log tree commit diff
path: root/pkgs/build-support/templaterpm/default.nix
blob: aca4e340e267a5a9c3d2e55fb3a74377b1133b16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{stdenv, makeWrapper, python, toposort, rpm}:

stdenv.mkDerivation rec {
  name = "nix-template-rpm-${version}";
  version = "0.1";

  buildInputs = [ makeWrapper python toposort rpm ];

  phases = [ "installPhase" "fixupPhase" ];

  installPhase = ''
    mkdir -p $out/bin
    cp ${./nix-template-rpm.py} $out/bin/nix-template-rpm
    wrapProgram $out/bin/nix-template-rpm \
      --set PYTHONPATH "${rpm}/lib/${python.libPrefix}/site-packages":"${toposort}/lib/${python.libPrefix}/site-packages"
    '';

  meta = with stdenv.lib; {
    description = "Create templates of nix expressions from RPM .spec files";
    maintainers = with maintainers; [ tstrobel ];
    platforms = with stdenv.lib.platforms; unix;
    hydraPlatforms = [];
  };
}