nixpkgs/pkgs/development/python-modules/blivet/default.nix
Frederik Rietdijk ced21f5e1a pythonPackages: remove name attribute`
The `buildPython*` function computes name from `pname` and `version`.
This change removes `name` attribute from all expressions in
`pkgs/development/python-modules`.

While at it, some other minor changes were made as well, such as
replacing `fetchurl` calls with `fetchPypi`.
2018-06-23 18:14:26 +02:00

48 lines
1.4 KiB
Nix

{ stdenv, fetchFromGitHub, buildPythonPackage, pykickstart, pyparted, pyblock
, pyudev, six, libselinux, cryptsetup, multipath-tools, lsof, utillinux
}:
let
pyenable = { enablePython = true; };
selinuxWithPython = libselinux.override pyenable;
cryptsetupWithPython = cryptsetup.override pyenable;
in buildPythonPackage rec {
pname = "blivet";
version = "0.67";
src = fetchFromGitHub {
owner = "dwlehman";
repo = "blivet";
rev = "${pname}-${version}";
sha256 = "1gk94ghjrxfqnx53hph1j2s7qcv86fjz48is7l099q9c24rjv8ky";
};
postPatch = ''
sed -i \
-e 's|"multipath"|"${multipath-tools}/sbin/multipath"|' \
-e '/^def set_friendly_names/a \ return False' \
blivet/devicelibs/mpath.py
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
'';
propagatedBuildInputs = [
pykickstart pyparted pyblock pyudev selinuxWithPython cryptsetupWithPython
six
];
# Tests are in nixos/tests/blivet.nix.
doCheck = false;
meta = with stdenv.lib; {
homepage = https://fedoraproject.org/wiki/Blivet;
description = "Module for management of a system's storage configuration";
license = with licenses; [ gpl2Plus lgpl21Plus ];
platforms = platforms.linux;
};
}