1{ lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper, installShellFiles }:
2
3let
4 data = import ./data.nix {};
5in stdenv.mkDerivation {
6 pname = "pulumi";
7 version = data.version;
8
9 postUnpack = ''
10 mv pulumi-* pulumi
11 '';
12
13 srcs = map (x: fetchurl x) data.pulumiPkgs.${stdenv.hostPlatform.system};
14
15 installPhase = ''
16 install -D -t $out/bin/ *
17 '' + lib.optionalString stdenv.isLinux ''
18 wrapProgram $out/bin/pulumi --set LD_LIBRARY_PATH "${stdenv.cc.cc.lib}/lib"
19 '' + ''
20 installShellCompletion --cmd pulumi \
21 --bash <($out/bin/pulumi completion bash) \
22 --fish <($out/bin/pulumi completion fish) \
23 --zsh <($out/bin/pulumi completion zsh)
24 '';
25
26 nativeBuildInputs = [ installShellFiles ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook makeWrapper ];
27 buildInputs = [ stdenv.cc.cc.libgcc or null ];
28
29 meta = with lib; {
30 homepage = "https://pulumi.io/";
31 description = "Pulumi is a cloud development platform that makes creating cloud programs easy and productive";
32 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
33 license = with licenses; [ asl20 ];
34 platforms = builtins.attrNames data.pulumiPkgs;
35 maintainers = with maintainers; [
36 ghuntley
37 peterromfeldhk
38 jlesquembre
39 cpcloud
40 ];
41 };
42}