From 4739e28eb1ad7e474ebbe051850f7d2b9340d377 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 12 Oct 2023 12:00:28 +0000 Subject: [PATCH] fts: set to musl-fts on musl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NetBSD fts wasn't really designed to be used in this way, and it can produce some strange errors — e.g. I sometimes see duplicate symbols when musl and libnbcompat define the same symbol. More packages used musl-fts directly than the fts package anyway, which can now be changed to use the generic fts. Unlike netbsd.fts, musl-fts doesn't have a setup hook, so we have to tell packages that don't know about it to link against libfts. We could decide to copy netbsd.fts's setup hook later if we want to. --- pkgs/os-specific/linux/libselinux/default.nix | 2 ++ pkgs/tools/compression/xar/default.nix | 2 ++ pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix index 695012effc5c..62db42e13aa0 100644 --- a/pkgs/os-specific/linux/libselinux/default.nix +++ b/pkgs/os-specific/linux/libselinux/default.nix @@ -61,6 +61,8 @@ stdenv.mkDerivation rec { "LIBSEPOLA=${lib.getLib libsepol}/lib/libsepol.a" "ARCH=${stdenv.hostPlatform.linuxArch}" + ] ++ optionals (fts != null) [ + "FTS_LDLIBS=-lfts" ] ++ optionals stdenv.hostPlatform.isStatic [ "DISABLE_SHARED=y" ] ++ optionals enablePython [ diff --git a/pkgs/tools/compression/xar/default.nix b/pkgs/tools/compression/xar/default.nix index fa680ebcf51c..9c03c41054be 100644 --- a/pkgs/tools/compression/xar/default.nix +++ b/pkgs/tools/compression/xar/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { --replace 'openssl/evp.h' 'openssl/crypto.h' ''; + configureFlags = lib.optional (fts != null) "LDFLAGS=-lfts"; + meta = { homepage = "https://mackyle.github.io/xar/"; description = "Extensible Archiver"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c207c5c11d8b..aaaa3fa90315 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -41815,7 +41815,7 @@ with pkgs; mount wall hostname more sysctl getconf getent locale killall xxd watch; - fts = if stdenv.hostPlatform.isMusl then netbsd.fts else null; + fts = if stdenv.hostPlatform.isMusl then musl-fts else null; bsdSetupHook = makeSetupHook { name = "bsd-setup-hook";