about summary refs log tree commit diff
path: root/pkgs/build-support/dlang/dub-to-nix/default.nix
blob: 87db7eed093315f7884a812e7d6fc061e80dd54d (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
26
{
  lib,
  runCommand,
  makeWrapper,
  python3,
  nix,
  nix-prefetch-git,
}:

let
  binPath = lib.makeBinPath [
    nix
    nix-prefetch-git
  ];
in
runCommand "dub-to-nix"
  {
    nativeBuildInputs = [ makeWrapper ];
    buildInputs = [ python3 ];
  }
  ''
    install -Dm755 ${./dub-to-nix.py} "$out/bin/dub-to-nix"
    patchShebangs "$out/bin/dub-to-nix"
    wrapProgram "$out/bin/dub-to-nix" \
        --prefix PATH : ${binPath}
  ''