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

index 656ecf1927e802c3f8a4b0b0eda0941dede100db..938ddb974485eac96757fe1719ba323163135710 100644 (file)
@@ -7,8 +7,12 @@ PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
 inherit cmake-utils llvm.org multilib-minimal multiprocessing \
        pax-utils python-any-r1 toolchain-funcs
 
+# no changes in 9.0.1
+MANPAGE_P=llvm-9.0.0-manpages
 DESCRIPTION="Low Level Virtual Machine"
 HOMEPAGE="https://llvm.org/"
+SRC_URI="
+       !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/${MANPAGE_P}.tar.bz2 )"
 LLVM_COMPONENTS=( llvm )
 llvm.org_set_globals
 
@@ -80,6 +84,16 @@ python_check_deps() {
        has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
 }
 
+src_unpack() {
+       llvm.org_src_unpack
+
+       if ! use doc; then
+               ebegin "Unpacking ${MANPAGE_P}.tar.bz2"
+               tar -xf "${DISTDIR}/${MANPAGE_P}.tar.bz2" || die
+               eend
+       fi
+}
+
 src_prepare() {
        # Fix llvm-config for shared linking and sane flags
        # https://bugs.gentoo.org/show_bug.cgi?id=565358
@@ -266,6 +280,13 @@ multilib_src_install_all() {
                LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
        _EOF_
 
+       # install pre-generated manpages
+       if ! use doc; then
+               # (doman does not support custom paths)
+               insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
+               doins "${WORKDIR}/${MANPAGE_P}/llvm"/*.1
+       fi
+
        docompress "/usr/lib/llvm/${SLOT}/share/man"
 }