2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2023-04-29 16:46:19 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, isPyPy
|
|
|
|
, pkgs
|
|
|
|
, python
|
|
|
|
, six
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyparted";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "3.12.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = isPyPy;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = pname;
|
|
|
|
owner = "dcantrell";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-LfBLR0A/wnfBtXISAAY6Nl4vnk1rtY03F+PT8UIMrEs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's|mke2fs|${pkgs.e2fsprogs}/bin/mke2fs|' tests/baseclass.py
|
|
|
|
sed -i -e '
|
|
|
|
s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path|
|
|
|
|
' tests/test__ped_ped.py
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString stdenv.isi686 ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# remove some integers in this test case which overflow on 32bit systems
|
|
|
|
sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \
|
|
|
|
tests/test__ped_ped.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./fix-test-pythonpath.patch
|
2023-04-29 16:46:19 +00:00
|
|
|
(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=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
PATH="${pkgs.parted}/sbin:$PATH"
|
|
|
|
'';
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ pkgs.pkg-config ];
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ six ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ pkgs.parted ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
patchShebangs Makefile
|
|
|
|
make test PYTHON=${python.executable}
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/dcantrell/pyparted/";
|
|
|
|
description = "Python interface for libparted";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ lsix ];
|
|
|
|
};
|
|
|
|
}
|