stagex/packages/brotli/Containerfile

49 lines
1.2 KiB
Text
Raw Normal View History

FROM scratch AS base
2024-08-16 19:26:04 +00:00
ARG ARCH=x86_64
ENV VERSION=1.1.0
ENV SRC_HASH=e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/google/brotli/archive/refs/tags/${SRC_FILE}
FROM base AS fetch
2024-08-16 19:26:04 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch AS build
2024-08-16 19:26:04 +00:00
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/samurai . /
COPY --from=stagex/cmake . /
COPY --from=stagex/openssl . /
RUN tar -xf ${SRC_FILE}
WORKDIR brotli-${VERSION}
RUN --network=none <<-EOF
set -eux
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
2024-08-26 11:10:17 +00:00
-DCMAKE_INSTALL_PREFIX=/usr \
2024-08-16 19:26:04 +00:00
-DBUILD_SHARED_LIBS=OFF
cmake --build build
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
2024-08-26 11:10:17 +00:00
-DCMAKE_INSTALL_PREFIX=/usr \
2024-08-16 19:26:04 +00:00
-DBUILD_SHARED_LIBS=ON
cmake --build build
EOF
FROM build AS install
RUN <<-EOF
set -eux
DESTDIR=/rootfs cmake --install build
for file in common dec enc; do
2024-08-26 11:10:17 +00:00
install -D -m 755 build/libbrotli$file.a /rootfs/usr/lib64
done
2024-08-26 11:10:17 +00:00
mv /rootfs/usr/lib64 /rootfs/usr/lib
EOF
2024-08-16 19:26:04 +00:00
FROM stagex/filesystem AS package
2024-08-16 19:26:04 +00:00
COPY --from=install /rootfs/. /