dev-libs/grok: Rev bump to allow building against >=gperf-3.1

Closes: https://github.com/jordansissel/grok/issues/29
Package-Manager: Portage-2.3.5, Repoman-2.3.2
This commit is contained in:
Thomas Deutschmann
2017-05-22 15:42:58 +02:00
parent 0bdc0027d7
commit 6cec5ed8f0
3 changed files with 125 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
--- a/Makefile
+++ b/Makefile
@@ -25,10 +25,12 @@ else
GPERF?=/usr/bin/gperf
endif
+LIBS=-lpcre -levent -rdynamic -ltokyocabinet
+
# For linux, we need libdl for dlopen()
# On FreeBSD, comment this line out.
ifeq ($(PLATFORM), GNULinux)
-LDFLAGS+=-ldl
+LIBS+=-ldl
endif
# #############################################
@@ -41,8 +43,7 @@ VERSION=$(shell sh $(BASE)/version.sh)
#CFLAGS+=-g
#LDFLAGS+=-g
-CFLAGS+=-pipe -fPIC -I. -O2
-LDFLAGS+=-lpcre -levent -rdynamic -ltokyocabinet
+CFLAGS+=-fPIC -I.
LIBSUFFIX=$(shell sh $(BASE)/platform.sh libsuffix)
VERLIBSUFFIX=$(shell sh $(BASE)/platform.sh libsuffix $(MAJOR))
@@ -50,8 +51,8 @@ DYNLIBFLAG=$(shell sh $(BASE)/platform.sh dynlibflag)
LIBNAMEFLAG=$(shell sh $(BASE)/platform.sh libnameflag $(MAJOR) $(INSTALLLIB))
# Sane includes
-CFLAGS+=-I/usr/local/include
-LDFLAGS+=-L/usr/local/lib
+#CFLAGS+=-I/usr/local/include
+#LDFLAGS+=-L/usr/local/lib
# Platform so we know what to dlopen
CFLAGS+=-DPLATFORM_$(PLATFORM)
@@ -97,6 +98,7 @@ install: libgrok.$(LIBSUFFIX) grok discogrok $(GROKHEADER)
install -m 755 grok $(DESTDIR)$(PREFIX)/bin
install -m 755 discogrok $(DESTDIR)$(PREFIX)/bin
install -m 644 libgrok.$(LIBSUFFIX) $(DESTDIR)$(PREFIX)/lib
+ ln -s libgrok.$(LIBSUFFIX) $(DESTDIR)$(PREFIX)/lib/libgrok.$(LIBSUFFIX).1
for header in $(GROKHEADER); do \
install -m 644 $$header $(DESTDIR)$(PREFIX)/include; \
done
@@ -162,14 +164,14 @@ cleanver:
# Binary creation
grok: LDFLAGS+=-levent
grok: $(GROKOBJ) conf.tab.o conf.yy.o main.o grok_config.o
- $(CC) $(LDFLAGS) $^ -o $@
+ $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
discogrok: $(GROKOBJ) discover_main.o
- $(CC) $(LDFLAGS) $^ -o $@
+ $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
libgrok.$(LIBSUFFIX):
libgrok.$(LIBSUFFIX): $(GROKOBJ)
- $(CC) $(LDFLAGS) -fPIC $(DYNLIBFLAG) $(LIBNAMEFLAG) $^ -o $@
+ $(CC) $(LDFLAGS) -fPIC $(DYNLIBFLAG) $(LIBNAMEFLAG) $^ $(LIBS) -o $@
libgrok.$(VERLIBSUFFIX): libgrok.$(LIBSUFFIX);
ln -s $< $@

View File

@@ -0,0 +1,26 @@
Closes: https://github.com/jordansissel/grok/issues/28
Closes: https://github.com/jordansissel/grok/issues/29
--- a/Makefile
+++ b/Makefile
@@ -213,8 +213,8 @@ grok_capture_xdr.h: grok_capture.x
rpcgen -h $< -o $@
%.c: %.gperf
- @if $(GPERF) --version | head -1 | egrep -v '3\.[0-9]+\.[0-9]+' ; then \
- echo "We require gperf version >= 3.0.3" ; \
+ @if $(GPERF) --version | head -1 | grep --quiet -E '[0-2]\.[0-9]\.[0-9]+|3\.0\.[0-9]+' ; then \
+ echo "We require gperf version >= 3.1.0" ; \
exit 1; \
fi
$(GPERF) $< > $@
--- a/grok_matchconf_macro.h
+++ b/grok_matchconf_macro.h
@@ -19,6 +19,6 @@ struct strmacro {
#endif
/* this function is generated by gperf */
-const struct strmacro *patname2macro(const char *str, unsigned int len);
+const struct strmacro *patname2macro(const char *str, size_t len);
#endif /* _GROK_MATCHCONF_MACRO_ */

View File

@@ -0,0 +1,36 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit toolchain-funcs
DESCRIPTION="DRY and RAD for regular expressions"
HOMEPAGE="https://github.com/jordansissel/grok https://code.google.com/p/semicomplete/wiki/Grok"
SRC_URI="https://github.com/jordansissel/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~hppa ~x86"
IUSE=""
CDEPEND="dev-db/tokyocabinet
>=dev-libs/libevent-1.3:=
>=dev-libs/libpcre-7.6"
RDEPEND="${CDEPEND}"
DEPEND="${CDEPEND}
>=dev-util/gperf-3.1"
PATCHES=(
"${FILESDIR}"/grok-0.9.2-Makefile.patch
"${FILESDIR}"/0.9.2-build-with-pcre-lt-8.34.patch
"${FILESDIR}"/grok-0.9.2-build-with-gperf-3.1.patch
)
src_prepare() {
default
tc-export CC
}