From 01fc8844e8adce493c814d2e287cf342941ab3f4 Mon Sep 17 00:00:00 2001 From: beefcurtains Date: Thu, 21 May 2015 07:37:58 +0000 Subject: [PATCH 1/2] New package: re2c-0.14.2 --- srcpkgs/re2c/template | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 srcpkgs/re2c/template diff --git a/srcpkgs/re2c/template b/srcpkgs/re2c/template new file mode 100644 index 00000000000..c8eac224095 --- /dev/null +++ b/srcpkgs/re2c/template @@ -0,0 +1,29 @@ +# Template file for 're2c' +pkgname=re2c +version=0.14.2 +revision=1 +build_style=gnu-configure +hostmakedepends="bison" +short_desc="Tool for generating fast C-based recognizers" +maintainer="beefcurtains " +license="Public Domain" +homepage="http://re2c.sourceforge.net/" +distfiles="${SOURCEFORGE_SITE}/${pkgname}/${version}/${pkgname}-${version}.tar.gz" +checksum=a702eb63977af4715555edb41eba3b47bbfdcdb44b566d146869a7db022f1c30 + +pre_configure() { + # re2c uses itself to build, but that's not + # possible when cross-compiling. Here it's + # forced to build on the host first, so the + # dependency can be satisfied. + env - PATH=/usr/bin:/usr/sbin ./configure + make ${makejobs} + mv re2c host_re2c + make clean +} + +post_build() { + ./host_re2c -b scanner.re >scanner.cc + rm -f re2c scanner.o + make ${make_build_args} ${make_build_target} +} From 5e748dc97def8f004326acd82ebb6362c74ab0a8 Mon Sep 17 00:00:00 2001 From: beefcurtains Date: Thu, 21 May 2015 12:45:46 +0000 Subject: [PATCH 2/2] re2c: speed up non-cross compile, allow hooks to be run at proper stages --- srcpkgs/re2c/template | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/srcpkgs/re2c/template b/srcpkgs/re2c/template index c8eac224095..de719fcbe06 100644 --- a/srcpkgs/re2c/template +++ b/srcpkgs/re2c/template @@ -12,17 +12,23 @@ distfiles="${SOURCEFORGE_SITE}/${pkgname}/${version}/${pkgname}-${version}.tar.g checksum=a702eb63977af4715555edb41eba3b47bbfdcdb44b566d146869a7db022f1c30 pre_configure() { - # re2c uses itself to build, but that's not - # possible when cross-compiling. Here it's - # forced to build on the host first, so the - # dependency can be satisfied. - env - PATH=/usr/bin:/usr/sbin ./configure - make ${makejobs} - mv re2c host_re2c - make clean + if [ -n "$CROSS_BUILD" ]; then + # re2c uses itself to build, but that's not + # possible when cross-compiling. Here it's + # forced to build on the host first, so the + # dependency can be satisfied. + env - PATH=/usr/bin:/usr/sbin ./configure + make ${makejobs} + mv re2c host_re2c + make clean + fi } -post_build() { +do_build() { + make ${makejobs} ${make_build_args} ${make_build_target} + if [ ! -e host_re2c ]; then + mv re2c host_re2c + fi ./host_re2c -b scanner.re >scanner.cc rm -f re2c scanner.o make ${make_build_args} ${make_build_target}