Merge pull request #264228 from Yarny0/pyparted-fix

python311Packages.pyparted: fix build after update to 3.13.0
This commit is contained in:
OTABI Tomoya 2023-11-09 00:59:52 +09:00 committed by GitHub
commit ef3e4e40af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 45 deletions

View File

@ -1,11 +1,11 @@
{ 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";

View File

@ -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
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: