summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-09-19 11:26:05 +0200
committerMichał Górny <mgorny@gentoo.org>2022-09-20 13:06:01 +0200
commit9c1c3134cc0c0d07d33ed152cdf8259ce806aa72 (patch)
tree8ed5ea7a27e5bb399cf39ec227b8d671de281e76 /sys-devel/clang-toolchain-symlinks
parentsys-devel/lld: Add PDEP on lld-toolchain-symlinks to 16.x (diff)
downloadgentoo-9c1c3134cc0c0d07d33ed152cdf8259ce806aa72.tar.gz
gentoo-9c1c3134cc0c0d07d33ed152cdf8259ce806aa72.tar.bz2
gentoo-9c1c3134cc0c0d07d33ed152cdf8259ce806aa72.zip
sys-devel/clang-toolchain-symlinks: New package for GCC-free sys
New package that installs generic "cc", "c++" and "cpp" symlinks to Clang, for use on GCC-free systems. It can also install "gcc" and "g++" for better compatibility, if desired. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'sys-devel/clang-toolchain-symlinks')
-rw-r--r--sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-16.ebuild52
-rw-r--r--sys-devel/clang-toolchain-symlinks/metadata.xml21
2 files changed, 73 insertions, 0 deletions
diff --git a/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-16.ebuild b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-16.ebuild
new file mode 100644
index 000000000000..980427e31a5e
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-16.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use Clang on GCC-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS=""
+PROPERTIES="live"
+IUSE="gcc-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/clang:${SLOT}
+"
+
+src_install() {
+ local tools=()
+
+ if use native-symlinks; then
+ tools+=(
+ cc:clang
+ cpp:clang-cpp
+ c++:clang++
+ )
+ fi
+ if use gcc-symlinks; then
+ tools+=(
+ gcc:clang
+ g++:clang++
+ )
+ fi
+
+ local abi t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${t%:*}"
+ done
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${abi_chost}-${t%:*}"
+ done
+ done
+}
diff --git a/sys-devel/clang-toolchain-symlinks/metadata.xml b/sys-devel/clang-toolchain-symlinks/metadata.xml
new file mode 100644
index 000000000000..58c5027c2994
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="gcc-symlinks">
+ Install symlinks for 'gcc' and 'g++' for extra
+ compatibility.
+ </flag>
+ <flag name="native-symlinks">
+ Install generic tool symlinks like 'cc' and 'c++',
+ as well as ${CTARGET}-*. These symlinks are installed
+ into slotted LLVM bindir, so they should not take precedence
+ over symlinks installed into /usr/bin
+ by <pkg>sys-devel/gcc-config</pkg> but they can be helpful
+ for GCC-free setups.
+ </flag>
+ </use>
+</pkgmetadata>