stagex/packages/clang/Containerfile

49 lines
1.3 KiB
Text
Raw Normal View History

2024-08-15 03:23:49 +00:00
FROM scratch AS base
2024-08-14 00:52:57 +00:00
ENV VERSION=18.1.8
ENV SRC_HASH=0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a
2024-02-14 01:12:07 +00:00
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}
2024-02-09 21:17:17 +00:00
2024-08-08 07:47:42 +00:00
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-08-08 07:47:42 +00:00
FROM fetch AS build
2024-02-16 16:11:30 +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/llvm . /
2024-02-26 01:36:48 +00:00
COPY --from=stagex/zlib . /
2024-02-16 16:11:30 +00:00
2024-02-14 01:12:07 +00:00
RUN tar -xf ${SRC_FILE}
WORKDIR llvm-project-${VERSION}.src
2024-04-11 20:09:20 +00:00
RUN --network=none <<-EOF
set -eux
2024-02-09 21:17:17 +00:00
cmake \
-S clang \
2024-02-09 21:17:17 +00:00
-B build \
-G Ninja \
-Wno-dev \
2024-02-09 21:17:17 +00:00
-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 \
2024-04-11 20:09:20 +00:00
-DLIBCLANG_BUILD_STATIC=ON
2024-02-09 21:17:17 +00:00
cmake --build build
2024-04-11 20:09:20 +00:00
EOF
2024-02-09 21:17:17 +00:00
2024-08-08 07:47:42 +00:00
FROM build AS install
2024-04-11 20:09:20 +00:00
RUN --network=none DESTDIR="/rootfs" cmake --install build
2024-02-09 21:17:17 +00:00
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /