summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/tools/azure-functions-core-tools/default.nix74
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 76 insertions, 0 deletions
diff --git a/pkgs/development/tools/azure-functions-core-tools/default.nix b/pkgs/development/tools/azure-functions-core-tools/default.nix
new file mode 100644
index 00000000000..9396821f8c6
--- /dev/null
+++ b/pkgs/development/tools/azure-functions-core-tools/default.nix
@@ -0,0 +1,74 @@
+{ stdenv
+, lib
+, config
+, fetchurl
+, unzip
+, makeWrapper
+, icu
+, libunwind
+, curl
+, zlib
+, libuuid
+, dotnetbuildhelpers
+, dotnetCorePackages
+, coreclr
+, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "azure-functions-core-tools";
+  version = "3.0.3568";
+
+  src = fetchurl {
+    url = "https://github.com/Azure/${pname}/releases/download/${version}/Azure.Functions.Cli.linux-x64.${version}.zip";
+    sha256 = "0yxdqc5d1xsixjj2dlvs32d6fz4vh58ih2l00lc456fg15mfw3lg";
+  };
+
+  buildInputs = [
+    unzip
+    makeWrapper
+    dotnetbuildhelpers
+  ];
+
+  nativeBuildInputs = [
+    icu
+    libunwind
+    curl
+    zlib
+    dotnetCorePackages.sdk_3_1
+  ];
+
+  libPath = lib.makeLibraryPath [
+    libunwind
+    libuuid
+    stdenv.cc.cc
+    curl
+    zlib
+    icu
+    openssl
+  ];
+
+  unpackPhase = ''
+    unzip $src
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -prd * $out/bin
+    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}
+  '';
+  dontStrip = true; # Causes rpath patching to break if not set
+
+  meta = with lib; {
+    homepage = "https://github.com/Azure/azure-functions-core-tools";
+    description = "Command line tools for Azure Functions";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jshcmpbll ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 232b7cf0cc5..6263f99c137 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1239,6 +1239,8 @@ in
 
   azure-cli = callPackage ../tools/admin/azure-cli { };
 
+  azure-functions-core-tools = callPackage ../development/tools/azure-functions-core-tools { };
+
   azure-storage-azcopy = callPackage ../development/tools/azcopy { };
 
   azure-vhd-utils  = callPackage ../tools/misc/azure-vhd-utils { };