about summary refs log tree commit diff
path: root/pkgs/development/python-modules/distutils/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/distutils/default.nix')
-rw-r--r--pkgs/development/python-modules/distutils/default.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/distutils/default.nix b/pkgs/development/python-modules/distutils/default.nix
new file mode 100644
index 000000000000..64c721824bb9
--- /dev/null
+++ b/pkgs/development/python-modules/distutils/default.nix
@@ -0,0 +1,59 @@
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  setuptools-scm,
+  setuptools,
+  python,
+  jaraco-collections,
+  jaraco-functools,
+  jaraco-envs,
+  jaraco-path,
+  jaraco-text,
+  more-itertools,
+  path,
+  pyfakefs,
+  pytestCheckHook,
+}:
+
+buildPythonPackage rec {
+  pname = "distutils";
+  inherit (setuptools) version;
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "pypa";
+    repo = "distutils";
+    rev = "378984e02edae91d5f49425da8436f8dd9152b8a"; # correlate commit from setuptools version
+    hash = "sha256-31sPPVY6tr+OwpiFiaKw82KyhDNBVW3Foea49dCa6pA=";
+  };
+
+  build-system = [ setuptools-scm ];
+
+  dependencies = [ jaraco-functools ];
+
+  postInstall = ''
+    rm -r $out/${python.sitePackages}/distutils
+    ln -s ${setuptools}/${python.sitePackages}/setuptools/_distutils $out/${python.sitePackages}/distutils
+  '';
+
+  pythonImportsCheck = [ "distutils" ];
+
+  nativeCheckInputs = [
+    jaraco-collections
+    jaraco-envs
+    jaraco-path
+    jaraco-text
+    more-itertools
+    path
+    pyfakefs
+    pytestCheckHook
+  ];
+
+  meta = {
+    description = "Distutils as found in cpython";
+    homepage = "https://github.com/pypa/distutils";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ dotlambda ];
+  };
+}