Merge remote-tracking branch 'origin/lance/nodejs' into staging

This commit is contained in:
Anton Livaja 2024-08-29 22:57:53 -04:00
commit 4d722f3848
No known key found for this signature in database
GPG key ID: 44A86CFF1FDF0E85
6 changed files with 282 additions and 4 deletions

View file

@ -23,20 +23,26 @@ RUN --network=none <<-EOF
set -eux
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr/lib \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=OFF
cmake --build build
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr/lib \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=ON
cmake --build build
EOF
FROM build AS install
RUN DESTDIR=/rootfs cmake --install build
RUN find /rootfs -exec touch -hcd "@0" "{}" +
RUN <<-EOF
set -eux
DESTDIR=/rootfs cmake --install build
for file in common dec enc; do
install -D -m 755 build/libbrotli$file.a /rootfs/usr/lib64
done
mv /rootfs/usr/lib64 /rootfs/usr/lib
EOF
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /

View file

@ -0,0 +1,35 @@
FROM scratch AS base
ENV VERSION=1.33.1
ENV SRC_HASH=06869824094745872fa26efd4c48e622b9bd82a89ef0ce693dc682a23604f415
ENV SRC_FILE=c-ares-${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/c-ares/c-ares/releases/download/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/binutils . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/gcc . /
RUN --network=none tar -xf ${SRC_FILE}
WORKDIR /c-ares-${VERSION}
RUN --network=none <<EOF
set -eux
./configure \
--build=x86_64-linux-musl \
--host=x86_64-linux-musl \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--enable-shared
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,44 @@
FROM scratch AS base
ENV VERSION=4.33
ENV SRC_HASH=507eb7b8d1015fbec5b935f34ebed15bf346bed04a11ab82b8eee848c4205aea
ENV SRC_FILE=libev-${VERSION}.tar.gz
ENV SRC_SITE=http://dist.schmorp.de/libev/Attic/${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 . /
COPY --from=stagex/perl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/libtool . /
COPY --from=stagex/m4 . /
RUN --network=none tar -xf ${SRC_FILE}
WORKDIR /libev-${VERSION}
ENV SOURCE_DATE_EPOCH=1
RUN --network=none <<EOF
set -eux
libtoolize --force
aclocal -I m4
autoheader
autoconf
automake --add-missing
./configure \
--build=x86_64-linux-musl \
--host=x86_64-linux-musl \
--prefix=/usr \
--sysconfdir=/etc
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,59 @@
FROM scratch AS base
ENV VERSION=1.62.1
ENV SRC_HASH=d0b0b9d00500ee4aa3bfcac00145d3b1ef372fd301c35bff96cf019c739db1b4
ENV SRC_FILE=nghttp2-${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/nghttp2/nghttp2/releases/download/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/binutils . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/gcc . /
COPY --from=stagex/zlib . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/openssl . /
COPY --from=stagex/libev . /
COPY --from=stagex/c-ares . /
RUN --network=none tar -xf ${SRC_FILE}
WORKDIR /nghttp2-${VERSION}
RUN --network=none <<EOF
set -eux
./configure \
--build=x86_64-linux-musl \
--host=x86_64-linux-musl \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--disable-python-bindings \
--enable-lib-only \
--with-libcares \
--with-libev \
--with-openssl \
--disable-examples \
--disable-http3 \
--disable-werror \
--without-jansson \
--without-jemalloc \
--without-libbpf \
--without-libnghttp3 \
--without-libngtcp2 \
--without-libxml2 \
--without-mruby \
--without-neverbleed \
--without-systemd \
--without-cunit
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,65 @@
FROM scratch AS base
ENV VERSION=22.7.0
ENV SRC_HASH=7a7c99282d59866d971b2da12c99596cb15782b9c3efe2e2146390c14f4d490e
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/icu . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/libnghttp2 . /
COPY --from=stagex/brotli . /
COPY --from=stagex/c-ares . /
COPY --from=stagex/pkgconf . /
RUN tar -xf ${SRC_FILE}
WORKDIR /node-v${VERSION}
ENV SOURCE_DATE_EPOCH=1
ENV LDFLAGS=" \
-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro \
-Wl,-z,now -Wl,-z,pack-relative-relocs"
ENV CFLAGS=" \
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection \
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
ENV CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
ENV CPPFLAGS="$CXXFLAGS"
ENV LTOFLAGS="-flto=auto"
RUN --network=none <<-EOF
set -eux
python configure.py \
--prefix=/usr \
--ninja \
--shared-zlib \
--shared-nghttp2 \
--shared-openssl \
--shared-cares \
--shared-brotli \
--without-npm \
--without-corepack \
--with-intl=system-icu \
--with-icu-default-data-dir=$(icu-config --icudatadir) \
--openssl-use-def-ca-store
make BUILDTYPE=Release -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

@ -325,6 +325,18 @@ out/bzip2/index.json: \
out/musl/index.json
$(call build,bzip2)
.PHONY: c-ares
c-ares: out/c-ares/index.json
out/c-ares/index.json: \
packages/c-ares/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,c-ares)
.PHONY: ca-certificates
ca-certificates: out/ca-certificates/index.json
out/ca-certificates/index.json: \
@ -1491,6 +1503,23 @@ out/libedit/index.json: \
out/perl/index.json
$(call build,libedit)
.PHONY: libev
libev: out/libev/index.json
out/libev/index.json: \
packages/libev/Containerfile \
out/autoconf/index.json \
out/automake/index.json \
out/binutils/index.json \
out/busybox/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/libtool/index.json \
out/m4/index.json \
out/make/index.json \
out/musl/index.json \
out/perl/index.json
$(call build,libev)
.PHONY: libevent
libevent: out/libevent/index.json
out/libevent/index.json: \
@ -1621,6 +1650,23 @@ out/libnftnl/index.json: \
out/pkgconf/index.json
$(call build,libnftnl)
.PHONY: libnghttp2
libnghttp2: out/libnghttp2/index.json
out/libnghttp2/index.json: \
packages/libnghttp2/Containerfile \
out/binutils/index.json \
out/busybox/index.json \
out/c-ares/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/libev/index.json \
out/make/index.json \
out/musl/index.json \
out/openssl/index.json \
out/pkgconf/index.json \
out/zlib/index.json
$(call build,libnghttp2)
.PHONY: libqrencode
libqrencode: out/libqrencode/index.json
out/libqrencode/index.json: \
@ -2239,6 +2285,29 @@ 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/brotli/index.json \
out/busybox/index.json \
out/bzip2/index.json \
out/c-ares/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/icu/index.json \
out/libnghttp2/index.json \
out/linux-headers/index.json \
out/make/index.json \
out/musl/index.json \
out/ninja/index.json \
out/openssl/index.json \
out/pkgconf/index.json \
out/python/index.json \
out/zlib/index.json
$(call build,nodejs)
.PHONY: npth
npth: out/npth/index.json
out/npth/index.json: \