From 533a90d6809e2e922d8122bab8015f622b44aee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 29 Mar 2024 21:11:35 +0700 Subject: [PATCH] apr: update to 1.7.4. --- .../hooks/pre-configure/02-script-wrapper.sh | 1 - srcpkgs/apr/patches/atomic64.patch | 56 ------------------- .../apr/patches/partial-disable-test.patch | 48 ++++++++++++++++ srcpkgs/apr/template | 41 +++++++------- srcpkgs/electron24/patches/fix-include.patch | 10 ++++ 5 files changed, 79 insertions(+), 77 deletions(-) delete mode 100644 srcpkgs/apr/patches/atomic64.patch create mode 100644 srcpkgs/apr/patches/partial-disable-test.patch diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh index 81e7b7bd2ee2fb..004c68442c061c 100644 --- a/common/hooks/pre-configure/02-script-wrapper.sh +++ b/common/hooks/pre-configure/02-script-wrapper.sh @@ -239,6 +239,5 @@ hook() { generic_wrapper3 giblib-config python_wrapper python-config 2.7 python_wrapper python3-config 3.12 - apr_apu_wrapper apr-1-config apr_apu_wrapper apu-1-config } diff --git a/srcpkgs/apr/patches/atomic64.patch b/srcpkgs/apr/patches/atomic64.patch deleted file mode 100644 index ced9b7df0abd50..00000000000000 --- a/srcpkgs/apr/patches/atomic64.patch +++ /dev/null @@ -1,56 +0,0 @@ -commit 69e9378eb86357d4361322256d5d5a39ff4a592d -Author: q66 -Date: Fri Jan 10 13:04:37 2020 +0100 - - use __atomic builtins instead of legacy __sync - - This allows for 64-bit atomic ops on platforms that don't natively - support them such as armv6 and ppc32. - -diff --git atomic/unix/builtins64.c atomic/unix/builtins64.c -index 4a4b685..90b5c5e 100644 ---- a/atomic/unix/builtins64.c -+++ b/atomic/unix/builtins64.c -@@ -30,35 +30,34 @@ APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val) - - APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val) - { -- return __sync_fetch_and_add(mem, val); -+ return __atomic_fetch_add(mem, val, __ATOMIC_SEQ_CST); - } - - APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val) - { -- __sync_fetch_and_sub(mem, val); -+ __atomic_fetch_sub(mem, val, __ATOMIC_SEQ_CST); - } - - APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem) - { -- return __sync_fetch_and_add(mem, 1); -+ return __atomic_fetch_add(mem, 1, __ATOMIC_SEQ_CST); - } - - APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem) - { -- return __sync_sub_and_fetch(mem, 1); -+ return (int)__atomic_sub_fetch(mem, 1, __ATOMIC_SEQ_CST); - } - - APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with, - apr_uint64_t cmp) - { -- return __sync_val_compare_and_swap(mem, cmp, with); -+ __atomic_compare_exchange_n(mem, &cmp, with, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); -+ return cmp; - } - - APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val) - { -- __sync_synchronize(); -- -- return __sync_lock_test_and_set(mem, val); -+ return __atomic_exchange_n(mem, val, __ATOMIC_SEQ_CST); - } - - #endif /* USE_ATOMICS_BUILTINS */ diff --git a/srcpkgs/apr/patches/partial-disable-test.patch b/srcpkgs/apr/patches/partial-disable-test.patch new file mode 100644 index 00000000000000..88cca73cf7f52c --- /dev/null +++ b/srcpkgs/apr/patches/partial-disable-test.patch @@ -0,0 +1,48 @@ +musl never unload libraries +--- a/test/testdso.c ++++ b/test/testdso.c +@@ -117,6 +117,7 @@ static void test_dso_sym_return_value(ab + + static void test_unload_module(abts_case *tc, void *data) + { ++#ifdef __GLIBC__ + apr_dso_handle_t *h = NULL; + apr_status_t status; + char errstr[256]; +@@ -131,6 +132,7 @@ static void test_unload_module(abts_case + + status = apr_dso_sym(&func1, h, "print_hello"); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); ++#endif + } + + +@@ -203,6 +205,7 @@ static void test_dso_sym_return_value_li + + static void test_unload_library(abts_case *tc, void *data) + { ++#ifdef __GLIBC__ + apr_dso_handle_t *h = NULL; + apr_status_t status; + char errstr[256]; +@@ -217,6 +220,7 @@ static void test_unload_library(abts_cas + + status = apr_dso_sym(&func1, h, "print_hello"); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ESYMNOTFOUND(status)); ++#endif + } + + #endif /* def(LIB_NAME) */ +--- a/test/testsockets.c ++++ b/test/testsockets.c +@@ -232,6 +232,10 @@ abts_suite *testsockets(abts_suite *suit + abts_run_test(suite, sendto_receivefrom6, NULL); + #endif + ++ if (getenv("XBPS_BUILD_ENVIRONMENT") == NULL) { ++ return suite; ++ } ++ + abts_run_test(suite, socket_userdata, NULL); + + return suite; diff --git a/srcpkgs/apr/template b/srcpkgs/apr/template index 38b6d1e4927846..f6131e5a0655e9 100644 --- a/srcpkgs/apr/template +++ b/srcpkgs/apr/template @@ -1,27 +1,28 @@ # Template file for 'apr' pkgname=apr -version=1.7.0 -revision=4 +version=1.7.4 +revision=1 build_style=gnu-configure configure_args="--with-installbuilddir=/usr/share/apr-1/build" makedepends="expat-devel libuuid-devel" +checkdepends="iana-etc" short_desc="Apache Portable Runtime Library" maintainer="Orphaned " license="Apache-2.0" homepage="https://apr.apache.org/" distfiles="https://archive.apache.org/dist/apr/apr-${version}.tar.bz2" -checksum=e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea - -# Do not redefine struct iovec in include/apr_want.h -CFLAGS="-DAPR_IOVEC_DEFINED=1" +checksum=fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577 # Can't run test programs when cross compiling +# NOTE always diff between native and cross build!!! if [ "$CROSS_BUILD" ]; then configure_args+=" apr_cv_pthreads_cflags=-pthread" configure_args+=" apr_cv_process_shared_works=yes" configure_args+=" apr_cv_mutex_robust_shared=yes" configure_args+=" apr_cv_tcp_nodelay_with_cork=yes" - configure_args+=" ac_cv_func_sem_open=sem_open" + configure_args+=" ac_cv_func_sem_open=yes" + configure_args+=" ac_cv_mmap__dev_zero=yes" + configure_args+=" ac_cv_struct_rlimit=yes" fi # The apr package doesn't use crypt_r, however apr-util does, @@ -30,29 +31,29 @@ if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then makedepends+=" libxcrypt-devel" fi -pre_build() { - if [ "$CROSS_BUILD" ]; then - vsed -i Makefile \ - -e "/LINK_PROG.*OBJECTS_gen_test_char/s|.*|\t${BUILD_CC} ${BUILD_CFLAGS} tools/gen_test_char.c -o tools/gen_test_char|" - # Fixup some not detected configure results to match native builds - vsed -i include/apr.h \ - -e "/#define APR_HAVE_SHMEM_MMAP_ZERO/s;0;1;" \ - -e "/#define APR_HAVE_IOVEC/s;0;1;" \ - -e "/#define APR_HAS_POSIXSEM_SERIALIZE/s;0;1;" \ - -e "/#define APR_HAS_PROC_PTHREAD_SERIALIZE/s;0;1;" - fi +do_check() { + export XBPS_BUILD_ENVIRONMENT + cd test + make ${makejobs} + ./testall } post_install() { + sed -i -e 's,-ffile-prefix-map=[^[:space:]]*,,' \ + "$DESTDIR/usr/share/apr-1/build/apr_rules.mk" if [ "$CROSS_BUILD" ]; then - vsed -i -e "s,$XBPS_CROSS_BASE,,g" \ - "$DESTDIR/usr/bin/apr-1-config" \ + sed -i -e 's;cross_compiling=.*;cross_compiling=;' \ + "$DESTDIR/usr/bin/apr-1-config" + sed -i -e "s,$XBPS_CROSS_BASE,,g" \ "$DESTDIR/usr/share/apr-1/build/apr_rules.mk" fi } apr-devel_package() { depends="libtool libuuid-devel apr>=${version}_${revision}" + if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then + depends+=" libxcrypt-devel" + fi short_desc+=" - development files" pkg_install() { vmove usr/include diff --git a/srcpkgs/electron24/patches/fix-include.patch b/srcpkgs/electron24/patches/fix-include.patch index 2a8b26b84c8b74..97d2241acebe4f 100644 --- a/srcpkgs/electron24/patches/fix-include.patch +++ b/srcpkgs/electron24/patches/fix-include.patch @@ -301,3 +301,13 @@ namespace pdfium { namespace annotation_flags { +--- a/src/third_party/openscreen/src/platform/base/error.h ++++ b/src/third_party/openscreen/src/platform/base/error.h +@@ -6,6 +6,7 @@ + #define PLATFORM_BASE_ERROR_H_ + + #include ++#include + #include + #include + #include