nixpkgs/pkgs/development/python-modules/blivet/default.nix
Eelco Dolstra cae5bfb991 statsd: Don't use <nixpkgs>
This was preventing the Nixpkgs channel from updating, since the
program indexer barfed on:

  error: anonymous function at /nix/store/wdnwbh3kmf68nhqqp0khcyxbdbp43vg5-nixos-14.12.626.b0d594c/nixos/nixpkgs/pkgs/top-level/node-packages.nix:1:1 called without required argument ‘neededNatives’, at /data/releases/nixos/unstable-small/.tmp-nixos-16.03pre72946.c50d013-787/unpack/nixos-16.03pre72946.c50d013/lib/customisation.nix:56:12

because Nixpkgs 16.03 was importing files from Nixpkgs 14.12.

Also added some half-assed checks to detect this issue in the future.
2015-12-02 15:58:30 +01:00

49 lines
1.5 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 {
name = "blivet-${version}";
version = "0.67";
src = fetchFromGitHub {
owner = "dwlehman";
repo = "blivet";
rev = name;
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
sed -i -e '/pvscan/s/, *"--cache"//' blivet/devicelibs/lvm.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;
};
}