Repository navigation
Expand file tree
/
Copy pathDockerfile.fromsource
More file actions
81 lines (75 loc) · 2.79 KB
/
Copy pathDockerfile.fromsource
File metadata and controls
81 lines (75 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
ARG BASE_IMAGE=gentoo/stage3:amd64-nomultilib-openrc
FROM ${BASE_IMAGE}
ARG compiler_kind=clang-p2996
ARG compiler_version=21.0.0.9999
RUN /bin/bash <<"EOF"
set -eux
echo 'BINPKG_FORMAT="gpkg"' >> /etc/portage/make.conf
echo 'FEATURES="getbinpkg"' >> /etc/portage/make.conf
for i in 1 2 3; do emerge --sync && break; sleep 60; done
getuto
emerge dev-vcs/git
mkdir -p /etc/portage/repos.conf
case $(uname -m) in
x86_64) GENTOO_ARCH=amd64; GCC_TRIPLET=x86_64-pc-linux-gnu ;;
aarch64) GENTOO_ARCH=arm64; GCC_TRIPLET=aarch64-unknown-linux-gnu ;;
*) echo "Unsupported arch: $(uname -m)"; exit 1 ;;
esac
if [[ ${compiler_kind} == clang-p2996 ]] ; then
cat > /etc/portage/repos.conf/gentoo.conf <<"EOF2"
[gentoo]
location = /var/db/repos/gentoo
sync-type = git
sync-uri = https://github.com/bemanproject/container-infra-clang-p2996-gentoo.git
auto-sync = yes
sync-openpgp-key-refresh = no
EOF2
rm -rf /var/db/repos/gentoo
emerge --sync
fi
echo "ACCEPT_KEYWORDS=\"~${GENTOO_ARCH}\"" >> /etc/portage/make.conf
echo "=dev-build/cmake-4.4.3" >> /etc/portage/package.unmask
mkdir -p /etc/portage/package.accept_keywords
echo "dev-util/gcovr **" >> /etc/portage/package.accept_keywords/gcovr
emerge =dev-build/cmake-4.4.3
emerge dev-build/ninja
emerge dev-util/gcovr
emerge app-misc/jq
if [[ ${compiler_kind} == clang* ]] ; then
if [[ ${compiler_version%%.*} == "22" ]] ; then
cat >> /etc/portage/package.mask/llvm <<'EOF2'
>=llvm-core/clang-common-23
>=llvm-core/llvm-23
>=llvm-core/llvmgold-23
>=llvm-runtimes/openmp-23
>=llvm-runtimes/libcxx-23
>=llvm-runtimes/libcxxabi-23
>=llvm-runtimes/clang-runtime-23
>=llvm-runtimes/compiler-rt-23
>=llvm-runtimes/compiler-rt-sanitizers-23
EOF2
fi
export USE="libcxx"
if ! emerge =llvm-core/clang-${compiler_version} --autounmask --autounmask-write ; then
etc-update --automode -5
emerge =llvm-core/clang-${compiler_version}
fi
ln -sv /usr/lib/llvm/${compiler_version%%.*}/bin/* /usr/local/bin/
elif [[ ${compiler_kind} == gcc ]] ; then
if ! emerge =sys-devel/gcc-${compiler_version} --autounmask --autounmask-write ; then
etc-update --automode -5
emerge =sys-devel/gcc-${compiler_version}
fi
eselect gcc set ${GCC_TRIPLET}-${compiler_version%%\.*}
else
exit 1
fi
emerge app-arch/zip app-arch/unzip net-misc/curl app-misc/ca-certificates
update-ca-certificates
git clone --depth 1 https://github.com/microsoft/vcpkg.git /opt/vcpkg
/opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics
ln -sf /opt/vcpkg/vcpkg /usr/local/bin/vcpkg
rm -rf /var/db/repos/gentoo /var/cache/*
EOF
ENV VCPKG_ROOT=/opt/vcpkg