Unverified Commit ef3e4e40 authored by OTABI Tomoya's avatar OTABI Tomoya Committed by GitHub
Browse files

Merge pull request #264228 from Yarny0/pyparted-fix

python311Packages.pyparted: fix build after update to 3.13.0
parents fea9134c 1e0c4226
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
{ lib, stdenv
, fetchFromGitHub
, fetchpatch
, buildPythonPackage
, isPyPy
, pkgs
, python
, six
, pytestCheckHook
}:

buildPythonPackage rec {
@@ -31,31 +31,14 @@ buildPythonPackage rec {
      tests/test__ped_ped.py
  '';

  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 = ''
    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";
+0 −26
Original line number Diff line number Diff line
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
 	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 \
 	tests/pylint/runpylint.py
 
 dist: