packages/

argp-standalone

Details
Source
FROM scratch AS base
ENV VERSION=1.5.0
ENV SRC_FILE=${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/argp-standalone/argp-standalone/archive/refs/tags/${SRC_FILE}
ENV SRC_HASH=c29eae929dfebd575c38174f2c8c315766092cec99a8f987569d0cad3c6d64f6

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/perl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/m4 . /
RUN tar -xf ${SRC_FILE}
WORKDIR /argp-standalone-${VERSION}
RUN --network=none <<-EOF
	set -eux
	/usr/bin/autoreconf -vif
	CFLAGS="-fPIC" \
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make -j "$(nproc)"
EOF

FROM build AS install
RUN <<-EOF
	set -eux
	install -D -m644 argp.h /rootfs/usr/include/argp.h
	install -D -m755 libargp.a /rootfs/usr/lib/libargp.a
EOF

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