feat: package jq

This commit is contained in:
Lance R. Vick 2024-05-08 18:16:55 -07:00
parent d848bae5e0
commit 073902f131
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
2 changed files with 51 additions and 0 deletions

39
packages/jq/Containerfile Normal file
View file

@ -0,0 +1,39 @@
FROM scratch as base
ARG ARCH=x86_64
ENV VERSION=1.7.1
ENV SRC_HASH=478c9ca129fd2e3443fe27314b455e211e0d8c60bc8ff7df703873deeee580c2
ENV SRC_FILE=jq-${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/jqlang/jq/releases/download/jq-${VERSION}/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/gcc . /
RUN tar -xf ${SRC_FILE}
WORKDIR jq-${VERSION}
RUN --network=none <<-EOF
set -ex
./configure \
--build=${ARCH}-linux-musl \
--host=${ARCH}-linux-musl \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/etc \
--mandir=/usr/share/man \
--disable-docs
make -j "$(nproc)"
EOF
FROM build as install
RUN --network=none <<-EOF
set -eu
make DESTDIR="/rootfs" install
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /

View file

@ -650,6 +650,18 @@ out/iputils/index.json: \
out/zlib/index.json
$(call build,iputils)
.PHONY: jq
jq: out/jq/index.json
out/jq/index.json: \
packages/jq/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/make/index.json \
out/musl/index.json
$(call build,jq)
.PHONY: json-c
json-c: out/json-c/index.json
out/json-c/index.json: \