2021-01-17 09:17:16 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, python, buildPythonApplication, parted, e2fsprogs }:
|
2014-10-22 07:15:30 +01:00
|
|
|
|
2016-02-19 12:12:11 +00:00
|
|
|
buildPythonApplication rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "pyparted";
|
2014-10-22 07:15:30 +01:00
|
|
|
version = "3.10";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "https://fedorahosted.org/releases/p/y/pyparted/${pname}-${version}.tar.gz";
|
2014-10-22 07:15:30 +01:00
|
|
|
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-14 15:36:34 +00:00
|
|
|
'' + lib.optionalString stdenv.isi686 ''
|
2014-10-22 07:15:30 +01: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-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2014-10-22 07:15:30 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ parted ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2015-01-08 09:26:49 +00:00
|
|
|
patchShebangs Makefile
|
2014-10-22 07:15:30 +01:00
|
|
|
make test PYTHON=${python.executable}
|
|
|
|
'';
|
|
|
|
|
2021-01-14 15:36:34 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://fedorahosted.org/pyparted/";
|
2014-10-22 07:15:30 +01:00
|
|
|
description = "Python interface for libparted";
|
2021-01-14 15:36:34 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2014-10-22 07:15:30 +01:00
|
|
|
};
|
|
|
|
}
|