2014-10-22 00:37:32 +01:00
|
|
|
{ stdenv, fetchFromGitHub, buildPythonPackage, pykickstart, pyparted, pyblock
|
|
|
|
, pyudev, six, libselinux, cryptsetup, multipath_tools, lsof, utillinux
|
2013-07-02 16:00:39 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pyenable = { enablePython = true; };
|
|
|
|
selinuxWithPython = libselinux.override pyenable;
|
|
|
|
cryptsetupWithPython = cryptsetup.override pyenable;
|
|
|
|
in buildPythonPackage rec {
|
|
|
|
name = "blivet-${version}";
|
2014-10-22 00:37:32 +01:00
|
|
|
version = "0.67";
|
2013-07-02 16:00:39 +01:00
|
|
|
|
2014-10-22 00:37:32 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dwlehman";
|
|
|
|
repo = "blivet";
|
|
|
|
rev = name;
|
|
|
|
sha256 = "1gk94ghjrxfqnx53hph1j2s7qcv86fjz48is7l099q9c24rjv8ky";
|
2013-07-02 16:00:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2014-10-22 00:37:32 +01:00
|
|
|
sed -i \
|
|
|
|
-e 's|"multipath"|"${multipath_tools}/sbin/multipath"|' \
|
|
|
|
-e '/^def set_friendly_names/a \ return False' \
|
|
|
|
blivet/devicelibs/mpath.py
|
2013-07-02 16:00:39 +01: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 00:37:32 +01:00
|
|
|
sed -i -e '/pvscan/s/, *"--cache"//' blivet/devicelibs/lvm.py
|
|
|
|
'';
|
2013-07-02 16:00:39 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2014-10-22 00:37:32 +01:00
|
|
|
pykickstart pyparted pyblock pyudev selinuxWithPython cryptsetupWithPython
|
|
|
|
six
|
|
|
|
];
|
2013-07-02 16:00:39 +01:00
|
|
|
|
2014-10-22 00:37:32 +01:00
|
|
|
# Tests in <nixos/tests/blivet.nix> coming soon.
|
2013-07-02 16:00:39 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://fedoraproject.org/wiki/Blivet";
|
|
|
|
description = "Module for management of a system's storage configuration";
|
|
|
|
license = [ "GPLv2+" "LGPLv2.1+" ];
|
2013-10-07 16:36:47 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2013-07-02 16:00:39 +01:00
|
|
|
};
|
|
|
|
}
|