17 platformStr = "osx-arm64";
18 hash = "sha256-yp3VTt5m8KuACjrBIotfQ5ZdgMvfwYIFaqY2475pHRs=";
21 platformStr = "osx-x64";
22 hash = "sha256-bTHh0mwGbe6JVsR8rDHGpGJ2+AipHb8NIBIW7iiuz6I=";
25 platformStr = "linux-x64";
26 hash = "sha256-5R4/hCxCz6KfBl9Zbei+iFty5S2MOYt9hMvPMjCzL54=";
30 platformInfo = builtins.getAttr stdenv.hostPlatform.system platforms;
32 stdenv.mkDerivation rec {
33 pname = "azure-functions-core-tools";
37 url = "https://github.com/Azure/${pname}/releases/download/${version}/Azure.Functions.Cli.${platformInfo.platformStr}.${version}.zip";
38 inherit (platformInfo) hash;
50 libPath = lib.makeLibraryPath [
67 cp -prd . $out/bin/azure-functions-core-tools
68 chmod +x $out/bin/azure-functions-core-tools/{func,gozip}
70 + lib.optionalString stdenv.isLinux ''
72 --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
73 --set-rpath "${libPath}" "$out/bin/azure-functions-core-tools/func"
74 find $out/bin/azure-functions-core-tools -type f -name "*.so" -exec patchelf --set-rpath "${libPath}" {} \;
75 wrapProgram "$out/bin/azure-functions-core-tools/func" --prefix LD_LIBRARY_PATH : ${libPath}
78 ln -s $out/bin/{azure-functions-core-tools,}/func
79 ln -s $out/bin/{azure-functions-core-tools,}/gozip
81 dontStrip = true; # Causes rpath patching to break if not set
84 homepage = "https://github.com/Azure/azure-functions-core-tools";
85 description = "Command line tools for Azure Functions";
86 sourceProvenance = with sourceTypes; [
90 license = licenses.mit;
91 maintainers = with maintainers; [ mdarocha ];
92 platforms = ["x86_64-linux" "aarch64-darwin" "x86_64-darwin"];