about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyside2/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pyside2/default.nix')
-rw-r--r--pkgs/development/python-modules/pyside2/default.nix36
1 files changed, 10 insertions, 26 deletions
diff --git a/pkgs/development/python-modules/pyside2/default.nix b/pkgs/development/python-modules/pyside2/default.nix
index d66ef9a52257..2a3ff3c5ad34 100644
--- a/pkgs/development/python-modules/pyside2/default.nix
+++ b/pkgs/development/python-modules/pyside2/default.nix
@@ -1,6 +1,5 @@
 {
   python,
-  pythonAtLeast,
   fetchurl,
   lib,
   stdenv,
@@ -35,28 +34,9 @@ stdenv.mkDerivation rec {
     ./Modify-sendCommand-signatures.patch
   ];
 
-  postPatch =
-    (lib.optionalString (pythonAtLeast "3.12") ''
-      substituteInPlace \
-        ez_setup.py \
-        build_scripts/main.py \
-        build_scripts/options.py \
-        build_scripts/utils.py \
-        build_scripts/wheel_override.py \
-        build_scripts/wheel_utils.py \
-        sources/pyside2/CMakeLists.txt \
-        --replace-fail "from distutils" "import setuptools; from distutils"
-      substituteInPlace \
-        build_scripts/config.py \
-        build_scripts/main.py \
-        build_scripts/options.py \
-        build_scripts/setup_runner.py \
-        build_scripts/utils.py \
-        --replace-fail "import distutils" "import setuptools; import distutils"
-    '')
-    + ''
-      cd sources/pyside2
-    '';
+  postPatch = ''
+    cd sources/pyside2
+  '';
 
   cmakeFlags = [
     "-DBUILD_TESTS=OFF"
@@ -69,8 +49,12 @@ stdenv.mkDerivation rec {
     cmake
     ninja
     qt5.qmake
-    python
-    python.pkgs.setuptools
+    (python.withPackages (
+      ps: with ps; [
+        distutils
+        setuptools
+      ]
+    ))
   ];
 
   buildInputs =
@@ -113,6 +97,6 @@ stdenv.mkDerivation rec {
     homepage = "https://wiki.qt.io/Qt_for_Python";
     maintainers = with maintainers; [ gebner ];
     platforms = platforms.all;
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
   };
 }