stagex/packages/clang16/Containerfile

49 lines
1.3 KiB
Text
Raw Normal View History

FROM scratch AS base
2024-08-14 00:52:57 +00:00
ENV VERSION=16.0.6
ENV SRC_HASH=ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e
ENV SRC_FILE=llvm-project-${VERSION}.src.tar.xz
ENV SRC_SITE=https://github.com/llvm/llvm-project/releases/download/llvm-org-${VERSION}/${SRC_FILE}
FROM base AS fetch
2024-08-14 00:52:57 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch AS build
2024-08-14 00:52:57 +00:00
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/cmake . /
COPY --from=stagex/ninja . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/python . /
COPY --from=stagex/py-setuptools . /
COPY --from=stagex/openssl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm16 . /
COPY --from=stagex/zlib . /
RUN tar -xf ${SRC_FILE}
2024-08-26 01:18:52 +00:00
WORKDIR /llvm-project-${VERSION}.src
2024-08-14 00:52:57 +00:00
RUN --network=none <<-EOF
set -eux
cmake \
-S clang \
-B build \
-G Ninja \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DCMAKE_INSTALL_RPATH=/usr/ \
-DCLANG_BUILT_STANDALONE=ON \
-DCLANG_LINK_CLANG_DYLIB=ON \
-DCLANG_PLUGIN_SUPPORT=ON \
-DCLANG_VENDOR=stagex \
-DLIBCLANG_BUILD_STATIC=ON
cmake --build build
EOF
FROM build AS install
2024-08-14 00:52:57 +00:00
RUN --network=none DESTDIR="/rootfs" cmake --install build
FROM stagex/filesystem AS package
2024-08-14 00:52:57 +00:00
COPY --from=install /rootfs/. /