2016-09-05 18:59:00 +02:00
|
|
|
# FIXME: Unify with pkgs/development/python-modules/blivet/default.nix.
|
|
|
|
|
2016-02-19 13:12:11 +01:00
|
|
|
{ stdenv, fetchurl, buildPythonApplication, pykickstart, pyparted, pyblock
|
2014-10-22 01:37:32 +02:00
|
|
|
, libselinux, cryptsetup, multipath_tools, lsof, utillinux
|
2016-09-05 18:59:00 +02:00
|
|
|
, useNixUdev ? true, systemd ? null
|
2014-10-22 01:37:32 +02:00
|
|
|
}:
|
|
|
|
|
2016-09-05 18:59:00 +02:00
|
|
|
assert useNixUdev -> systemd != null;
|
2014-10-22 01:37:32 +02:00
|
|
|
|
2016-02-19 13:12:11 +01:00
|
|
|
buildPythonApplication rec {
|
2014-10-22 01:37:32 +02:00
|
|
|
name = "blivet-${version}";
|
|
|
|
version = "0.17-1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://git.fedorahosted.org/cgit/blivet.git/snapshot/"
|
|
|
|
+ "${name}.tar.bz2";
|
|
|
|
sha256 = "1k3mws2q0ryb7422mml6idmaasz2i2v6ngyvg6d976dx090qnmci";
|
|
|
|
};
|
|
|
|
|
2015-10-21 16:43:34 +02:00
|
|
|
patches = [ ./blivet.patch ];
|
|
|
|
|
2014-10-22 01:37:32 +02:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's|"multipath"|"${multipath_tools}/sbin/multipath"|' \
|
|
|
|
blivet/devicelibs/mpath.py blivet/devices.py
|
|
|
|
sed -i -e '/"wipefs"/ {
|
2015-04-24 12:21:18 +02:00
|
|
|
s|wipefs|${utillinux.bin}/sbin/wipefs|
|
2014-10-22 01:37:32 +02:00
|
|
|
s/-f/--force/
|
|
|
|
}' blivet/formats/__init__.py
|
|
|
|
sed -i -e 's|"lsof"|"${lsof}/bin/lsof"|' blivet/formats/fs.py
|
2015-04-24 12:21:18 +02:00
|
|
|
sed -i -r -e 's|"(u?mount)"|"${utillinux.bin}/bin/\1"|' blivet/util.py
|
2015-10-21 16:43:34 +02:00
|
|
|
'' + stdenv.lib.optionalString useNixUdev ''
|
2014-10-22 01:37:32 +02:00
|
|
|
sed -i -e '/find_library/,/find_library/ {
|
2016-09-05 18:59:00 +02:00
|
|
|
c libudev = "${systemd.lib}/lib/libudev.so.1"
|
2014-10-22 01:37:32 +02:00
|
|
|
}' blivet/pyudev.py
|
2015-10-21 16:43:34 +02:00
|
|
|
'';
|
2014-10-22 01:37:32 +02:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2014-10-22 08:15:30 +02:00
|
|
|
pykickstart pyparted pyblock libselinux cryptsetup
|
2016-09-05 18:59:00 +02:00
|
|
|
] ++ stdenv.lib.optional useNixUdev systemd;
|
2014-10-22 01:37:32 +02:00
|
|
|
|
|
|
|
# tests are currently _heavily_ broken upstream
|
|
|
|
doCheck = false;
|
|
|
|
|
2015-05-27 21:56:04 +02:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://fedoraproject.org/wiki/Blivet;
|
2014-10-22 01:37:32 +02:00
|
|
|
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;
|
2014-10-22 01:37:32 +02:00
|
|
|
};
|
|
|
|
}
|