From d6ffaac4ace8d9427a9618d2f2d08a14cf3861c6 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sat, 24 Mar 2018 13:49:05 -0500 Subject: [PATCH 1/3] zfs: libtirpc dep on musl --- pkgs/os-specific/linux/zfs/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index aac1576261d..6088e86218d 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -4,6 +4,7 @@ # Userspace dependencies , zlib, libuuid, python, attr, openssl +, libtirpc # Kernel dependencies , kernel ? null, spl ? null, splUnstable ? null, splLegacyCrypto ? null @@ -49,7 +50,8 @@ let buildInputs = optionals buildKernel [ spl ] ++ optionals buildUser [ zlib libuuid python attr ] - ++ optionals (buildUser && (isUnstable || isLegacyCrypto)) [ openssl ]; + ++ optionals (buildUser && (isUnstable || isLegacyCrypto)) [ openssl ] + ++ optional stdenv.hostPlatform.isMusl [ libtirpc ]; # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work NIX_CFLAGS_LINK = "-lgcc_s"; From 47dc9d7b35e1dfb308ea7285e583cf276bbc0ee1 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sat, 24 Mar 2018 14:00:08 -0500 Subject: [PATCH 2/3] tirpc: remove upstreamed patch, fix w/musl --- pkgs/development/libraries/ti-rpc/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/ti-rpc/default.nix b/pkgs/development/libraries/ti-rpc/default.nix index aa134d35104..99f0bb65441 100644 --- a/pkgs/development/libraries/ti-rpc/default.nix +++ b/pkgs/development/libraries/ti-rpc/default.nix @@ -8,14 +8,12 @@ stdenv.mkDerivation rec { sha256 = "0ppxl3k3nsz0qdakq844i2kj4fvh9h937lhx26bgmpmxq67sghw6"; }; - patches = stdenv.lib.optional stdenv.hostPlatform.isMusl - (fetchpatch { - url = "https://raw.githubusercontent.com/openembedded/openembedded-core/2be873301420ec6ca2c70d899b7c49a7e2b0954d/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch"; - sha256 = "1jmbn0j2bnjp0j9z5vzz5xiwyv3kd28w5pixbqsy2lz6q8nii7cf"; - }); - postPatch = '' sed '1i#include ' -i src/xdr_sizeof.c + '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' + substituteInPlace tirpc/rpc/types.h \ + --replace '#if defined __APPLE_CC__ || defined __FreeBSD__' \ + '#if defined __APPLE_CC__ || defined __FreeBSD__ || !defined __GLIBC__' ''; nativeBuildInputs = [ autoreconfHook ]; From bae5ec0faf435143c8cea72924c8c70cf7f70468 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sat, 24 Mar 2018 14:09:00 -0500 Subject: [PATCH 3/3] zfs: fix hardcoded include path for libtirpc --- pkgs/os-specific/linux/zfs/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index 6088e86218d..2535745e359 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -43,6 +43,9 @@ let postPatch = optionalString buildKernel '' patchShebangs scripts + '' + optionalString stdenv.hostPlatform.isMusl '' + substituteInPlace config/user-libtirpc.m4 \ + --replace /usr/include/tirpc ${libtirpc}/include/tirpc ''; nativeBuildInputs = [ autoreconfHook nukeReferences ]