commit:     06d2b112fde3faca9767a93835c07009ada5b177
Author:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 23 13:12:07 2020 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Mon Mar 23 13:13:50 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06d2b112

dev-libs/check: update subunit logic, fix pkgconfig file

 - subunit & doc handling patches from #711390
 - .pc libdir issue when using multilib #714058

Bug: https://bugs.gentoo.org/711390
Closes: https://bugs.gentoo.org/714058
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-libs/check/check-0.14.0-r2.ebuild              | 58 ++++++++++++++++++++++
 .../check-0.14.0-r2-disable-automagic-dep.patch    | 23 +++++++++
 2 files changed, 81 insertions(+)

diff --git a/dev-libs/check/check-0.14.0-r2.ebuild 
b/dev-libs/check/check-0.14.0-r2.ebuild
new file mode 100644
index 00000000000..c2a9889d2e5
--- /dev/null
+++ b/dev-libs/check/check-0.14.0-r2.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS=cmake
+inherit cmake-multilib
+
+DESCRIPTION="A unit test framework for C"
+HOMEPAGE="https://libcheck.github.io/check/";
+SRC_URI="https://github.com/lib${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 
~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos 
~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc subunit test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="subunit? ( dev-python/subunit[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+       sys-apps/texinfo"
+BDEPEND="doc? ( app-doc/doxygen )"
+
+PATCHES=( "${FILESDIR}/check-0.14.0-r2-disable-automagic-dep.patch" )
+
+src_prepare() {
+       cmake_src_prepare
+
+       # Fix wrong libdir, probably caused by multilib
+       sed -i "s|\${libdir}|/usr/$(get_libdir)|g" check.pc.in || die "sed .pc 
failed."
+}
+
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -DBUILD_TESTING=$(usex test ON OFF)
+               -DCHECK_ENABLE_SUBUNIT=$(usex subunit ON OFF)
+       )
+
+       cmake_src_configure
+}
+
+multilib_src_compile() {
+       cmake_src_compile
+
+       if use doc && multilib_is_native_abi; then
+               cd "${S}"/doc/ || die "Failed to switch directories."
+               doxygen "." || die "Failed to run doxygen to generate docs."
+       fi
+}
+
+multilib_src_install_all() {
+       use doc && local HTML_DOCS=( "${S}"/doc/html/. )
+       einstalldocs
+
+       find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
+}

diff --git a/dev-libs/check/files/check-0.14.0-r2-disable-automagic-dep.patch 
b/dev-libs/check/files/check-0.14.0-r2-disable-automagic-dep.patch
new file mode 100644
index 00000000000..0843413ee2e
--- /dev/null
+++ b/dev-libs/check/files/check-0.14.0-r2-disable-automagic-dep.patch
@@ -0,0 +1,23 @@
+--- a/CMakeLists.txt   2020-03-21 09:42:30.411037664 +0200
++++ b/CMakeLists.txt   2020-03-21 09:49:12.358161439 +0200
+@@ -365,15 +365,16 @@
+   ADD_DEFINITIONS(-DHAVE_LIBRT=1)
+ endif (HAVE_LIBRT)
+
+-check_library_exists(subunit subunit_test_start "" HAVE_SUBUNIT)
+-if (HAVE_SUBUNIT)
++option(CHECK_ENABLE_SUBUNIT "Enable subunit support" ON)
++if (CHECK_ENABLE_SUBUNIT)
+   set(SUBUNIT "subunit")
+   set(ENABLE_SUBUNIT 1)
++  set(HAVE_SUBUNIT 1)
+   add_definitions(-DENABLE_SUBUNIT=1)
+-else(HAVE_SUBUNIT)
++else(CHECK_ENABLE_SUBUNIT)
+   set(ENABLE_SUBUNIT 0)
+   add_definitions(-DENABLE_SUBUNIT=0)
+-endif (HAVE_SUBUNIT)
++endif (CHECK_ENABLE_SUBUNIT)
+
+ 
###############################################################################
+ # Generate "config.h" from "cmake/config.h.in"

Reply via email to