From 21112a7c169d8ebbd7a27d706fc287d6495a3a6d Mon Sep 17 00:00:00 2001 From: strager Date: Fri, 3 May 2019 11:14:18 -0700 Subject: [PATCH] libgcrypt: fix 1.5 build on macOS (#59507) libgcrypt-1.5's configure script incorrectly detects x86_64-apple-darwin (macOS) as an ELF platform. This causes failures when compiling assembly sources. Backport libgcrypt's fix for this issue, fixing libgcrypt-1.5's build on macOS. --- pkgs/development/libraries/libgcrypt/1.5.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libgcrypt/1.5.nix b/pkgs/development/libraries/libgcrypt/1.5.nix index 2ccdd14874a1..80cb6641bfba 100644 --- a/pkgs/development/libraries/libgcrypt/1.5.nix +++ b/pkgs/development/libraries/libgcrypt/1.5.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, libgpgerror, enableCapabilities ? false, libcap }: +{ lib, stdenv, fetchpatch, fetchurl, libgpgerror, enableCapabilities ? false, libcap }: assert enableCapabilities -> stdenv.isLinux; @@ -10,6 +10,14 @@ stdenv.mkDerivation rec { sha256 = "0ydy7bgra5jbq9mxl5x031nif3m6y3balc6ndw2ngj11wnsjc61h"; }; + patches = stdenv.lib.optionals stdenv.isDarwin [ + (fetchpatch { + name = "fix-x86_64-apple-darwin.patch"; + sha256 = "138sfwl1avpy19320dbd63mskspc1khlc93j1f1zmylxx3w19csi"; + url = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=patch;h=71939faa7c54e7b4b28d115e748a85f134876a02"; + }) + ]; + buildInputs = [ libgpgerror ] ++ lib.optional enableCapabilities libcap;