packages/

libxml2

Details
Source
FROM scratch AS base
ENV VERSION=2.12.1
ENV SRC_HASH=1090e62c5a1900429f63e4681263b96e7829876ccbc66cf2d9266cd589f67286
ENV SRC_FILE=libxml2-v${VERSION}.tar.gz
ENV SRC_SITE=https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${VERSION}/${SRC_FILE}

FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .

FROM fetch AS build
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 . /
RUN tar -xf ${SRC_FILE}
WORKDIR /libxml2-v${VERSION}
RUN --network=none <<-EOF
    set -eux
    sh autogen.sh
    ./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 \
        --infodir=/usr/share/info \
        --enable-static \
        --with-zlib \
        --with-python=/usr/bin/python3
    make -j "$(nproc)"
EOF

FROM build AS install
RUN --network=none <<-EOF
    set -eux
    make DESTDIR=/rootfs install
    find /rootfs | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
EOF

FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /