linuxPackages.spl: simplify expression

This package only contains a kernel module.
This commit is contained in:
Franz Pletz 2017-12-29 22:45:53 +01:00
parent 1fb0d3d158
commit 84d8ef6e2f
No known key found for this signature in database
GPG Key ID: 846FDED7792617B4
2 changed files with 7 additions and 14 deletions

View File

@ -1,21 +1,18 @@
{ fetchFromGitHub, stdenv, autoreconfHook, coreutils, gawk { fetchFromGitHub, stdenv, autoreconfHook, coreutils, gawk
, configFile ? "all"
# Kernel dependencies # Kernel dependencies
, kernel ? null , kernel
}: }:
with stdenv.lib; with stdenv.lib;
let let
buildKernel = any (n: n == configFile) [ "kernel" "all" ];
buildUser = any (n: n == configFile) [ "user" "all" ];
common = { version common = { version
, sha256 , sha256
, rev ? "spl-${version}" , rev ? "spl-${version}"
, broken ? false , broken ? false
} @ args : stdenv.mkDerivation rec { } @ args : stdenv.mkDerivation rec {
name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}"; name = "spl-${version}-${kernel.version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "zfsonlinux"; owner = "zfsonlinux";
@ -25,7 +22,7 @@ let
patches = [ ./const.patch ./install_prefix.patch ]; patches = [ ./const.patch ./install_prefix.patch ];
nativeBuildInputs = [ autoreconfHook ] ++ optional (kernel != null) kernel.moduleBuildDependencies; nativeBuildInputs = [ autoreconfHook ] ++ kernel.moduleBuildDependencies;
hardeningDisable = [ "pic" ]; hardeningDisable = [ "pic" ];
@ -37,8 +34,7 @@ let
''; '';
configureFlags = [ configureFlags = [
"--with-config=${configFile}" "--with-config=kernel"
] ++ optionals buildKernel [
"--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
]; ];
@ -62,8 +58,7 @@ let
}; };
}; };
in in
assert any (n: n == configFile) [ "kernel" "user" "all" ]; assert kernel != null;
assert buildKernel -> kernel != null;
{ {
splStable = common { splStable = common {
version = "0.7.4"; version = "0.7.4";

View File

@ -12886,10 +12886,8 @@ with pkgs;
sch_cake = callPackage ../os-specific/linux/sch_cake { }; sch_cake = callPackage ../os-specific/linux/sch_cake { };
inherit (callPackage ../os-specific/linux/spl { inherit (callPackage ../os-specific/linux/spl { })
configFile = "kernel"; splStable splUnstable;
inherit kernel;
}) splStable splUnstable;
spl = splStable; spl = splStable;