sys-devel/clang: Support pregenerated manpages
authorMichał Górny <mgorny@gentoo.org>
Sat, 21 Dec 2019 08:12:27 +0000 (09:12 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sat, 21 Dec 2019 08:30:03 +0000 (09:30 +0100)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
sys-devel/clang/clang-9.0.1.ebuild

index 8636b7166174b881985e62fe636803cee6690b63..926c06a7ee9c9da3c65e9fe3edb3d892ad4836c6 100644 (file)
@@ -7,8 +7,11 @@ PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
 inherit cmake-utils llvm llvm.org multilib-minimal multiprocessing \
        pax-utils python-single-r1 toolchain-funcs
 
+MANPAGE_P=llvm-9.0.0-manpages
 DESCRIPTION="C language family frontend for LLVM"
 HOMEPAGE="https://llvm.org/"
+SRC_URI="
+       !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/${MANPAGE_P}.tar.bz2 )"
 LLVM_COMPONENTS=( clang clang-tools-extra )
 LLVM_TEST_COMPONENTS=(
        llvm/lib/Testing/Support
@@ -80,6 +83,12 @@ src_unpack() {
        cd x/y || die
        llvm.org_src_unpack
        mv clang-tools-extra clang/tools/extra || die
+
+       if ! use doc; then
+               ebegin "Unpacking ${MANPAGE_P}.tar.bz2"
+               tar -xf "${DISTDIR}/${MANPAGE_P}.tar.bz2" || die
+               eend
+       fi
 }
 
 multilib_src_configure() {
@@ -243,6 +252,12 @@ multilib_src_install_all() {
                python_optimize "${ED}"/usr/lib/llvm/${SLOT}/share/scan-view
        fi
 
+       # install pre-generated manpages
+       if ! use doc; then
+               insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
+               doins "${WORKDIR}/x/y/${MANPAGE_P}/clang"/*.1
+       fi
+
        docompress "/usr/lib/llvm/${SLOT}/share/man"
        # match 'html' non-compression
        use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"