2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, python, buildPythonApplication, parted, e2fsprogs }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "pyparted";
|
|
|
|
version = "3.10";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://fedorahosted.org/releases/p/y/pyparted/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "17wq4invmv1nfazaksf59ymqyvgv3i8h4q03ry2az0s9lldyg3dv";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's|/sbin/mke2fs|${e2fsprogs}&|' tests/baseclass.py
|
|
|
|
sed -i -e '
|
|
|
|
s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path|
|
|
|
|
' tests/test__ped_ped.py
|
2021-01-15 22:18: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="${parted}/sbin:$PATH"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ 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://fedorahosted.org/pyparted/";
|
|
|
|
description = "Python interface for libparted";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|