From 9532772756e380fc070443f02e66abb6a3d0994c Mon Sep 17 00:00:00 2001 From: Nathan Owens Date: Wed, 30 Dec 2020 09:51:42 -0600 Subject: [PATCH] dar: correctly fix cross patch --- .../dar/patches/0001-fix-cross-builds.patch | 233 ++++++++++++++++++ srcpkgs/dar/patches/fix-configure.patch | 36 --- srcpkgs/dar/template | 7 +- 3 files changed, 238 insertions(+), 38 deletions(-) create mode 100644 srcpkgs/dar/patches/0001-fix-cross-builds.patch delete mode 100644 srcpkgs/dar/patches/fix-configure.patch diff --git a/srcpkgs/dar/patches/0001-fix-cross-builds.patch b/srcpkgs/dar/patches/0001-fix-cross-builds.patch new file mode 100644 index 00000000000..5abc4fb90d0 --- /dev/null +++ b/srcpkgs/dar/patches/0001-fix-cross-builds.patch @@ -0,0 +1,233 @@ +From d2187f4908f3ceba7254e29bc2c7caa4db25c7ab Mon Sep 17 00:00:00 2001 +From: Nathan Owens +Date: Wed, 30 Dec 2020 09:39:27 -0600 +Subject: [PATCH] fix cross-builds + +--- +diff --git configure.ac configure.ac +index cfe6d41..2577aee 100644 +--- configure.ac ++++ configure.ac +@@ -30,10 +30,10 @@ AC_DEFINE_UNQUOTED(DAR_VERSION, "AC_PACKAGE_VERSION", [dar and dar_suite version + + AM_INIT_AUTOMAKE([subdir-objects]) + AM_GNU_GETTEXT([external]) +-AM_GNU_GETTEXT_VERSION ++AM_GNU_GETTEXT_VERSION(0.18) + XGETTEXT_EXTRA_OPTIONS='--keyword=dar_gettext' + AM_ICONV +- ++m4_pattern_allow([^AC_]) + #### + # configure checks what is available from the operational system: + # - it displays things on output for the user running the configure script has status information +@@ -72,7 +72,7 @@ AC_PROG_MAKE_SET + AC_PROG_RANLIB + + AC_MSG_CHECKING([for C++ compiler usability]) +-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], ++AC_TRY_LINK([AC_LANG_PROGRAM([], + [ class test { public: int test; }; ])], + [AC_MSG_RESULT(ok)], + [AC_MSG_ERROR([No C++ compiler found])]) +@@ -461,7 +461,7 @@ AS_IF( [test "x$enable_libz_linking" != "xyes"], + local_libz="no" + ]) + if test "$local_libz" = "yes" ; then +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[ extern "C" { + #if HAVE_ZLIB_H + #include + #endif +@@ -502,7 +502,7 @@ AS_IF( [test "x$enable_libbz2_linking" != "xyes"], + local_libbz2="no" + ]) + if test "$local_libbz2" = "yes" ; then +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[ extern "C" { + #if HAVE_BZLIB_H + #include + #endif +@@ -544,7 +544,7 @@ AS_IF( [test "x$enable_liblzo2_linking" != "xyes"], + local_liblzo2="no" + ]) + if test "$local_liblzo2" = "yes" ; then +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[ extern "C" { + #if HAVE_LZO_LZO1X_H + #include + #endif +@@ -584,7 +584,7 @@ AS_IF( [test "x$enable_libxz_linking" != "xyes"], + local_libxz="no" + ]) + if test "$local_libxz" = "yes" ; then +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[ extern "C" { + #if HAVE_LZMA_H + #include + #endif +@@ -634,7 +634,7 @@ AS_IF( [test "x$enable_libgcrypt_linking" != "xyes"], + min_version_gcrypt_hash_bug="1.6.0" + AC_DEFINE_UNQUOTED(MIN_VERSION_GCRYPT_HASH_BUG, "$min_version_gcrypt_hash_bug", [ligcrypt minimum version without hash bug]) + AC_MSG_CHECKING([for libgcrypt usability]) +- AC_RUN_IFELSE([AC_LANG_PROGRAM([[ extern "C" ++ AC_TRY_COMPILE([AC_LANG_PROGRAM([[ extern "C" + { + #if HAVE_GCRYPT_H + #include +@@ -655,7 +655,7 @@ AS_IF( [test "x$enable_libgcrypt_linking" != "xyes"], + ], + [ AC_DEFINE(CRYPTO_AVAILABLE, 1, [header and linking is available to have strong encryption works]) + AC_MSG_RESULT([ok]) +- AC_RUN_IFELSE([AC_LANG_PROGRAM([[ extern "C" ++ AC_TRY_COMPILE([AC_LANG_PROGRAM([[ extern "C" + { + #if HAVE_GCRYPT_H + #include +@@ -705,7 +705,7 @@ AS_IF( [test "x$enable_ea_support" != "xyes"], + [ AC_CHECK_HEADERS([attr/xattr.h sys/xattr.h]) + AC_CHECK_LIB(attr, [lgetxattr], [], []) + AC_MSG_CHECKING([for Unix Extended Attribute support]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[extern "C" { + #if HAVE_SYS_TYPES_H + #include + #endif +@@ -728,7 +728,7 @@ AS_IF( [test "x$enable_ea_support" != "xyes"], + AC_CHECK_HEADERS([sys/xattr.h]) + AC_CHECK_LIB(c, [fgetxattr]) + AC_MSG_CHECKING([for Mac OS X Extended Attribute support]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[extern "C" { + #if HAVE_SYS_XATTR_H + #include + #endif +@@ -760,7 +760,7 @@ AC_ARG_ENABLE( [nodump-flag], + + AS_IF( [test "x$enable_nodump_flag" != "xyes"], + [AC_MSG_RESULT([extX FSA disabled])], +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { ++ [AC_TRY_LINK([AC_LANG_PROGRAM([[extern "C" { + #include + #if HAVE_SYS_IOCTL_H + #include +@@ -774,7 +774,7 @@ AS_IF( [test "x$enable_nodump_flag" != "xyes"], + AC_MSG_RESULT([found ]) + ], + [ +- AC_LINK_IFELSE( [AC_LANG_PROGRAM([[extern "C" { ++ AC_TRY_LINK( [AC_LANG_PROGRAM([[extern "C" { + #include + #if HAVE_SYS_IOCTL_H + #include +@@ -806,7 +806,7 @@ AC_ARG_ENABLE( [birthtime], + + AS_IF( [test "x$enable_birthtime" != "xyes"], + [AC_MSG_RESULT([hfs+ FSA disabled])], +- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ++ [AC_TRY_LINK([AC_LANG_PROGRAM([[ + extern "C" { + #if HAVE_SYS_TYPE_H + #include +@@ -875,7 +875,7 @@ AS_IF( [test "x$enable_librsync_linking" != "xyes"], + local_librsync="no" + ]) + if test "$local_librsync" = "yes" ; then +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[ extern "C" { + #if HAVE_LIBRSYNC_H + #include + #include +@@ -933,7 +933,7 @@ AS_IF( [test "x$enable_libcurl_linking" != "xyes"], + ]) + + if test "$local_libcurl" = "yes" ; then +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[ extern "C" { + #if HAVE_CURL_CURL_H + #include + #endif +@@ -990,7 +990,7 @@ AS_IF( [test "x$enable_fadvise" != "xyes"], + ) + + AC_MSG_CHECKING([for getopt() availability]); +-AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { ++AC_TRY_LINK([AC_LANG_PROGRAM([[extern "C" { + #if HAVE_STDIO_H + #include + #endif +@@ -1009,7 +1009,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { + [AC_MSG_ERROR([absent but required])]) + + AC_MSG_CHECKING([for getopt_long() availability]); +-AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { ++AC_TRY_LINK([AC_LANG_PROGRAM([[extern "C" { + #if HAVE_STDIO_H + #include + #endif +@@ -1085,7 +1085,7 @@ AS_IF( [test "x$enable_furtive_read" != "xyes"], + AC_MSG_WARN([Furtive read mode disabled]) + ], + [ AC_MSG_CHECKING([furtive read mode availability]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[ extern "C" { + #if HAVE_SYS_TYPE_H + #include + #endif +@@ -1247,7 +1247,7 @@ AS_IF( [ test "x$enable_gpgme_linking" != "xyes" ], + AC_CHECK_HEADERS([gpgme.h]) + AC_CHECK_LIB(gpgme, [gpgme_signers_add], [], []) + AC_MSG_CHECKING([for libgpgme usability]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ++ AC_TRY_LINK([AC_LANG_PROGRAM([[ + #if HAVE_GPGME_H + #include + #endif +@@ -1296,7 +1296,7 @@ AS_IF( [ test "x$enable_thread_safe" != "xyes" ], + [ AC_MSG_NOTICE([thread-safe support disabled])], + [ AC_CHECK_LIB(pthread, [pthread_mutex_init], [], []) + AC_MSG_CHECKING([for POSIX mutex]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[extern "C" { + #if HAVE_PTHREAD_H + #include + #endif +@@ -1312,7 +1312,7 @@ AS_IF( [ test "x$enable_thread_safe" != "xyes" ], + ], + [ AC_MSG_RESULT(no)]) + AC_MSG_CHECKING([for reentrant stdlib calls]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[extern "C" { + #if HAVE_TIME_H + #include + #endif +@@ -1385,7 +1385,7 @@ AS_IF( [ test "x$enable_execinfo" != "xyes" ], + AC_CHECK_HEADERS([execinfo.h]) + AC_CHECK_LIB(execinfo, [backtrace], [], []) + AC_MSG_CHECKING([for backtrace() usability]) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { ++ AC_TRY_LINK([AC_LANG_PROGRAM([[extern "C" { + #if HAVE_EXECINFO_H + #include + #endif +@@ -1464,7 +1464,7 @@ AS_IF( [ test "x$enable_threadar" != "xyes" ], + [ AC_MSG_WARN([Cannot find libthreadar.h header file]) ] + ) + AC_MSG_CHECKING([for libthreadar() operationability]) +- AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ ++ AC_TRY_COMPILE([AC_LANG_PROGRAM( [[ + #if HAVE_LIBTHREADAR_LIBTHREADAR_HPP + #include + #endif +@@ -1523,7 +1523,7 @@ LDFLAGS="$LDFLAGS -static" + LIBS__cache="$LIBS" + LIBS="$LIBS $GPGME_LIBS $LIBCURL_LIBS $LIBTHREADAR_LIBS $CXXSTDFLAGS" + AC_MSG_CHECKING([static linking]) +-AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { ++AC_TRY_LINK([AC_LANG_PROGRAM([[ extern "C" { + #if HAVE_STDIO_H + #include + #endif +-- +2.30.0 + diff --git a/srcpkgs/dar/patches/fix-configure.patch b/srcpkgs/dar/patches/fix-configure.patch deleted file mode 100644 index 1e3111bb8e6..00000000000 --- a/srcpkgs/dar/patches/fix-configure.patch +++ /dev/null @@ -1,36 +0,0 @@ -Disable cross compile checks for libgcrypt usability -tests. They are not required. - ---- configure 2015-10-18 14:02:02.423216637 +0200 -+++ configure 2015-10-18 14:04:45.198228372 +0200 -@@ -22294,7 +22294,7 @@ - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgcrypt usability" >&5 - $as_echo_n "checking for libgcrypt usability... " >&6; } -- if test "$cross_compiling" = yes; then : -+ if test "$cross_compiling" = xxx; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - as_fn_error $? "cannot run test program while cross compiling -@@ -22334,7 +22334,7 @@ - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 - $as_echo "ok" >&6; } -- if test "$cross_compiling" = yes; then : -+ if test "$cross_compiling" = xxx; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - as_fn_error $? "cannot run test program while cross compiling -diff --git configure configure -index 157b7a9..7c6a50d 100755 ---- configure -+++ configure -@@ -25481,7 +25481,7 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libthreadar() operationability" >&5 - $as_echo_n "checking for libthreadar() operationability... " >&6; } -- if test "$cross_compiling" = yes; then : -+ if test "$cross_compiling" = xxx; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - as_fn_error $? "cannot run test program while cross compiling diff --git a/srcpkgs/dar/template b/srcpkgs/dar/template index c289909e812..efc5ba830ef 100644 --- a/srcpkgs/dar/template +++ b/srcpkgs/dar/template @@ -16,11 +16,14 @@ distfiles="${SOURCEFORGE_SITE}/dar/dar-${version}.tar.gz" checksum=3fea9ff9e55fb9827e17a080de7d1a2605b82c2320c0dec969071efefdbfd097 if [ "$CROSS_BUILD" ]; then - configure_args+=" --with-gpgme-prefix=${XBPS_CROSS_BASE}/usr - ac_cv_lib_gcrypt_gcry_check_version=false" + configure_args+=" --with-gpgme-prefix=${XBPS_CROSS_BASE}/usr" LDFLAGS="-L${XBPS_CROSS_BASE}/usr/lib -lgcrypt" fi +pre_configure() { + autoreconf -fi +} + do_check() { # need to be run as root :