Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497428 - sys-devel/llvm-3.[34] - add a USE flag for installing clang-tools-extra
Summary: sys-devel/llvm-3.[34] - add a USE flag for installing clang-tools-extra
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords: EBUILD, PATCH
: 462600 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-07 18:38 UTC by Evan Teran
Modified: 2014-01-30 19:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
First attempt at a version of the LLVM-3.4 ebuild which builds the extra tools (llvm-3.4-r1.ebuild,14.16 KB, text/plain)
2014-01-07 22:10 UTC, Evan Teran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Evan Teran 2014-01-07 18:38:53 UTC
There are some very useful utilities available as part of the LLVM architecture that are part of the official release, but are optional. (See http://clang.llvm.org/extra/)

I would love to have access to these tools with my normal LLVM install, so this seems like it is a perfect use case for an "extras" USE flag.

If it would help, I can look into patching the ebuild to support it. I think it would boil down to a small addition to SRC_URI src_unpack.

Reproducible: Always
Comment 1 Evan Teran 2014-01-07 22:10:33 UTC
Created attachment 367330 [details]
First attempt at a version of the LLVM-3.4 ebuild which builds the extra tools

After emerging this version of the ebuild while using the "extras" USE flag, I now have clang-modernize :-).
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-01-08 03:37:08 UTC
Comment on attachment 367330 [details]
First attempt at a version of the LLVM-3.4 ebuild which builds the extra tools

--- llvm-3.4.ebuild     2014-01-06 22:06:15.000000000 +0100
+++ -   2014-01-08 04:36:57.130203908 +0100
@@ -14,12 +14,13 @@
 SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz
        clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.gz
                http://llvm.org/releases/${PV}/clang-${PV}.src.tar.gz )
-       !doc? ( http://dev.gentoo.org/~mgorny/dist/${P}-manpages.tar.bz2 )"
+       !doc? ( http://dev.gentoo.org/~mgorny/dist/${P}-manpages.tar.bz2 )
+       extras? ( http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.gz ) "
 LICENSE="UoI-NCSA"
 SLOT="0/${PV}"
-KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos"
-IUSE="clang debug doc gold +libffi multitarget ncurses ocaml python
+KEYWORDS="amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="clang debug doc gold +libffi multitarget ncurses ocaml python extras
        +static-analyzer test udis86 xml video_cards_radeon
        kernel_Darwin kernel_FreeBSD"
@@ -150,6 +151,11 @@
                        || die "clang source directory move failed"
                mv "${WORKDIR}"/compiler-rt-${PV} "${S}"/projects/compiler-rt \
                        || die "compiler-rt source directory move failed"
+
+               if use extras; then
+                       mv "${WORKDIR}"/clang-tools-extra-${PV} "${S}"/tools/clang/tools/extra \
+                               || die "extras source directory move failed"
+               fi
        fi
 }
@@ -286,13 +292,17 @@
                                llvm-size llvm-stress llvm-mcmarkup llvm-symbolizer obj2yaml
                                yaml2obj lto bugpoint
                        )
-
+
                        # those tools require 'lto' built first, so we need to delay
                        # building them to a second run
                        if [[ ${1} != -1 ]]; then
                                tools+=( llvm-lto )
                                use gold && tools+=( gold )
+
+                               # these tools need to be built during the second run
+                               # as well, so we'll put them here
+                               use clang && use extras && tools+=( clang/tools/extra )
                        fi
                fi
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-08 04:56:29 UTC
Those tools like tiny to me. I think we can add them unconditionally to USE=clang.
Comment 4 Evan Teran 2014-01-08 13:01:26 UTC
@Michał Górny: I agree. They are small and including them in the build does not seem to add any appreciable amount of compile time. I just figured that since these tools are an entirely optional part of the build process (and a separate tgz for that matter, that pulling them in with a USE flag (such as extras) was the cleanest route.

Of course, I'm fine with whichever approach you decide is best :-)
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-08 16:13:24 UTC
Ok, I'm working on it. As you can guess, rebuilding LLVM will take some time and my ccache is dirty already, so it will take a while or two :).
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-08 21:44:06 UTC
Committed to -9999 and -3.4. I wasn't able to test 3.4 thoroughly yet but I'll do it tomorrow. I don't think there's a point in applying it to older versions anymore.
Comment 7 Bernard Cafarelli gentoo-dev 2014-01-30 19:20:55 UTC
*** Bug 462600 has been marked as a duplicate of this bug. ***