From d5765d13e11ab5d77669993a21d9fea583348e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Fri, 1 Sep 2017 14:31:04 +0200 Subject: [PATCH] xerces-c: fix cross --- .../patches/fix-configure-cross.patch | 80 +++++++++++++++++++ srcpkgs/xerces-c/template | 9 ++- 2 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/xerces-c/patches/fix-configure-cross.patch diff --git a/srcpkgs/xerces-c/patches/fix-configure-cross.patch b/srcpkgs/xerces-c/patches/fix-configure-cross.patch new file mode 100644 index 0000000000..4f98598767 --- /dev/null +++ b/srcpkgs/xerces-c/patches/fix-configure-cross.patch @@ -0,0 +1,80 @@ +Remove checks which require running a binary in order to +make cross compiling possible again. The results are all +true for glibc and musl libc, thus unconditionally add +the corresponding defines via AC_DEFINE_UNQUOTED. + +--- configure.ac 2017-08-06 20:09:44.000000000 +0200 ++++ configure.ac 2017-09-01 14:22:45.842676418 +0200 +@@ -174,69 +174,9 @@ + ] + ) + +-# The check for mbrlen, wcsrtombs and mbsrtowcs gives a false +-# positive on HP-UX, so we use a different snippet to set the +-# corresponding macro +-# Furthermore, OpenBSD 5.1 doesn't follow the standard that states +-# that the "src" pointer must be set to NULL when a \0 has been +-# converted in the source data, a behaviour that we rely on +-# So we also check for this scenario before using these functions +-AC_MSG_CHECKING([for mbrlen]) +-AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], +- [[mbstate_t st; mbrlen( "t", 5, &st );]])], +- [ +- AC_MSG_RESULT([yes]) +- AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 1, [Define to 1 if you have the `mbrlen' function.]) +- ], +- [ +- AC_MSG_RESULT([no]) +- AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 0, [Define to 1 if you have the `mbrlen' function.]) +- ] +- ) +-AC_MSG_CHECKING([for wcsrtombs]) +-AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include +-#include ]], +- [[ +-mbstate_t st; +-memset(&st, 0, sizeof(st)); +-char buffer[32]; +-const wchar_t* src=L"help"; +-wcsrtombs(buffer, &src, 32, &st); +-if(src==0) +- return 0; +-else +- return 1;]])], +- [ +- AC_MSG_RESULT([yes]) +- AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 if you have the `wcsrtombs' function.]) +- ], +- [ +- AC_MSG_RESULT([no]) +- AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 if you have the `wcsrtombs' function.]) +- ] +- ) +-AC_MSG_CHECKING([for mbsrtowcs]) +-AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include +-#include ]], +- [[ +-mbstate_t st; +-memset(&st, 0, sizeof(st)); +-wchar_t buffer[32]; +-const char* src="help"; +-mbsrtowcs(buffer, &src, 32, &st); +-if(src==0) +- return 0; +-else +- return 1;]])], +- [ +- AC_MSG_RESULT([yes]) +- AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [Define to 1 if you have the `mbsrtowcs' function.]) +- ], +- [ +- AC_MSG_RESULT([no]) +- AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 if you have the `mbsrtowcs' function.]) +- ] +- ) ++AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 1, [Define to 1 if you have the `mbrlen' function.]) ++AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 if you have the `wcsrtombs' function.]) ++AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [Define to 1 if you have the `mbsrtowcs' function.]) + + AC_MSG_CHECKING([if iconv uses const pointers]) + AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], diff --git a/srcpkgs/xerces-c/template b/srcpkgs/xerces-c/template index 87a4c62cd5..538ae6debc 100644 --- a/srcpkgs/xerces-c/template +++ b/srcpkgs/xerces-c/template @@ -1,9 +1,9 @@ # Template file for 'xerces-c' pkgname=xerces-c version=3.2.0 -revision=1 +revision=2 build_style=gnu-configure -hostmakedepends="pkg-config" +hostmakedepends="automake libtool pkg-config" makedepends="libcurl-devel icu-devel" depends="lib${pkgname}>=${version}_${revision}" short_desc="Validating XML parser written in portable C++" @@ -12,12 +12,15 @@ license="Apache-2.0" homepage="http://xerces.apache.org/xerces-c/" distfiles="http://archive.apache.org/dist/xerces/c/3/sources/${pkgname}-${version}.tar.bz2" checksum=9f3327b63fd7eef3de45025449d5d948ab46f066a475706d2e34f94e91617b34 -nocross="https://build.voidlinux.eu/builders/armv7l_builder/builds/4597/steps/shell_3/logs/stdio" case "$XBPS_TARGET_MACHINE" in i686*) export CCACHE_DISABLE=yes esac +pre_configure() { + autoreconf -fi +} + pre_build() { # Copy samples before build: avoid binaries in -doc package mkdir -p _docs