commit:     29e85f853557ceb18cb712675df14ae3f3ad99c5
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Fri Aug 18 20:52:17 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Aug 22 18:03:37 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29e85f85

sys-devel/clang-crossdev-wrappers: new package, add 16, 17, and 18

Creates wrappers and symlinks for clang, clang++, and clang-cpp so that
llvm.org's fix version function is happy with ${CTARGET}-clang

Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Closes: https://github.com/gentoo/gentoo/pull/32136
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../clang-crossdev-wrappers-16.ebuild              | 42 +++++++++++++++++++++
 .../clang-crossdev-wrappers-17.ebuild              | 43 ++++++++++++++++++++++
 .../clang-crossdev-wrappers-18.ebuild              | 43 ++++++++++++++++++++++
 sys-devel/clang-crossdev-wrappers/metadata.xml     | 11 ++++++
 4 files changed, 139 insertions(+)

diff --git 
a/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-16.ebuild 
b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-16.ebuild
new file mode 100644
index 000000000000..8bed967647fa
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-16.ebuild
@@ -0,0 +1,42 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev
+
+DESCRIPTION="Symlinks to a Clang crosscompiler"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM";
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux 
~x64-macos"
+
+RDEPEND="
+       sys-devel/clang:${SLOT}
+"
+
+src_install() {
+       local llvm_path="${EPREFIX}/usr/lib/llvm/${SLOT}"
+       into "${llvm_path}"
+
+       for exe in "clang" "clang++" "clang-cpp"; do
+               newbin - "${CTARGET}-${exe}" <<-EOF
+               #!/bin/sh
+               exec ${exe}-${SLOT} --no-default-config 
--config="/etc/clang/cross/${CTARGET}.cfg" \${@}
+               EOF
+       done
+
+       local tools=(
+               ${CTARGET}-clang-${SLOT}:${CTARGET}-clang
+               ${CTARGET}-clang-cpp-${SLOT}:${CTARGET}-clang-cpp
+               ${CTARGET}-clang++-${SLOT}:${CTARGET}-clang++
+       )
+
+       local t
+       for t in "${tools[@]}"; do
+               dosym "${t#*:}" "${llvm_path}/bin/${t%:*}"
+       done
+}

diff --git 
a/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-17.ebuild 
b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-17.ebuild
new file mode 100644
index 000000000000..6cce67ad5210
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-17.ebuild
@@ -0,0 +1,43 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev
+
+DESCRIPTION="Symlinks to a Clang crosscompiler"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM";
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS=""
+PROPERTIES="live"
+
+RDEPEND="
+       sys-devel/clang:${SLOT}
+"
+
+src_install() {
+       local llvm_path="${EPREFIX}/usr/lib/llvm/${SLOT}"
+       into "${llvm_path}"
+
+       for exe in "clang" "clang++" "clang-cpp"; do
+               newbin - "${CTARGET}-${exe}" <<-EOF
+               #!/bin/sh
+               exec ${exe}-${SLOT} --no-default-config 
--config="/etc/clang/cross/${CTARGET}.cfg" \${@}
+               EOF
+       done
+
+       local tools=(
+               ${CTARGET}-clang-${SLOT}:${CTARGET}-clang
+               ${CTARGET}-clang-cpp-${SLOT}:${CTARGET}-clang-cpp
+               ${CTARGET}-clang++-${SLOT}:${CTARGET}-clang++
+       )
+
+       local t
+       for t in "${tools[@]}"; do
+               dosym "${t#*:}" "${llvm_path}/bin/${t%:*}"
+       done
+}

diff --git 
a/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-18.ebuild 
b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-18.ebuild
new file mode 100644
index 000000000000..6cce67ad5210
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-18.ebuild
@@ -0,0 +1,43 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev
+
+DESCRIPTION="Symlinks to a Clang crosscompiler"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM";
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS=""
+PROPERTIES="live"
+
+RDEPEND="
+       sys-devel/clang:${SLOT}
+"
+
+src_install() {
+       local llvm_path="${EPREFIX}/usr/lib/llvm/${SLOT}"
+       into "${llvm_path}"
+
+       for exe in "clang" "clang++" "clang-cpp"; do
+               newbin - "${CTARGET}-${exe}" <<-EOF
+               #!/bin/sh
+               exec ${exe}-${SLOT} --no-default-config 
--config="/etc/clang/cross/${CTARGET}.cfg" \${@}
+               EOF
+       done
+
+       local tools=(
+               ${CTARGET}-clang-${SLOT}:${CTARGET}-clang
+               ${CTARGET}-clang-cpp-${SLOT}:${CTARGET}-clang-cpp
+               ${CTARGET}-clang++-${SLOT}:${CTARGET}-clang++
+       )
+
+       local t
+       for t in "${tools[@]}"; do
+               dosym "${t#*:}" "${llvm_path}/bin/${t%:*}"
+       done
+}

diff --git a/sys-devel/clang-crossdev-wrappers/metadata.xml 
b/sys-devel/clang-crossdev-wrappers/metadata.xml
new file mode 100644
index 000000000000..ae058f380024
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM 'https://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <description>proxy</description>
+       </maintainer>
+       <maintainer type="project">
+               <email>[email protected]</email>
+       </maintainer>
+</pkgmetadata>

Reply via email to