nixpkgs/pkgs/os-specific/linux/spl/default.nix

63 lines
2.0 KiB
Nix
Raw Normal View History

{ fetchFromGitHub, stdenv, autoreconfHook, coreutils, gawk
, configFile ? "all"
# Kernel dependencies
, kernel ? null
}:
with stdenv.lib;
2017-07-27 18:00:54 +01:00
let
buildKernel = any (n: n == configFile) [ "kernel" "all" ];
buildUser = any (n: n == configFile) [ "user" "all" ];
2017-07-27 18:00:54 +01:00
in
assert any (n: n == configFile) [ "kernel" "user" "all" ];
assert buildKernel -> kernel != null;
stdenv.mkDerivation rec {
name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
2017-08-12 07:20:09 +01:00
version = "0.7.1";
2017-07-27 18:00:54 +01:00
src = fetchFromGitHub {
owner = "zfsonlinux";
repo = "spl";
rev = "spl-${version}";
2017-08-12 07:20:09 +01:00
sha256 = "0m8qhbdd8n40lbd91s30q4lrw8g169sha0410c8rwk2d5qfaxv9n";
2017-07-27 18:00:54 +01:00
};
2017-07-27 18:00:54 +01:00
patches = [ ./const.patch ./install_prefix.patch ];
2012-10-05 17:11:25 +01:00
2017-07-27 18:00:54 +01:00
nativeBuildInputs = [ autoreconfHook ];
2017-07-27 18:00:54 +01:00
hardeningDisable = [ "pic" ];
2017-07-27 18:00:54 +01:00
preConfigure = ''
substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
'';
2016-02-07 22:44:42 +00:00
2017-07-27 18:00:54 +01:00
configureFlags = [
"--with-config=${configFile}"
] ++ optionals buildKernel [
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
2017-07-27 18:00:54 +01:00
enableParallelBuilding = true;
2017-07-27 18:00:54 +01:00
meta = {
description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
2017-07-27 18:00:54 +01:00
longDescription = ''
This kernel module is a porting layer for ZFS to work inside the linux
kernel.
'';
2017-07-27 18:00:54 +01:00
homepage = http://zfsonlinux.org/;
platforms = platforms.linux;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ jcumming wizeman wkennington fpletz globin ];
};
2017-07-27 18:00:54 +01:00
}