69 lines
1.5 KiB
Bash
69 lines
1.5 KiB
Bash
# Copyright 1999-2025 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
EAPI=8
|
|
|
|
DESCRIPTION="Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects"
|
|
HOMEPAGE="https://github.com/intel/llvm"
|
|
|
|
SRC_URI="${HOMEPAGE}/releases/download/v${PV}/sycl_linux.tar.gz -> ${P}.tar.gz"
|
|
|
|
S="${WORKDIR}"
|
|
LICENSE="Apache2.0"
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64"
|
|
|
|
IUSE=""
|
|
|
|
RDEPEND=""
|
|
DEPEND="${RDEPEND}"
|
|
BDEPEND="virtual/pkgconfig"
|
|
|
|
src_test() {
|
|
local tdir="${T}/smoke"
|
|
mkdir -p "${tdir}" || die
|
|
|
|
cat > "${tdir}/hello.c" <<-'EOF' || die
|
|
#include <stdio.h>
|
|
int main(void) {
|
|
puts("ok");
|
|
return 0;
|
|
}
|
|
EOF
|
|
|
|
cat > "${tdir}/hello.cpp" <<-'EOF' || die
|
|
#include <array>
|
|
int main() {
|
|
std::array<int, 2> xs{1, 2};
|
|
return xs[0] != 1;
|
|
}
|
|
EOF
|
|
|
|
cat > "${tdir}/hello_sycl.cpp" <<-'EOF' || die
|
|
#include <sycl/sycl.hpp>
|
|
int main() {
|
|
sycl::queue q;
|
|
(void)q;
|
|
return 0;
|
|
}
|
|
EOF
|
|
|
|
"${S}/bin/clang" "${tdir}/hello.c" -o "${tdir}/hello-c" || die
|
|
"${S}/bin/clang++" -std=c++20 "${tdir}/hello.cpp" -o "${tdir}/hello-cpp" || die
|
|
"${S}/bin/clang++" -fsycl -std=c++20 -fsyntax-only "${tdir}/hello_sycl.cpp" || die
|
|
}
|
|
|
|
src_install() {
|
|
dodir "/opt/${PN}"
|
|
cp -a bin include lib "${ED}/opt/${PN}/" || die
|
|
|
|
newenvd - 99intel-llvm <<-EOF
|
|
LDPATH=/opt/intel-llvm/lib
|
|
EOF
|
|
|
|
dosym /opt/intel-llvm/bin/clang /opt/intel-llvm/bin/icx
|
|
dosym /opt/intel-llvm/bin/clang++ /opt/intel-llvm/bin/icpx
|
|
dosym ../../opt/intel-llvm/bin/icx /usr/bin/icx
|
|
dosym ../../opt/intel-llvm/bin/icpx /usr/bin/icpx
|
|
dosym ../../opt/intel-llvm/bin/llvm-foreach /usr/bin/llvm-foreach
|
|
}
|