libarchive: add patch to fix .pc file

(cherry picked from commit 505530e3de)
This commit is contained in:
Emily 2024-11-19 11:39:30 +00:00 committed by github-actions[bot]
parent 2c9cbf7c3b
commit b5ca14bb98
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,18 @@
diff --git a/configure.ac b/configure.ac
index 0fdfaf06a5..d08611848c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -453,13 +453,8 @@
AC_CHECK_HEADERS([iconv.h],[],[],[#include <stdlib.h>])
if test "x$am_cv_func_iconv" = "xyes"; then
AC_CHECK_HEADERS([localcharset.h])
- am_save_LIBS="$LIBS"
LIBS="${LIBS} ${LIBICONV}"
- if test -n "$LIBICONV"; then
- LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }iconv"
- fi
AC_CHECK_FUNCS([locale_charset])
- LIBS="${am_save_LIBS}"
if test "x$ac_cv_func_locale_charset" != "xyes"; then
# If locale_charset() is not in libiconv, we have to find libcharset.
AC_CHECK_LIB(charset,locale_charset)

View File

@ -40,6 +40,22 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-maV2+Whi4aDG1VLAYpOTxluO9I0zNiZ8fA3w7epGlDg=";
};
patches = [
# The `.pc` file lists `iconv` in `Requires.private` when `-liconv`
# is required, even though common platforms in that situation like
# Darwin dont ship a `.pc` file for their `libiconv`. This isnt
# upstreamed as there are a handful of closed or regressed PRs
# trying to fix it already and it seems upstream added this to deal
# with some nonportable MSYS2 thing or something.
#
# See:
#
# * <https://github.com/libarchive/libarchive/issues/1766>
# * <https://github.com/libarchive/libarchive/issues/1819>
# * <https://github.com/Homebrew/homebrew-core/blob/f8e9e8d4f30979dc99146b5877fce76be6d35124/Formula/lib/libarchive.rb#L48-L52>
./fix-pkg-config-iconv.patch
];
outputs = [ "out" "lib" "dev" ];
postPatch = let