packages/

libqrencode

Details
Source
FROM scratch AS base
ARG ARCH=x86_64
ENV VERSION=4.1.1
ENV SRC_HASH=da448ed4f52aba6bcb0cd48cac0dd51b8692bccc4cd127431402fca6f8171e8e
ENV SRC_FILE=qrencode-${VERSION}.tar.gz
ENV SRC_SITE=https://fukuchi.org/works/qrencode/${SRC_FILE}

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

FROM fetch AS build
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/musl . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/make . /
COPY --from=stagex/gcc . /
RUN tar -xzf ${SRC_FILE}
WORKDIR /qrencode-${VERSION}
RUN --network=none <<-EOF
	set -eux
	./configure \
		--build=${ARCH}-linux-musl \
		--host=${ARCH}-linux-musl \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-tests
	make -j "$(nproc)"
EOF

FROM build AS install
RUN --network=none make DESTDIR="/rootfs" install

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