2016-09-05 17:59:00 +01:00
|
|
|
# FIXME: Unify with pkgs/development/python-modules/blivet/default.nix.
|
|
|
|
|
2016-02-19 12:12:11 +00:00
|
|
|
{ stdenv, fetchurl, buildPythonApplication, pykickstart, pyparted, pyblock
|
2014-10-22 00:37:32 +01:00
|
|
|
, libselinux, cryptsetup, multipath_tools, lsof, utillinux
|
2016-09-05 17:59:00 +01:00
|
|
|
, useNixUdev ? true, systemd ? null
|
2019-11-29 11:03:18 +00:00
|
|
|
# useNixUdev is here for bw compatibility
|
2014-10-22 00:37:32 +01:00
|
|
|
}:
|
|
|
|
|
2016-09-05 17:59:00 +01:00
|
|
|
assert useNixUdev -> systemd != null;
|
2014-10-22 00:37:32 +01:00
|
|
|
|
2016-02-19 12:12:11 +00:00
|
|
|
buildPythonApplication rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "blivet";
|
2014-10-22 00:37:32 +01:00
|
|
|
version = "0.17-1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://git.fedorahosted.org/cgit/blivet.git/snapshot/"
|
2019-08-15 13:41:18 +01:00
|
|
|
+ "${pname}-${version}.tar.bz2";
|
2014-10-22 00:37:32 +01:00
|
|
|
sha256 = "1k3mws2q0ryb7422mml6idmaasz2i2v6ngyvg6d976dx090qnmci";
|
|
|
|
};
|
|
|
|
|
2015-10-21 15:43:34 +01:00
|
|
|
patches = [ ./blivet.patch ];
|
|
|
|
|
2014-10-22 00:37:32 +01: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 11:21:18 +01:00
|
|
|
s|wipefs|${utillinux.bin}/sbin/wipefs|
|
2014-10-22 00:37:32 +01:00
|
|
|
s/-f/--force/
|
|
|
|
}' blivet/formats/__init__.py
|
|
|
|
sed -i -e 's|"lsof"|"${lsof}/bin/lsof"|' blivet/formats/fs.py
|
2015-04-24 11:21:18 +01:00
|
|
|
sed -i -r -e 's|"(u?mount)"|"${utillinux.bin}/bin/\1"|' blivet/util.py
|
2014-10-22 00:37:32 +01:00
|
|
|
sed -i -e '/find_library/,/find_library/ {
|
2020-08-12 19:20:03 +01:00
|
|
|
c libudev = "${stdenv.lib.getLib systemd}/lib/libudev.so.1"
|
2014-10-22 00:37:32 +01:00
|
|
|
}' blivet/pyudev.py
|
2015-10-21 15:43:34 +01:00
|
|
|
'';
|
2014-10-22 00:37:32 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2020-01-18 10:16:59 +00:00
|
|
|
pykickstart pyparted pyblock libselinux cryptsetup
|
2016-09-05 17:59:00 +01:00
|
|
|
] ++ stdenv.lib.optional useNixUdev systemd;
|
2014-10-22 00:37:32 +01:00
|
|
|
|
|
|
|
# tests are currently _heavily_ broken upstream
|
|
|
|
doCheck = false;
|
|
|
|
|
2015-05-27 20:56:04 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://fedoraproject.org/wiki/Blivet";
|
2014-10-22 00:37:32 +01:00
|
|
|
description = "Module for management of a system's storage configuration";
|
2015-05-27 20:56:04 +01:00
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
|
|
|
platforms = platforms.linux;
|
2014-10-22 00:37:32 +01:00
|
|
|
};
|
|
|
|
}
|