2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-06-20 22:41:21 +00:00
|
|
|
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
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-06-20 22:41:21 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM fetch AS build
|
2024-06-20 22:41:21 +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/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
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-06-20 22:41:21 +00:00
|
|
|
RUN make DESTDIR=/rootfs install
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-06-20 22:41:21 +00:00
|
|
|
COPY --from=install /rootfs/. /
|