summaryrefslogtreecommitdiff
path: root/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild')
-rw-r--r--sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild51
1 files changed, 30 insertions, 21 deletions
diff --git a/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild b/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild
index b306d267303c..fef201259b9f 100644
--- a/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild
+++ b/sys-devel/llvm/llvm-16.0.0_pre20221006.ebuild
@@ -4,8 +4,8 @@
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
-inherit cmake llvm.org multilib multilib-minimal pax-utils \
- python-any-r1 toolchain-funcs
+inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
+ toolchain-funcs
DESCRIPTION="Low Level Virtual Machine"
HOMEPAGE="https://llvm.org/"
@@ -17,7 +17,7 @@ HOMEPAGE="https://llvm.org/"
# 4. ConvertUTF.h: TODO.
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
-SLOT="$(ver_cut 1)"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
KEYWORDS=""
IUSE="
+binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
@@ -47,7 +47,7 @@ BDEPEND="
>=dev-util/cmake-3.16
sys-devel/gnuconfig
kernel_Darwin? (
- <sys-libs/libcxx-$(ver_cut 1-3).9999
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
>=sys-devel/binutils-apple-5.1
)
doc? ( $(python_gen_any_dep '
@@ -64,8 +64,8 @@ RDEPEND="
"
PDEPEND="
sys-devel/llvm-common
- sys-devel/llvm-toolchain-symlinks:${SLOT}
- binutils-plugin? ( >=sys-devel/llvmgold-${SLOT} )
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
"
LLVM_COMPONENTS=( llvm cmake third-party )
@@ -347,7 +347,7 @@ multilib_src_configure() {
# disable appending VCS revision to the version to improve
# direct cache hit ratio
-DLLVM_APPEND_VC_REV=OFF
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-DBUILD_SHARED_LIBS=OFF
@@ -385,15 +385,24 @@ multilib_src_configure() {
-DOCAMLFIND=NO
)
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
if is_libcxx_linked; then
# Smart hack: alter version suffix -> SOVERSION when linking
# against libc++. This way we won't end up mixing LLVM libc++
# libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
mycmakeargs+=(
- -DLLVM_VERSION_SUFFIX="libcxx"
-DLLVM_ENABLE_LIBCXX=ON
)
fi
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
# Note: go bindings have no CMake rules at the moment
# but let's kill the check in case they are introduced
@@ -412,7 +421,7 @@ multilib_src_configure() {
if llvm_are_manpages_built; then
build_docs=ON
mycmakeargs+=(
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
-DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
-DSPHINX_WARNINGS_AS_ERRORS=OFF
)
@@ -431,7 +440,7 @@ multilib_src_configure() {
fi
if tc-is-cross-compiler; then
- local tblgen="${EPREFIX}/usr/lib/llvm/${SLOT}/bin/llvm-tblgen"
+ local tblgen="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
[[ -x "${tblgen}" ]] \
|| die "${tblgen} not found or usable"
mycmakeargs+=(
@@ -458,7 +467,7 @@ multilib_src_configure() {
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
cmake_src_configure
- grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=$(ver_cut 1)$" \
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
CMakeCache.txt ||
die "Incorrect version, did you update _LLVM_MASTER_MAJOR?"
multilib_is_native_abi && check_distribution_components
@@ -486,7 +495,7 @@ multilib_src_test() {
src_install() {
local MULTILIB_CHOST_TOOLS=(
- /usr/lib/llvm/${SLOT}/bin/llvm-config
+ /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
)
local MULTILIB_WRAPPED_HEADERS=(
@@ -497,7 +506,7 @@ src_install() {
multilib-minimal_src_install
# move wrapped headers back
- mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${SLOT}/include || die
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
}
multilib_src_install() {
@@ -505,28 +514,28 @@ multilib_src_install() {
# move headers to /usr/include for wrapping
rm -rf "${ED}"/usr/include || die
- mv "${ED}"/usr/lib/llvm/${SLOT}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
- LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
}
multilib_src_install_all() {
- local revord=$(( 9999 - ${SLOT} ))
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
newenvd - "60llvm-${revord}" <<-_EOF_
- PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
# we need to duplicate it in ROOTPATH for Portage to respect...
- ROOTPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
- MANPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
_EOF_
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
}
pkg_postinst() {
elog "You can find additional opt-viewer utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
elog "To use these scripts, you will need Python along with the following"
elog "packages:"
elog " dev-python/pygments (for opt-viewer)"