dev-libs/zlog: Revbump to 1.2.12-r1, handle libdir properly #628732
authorPatrick McLean <chutzpah@gentoo.org>
Wed, 14 Feb 2018 01:16:03 +0000 (17:16 -0800)
committerPatrick McLean <chutzpah@gentoo.org>
Wed, 14 Feb 2018 01:16:03 +0000 (17:16 -0800)
Also random QA fixes, make sure we are using the right compiler, CFLAGS
gets passed around properly, use eapply and PATCHES since it's already
EAPI=6.

Closes: https://bugs.gentoo.org/628732
Package-Manager: Portage-2.3.24, Repoman-2.3.6

dev-libs/zlog/files/zlog-testsuite-flags.patch [new file with mode: 0644]
dev-libs/zlog/files/zlog_no_werr.patch
dev-libs/zlog/zlog-1.2.12-r1.ebuild [new file with mode: 0644]

diff --git a/dev-libs/zlog/files/zlog-testsuite-flags.patch b/dev-libs/zlog/files/zlog-testsuite-flags.patch
new file mode 100644 (file)
index 0000000..4ce0a4b
--- /dev/null
@@ -0,0 +1,22 @@
+--- zlog-1.2.12.orig/test/makefile     2013-09-25 04:38:42.000000000 -0700
++++ zlog-1.2.12/test/makefile  2018-02-13 16:59:33.812131188 -0800
+@@ -1,3 +1,6 @@
++CFLAGS := -O2 -g
++CC := gcc
++
+ exe =                 \
+       test_tmp        \
+       test_buf        \
+@@ -24,10 +27,10 @@
+ all     :       $(exe)
+ $(exe)  :       %:%.o
+-      gcc -O2 -g -o $@ $^ -L../src -lzlog -lpthread -Wl,-rpath ../src
++      $(CC) $(CFLAGS) -o $@ $^ -L../src -lzlog -lpthread -Wl,-rpath ../src
+ .c.o  :
+-      gcc -O2 -g -Wall -D_GNU_SOURCE -o $@ -c $< -I. -I../src
++      $(CC) $(CLFAGS) -Wall -D_GNU_SOURCE -o $@ -c $< -I. -I../src
+ clean :
+       rm -f press.log* *.o $(exe)
index 6cb2e87086721882cf197fc6c7f598faa6d089cf..b01325db09d0d5bbd19c48c6a0664d4625d34213 100644 (file)
@@ -1,5 +1,5 @@
---- src/makefile.orig  2016-08-11 10:40:49.466873499 +0200
-+++ src/makefile       2016-08-11 10:40:59.626762850 +0200
+--- a/src/makefile     2016-08-11 10:40:49.466873499 +0200
++++ b/src/makefile     2016-08-11 10:40:59.626762850 +0200
 @@ -32,7 +32,7 @@
  # Fallback to gcc when $CC is not in $PATH.
  CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
diff --git a/dev-libs/zlog/zlog-1.2.12-r1.ebuild b/dev-libs/zlog/zlog-1.2.12-r1.ebuild
new file mode 100644 (file)
index 0000000..cd97f55
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="A reliable, thread safe, clear-model, pure C logging library."
+HOMEPAGE="http://hardysimpson.github.io/zlog/"
+SRC_URI="https://github.com/HardySimpson/${PN}/archive/${PV}.tar.gz -> ${PN}-v${PV}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+PATCHES=(
+       "${FILESDIR}/zlog_no_werr.patch"
+       "${FILESDIR}/zlog-testsuite-flags.patch"
+)
+
+src_compile() {
+       emake CC="$(tc-getCC)"
+}
+
+src_test () {
+       emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" test || die "Tests failed."
+}
+
+src_install() {
+       emake LIBRARY_PATH="$(get_libdir)" PREFIX="${D}/usr" install
+}