From 201148d02bd106c593d1def08d05bb410e5c669b Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 24 Jan 2023 21:58:18 -0800 Subject: [PATCH] libarchive: backport fix for static linking libarchive 3.6.2 broke static linking, which is causing the nixStatic jobs to fail on Hydra: - https://hydra.nixos.org/job/nixpkgs/cross-trunk/powerpc64le-nixCrossStatic.nixStatic.x86_64-linux - https://hydra.nixos.org/job/nixpkgs/cross-trunk/mips64el-nixCrossStatic.nixStatic.x86_64-linux This commit backports the fix (merged upstream) from libarchive 3.6.3. Co-authored-by: Anderson Torres --- .../libraries/libarchive/default.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix index 381689f9cb6..c8f050c300c 100644 --- a/pkgs/development/libraries/libarchive/default.nix +++ b/pkgs/development/libraries/libarchive/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , acl , attr , autoreconfHook @@ -29,7 +30,7 @@ let autoreconfHook = buildPackages.autoreconfHook269; in assert xarSupport -> libxml2 != null; -stdenv.mkDerivation (finalAttrs: { +(stdenv.mkDerivation (finalAttrs: { pname = "libarchive"; version = "3.6.2"; @@ -118,4 +119,16 @@ stdenv.mkDerivation (finalAttrs: { passthru.tests = { inherit cmake nix samba; }; -}) +})).overrideAttrs(previousAttrs: + assert previousAttrs.version == "3.6.2"; + lib.optionalAttrs stdenv.hostPlatform.isStatic { + patches = [ + # fixes static linking; upstream in releases after 3.6.2 + # https://github.com/libarchive/libarchive/pull/1825 merged upstream + (fetchpatch { + name = "001-only-add-iconv-to-pc-file-if-needed.patch"; + url = "https://github.com/libarchive/libarchive/commit/1f35c466aaa9444335a1b854b0b7223b0d2346c2.patch"; + hash = "sha256-lb+zwWSH6/MLUIROvu9I/hUjSbb2jOWO755WC/r+lbY="; + }) + ]; + })