Merge pull request #193902 from okpedersen/azure-functions-core-tools-darwin
azure-functions-core-tools: Add darwin support, upgrade to v4
This commit is contained in:
commit
34564656c8
@ -16,12 +16,20 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "azure-functions-core-tools";
|
||||
version = "3.0.3785";
|
||||
version = "4.0.4785";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Azure/${pname}/releases/download/${version}/Azure.Functions.Cli.linux-x64.${version}.zip";
|
||||
sha256 = "sha256-NdTEFQaG8eFengjzQr51ezehIHFvQZqmrjpjWk4vZKo=";
|
||||
};
|
||||
src =
|
||||
if stdenv.isLinux then
|
||||
fetchurl {
|
||||
url = "https://github.com/Azure/${pname}/releases/download/${version}/Azure.Functions.Cli.linux-x64.${version}.zip";
|
||||
sha256 = "sha256-SWvbPEslwhYNd2fTQJWy1+823o1vJR/roPstgelSfnQ=";
|
||||
}
|
||||
else
|
||||
fetchurl {
|
||||
url = "https://github.com/Azure/${pname}/releases/download/${version}/Azure.Functions.Cli.osx-x64.${version}.zip";
|
||||
sha256 = "sha256-m06XeUHVDCxo7sfK4eF1oM6IuaVET9jr/xSO9qzpxSU=";
|
||||
}
|
||||
;
|
||||
|
||||
nativeBuildInputs = [
|
||||
unzip
|
||||
@ -50,13 +58,17 @@ stdenv.mkDerivation rec {
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp -prd *.dll *.so gozip func $out/bin
|
||||
cp -prd . $out/bin/azure-functions-core-tools
|
||||
chmod +x $out/bin/azure-functions-core-tools/{func,gozip}
|
||||
'' + lib.optionalString stdenv.isLinux ''
|
||||
patchelf \
|
||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
--set-rpath "${libPath}" "$out/bin/func"
|
||||
chmod +x $out/bin/func $out/bin/gozip
|
||||
find $out/bin -type f -name "*.so" -exec patchelf --set-rpath "${libPath}" {} \;
|
||||
wrapProgram "$out/bin/func" --prefix LD_LIBRARY_PATH : ${libPath}
|
||||
--set-rpath "${libPath}" "$out/bin/azure-functions-core-tools/func"
|
||||
find $out/bin/azure-functions-core-tools -type f -name "*.so" -exec patchelf --set-rpath "${libPath}" {} \;
|
||||
wrapProgram "$out/bin/azure-functions-core-tools/func" --prefix LD_LIBRARY_PATH : ${libPath}
|
||||
'' + ''
|
||||
ln -s $out/bin/{azure-functions-core-tools,}/func
|
||||
ln -s $out/bin/{azure-functions-core-tools,}/gozip
|
||||
'';
|
||||
dontStrip = true; # Causes rpath patching to break if not set
|
||||
|
||||
@ -69,6 +81,6 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ jshcmpbll ];
|
||||
platforms = platforms.linux;
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user