dev-libs/criterion: add new package
authorTomas Mozes <hydrapolic@gmail.com>
Thu, 19 Dec 2019 15:05:39 +0000 (16:05 +0100)
committerJoonas Niilola <juippis@gentoo.org>
Fri, 20 Dec 2019 05:45:07 +0000 (07:45 +0200)
Needed for app-admin/syslog-ng tests

Package-Manager: Portage-2.3.82, Repoman-2.3.20
Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
dev-libs/criterion/Manifest [new file with mode: 0644]
dev-libs/criterion/criterion-2.3.3.ebuild [new file with mode: 0644]
dev-libs/criterion/metadata.xml [new file with mode: 0644]

diff --git a/dev-libs/criterion/Manifest b/dev-libs/criterion/Manifest
new file mode 100644 (file)
index 0000000..4b651b0
--- /dev/null
@@ -0,0 +1 @@
+DIST criterion-v2.3.3.tar.bz2 1821413 BLAKE2B 7972bf03870ae07da57252f7d62f3f5818755ad9ea2a0bed7b73d42649fbf5069c1a9af16bd8da9366d0506bbc86ec93a12904809bf91e36618d53f5d8674c18 SHA512 bf53716ff90421a42dd4d1bbd61451a4183aa6436af901c222e43e9e9b3e008008a891157a1c982b80c04e7e68aadc287392503094a3c4ad9c2066432d548e16
diff --git a/dev-libs/criterion/criterion-2.3.3.ebuild b/dev-libs/criterion/criterion-2.3.3.ebuild
new file mode 100644 (file)
index 0000000..ffb7d5c
--- /dev/null
@@ -0,0 +1,54 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_MAKEFILE_GENERATOR="emake"
+inherit cmake-utils
+
+DESCRIPTION="Cross platform unit testing framework for C and C++"
+HOMEPAGE="https://github.com/Snaipe/Criterion"
+SRC_URI="https://github.com/Snaipe/Criterion/releases/download/v${PV}/${PN}-v${PV}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+REPEND="dev-libs/nanomsg:="
+DDEPEND="${DEPEND}
+       test? ( dev-util/cram )"
+BDEPEND="virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}-v${PV}"
+
+QA_EXECSTACK="usr/lib*/libcriterion.so*"
+
+src_configure() {
+       local mycmakeargs=(
+               -DCTESTS="$(usex test ON OFF)"
+       )
+
+       cmake-utils_src_configure
+}
+
+src_compile() {
+       cmake-utils_src_compile
+
+       if use test; then
+               cmake-utils_src_make criterion_tests
+       fi
+}
+
+src_install() {
+       cmake-utils_src_install
+
+       if [[ "/usr/lib" != "/usr/$(get_libdir)" ]]; then
+               mkdir -p "${D}/usr/$(get_libdir)" || die
+               mv "${D}"/usr/lib/libcriterion.so* "${D}/usr/$(get_libdir)/" || die
+       fi
+
+       sed -i "s@${prefix}/lib@${prefix}/$(get_libdir)@g" \
+               "${D}/usr/share/pkgconfig/criterion.pc" || die
+}
diff --git a/dev-libs/criterion/metadata.xml b/dev-libs/criterion/metadata.xml
new file mode 100644 (file)
index 0000000..5df5b28
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>hydrapolic@gmail.com</email>
+    <name>Tomáš Mózes</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">Snaipe/Criterion</remote-id>
+  </upstream>
+</pkgmetadata>