2024-02-09 07:30:28 +00:00
|
|
|
FROM scratch as base
|
|
|
|
ENV VERSION=2.12.1
|
2023-12-05 04:34:07 +00:00
|
|
|
ENV SRC_HASH=1090e62c5a1900429f63e4681263b96e7829876ccbc66cf2d9266cd589f67286
|
2024-02-09 07:30:28 +00:00
|
|
|
ENV SRC_FILE=libxml2-v${VERSION}.tar.gz
|
|
|
|
ENV SRC_SITE=https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${VERSION}/${SRC_FILE}
|
2023-12-16 23:50:40 +00:00
|
|
|
|
|
|
|
FROM base as fetch
|
2024-02-10 13:51:03 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
2023-12-16 23:50:40 +00:00
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/python . /
|
|
|
|
COPY --from=stagex/perl . /
|
|
|
|
COPY --from=stagex/autoconf . /
|
|
|
|
COPY --from=stagex/automake . /
|
|
|
|
COPY --from=stagex/pkgconf . /
|
|
|
|
COPY --from=stagex/libtool . /
|
|
|
|
COPY --from=stagex/zlib . /
|
|
|
|
COPY --from=stagex/m4 . /
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR libxml2-v${VERSION}
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
sh autogen.sh
|
2023-12-05 04:34:07 +00:00
|
|
|
./configure \
|
|
|
|
--build=x86_64-unknown-linux-musl \
|
|
|
|
--host=x86_64-unknown-linux-musl \
|
|
|
|
--target=x86_64-unknown-linux-musl \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--mandir=/usr/share/man \
|
2024-02-10 15:49:52 +00:00
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--enable-static \
|
|
|
|
--with-zlib \
|
|
|
|
--with-python=/usr/bin/python3
|
2024-03-14 07:16:26 +00:00
|
|
|
make -j "$(nproc)"
|
2024-02-09 07:30:28 +00:00
|
|
|
EOF
|
2023-12-16 23:50:40 +00:00
|
|
|
|
|
|
|
FROM build as install
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
make DESTDIR=/rootfs install
|
2024-04-01 04:12:56 +00:00
|
|
|
find /rootfs | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
|
|
|
|
find /rootfs -exec touch -hcd "@0" "{}" +
|
2024-02-09 07:30:28 +00:00
|
|
|
EOF
|
2023-12-05 04:34:07 +00:00
|
|
|
|
2024-03-01 18:30:23 +00:00
|
|
|
FROM stagex/filesystem as package
|
|
|
|
COPY --from=install /rootfs/. /
|