From 4dfb44ee55bbd43c8ad5d00063e7b50248a64fa8 Mon Sep 17 00:00:00 2001 From: Nathan Owens Date: Sun, 3 Jan 2021 08:27:04 -0600 Subject: [PATCH] diction: add proper patch for cross-build --- srcpkgs/diction/patches/0001-fix-cross.patch | 48 ++++++++++++++++++++ srcpkgs/diction/template | 14 ++---- 2 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 srcpkgs/diction/patches/0001-fix-cross.patch diff --git a/srcpkgs/diction/patches/0001-fix-cross.patch b/srcpkgs/diction/patches/0001-fix-cross.patch new file mode 100644 index 00000000000..4bcd2f95a46 --- /dev/null +++ b/srcpkgs/diction/patches/0001-fix-cross.patch @@ -0,0 +1,48 @@ +From 27fb43ea79be3caefd109a082f4744efb925605c Mon Sep 17 00:00:00 2001 +From: Nathan Owens +Date: Sun, 3 Jan 2021 08:44:42 -0600 +Subject: [PATCH] fix cross + +--- + configure.in | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git configure.in configure.in +index 1e4dac4..44ee54f 100644 +--- configure.in ++++ configure.in +@@ -34,7 +34,7 @@ AC_CHECK_FUNCS(strerror) + AC_SEARCH_LIBS(regcomp, [regex pcre]) + + AC_MSG_CHECKING(for broken realloc) +-AC_TRY_RUN([#include ++AC_COMPILE_IFELSE([#include + #include + #include + +@@ -49,7 +49,7 @@ int main(void) + realloc((void*)0,1); + exit(0); + } +-],AC_MSG_RESULT(no),AC_DEFINE(BROKEN_REALLOC) AC_MSG_RESULT(yes)) ++],AC_MSG_RESULT(no),AC_DEFINE([BROKEN_REALLOC, [1], [Define broken realloc]]) AC_MSG_RESULT(yes)) + + USE_NLS=no + AC_CHECK_PROG(MSGFMT,msgfmt,yes,no) +@@ -58,11 +58,11 @@ then + AC_CHECK_HEADERS(libintl.h,[LIBINTL=yes]) + if test "$LIBINTL" = yes + then +- AC_SEARCH_LIBS(gettext,intl,[AC_DEFINE(HAVE_GETTEXT) USE_NLS=yes]) ++ AC_SEARCH_LIBS(gettext,intl,[AC_DEFINE([HAVE_GETTEXT, [1], [Define HAVE_GETTEXT]]) USE_NLS=yes]) + fi + fi + +-AC_DEFINE_UNQUOTED(VERSION,"$VERSION") ++AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Define VERSION]) + AC_SUBST(VERSION) + AC_SUBST(UPDATED) + eval DATADIR=$datadir +-- +2.30.0 + diff --git a/srcpkgs/diction/template b/srcpkgs/diction/template index 0a141dffb58..1ad579d15a2 100644 --- a/srcpkgs/diction/template +++ b/srcpkgs/diction/template @@ -3,18 +3,14 @@ pkgname=diction version=1.11 revision=1 build_style=gnu-configure +hostmakedepends="automake" short_desc="Writing style checkers, diction and style" maintainer="Rui Abreu Ferreira " -license="GPL-3" +license="GPL-3.0-only" homepage="https://www.gnu.org/software/diction/diction.html" distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.gz" checksum=35c2f1bf8ddf0d5fa9f737ffc8e55230736e5d850ff40b57fdf5ef1d7aa024f6 -if [ -n "$CROSS_BUILD" ]; then - pre_configure() { - # cannot check for broken realloc when cross compiling - # but we know from native build that it’s not broken - # so remove the check (default is not broken) - sed -i -e "/checking for broken realloc/,/USE_NLS=no/ {/USE_NLS=no/!d}" configure - } -fi +pre_configure() { + autoreconf -fi +}