fix: package nodejs and dependencies

This commit is contained in:
Lance R. Vick 2024-03-09 04:35:31 -08:00
parent 798814c13a
commit 3ea6ef1124
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
5 changed files with 107 additions and 2 deletions

View file

@ -61,4 +61,3 @@ gen-make: out/sxctl/index.json $(shell find packages/*/Containerfile | tr '\n' '
--volume .:/src \
--user $(shell id -u):$(shell id -g) \
stagex/sxctl -baseDir=/src gen make
touch $@

View file

@ -0,0 +1,32 @@
FROM scratch as base
ARG ARCH=x86_64
ENV VERSION=1.0.8
ENV SRC_HASH=ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269
ENV SRC_FILE=bzip2-${VERSION}.tar.gz
ENV SRC_SITE=https://sourceware.org/pub/bzip2/${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 bzip2-${VERSION}
RUN --network=none <<-EOF
set -ex
make -f Makefile-libbz2_so all
make all
EOF
FROM build as install
RUN --network=none <<-EOF
make PREFIX="/rootfs/usr" install
find /rootfs -exec touch -hcd "@0" "{}" +
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /

View file

@ -0,0 +1,43 @@
FROM scratch as base
ENV VERSION=20.11.1
ENV SRC_HASH=4af1ba6ea848cc05908b8a62b02fb27684dd52b2a7988ee82b0cfa72deb90b94
ENV SRC_FILE=node-v${VERSION}.tar.gz
ENV SRC_SITE=https://nodejs.org/dist/v${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/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/openssl . /
COPY --from=stagex/python . /
COPY --from=stagex/bzip2 . /
COPY --from=stagex/ninja . /
COPY --from=stagex/zlib . /
COPY --from=stagex/linux-headers . /
RUN tar -xf ${SRC_FILE}
WORKDIR node-v${VERSION}
RUN --network=none <<-EOF
set -eux
python configure.py \
--prefix=/usr \
--ninja \
--shared-openssl \
--shared-zlib \
--openssl-use-def-ca-store
make BUILDTYPE=Release
EOF
FROM build as install
RUN --network=none <<-EOF
set -eux
make DESTDIR=/rootfs install
find /rootfs -exec touch -hcd "@0" "{}" +
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /

View file

@ -15,6 +15,7 @@ COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/openssl . /
COPY --from=stagex/zlib . /
COPY --from=stagex/bzip2 . /
RUN tar -xf ${SRC_FILE}
WORKDIR Python-${VERSION}
ENV SOURCE_DATE_EPOCH=1

View file

@ -113,6 +113,18 @@ out/busybox/index.json: \
out/stage3/index.json
$(call build,busybox)
.PHONY: bzip2
bzip2: out/bzip2/index.json
out/bzip2/index.json: \
packages/bzip2/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,bzip2)
.PHONY: ca-certificates
ca-certificates: out/ca-certificates/index.json
out/ca-certificates/index.json: \
@ -523,7 +535,6 @@ out/keyfork/index.json: \
out/libunwind/index.json \
out/linux-headers/index.json \
out/llvm/index.json \
out/make/index.json \
out/musl/index.json \
out/nettle/index.json \
out/openssl/index.json \
@ -965,6 +976,24 @@ out/ninja/index.json: \
out/python/index.json
$(call build,ninja)
.PHONY: nodejs
nodejs: out/nodejs/index.json
out/nodejs/index.json: \
packages/nodejs/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/bzip2/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/linux-headers/index.json \
out/make/index.json \
out/musl/index.json \
out/ninja/index.json \
out/openssl/index.json \
out/python/index.json \
out/zlib/index.json
$(call build,nodejs)
.PHONY: npth
npth: out/npth/index.json
out/npth/index.json: \
@ -1050,6 +1079,7 @@ out/python/index.json: \
packages/python/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/bzip2/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/make/index.json \