forked from mirrors/nixpkgs
linuxPackages.zfs: use the kernel's stdenv when possible
This commit is contained in:
parent
b12705711c
commit
a12606bef4
|
@ -26,6 +26,14 @@ let
|
||||||
buildKernel = any (n: n == configFile) [ "kernel" "all" ];
|
buildKernel = any (n: n == configFile) [ "kernel" "all" ];
|
||||||
buildUser = any (n: n == configFile) [ "user" "all" ];
|
buildUser = any (n: n == configFile) [ "user" "all" ];
|
||||||
|
|
||||||
|
# XXX: You always want to build kernel modules with the same stdenv as the
|
||||||
|
# kernel was built with. However, since zfs can also be built for userspace we
|
||||||
|
# need to correctly pick between the provided/default stdenv, and the one used
|
||||||
|
# by the kernel.
|
||||||
|
# If you don't do this your ZFS builds will fail on any non-standard (e.g.
|
||||||
|
# clang-built) kernels.
|
||||||
|
stdenv' = if kernel == null then stdenv else kernel.stdenv;
|
||||||
|
|
||||||
common = { version
|
common = { version
|
||||||
, sha256
|
, sha256
|
||||||
, extraPatches ? []
|
, extraPatches ? []
|
||||||
|
@ -34,7 +42,7 @@ let
|
||||||
, latestCompatibleLinuxPackages
|
, latestCompatibleLinuxPackages
|
||||||
, kernelCompatible ? null }:
|
, kernelCompatible ? null }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv'.mkDerivation {
|
||||||
name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
|
name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
|
|
Loading…
Reference in a new issue