Skip to content

Commit

Permalink
libarchive: backport fix for static linking
Browse files Browse the repository at this point in the history
Picked from commit 201148d from PR #212540
(simplified, as it wouldn't apply anyway)
  • Loading branch information
vcunat committed Feb 9, 2023
1 parent 9a7e735 commit ece614f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkgs/development/libraries/libarchive/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, acl
, attr
, autoreconfHook
Expand Down Expand Up @@ -37,6 +38,18 @@ stdenv.mkDerivation rec {
hash = "sha256-wQbA6vlXH8pnpY7LJLkjrRFEBpcaPR1SqxnK71UVwxg=";
};

patches =
assert version == "3.6.2";
lib.optionals stdenv.hostPlatform.isStatic [
# 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=";
})
];

postPatch = ''
substituteInPlace Makefile.am --replace '/bin/pwd' "$(type -P pwd)"
Expand Down

1 comment on commit ece614f

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vcunat, you pushed a commit directly to master/release branch
instead of going through a Pull Request.

That's highly discouraged beyond the few exceptions listed
on #118661

Please sign in to comment.