--- /usr/portage/dev-util/gtest/gtest-1.5.0.ebuild 2011-09-18 19:01:13.000000000 +0100 +++ gtest-1.5.0.ebuild 2011-09-28 08:46:36.000000000 +0100 @@ -4,7 +4,7 @@ EAPI="3" PYTHON_DEPEND="2" -inherit autotools eutils python +inherit cmake-utils python DESCRIPTION="Google C++ Testing Framework" HOMEPAGE="http://code.google.com/p/googletest/" @@ -13,7 +13,9 @@ LICENSE="BSD" SLOT="0" KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~ppc-macos" -IUSE="examples threads static-libs" +IUSE="examples threads" + +DOCS="CHANGES CONTRIBUTORS README" pkg_setup() { python_set_active_version 2 @@ -25,28 +27,22 @@ python_convert_shebangs -r 2 . epatch "${FILESDIR}/${P}-asneeded.patch" + epatch "${FILESDIR}/${P}-pthread-as-needed.patch" eautoreconf } src_configure() { - econf \ - $(use_enable static-libs static) \ - $(use_with threads pthreads) || die -} - -src_test() { - # explicitly use parallel make - emake check || die + if use threads ; then + econf --with-pthreads || die + MYCMAKEARGS="-Dbuild_with_pthreads=1" + else + econf || die + fi + cmake-utils_src_configure || die } src_install() { - emake DESTDIR="${D}" install || die "emake install failed" - - dodoc CHANGES CONTRIBUTORS README || die - - if ! use static-libs ; then - rm "${ED}"/usr/lib*/*.la || die - fi + cmake-utils_src_install if use examples ; then insinto /usr/share/doc/${PF}/examples