feat: package libusb and ccid

This commit is contained in:
Lance R. Vick 2024-06-20 15:41:21 -07:00
parent dd9cfbf69b
commit f878587e95
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
3 changed files with 120 additions and 2 deletions

View file

@ -0,0 +1,41 @@
FROM scratch as base
ENV VERSION=1.5.5
ENV SRC_HASH=194708f75fe369d45dd7c15e8b3e8a7db8b49cfc5557574ca2a2e76ef12ca0ca
ENV SRC_FILE=ccid-${VERSION}.tar.bz2
ENV SRC_SITE=https://ccid.apdu.fr/files/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/m4 . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/perl . /
COPY --from=stagex/pcsc-lite . /
COPY --from=stagex/flex . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/libusb . /
COPY --from=stagex/zlib . /
RUN tar -xvf $SRC_FILE
WORKDIR ccid-${VERSION}
RUN --network=none <<-EOF
set -eux
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--enable-twinserial
make -j "$(nproc)"
EOF
FROM build as install
RUN --network=none make DESTDIR=/rootfs install
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /

View file

@ -0,0 +1,32 @@
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/. /

View file

@ -201,10 +201,34 @@ out/bzip2/index.json: \
ca-certificates: out/ca-certificates/index.json
out/ca-certificates/index.json: \
packages/ca-certificates/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/filesystem/index.json
out/filesystem/index.json \
out/gcc/index.json \
out/make/index.json \
out/musl/index.json \
out/openssl/index.json \
out/perl/index.json
$(call build,ca-certificates)
.PHONY: ccid
ccid: out/ccid/index.json
out/ccid/index.json: \
packages/ccid/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/filesystem/index.json \
out/flex/index.json \
out/gcc/index.json \
out/m4/index.json \
out/make/index.json \
out/musl/index.json \
out/pcsc-lite/index.json \
out/perl/index.json \
out/pkgconf/index.json \
out/zlib/index.json
$(call build,ccid)
.PHONY: clang
clang: out/clang/index.json
out/clang/index.json: \
@ -270,6 +294,7 @@ out/curl/index.json: \
packages/curl/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/ca-certificates/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/make/index.json \
@ -610,17 +635,24 @@ out/grpcurl/index.json: \
grub: out/grub/index.json
out/grub/index.json: \
packages/grub/Containerfile \
out/autoconf/index.json \
out/automake/index.json \
out/binutils/index.json \
out/bison/index.json \
out/busybox/index.json \
out/filesystem/index.json \
out/flex/index.json \
out/gawk/index.json \
out/gcc/index.json \
out/gettext/index.json \
out/linux-headers/index.json \
out/m4/index.json \
out/make/index.json \
out/musl/index.json \
out/python/index.json
out/perl/index.json \
out/pkgconf/index.json \
out/python/index.json \
out/xz/index.json
$(call build,grub)
.PHONY: gzip
@ -908,6 +940,19 @@ out/libunwind/index.json: \
out/musl/index.json
$(call build,libunwind)
.PHONY: libusb
libusb: out/libusb/index.json
out/libusb/index.json: \
packages/libusb/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/linux-headers/index.json \
out/make/index.json \
out/musl/index.json
$(call build,libusb)
.PHONY: libxml2
libxml2: out/libxml2/index.json
out/libxml2/index.json: \