1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 23:20:55 +00:00
nixpkgs/pkgs/os-specific/linux/multipath-tools/default.nix
Neil Mayhew 367b3a99e4 multipath-tools: Fix build failure due to GZIP make var
The multipath-tools makefiles use GZIP as a variable name but this is
also the name of the environment variable gzip uses to get its default
options.

Normally, this wouldn't get into the environment but nixpkgs exports
GZIP=-n in a setup hook. This in turn causes make to export its own
value for this variable. gzip objects to having -c in the environment
variable and aborts, causing the build to fail.
2020-06-02 09:38:29 -06:00

43 lines
1.3 KiB
Nix

{ stdenv, fetchurl, pkgconfig, perl, lvm2, libaio, gzip, readline, systemd, liburcu, json_c }:
stdenv.mkDerivation rec {
pname = "multipath-tools";
version = "0.8.3";
src = fetchurl {
name = "${pname}-${version}.tar.gz";
url = "https://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=snapshot;h=refs/tags/${version};sf=tgz";
sha256 = "1mgjylklh1cx8px8ffgl12kyc0ln3445vbabd2sy8chq31rpiiq8";
};
postPatch = ''
substituteInPlace libmultipath/Makefile --replace /usr/include/libdevmapper.h ${lvm2}/include/libdevmapper.h
sed -i -re '
s,^( *#define +DEFAULT_MULTIPATHDIR\>).*,\1 "'"$out/lib/multipath"'",
' libmultipath/defaults.h
sed -i -e 's,\$(DESTDIR)/\(usr/\)\?,$(prefix)/,g' \
kpartx/Makefile libmpathpersist/Makefile
sed -i -e "s,GZIP,GZ," \
$(find * -name Makefile\*)
'';
nativeBuildInputs = [ gzip pkgconfig perl ];
buildInputs = [ systemd lvm2 libaio readline liburcu json_c ];
makeFlags = [
"LIB=lib"
"prefix=$(out)"
"man8dir=$(out)/share/man/man8"
"man5dir=$(out)/share/man/man5"
"man3dir=$(out)/share/man/man3"
"SYSTEMDPATH=lib"
];
meta = with stdenv.lib; {
description = "Tools for the Linux multipathing driver";
homepage = "http://christophe.varoqui.free.fr/";
license = licenses.gpl2;
platforms = platforms.linux;
};
}