From 18597c8aa70b439faff09d66d656b3f12f874209 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 29 Oct 2023 11:13:14 +0100 Subject: [PATCH 1/2] python311Packages.pyparted: fix build for version 3.13.0 The update to version 3.13.0 in 1916d387bdb02bf0cba668bd5d526722f0c2c2c7 broke the build (for all python versions and architectures). The following changes are required to fix the package: * the two cherry-picked patches from upstream are dropped as they are already included in version 3.13.0 * "our" patch is adapted to chanes in the Makefile, see https://github.com/dcantrell/pyparted/commit/9131fcf6088cbad120c4fbb1d96c429e38cee543 --- pkgs/development/python-modules/pyparted/default.nix | 9 --------- .../python-modules/pyparted/fix-test-pythonpath.patch | 6 +++--- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/pyparted/default.nix b/pkgs/development/python-modules/pyparted/default.nix index 4d473ae094d8..935e700c4790 100644 --- a/pkgs/development/python-modules/pyparted/default.nix +++ b/pkgs/development/python-modules/pyparted/default.nix @@ -1,6 +1,5 @@ { lib, stdenv , fetchFromGitHub -, fetchpatch , buildPythonPackage , isPyPy , pkgs @@ -33,14 +32,6 @@ buildPythonPackage rec { patches = [ ./fix-test-pythonpath.patch - (fetchpatch { - url = "https://github.com/dcantrell/pyparted/commit/07ba882d04fa2099b53d41370416b97957d2abcb.patch"; - hash = "sha256-yYfLdy+TOKfN3gtTMgOWPebPTRYyaOYh/yFTowCbdjg="; - }) - (fetchpatch { - url = "https://github.com/dcantrell/pyparted/commit/a01b4eeecf63b0580c192c7c2db7a5c406a7ad6d.patch"; - hash = "sha256-M/8hYiKUBzaTOxPYDFK5BAvCm6WJGx+693qwj3HzdRA="; - }) ]; preConfigure = '' diff --git a/pkgs/development/python-modules/pyparted/fix-test-pythonpath.patch b/pkgs/development/python-modules/pyparted/fix-test-pythonpath.patch index 740bffbef6d8..3f084dc8bea5 100644 --- a/pkgs/development/python-modules/pyparted/fix-test-pythonpath.patch +++ b/pkgs/development/python-modules/pyparted/fix-test-pythonpath.patch @@ -18,9 +18,9 @@ diff -ur a/Makefile b/Makefile $(COVERAGE) report --include="build/lib.*/parted/*" > coverage-report.log check: clean - env PYTHON=python3 $(MAKE) ; \ -- env PYTHON=python3 PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src \ -+ env PYTHON=python3 PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src:$$PYTHONPATH \ + $(MAKE) ; \ +- env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src \ ++ env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src:$$PYTHONPATH \ tests/pylint/runpylint.py dist: From 1e0c4226a4cf808fa0c60bfe482d531e8a5236e9 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Tue, 7 Nov 2023 18:21:05 +0100 Subject: [PATCH 2/2] python311Packages.pyparted: use pytestCheckHook ...instead of manually patching the Makefile. --- .../python-modules/pyparted/default.nix | 12 ++------- .../pyparted/fix-test-pythonpath.patch | 26 ------------------- 2 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 pkgs/development/python-modules/pyparted/fix-test-pythonpath.patch diff --git a/pkgs/development/python-modules/pyparted/default.nix b/pkgs/development/python-modules/pyparted/default.nix index 935e700c4790..84d8439a5360 100644 --- a/pkgs/development/python-modules/pyparted/default.nix +++ b/pkgs/development/python-modules/pyparted/default.nix @@ -5,6 +5,7 @@ , pkgs , python , six +, pytestCheckHook }: buildPythonPackage rec { @@ -30,23 +31,14 @@ buildPythonPackage rec { tests/test__ped_ped.py ''; - patches = [ - ./fix-test-pythonpath.patch - ]; - preConfigure = '' PATH="${pkgs.parted}/sbin:$PATH" ''; nativeBuildInputs = [ pkgs.pkg-config ]; - nativeCheckInputs = [ six ]; + nativeCheckInputs = [ six pytestCheckHook ]; propagatedBuildInputs = [ pkgs.parted ]; - checkPhase = '' - patchShebangs Makefile - make test PYTHON=${python.executable} - ''; - meta = with lib; { homepage = "https://github.com/dcantrell/pyparted/"; description = "Python interface for libparted"; diff --git a/pkgs/development/python-modules/pyparted/fix-test-pythonpath.patch b/pkgs/development/python-modules/pyparted/fix-test-pythonpath.patch deleted file mode 100644 index 3f084dc8bea5..000000000000 --- a/pkgs/development/python-modules/pyparted/fix-test-pythonpath.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ur a/Makefile b/Makefile ---- a/Makefile 1980-01-02 00:00:00.000000000 +0100 -+++ b/Makefile 2020-02-18 20:04:14.068243263 +0100 -@@ -39,19 +39,19 @@ - @$(PYTHON) setup.py build - - test: all -- @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src \ -+ @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src:$$PYTHONPATH \ - $(PYTHON) -m unittest discover -v - - coverage: all - @echo "*** Running unittests with $(COVERAGE) for $(PYTHON) ***" -- @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src \ -+ @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src:$$PYTHONPATH \ - $(COVERAGE) run --branch -m unittest discover -v - $(COVERAGE) report --include="build/lib.*/parted/*" --show-missing - $(COVERAGE) report --include="build/lib.*/parted/*" > coverage-report.log - - check: clean - $(MAKE) ; \ -- env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src \ -+ env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src:$$PYTHONPATH \ - tests/pylint/runpylint.py - - dist: