about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/templaterpm/default.nix
blob: c98716a3fedb193011bc62e6982d3801e7ec189e (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
25
{lib, stdenv, makeWrapper, python, toposort, rpm}:

stdenv.mkDerivation {
  pname = "nix-template-rpm";
  version = "0.1";

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ python toposort rpm ];

  dontUnpack = true;

  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 lib; {
    description = "Create templates of nix expressions from RPM .spec files";
    maintainers = with maintainers; [ tstrobel ];
    platforms = platforms.unix;
    hydraPlatforms = [];
  };
}