3
0
Fork 0
forked from mirrors/nixpkgs

linuxPackages.zfs: use the kernel's stdenv when possible

This commit is contained in:
Bernardo Meurer 2021-09-02 01:20:49 -07:00
parent b12705711c
commit a12606bef4
No known key found for this signature in database
GPG key ID: F4C0D53B8D14C246

View file

@ -26,6 +26,14 @@ let
buildKernel = any (n: n == configFile) [ "kernel" "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
, sha256
, extraPatches ? []
@ -34,7 +42,7 @@ let
, latestCompatibleLinuxPackages
, kernelCompatible ? null }:
stdenv.mkDerivation {
stdenv'.mkDerivation {
name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
src = fetchFromGitHub {