about summary refs log tree commit diff
path: root/pkgs/development/compilers/dotnet/buildDotnet.nix
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2020-05-28 22:05:36 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2020-05-28 22:05:36 +0200
commit03de4c02fbd35d1b730ba0957f71df9a7a82bacf (patch)
tree78ed2f7dfa2efae85c9a76dd53320d875a8ff678 /pkgs/development/compilers/dotnet/buildDotnet.nix
parent99d25675152f30caf6354db93f01fac87f640c8f (diff)
parente27e3ae169d4ac64856befb6bbf044f2153e337d (diff)
downloadnixlib-03de4c02fbd35d1b730ba0957f71df9a7a82bacf.tar
nixlib-03de4c02fbd35d1b730ba0957f71df9a7a82bacf.tar.gz
nixlib-03de4c02fbd35d1b730ba0957f71df9a7a82bacf.tar.bz2
nixlib-03de4c02fbd35d1b730ba0957f71df9a7a82bacf.tar.lz
nixlib-03de4c02fbd35d1b730ba0957f71df9a7a82bacf.tar.xz
nixlib-03de4c02fbd35d1b730ba0957f71df9a7a82bacf.tar.zst
nixlib-03de4c02fbd35d1b730ba0957f71df9a7a82bacf.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/development/compilers/dotnet/buildDotnet.nix')
-rw-r--r--pkgs/development/compilers/dotnet/buildDotnet.nix12
1 files changed, 7 insertions, 5 deletions
diff --git a/pkgs/development/compilers/dotnet/buildDotnet.nix b/pkgs/development/compilers/dotnet/buildDotnet.nix
index 6f4237d2dce1..20abc1c78b9a 100644
--- a/pkgs/development/compilers/dotnet/buildDotnet.nix
+++ b/pkgs/development/compilers/dotnet/buildDotnet.nix
@@ -13,14 +13,16 @@ assert builtins.elem type [ "aspnetcore" "netcore" "sdk"];
 , curl
 }: 
 let pname = if type == "aspnetcore" then "aspnetcore-runtime" else if type == "netcore" then "dotnet-runtime" else "dotnet-sdk";
+    platform = if stdenv.isDarwin then "osx" else "linux";
     suffix = {
       x86_64-linux  = "x64";
       aarch64-linux = "arm64";
+      x86_64-darwin = "x64";
     }."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
     urls = {
-        aspnetcore = "https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/${version}/${pname}-${version}-linux-${suffix}.tar.gz";
-        netcore = "https://dotnetcli.azureedge.net/dotnet/Runtime/${version}/${pname}-${version}-linux-${suffix}.tar.gz";
-        sdk = "https://dotnetcli.azureedge.net/dotnet/Sdk/${version}/${pname}-${version}-linux-${suffix}.tar.gz";
+        aspnetcore = "https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/${version}/${pname}-${version}-${platform}-${suffix}.tar.gz";
+        netcore = "https://dotnetcli.azureedge.net/dotnet/Runtime/${version}/${pname}-${version}-${platform}-${suffix}.tar.gz";
+        sdk = "https://dotnetcli.azureedge.net/dotnet/Sdk/${version}/${pname}-${version}-${platform}-${suffix}.tar.gz";
     };
     descriptions = {
         aspnetcore = "ASP .NET Core runtime ${version}";
@@ -50,7 +52,7 @@ in stdenv.mkDerivation rec {
         runHook postInstall
     '';
 
-    postFixup = ''
+    postFixup = stdenv.lib.optionalString stdenv.isLinux ''
         patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $out/dotnet
         patchelf --set-rpath "${rpath}" $out/dotnet
         find $out -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \;
@@ -65,7 +67,7 @@ in stdenv.mkDerivation rec {
     meta = with stdenv.lib; {
         homepage = "https://dotnet.github.io/";
         description = builtins.getAttr type descriptions;
-        platforms = [ "x86_64-linux" "aarch64-linux" ];
+        platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
         maintainers = with maintainers; [ kuznero ];
         license = licenses.mit;
     };