From 0947852a6c1280152470a2fda05410909421c449 Mon Sep 17 00:00:00 2001 From: Nathan Owens Date: Wed, 30 Dec 2020 17:01:43 -0600 Subject: [PATCH] bonnie++: use better cross-build patch --- .../patches/0001-fix-cross-build.patch | 24 +++++++++++++++++++ srcpkgs/bonnie++/patches/configure.patch | 22 ----------------- srcpkgs/bonnie++/template | 8 +++++-- 3 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 srcpkgs/bonnie++/patches/0001-fix-cross-build.patch delete mode 100644 srcpkgs/bonnie++/patches/configure.patch diff --git a/srcpkgs/bonnie++/patches/0001-fix-cross-build.patch b/srcpkgs/bonnie++/patches/0001-fix-cross-build.patch new file mode 100644 index 00000000000000..4ecbafbd9b2a62 --- /dev/null +++ b/srcpkgs/bonnie++/patches/0001-fix-cross-build.patch @@ -0,0 +1,24 @@ +From b73c6b09c0c8d3d9162848a88fbe003d477ad0e2 Mon Sep 17 00:00:00 2001 +From: Nathan Owens +Date: Wed, 30 Dec 2020 16:57:45 -0600 +Subject: [PATCH] fix cross build + +AC_TRY_RUN fails with cross-building +use AC_COMPILE_IFLESE instead +--- +diff --git configure.in configure.in +index 4e75dd2..27c053c 100644 +--- configure.in ++++ configure.in +@@ -83,7 +83,7 @@ void * thread_func(void * param) { return NULL; } + , thread_ldflags="-pthread") + + AC_SUBST(large_file) +-AC_TRY_RUN([#ifndef _LARGEFILE64_SOURCE ++AC_COMPILE_IFELSE([#ifndef _LARGEFILE64_SOURCE + #define _LARGEFILE64_SOURCE + #endif + #include +-- +2.30.0 + diff --git a/srcpkgs/bonnie++/patches/configure.patch b/srcpkgs/bonnie++/patches/configure.patch deleted file mode 100644 index 91bb9c1bb61c58..00000000000000 --- a/srcpkgs/bonnie++/patches/configure.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git configure configure -index 4495abe..951dd7e 100755 ---- configure -+++ configure -@@ -2664,7 +2664,7 @@ $as_echo "$ac_try_echo"; } >&5 - else - { { $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 C compiled programs. -+$as_echo "cannot run C compiled programs. - If you meant to cross compile, use \`--host'. - See \`config.log' for more details" "$LINENO" 5 ; } - fi -@@ -3953,7 +3953,7 @@ rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - --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/bonnie++/template b/srcpkgs/bonnie++/template index 8fa4be8c3d62c6..7074eca54fd6ff 100644 --- a/srcpkgs/bonnie++/template +++ b/srcpkgs/bonnie++/template @@ -3,6 +3,7 @@ pkgname=bonnie++ version=1.98 revision=1 build_style=gnu-configure +hostmakedepends="automake" short_desc="Hard Drive and Filesystem benchmark utility" maintainer="Orphaned " license="GPL-2.0-only" @@ -11,15 +12,18 @@ distfiles="http://www.coker.com.au/bonnie++/bonnie++-${version}.tgz" checksum=6e0bcbc08b78856fd998dd7bcb352d4615a99c26c2dc83d5b8345b102bad0b04 post_extract() { - sed -i -e 's/sbin/bin/g' \ + vsed -i -e 's/sbin/bin/g' \ -e '/-o getc_putc_helper/s/CXX/LINK/' \ -e '/$(LINK)/s/$/ $(LDFLAGS)/' \ -e 's#@mandir@#$(eprefix)/share/man#g' \ Makefile.in } -pre_build() { + +pre_configure() { + autoreconf -fi export MORECFLAGS="$CFLAGS" } + do_install() { make prefix=${DESTDIR}/usr install }