summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2023-08-15 07:49:04 +0200
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-08-17 18:53:29 +0000
commitfa8eefefde3d8e63da35e75df4eaa208309c32a1 (patch)
tree120887ca76693ff270420080051aeef896f62539
parent8398c6fff661a2adc237ee0816fbbb11978f9e05 (diff)
downloadnixpkgs-fa8eefefde3d8e63da35e75df4eaa208309c32a1.tar
nixpkgs-fa8eefefde3d8e63da35e75df4eaa208309c32a1.tar.gz
nixpkgs-fa8eefefde3d8e63da35e75df4eaa208309c32a1.tar.bz2
nixpkgs-fa8eefefde3d8e63da35e75df4eaa208309c32a1.tar.lz
nixpkgs-fa8eefefde3d8e63da35e75df4eaa208309c32a1.tar.xz
nixpkgs-fa8eefefde3d8e63da35e75df4eaa208309c32a1.tar.zst
nixpkgs-fa8eefefde3d8e63da35e75df4eaa208309c32a1.zip
libarchive: make static patch unconditional
Cabal 3.8 has the same requirements as pkgsStatic even when linking
dynamically, so this patch will be useful for compiling
haskellPackages.libarchive.

https://github.com/haskell/cabal/issues/8455
-rw-r--r--pkgs/development/libraries/libarchive/default.nix26
1 files changed, 12 insertions, 14 deletions
diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix
index c8f050c300c..de305474a3a 100644
--- a/pkgs/development/libraries/libarchive/default.nix
+++ b/pkgs/development/libraries/libarchive/default.nix
@@ -30,7 +30,7 @@ let
   autoreconfHook = buildPackages.autoreconfHook269;
 in
 assert xarSupport -> libxml2 != null;
-(stdenv.mkDerivation (finalAttrs: {
+stdenv.mkDerivation (finalAttrs: {
   pname = "libarchive";
   version = "3.6.2";
 
@@ -43,6 +43,16 @@ assert xarSupport -> libxml2 != null;
 
   outputs = [ "out" "lib" "dev" ];
 
+  patches = [
+    # fixes static linking; upstream in releases after 3.6.2
+    # https://github.com/libarchive/libarchive/pull/1825 merged upstream
+    (assert finalAttrs.version == "3.6.2"; 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=";
+    })
+  ];
+
   postPatch = let
     skipTestPaths = [
       # test won't work in nix sandbox
@@ -119,16 +129,4 @@ assert xarSupport -> libxml2 != null;
   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=";
-      })
-    ];
-  })
+})