diff --git a/build-scripts/npth.build b/build-scripts/npth.build index a97ac33..da70fab 100644 --- a/build-scripts/npth.build +++ b/build-scripts/npth.build @@ -1,7 +1,7 @@ #! /bin/bash # npth -# Source: ftp://ftp.gnupg.org/gcrypt/npth/npth-1.6.tar.bz2 +# Source: https://www.gnupg.org/ftp/gcrypt/npth/npth-1.7.tar.bz2 # # $BUILD = Directory to temporarily install # $PKGS = Directory to store built packages @@ -11,6 +11,11 @@ # Recommended: NONE # Optional: NONE +# Apply patches from Chimera Linux +patch -Np1 -i ../patches/npth-chimera/musl-fix-build.patch +patch -Np1 -i ../patches/npth-chimera/pc-file-version.patch +./autogen.sh + # If building with LLVM-17's LLD, set the LDFLAGS # https://github.com/termux/termux-packages/issues/18761#issuecomment-1864098542 LDFLAGS="-Wl,--undefined-version" \ @@ -43,5 +48,5 @@ npth: npth: EOF sudo -S mv -v /tmp/slack-desc install/ && -sudo -S makepkg -l y -c n $PKGS/npth-1.6-$PSUFFIX && +sudo -S makepkg -l y -c n $PKGS/npth-1.7-$PSUFFIX && sudo -S rm -rf ${BUILD}/* diff --git a/patches/npth-chimera/musl-fix-build.patch b/patches/npth-chimera/musl-fix-build.patch new file mode 100644 index 0000000..3f6f986 --- /dev/null +++ b/patches/npth-chimera/musl-fix-build.patch @@ -0,0 +1,34 @@ +From 417abd56fd7bf45cd4948414050615cb1ad59134 Mon Sep 17 00:00:00 2001 +From: NIIBE Yutaka +Date: Fri, 1 Mar 2024 13:53:52 +0900 +Subject: [PATCH] Fix INSERT_EXPOSE_RWLOCK_API for musl C library. + +* configure.ac: Add a case for musl system. + +-- + +GnuPG-bug-id: 5664 +Signed-off-by: NIIBE Yutaka +--- + configure.ac | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index c1091b1..576a26e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -381,7 +381,10 @@ fi + AC_SUBST(INSERT_NO_RWLOCK) + + case "${host}" in +- *-*-linux*|*-*-gnu*) ++ *-*-linux-musl*) ++ INSERT_EXPOSE_RWLOCK_API="1" ++ ;; ++ *-*-linux-gnu*|*-*-gnu*) + INSERT_EXPOSE_RWLOCK_API="defined(__USE_UNIX98) || defined(__USE_XOPEN2K)" + ;; + *) +-- +2.44.0 + diff --git a/patches/npth-chimera/pc-file-version.patch b/patches/npth-chimera/pc-file-version.patch new file mode 100644 index 0000000..00a8bee --- /dev/null +++ b/patches/npth-chimera/pc-file-version.patch @@ -0,0 +1,14 @@ +Otherwise version in .pc file has suffix -unknown which cbuild fails on. +diff --git a/autogen.sh b/autogen.sh +index 9b36158..d5cccd2 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -266,7 +266,7 @@ if [ "$myhost" = "find-version" ]; then + else + ingit=no + beta=yes +- tmp="-unknown" ++ tmp="" + rev="0000000" + rvd="0" + fi