1{ fetchFromGitHub, stdenv, autoreconfHook, coreutils, gawk
2
3# Kernel dependencies
4, kernel
5}:
6
7with stdenv.lib;
8
9let
10 common = { version
11 , sha256
12 , rev ? "spl-${version}"
13 , broken ? false
14 } @ args : stdenv.mkDerivation rec {
15 name = "spl-${version}-${kernel.version}";
16
17 src = fetchFromGitHub {
18 owner = "zfsonlinux";
19 repo = "spl";
20 inherit rev sha256;
21 };
22
23 patches = [ ./const.patch ./install_prefix.patch ];
24
25 nativeBuildInputs = [ autoreconfHook ] ++ kernel.moduleBuildDependencies;
26
27 hardeningDisable = [ "pic" ];
28
29 preConfigure = ''
30 substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
31 substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
32 substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
33 substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
34 '';
35
36 configureFlags = [
37 "--with-config=kernel"
38 "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
39 "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
40 ];
41
42 enableParallelBuilding = true;
43
44 meta = {
45 description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
46
47 longDescription = ''
48 This kernel module is a porting layer for ZFS to work inside the linux
49 kernel.
50 '';
51
52 inherit broken;
53
54 homepage = http://zfsonlinux.org/;
55 platforms = platforms.linux;
56 license = licenses.gpl2Plus;
57 maintainers = with maintainers; [ jcumming wizeman wkennington fpletz globin ];
58 };
59 };
60in
61 assert kernel != null;
62{
63 splStable = common {
64 version = "0.7.6";
65 sha256 = "1l641d89k48ngmarx9mxh8gw2zzrf7fw7n8zmslhz4h1152plddb";
66 };
67
68 splUnstable = common {
69 version = "2018-01-24";
70 rev = "23602fdb39e1254c669707ec9d2d0e6bcdbf1771";
71 sha256 = "09py2dwj77f6s2qcnkwdslg5nxb3hq2bq39zpxpm6msqyifhl69h";
72 };
73
74 splLegacyCrypto = common {
75 version = "2018-01-24";
76 rev = "23602fdb39e1254c669707ec9d2d0e6bcdbf1771";
77 sha256 = "09py2dwj77f6s2qcnkwdslg5nxb3hq2bq39zpxpm6msqyifhl69h";
78 };
79}