2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, isPyPy
|
|
|
|
, pkgs
|
|
|
|
, python
|
|
|
|
, six
|
2023-11-16 04:20:00 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyparted";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "3.13.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = isPyPy;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = pname;
|
|
|
|
owner = "dcantrell";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-AiUCCrEbDD0OxrvXs1YN3/1IE7SuVasC2YCirIG58iU=";
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
PATH="${pkgs.parted}/sbin:$PATH"
|
|
|
|
'';
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ pkgs.pkg-config ];
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeCheckInputs = [ six pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ pkgs.parted ];
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|