2014-10-22 01:37:32 +02:00
|
|
|
{ stdenv, fetchFromGitHub, buildPythonPackage, pykickstart, pyparted, pyblock
|
2016-01-21 16:07:38 +01:00
|
|
|
, pyudev, six, libselinux, cryptsetup, multipath-tools, lsof, utillinux
|
2013-07-02 17:00:39 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pyenable = { enablePython = true; };
|
|
|
|
selinuxWithPython = libselinux.override pyenable;
|
|
|
|
cryptsetupWithPython = cryptsetup.override pyenable;
|
|
|
|
in buildPythonPackage rec {
|
2017-05-27 11:25:35 +02:00
|
|
|
pname = "blivet";
|
|
|
|
name = "${pname}-${version}";
|
2014-10-22 01:37:32 +02:00
|
|
|
version = "0.67";
|
2013-07-02 17:00:39 +02:00
|
|
|
|
2014-10-22 01:37:32 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dwlehman";
|
|
|
|
repo = "blivet";
|
|
|
|
rev = name;
|
|
|
|
sha256 = "1gk94ghjrxfqnx53hph1j2s7qcv86fjz48is7l099q9c24rjv8ky";
|
2013-07-02 17:00:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2014-10-22 01:37:32 +02:00
|
|
|
sed -i \
|
2016-01-21 16:07:38 +01:00
|
|
|
-e 's|"multipath"|"${multipath-tools}/sbin/multipath"|' \
|
2014-10-22 01:37:32 +02:00
|
|
|
-e '/^def set_friendly_names/a \ return False' \
|
|
|
|
blivet/devicelibs/mpath.py
|
2013-07-02 17:00:39 +02:00
|
|
|
sed -i -e '/"wipefs"/ {
|
|
|
|
s|wipefs|${utillinux}/sbin/wipefs|
|
|
|
|
s/-f/--force/
|
|
|
|
}' blivet/formats/__init__.py
|
|
|
|
sed -i -e 's|"lsof"|"${lsof}/bin/lsof"|' blivet/formats/fs.py
|
|
|
|
sed -i -r -e 's|"(u?mount)"|"${utillinux}/bin/\1"|' blivet/util.py
|
2014-10-22 01:37:32 +02:00
|
|
|
'';
|
2013-07-02 17:00:39 +02:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2014-10-22 01:37:32 +02:00
|
|
|
pykickstart pyparted pyblock pyudev selinuxWithPython cryptsetupWithPython
|
|
|
|
six
|
|
|
|
];
|
2013-07-02 17:00:39 +02:00
|
|
|
|
2015-12-02 15:58:30 +01:00
|
|
|
# Tests are in nixos/tests/blivet.nix.
|
2013-07-02 17:00:39 +02:00
|
|
|
doCheck = false;
|
|
|
|
|
2015-05-27 21:56:04 +02:00
|
|
|
meta = with stdenv.lib; {
|
2013-07-02 17:00:39 +02:00
|
|
|
homepage = "https://fedoraproject.org/wiki/Blivet";
|
|
|
|
description = "Module for management of a system's storage configuration";
|
2015-05-27 21:56:04 +02:00
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
|
|
|
platforms = platforms.linux;
|
2013-07-02 17:00:39 +02:00
|
|
|
};
|
|
|
|
}
|