feat: package openpgp-card-tools

This commit is contained in:
Lance R. Vick 2024-05-08 19:15:59 -07:00
parent d6a53d492b
commit f68e73f8c2
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
2 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,46 @@
FROM scratch AS base
ENV VERSION=0.10.1
ENV SRC_HASH=fb8cd1c95c558f1e16a749746dadc6040deca54f4e3aa7735ffa5f082cdfcc01
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://codeberg.org/openpgp-card/openpgp-card-tools/archive/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
COPY --from=stagex/rust . /
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm . /
COPY --from=stagex/libunwind . /
COPY --from=stagex/openssl . /
COPY --from=stagex/zlib . /
COPY --from=stagex/ca-certificates . /
RUN tar xf ${SRC_FILE}
WORKDIR openpgp-card-tools
RUN cargo fetch
FROM fetch AS build
COPY --from=stagex/clang . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/gmp . /
COPY --from=stagex/nettle . /
COPY --from=stagex/pcsc-lite . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/binutils . /
ENV PCSC_LIB_NAME=static=pcsclite
ENV RUSTFLAGS='-C codegen-units=1 -C target-feature=+crt-static'
RUN --network=none \
cargo build \
--frozen \
--release \
--target x86_64-unknown-linux-musl
FROM build AS install
RUN <<-EOF
set -eux
mkdir -p /rootfs/usr/bin
cp target/x86_64-unknown-linux-musl/release/oct /rootfs/usr/bin/
EOF
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /

View file

@ -1222,6 +1222,29 @@ out/npth/index.json: \
out/zlib/index.json
$(call build,npth)
.PHONY: openpgp-card-tools
openpgp-card-tools: out/openpgp-card-tools/index.json
out/openpgp-card-tools/index.json: \
packages/openpgp-card-tools/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/ca-certificates/index.json \
out/clang/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/gmp/index.json \
out/libunwind/index.json \
out/linux-headers/index.json \
out/llvm/index.json \
out/musl/index.json \
out/nettle/index.json \
out/openssl/index.json \
out/pcsc-lite/index.json \
out/pkgconf/index.json \
out/rust/index.json \
out/zlib/index.json
$(call build,openpgp-card-tools)
.PHONY: openssl
openssl: out/openssl/index.json
out/openssl/index.json: \