about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/dotnetcore2/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-09-28 15:30:15 +0000
committerAlyssa Ross <hi@alyssa.is>2019-09-28 22:14:42 +0000
commit80e4dc93ce4bb109cd00a98f0b39151f09de9d9b (patch)
tree64aa611a6a199dc0f40fc56d050d99e125e5c830 /nixpkgs/pkgs/development/python-modules/dotnetcore2/default.nix
parentbfa679f5a8e9beff6008ea0e9d5eabfa68018e20 (diff)
parent2436c27541b2f52deea3a4c1691216a02152e729 (diff)
downloadnixlib-80e4dc93ce4bb109cd00a98f0b39151f09de9d9b.tar
nixlib-80e4dc93ce4bb109cd00a98f0b39151f09de9d9b.tar.gz
nixlib-80e4dc93ce4bb109cd00a98f0b39151f09de9d9b.tar.bz2
nixlib-80e4dc93ce4bb109cd00a98f0b39151f09de9d9b.tar.lz
nixlib-80e4dc93ce4bb109cd00a98f0b39151f09de9d9b.tar.xz
nixlib-80e4dc93ce4bb109cd00a98f0b39151f09de9d9b.tar.zst
nixlib-80e4dc93ce4bb109cd00a98f0b39151f09de9d9b.zip
Merge commit '2436c27541b2f52deea3a4c1691216a02152e729'
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/dotnetcore2/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/dotnetcore2/default.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/dotnetcore2/default.nix b/nixpkgs/pkgs/development/python-modules/dotnetcore2/default.nix
new file mode 100644
index 000000000000..caafeb54740f
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/dotnetcore2/default.nix
@@ -0,0 +1,59 @@
+{ stdenv, lib, buildPythonPackage, fetchPypi, python, isPy27
+, dotnet-sdk
+, substituteAll
+, distro
+, unzip
+}:
+
+buildPythonPackage rec {
+  pname = "dotnetcore2";
+  version = "2.1.8.1";
+  format = "wheel";
+  disabled = isPy27;
+
+  src = fetchPypi {
+    inherit pname version format;
+    python = "py3";
+    platform = "manylinux1_x86_64";
+    sha256 = "13zrff5j767d3f8drl397sjhl28winsrfa8pa20svf00xfcsy34s";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  propagatedBuildInputs = [ distro ];
+
+  # needed to apply patches
+  prePatch = ''
+    unzip dist/dotnet*
+  '';
+
+  patches = [
+    ( substituteAll {
+        src = ./runtime.patch;
+        dotnet = dotnet-sdk;
+      }
+    )
+  ];
+
+  # unfortunately the noraml pip install fails because the manylinux1 format check fails with NixOS
+  installPhase = ''
+    mkdir -p $out/${python.sitePackages}/${pname}
+    # copy metadata
+    cp -r dotnetcore2-2* $out/${python.sitePackages}
+    # copy non-dotnetcore related files
+    cp -r dotnetcore2/{__init__.py,runtime.py} $out/${python.sitePackages}/${pname}
+  '';
+
+  # no tests, ensure it's one useful function works
+  checkPhase = ''
+    ${python.interpreter} -c 'from dotnetcore2 import runtime; print(runtime.get_runtime_path())'
+  '';
+
+  meta = with lib; {
+    description = "DotNet Core runtime";
+    homepage = "https://github.com/dotnet/core";
+    license = licenses.mit;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ jonringer ];
+  };
+}