stagex/packages/cmake/Containerfile

44 lines
1.2 KiB
Text
Raw Normal View History

2024-02-09 07:30:28 +00:00
FROM scratch as base
ENV VERSION=3.27.8
2023-11-20 03:29:02 +00:00
ENV SRC_HASH=fece24563f697870fbb982ea8bf17482c9d5f855d8c9bf0b82463d76c9e8d0cc
2024-02-09 07:30:28 +00:00
ENV SRC_FILE=cmake-${VERSION}.tar.gz
2024-02-11 02:00:10 +00:00
ENV SRC_SITE=https://cmake.org/files/v3.27/${SRC_FILE}
2023-11-20 03:29:02 +00:00
2023-12-16 23:50:40 +00:00
FROM base as fetch
2024-02-09 07:30:28 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2023-12-16 23:50:40 +00:00
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/ninja . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/gcc . /
COPY --from=stagex/zlib . /
COPY --from=stagex/openssl . /
2024-02-09 07:30:28 +00:00
RUN tar -xf ${SRC_FILE}
WORKDIR cmake-${VERSION}
2024-02-11 02:09:53 +00:00
# HACK: figure out why gcc package puts these in the wrong path at install time
COPY --from=stagex/gcc /usr/lib64/* /usr/lib/
2024-02-09 07:30:28 +00:00
RUN --network=none <<-EOF
set -eux
./bootstrap \
--prefix=/usr \
--mandir=/share/man \
--datadir=/share/cmake \
--docdir=/share/doc/cmake \
--no-system-cppdap \
2023-11-20 03:29:02 +00:00
--no-system-curl \
--no-system-jsoncpp \
2024-02-11 02:09:53 +00:00
--generator=Ninja || cat /cmake-3.27.8/Bootstrap.cmk/cmake_bootstrap.log
2024-02-09 07:30:28 +00:00
ninja
EOF
2023-12-16 23:50:40 +00:00
FROM build as install
2024-02-09 07:30:28 +00:00
RUN --network=none DESTDIR=/rootfs bin/cmake -P cmake_install.cmake
RUN find /rootfs -exec touch -hcd "@0" "{}" +
2023-11-20 03:29:02 +00:00
2023-12-12 17:45:39 +00:00
FROM scratch as package
2023-12-16 23:50:40 +00:00
COPY --from=install /rootfs /