stagex/packages/libusb/Containerfile

33 lines
822 B
Text
Raw Normal View History

2024-06-20 22:41:21 +00:00
FROM scratch as base
ENV VERSION=1.0.27
ENV SRC_FILE=libusb-${VERSION}.tar.bz2
ENV SRC_SITE=https://github.com/libusb/libusb/releases/download/v${VERSION}/${SRC_FILE}
ENV SRC_HASH=ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575
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/linux-headers . /
RUN tar -xf ${SRC_FILE}
WORKDIR libusb-${VERSION}
RUN --network=none <<-EOF
set -eux
./configure \
--prefix=/usr \
--disable-udev \
--enable-static
make -j1
EOF
FROM build as install
RUN make DESTDIR=/rootfs install
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /