|
6 | 6 | }:
|
7 | 7 |
|
8 | 8 | with stdenv.lib;
|
| 9 | + |
9 | 10 | let
|
10 | 11 | buildKernel = any (n: n == configFile) [ "kernel" "all" ];
|
11 | 12 | buildUser = any (n: n == configFile) [ "user" "all" ];
|
| 13 | +in |
| 14 | + assert any (n: n == configFile) [ "kernel" "user" "all" ]; |
| 15 | + assert buildKernel -> kernel != null; |
| 16 | +stdenv.mkDerivation rec { |
| 17 | + name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}"; |
| 18 | + version = "0.7.0"; |
| 19 | + |
| 20 | + src = fetchFromGitHub { |
| 21 | + owner = "zfsonlinux"; |
| 22 | + repo = "spl"; |
| 23 | + rev = "spl-${version}"; |
| 24 | + sha256 = "05qqwhxc9nj94y28c97iwfz8gkjwicrhnkj425yb47gqa8rafazk"; |
| 25 | + }; |
12 | 26 |
|
13 |
| - common = { version, sha256 } @ args : stdenv.mkDerivation rec { |
14 |
| - name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}"; |
15 |
| - |
16 |
| - src = fetchFromGitHub { |
17 |
| - owner = "zfsonlinux"; |
18 |
| - repo = "spl"; |
19 |
| - rev = "spl-${version}"; |
20 |
| - inherit sha256; |
21 |
| - }; |
| 27 | + patches = [ ./const.patch ./install_prefix.patch ]; |
22 | 28 |
|
23 |
| - patches = [ ./const.patch ./install_prefix.patch ]; |
| 29 | + nativeBuildInputs = [ autoreconfHook ]; |
24 | 30 |
|
25 |
| - nativeBuildInputs = [ autoreconfHook ]; |
| 31 | + hardeningDisable = [ "pic" ]; |
26 | 32 |
|
27 |
| - hardeningDisable = [ "pic" ]; |
| 33 | + preConfigure = '' |
| 34 | + substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid |
| 35 | + substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin" |
| 36 | + substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin" |
| 37 | + substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin" |
| 38 | + ''; |
28 | 39 |
|
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 |
| - ''; |
| 40 | + configureFlags = [ |
| 41 | + "--with-config=${configFile}" |
| 42 | + ] ++ optionals buildKernel [ |
| 43 | + "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" |
| 44 | + "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" |
| 45 | + ]; |
35 | 46 |
|
36 |
| - configureFlags = [ |
37 |
| - "--with-config=${configFile}" |
38 |
| - ] ++ optionals buildKernel [ |
39 |
| - "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" |
40 |
| - "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" |
41 |
| - ]; |
| 47 | + enableParallelBuilding = true; |
42 | 48 |
|
43 |
| - enableParallelBuilding = true; |
| 49 | + meta = { |
| 50 | + description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)"; |
44 | 51 |
|
45 |
| - meta = { |
46 |
| - description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)"; |
47 |
| - |
48 |
| - longDescription = '' |
49 |
| - This kernel module is a porting layer for ZFS to work inside the linux |
50 |
| - kernel. |
51 |
| - ''; |
| 52 | + longDescription = '' |
| 53 | + This kernel module is a porting layer for ZFS to work inside the linux |
| 54 | + kernel. |
| 55 | + ''; |
52 | 56 |
|
53 |
| - homepage = http://zfsonlinux.org/; |
54 |
| - platforms = platforms.linux; |
55 |
| - license = licenses.gpl2Plus; |
56 |
| - maintainers = with maintainers; [ jcumming wizeman wkennington fpletz ]; |
57 |
| - }; |
| 57 | + homepage = http://zfsonlinux.org/; |
| 58 | + platforms = platforms.linux; |
| 59 | + license = licenses.gpl2Plus; |
| 60 | + maintainers = with maintainers; [ jcumming wizeman wkennington fpletz globin ]; |
58 | 61 | };
|
59 |
| - |
60 |
| -in |
61 |
| - assert any (n: n == configFile) [ "kernel" "user" "all" ]; |
62 |
| - assert buildKernel -> kernel != null; |
63 |
| - { |
64 |
| - splStable = common { |
65 |
| - version = "0.6.5.11"; |
66 |
| - sha256 = "192val8035pj2rryi3fwb134avzirhv5ifaj5021vh8bbjx75pd5"; |
67 |
| - }; |
68 |
| - splUnstable = common { |
69 |
| - version = "0.7.0-rc5"; |
70 |
| - sha256 = "17y25g02c9swi3n90lhjvazcnsr69nh50dz3b8g1c08zlz9n2akp"; |
71 |
| - }; |
72 |
| - } |
| 62 | +} |