From b0997077e77465b0773339b0bd643d424c771fa5 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 18 Jan 2023 12:07:00 +0000 Subject: [PATCH] perl: don't use libxcrypt on FreeBSD Tested by building pkgsCross.x86_64-freebsd.perl from x86_64-linux. --- pkgs/development/interpreters/perl/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index 4d95ebf2052..ce7947a842c 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -36,7 +36,16 @@ let optional crossCompiling "mini"; setOutputFlags = false; - propagatedBuildInputs = lib.optional enableCrypt libxcrypt; + # On FreeBSD, if Perl is built with threads support, having + # libxcrypt available will result in a build failure, because + # perl.h will get conflicting definitions of struct crypt_data + # from libc's unistd.h and libxcrypt's crypt.h. + # + # FreeBSD Ports has the same issue building the perl port if + # the libxcrypt port has been installed. + # + # Without libxcrypt, Perl will still find FreeBSD's crypt functions. + propagatedBuildInputs = lib.optional (enableCrypt && !stdenv.isFreeBSD) libxcrypt; disallowedReferences = [ stdenv.cc ];