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

View File

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