diff --git a/packages/abuild/Containerfile b/packages/abuild/Containerfile new file mode 100644 index 0000000..882c483 --- /dev/null +++ b/packages/abuild/Containerfile @@ -0,0 +1,37 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=3.12.0 +ENV SRC_HASH=5783e04ededa21ffa3f600551a7e2ca6db1c8e1a962a868311f5e5e4560908ce +ENV SRC_FILE=abuild-${VERSION}.tar.gz +ENV SRC_SITE=https://gitlab.alpinelinux.org/alpine/abuild/-/archive/${VERSION}/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/meson . / +COPY --from=stagex/openssl . / +COPY --from=stagex/make . / +COPY --from=stagex/lzip . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/zlib . / +COPY --from=stagex/elfutils . / +COPY --from=stagex/scdoc . / +RUN tar -xf ${SRC_FILE} +WORKDIR abuild-${VERSION} +RUN --network=none <<-EOF + set -eux + make VERSION="${VERSION}-r5" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / + diff --git a/packages/acl/Containerfile b/packages/acl/Containerfile new file mode 100644 index 0000000..a17639e --- /dev/null +++ b/packages/acl/Containerfile @@ -0,0 +1,36 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.3.2 +ENV SRC_HASH=5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c +ENV SRC_FILE=acl-${VERSION}.tar.gz +ENV SRC_SITE=https://download.savannah.nongnu.org/releases/acl/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/attr . / +RUN tar -xf ${SRC_FILE} +WORKDIR acl-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --libdir=/usr/lib \ + --libexecdir=/usr/libexec + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/apache2/Containerfile b/packages/apache2/Containerfile new file mode 100644 index 0000000..2485d72 --- /dev/null +++ b/packages/apache2/Containerfile @@ -0,0 +1,78 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.4.59 +ENV SRC_HASH=ec51501ec480284ff52f637258135d333230a7d229c3afa6f6c2f9040e321323 +ENV SRC_FILE=httpd-${VERSION}.tar.bz2 +ENV SRC_SITE=https://dlcdn.apache.org/httpd/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/expat . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/brotli . / +COPY --from=stagex/openssl . / +COPY --from=stagex/zlib . / +COPY --from=stagex/libxml2 . / +COPY --from=stagex/pcre2 . / +COPY --from=stagex/lua . / + +RUN tar -xf ${SRC_FILE} +WORKDIR httpd-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --prefix=/usr \ + --enable-so \ + --enable-suexec \ + --with-suexec-caller=apache \ + --with-suexec-docroot=/var/www \ + --with-suexec-logfile=/var/log/apache2/suexec.log \ + --with-suexec-bin=/usr/sbin/suexec \ + --with-suexec-uidmin=99 \ + --with-suexec-gidmin=99 \ + --with-apr=/usr/bin/apr-1-config \ + --with-apr-util=/usr/bin/apu-1-config \ + --with-pcre=/usr \ + --enable-mods-shared=all \ + --enable-mpms-shared=all \ + --with-mpm=prefork \ + --enable-ssl \ + --with-ssl \ + --enable-proxy \ + --enable-cache \ + --enable-disk-cache \ + --enable-mem-cache \ + --enable-file-cache \ + --enable-ldap \ + --enable-authnz-ldap \ + --enable-cgid \ + --enable-cgi \ + --enable-authn-anon \ + --enable-authn-alias \ + --disable-imagemap \ + --enable-proxy-connect \ + --enable-proxy-http \ + --enable-proxy-ftp \ + --enable-deflate \ + --enable-dbd \ + --enable-exception-hook \ + --enable-dav \ + --enable-dav-fs \ + --enable-dav-lock + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/apr-util/Containerfile b/packages/apr-util/Containerfile new file mode 100644 index 0000000..9022ca6 --- /dev/null +++ b/packages/apr-util/Containerfile @@ -0,0 +1,48 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.6.3 +ENV SRC_HASH=a41076e3710746326c3945042994ad9a4fcac0ce0277dd8fea076fec3c9772b5 +ENV SRC_FILE=apr-util-${VERSION}.tar.bz2 +ENV SRC_SITE=https://www.apache.org/dist/apr/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/expat . / +COPY --from=stagex/gdbm . / +COPY --from=stagex/openldap . / +COPY --from=stagex/sqlite3 . / +COPY --from=stagex/openssl . / +COPY --from=stagex/postgresql . / + +RUN tar -xf ${SRC_FILE} +WORKDIR apr-util-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --prefix=/usr \ + --with-apr=/usr \ + --with-ldap \ + --with-pgsql \ + --with-mysql \ + --with-sqlite3 \ + --with-crypto \ + --with-openssl \ + --without-sqlite2 \ + --with-dbm=ndbm \ + --with-ndbm + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/apr/Containerfile b/packages/apr/Containerfile new file mode 100644 index 0000000..0a65758 --- /dev/null +++ b/packages/apr/Containerfile @@ -0,0 +1,38 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.7.4 +ENV SRC_HASH=fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577 +ENV SRC_FILE=apr-${VERSION}.tar.bz2 +ENV SRC_SITE=https://www.apache.org/dist/apr/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/util-linux . / +RUN tar -xf ${SRC_FILE} +WORKDIR apr-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux \ + patch -p1 apr-1.6.2-dont-test-dlclose.patch + patch -p1 semtimedop-s390x.patch + ./configure \ + --prefix=/usr \ + --datadir=/usr/share \ + --enable-nonportable-atomics=no \ + --with-devrandom=/dev/urandom + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/apr/apr-1.6.2-dont-test-dlclose.patch b/packages/apr/apr-1.6.2-dont-test-dlclose.patch new file mode 100644 index 0000000..faf8b0b --- /dev/null +++ b/packages/apr/apr-1.6.2-dont-test-dlclose.patch @@ -0,0 +1,22 @@ +dlclose is a no-op on musl. Test will always fail. + +--- apr-1.6.2/test/testdso.c.old 2010-01-03 19:35:07.000000000 -0600 ++++ apr-1.6.2/test/testdso.c 2017-09-10 18:43:43.374983090 -0500 +@@ -244,7 +244,7 @@ + abts_run_test(suite, test_load_module, NULL); + abts_run_test(suite, test_dso_sym, NULL); + abts_run_test(suite, test_dso_sym_return_value, NULL); +- abts_run_test(suite, test_unload_module, NULL); ++ /* abts_run_test(suite, test_unload_module, NULL); */ + + #ifdef LIB_NAME + apr_filepath_merge(&libname, NULL, LIB_NAME, 0, p); +@@ -252,7 +252,7 @@ + abts_run_test(suite, test_load_library, NULL); + abts_run_test(suite, test_dso_sym_library, NULL); + abts_run_test(suite, test_dso_sym_return_value_library, NULL); +- abts_run_test(suite, test_unload_library, NULL); ++ /* abts_run_test(suite, test_unload_library, NULL); */ + #endif + + abts_run_test(suite, test_load_notthere, NULL); \ No newline at end of file diff --git a/packages/apr/semtimedop-s390x.patch b/packages/apr/semtimedop-s390x.patch new file mode 100644 index 0000000..f1bb9ea --- /dev/null +++ b/packages/apr/semtimedop-s390x.patch @@ -0,0 +1,16 @@ +the testsuite hangs on s390x when testing locking mechanism sysvsem. Work +around by avoid use semtimedop for s390x. + +diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c +index 8e2187f..cad6c4a 100644 +--- a/locks/unix/proc_mutex.c ++++ b/locks/unix/proc_mutex.c +@@ -449,7 +449,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = + proc_mutex_sysv_create, + proc_mutex_sysv_acquire, + proc_mutex_sysv_tryacquire, +-#if defined(HAVE_SEMTIMEDOP) ++#if defined(HAVE_SEMTIMEDOP) && !defined(__s390x__) + proc_mutex_sysv_timedacquire, + #else + proc_mutex_spinsleep_timedacquire, \ No newline at end of file diff --git a/packages/argon2/Containerfile b/packages/argon2/Containerfile new file mode 100644 index 0000000..319466b --- /dev/null +++ b/packages/argon2/Containerfile @@ -0,0 +1,28 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=20190702 +ENV SRC_HASH=daf972a89577f8772602bf2eb38b6a3dd3d922bf5724d45e7f9589b5e830442c +ENV SRC_FILE=${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/${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/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +RUN tar -xf $SRC_FILE +WORKDIR phc-winner-argon2-${VERSION} +RUN --network=none <<-EOF + set -eux + make -j $(nproc) OPTTARGET=none ARGON2_VERSION=${VERSION} +EOF + +FROM build as install +RUN make OPTTARGET=none LIBRARY_REL=lib DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/aspell/Containerfile b/packages/aspell/Containerfile new file mode 100644 index 0000000..46913e6 --- /dev/null +++ b/packages/aspell/Containerfile @@ -0,0 +1,38 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=0.60.8.1 +ENV SRC_HASH=d6da12b34d42d457fa604e435ad484a74b2effcd120ff40acd6bb3fb2887d21b +ENV SRC_FILE=aspell-${VERSION}.tar.gz +ENV SRC_SITE=https://ftp.gnu.org/gnu/aspell/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . + +FROM fetch as build +COPY --from=stagex/busybox . / +COPY --from=stagex/perl . / +COPY --from=stagex/binutils . / +COPY --from=stagex/musl . / +COPY --from=stagex/make . / +COPY --from=stagex/gcc . / +RUN tar -xf ${SRC_FILE} +WORKDIR aspell-${VERSION} +ENV SOURCE_DATE_EPOCH=1 +RUN --network=none <<-EOF + set -ex + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc \ + --enable-dict-dir=/usr/share/aspell \ + --enable-pkgdatadir=/usr/share/aspell + make +EOF + +FROM build as install +RUN --network=none make DESTDIR="/rootfs" install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/attr/Containerfile b/packages/attr/Containerfile new file mode 100644 index 0000000..0f04f12 --- /dev/null +++ b/packages/attr/Containerfile @@ -0,0 +1,43 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.5.2 +ENV SRC_HASH=39bf67452fa41d0948c2197601053f48b3d78a029389734332a6309a680c6c87 +ENV SRC_FILE=attr-${VERSION}.tar.gz +ENV SRC_SITE=https://download.savannah.nongnu.org/releases/attr/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/perl . / + +RUN tar -xf ${SRC_FILE} +WORKDIR attr-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --prefix=/usr \ + --exec-prefix=/ \ + --sbindir=/bin \ + --bindir=/usr/bin \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --includedir=/usr/include \ + --mandir=/usr/share/man \ + --docdir=/usr/share/doc/attr \ + --datadir=/usr/share \ + --disable-nls + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/brotli/Containerfile b/packages/brotli/Containerfile new file mode 100644 index 0000000..4c540ea --- /dev/null +++ b/packages/brotli/Containerfile @@ -0,0 +1,42 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.1.0 +ENV SRC_HASH=e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff +ENV SRC_FILE=v${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/google/brotli/archive/refs/tags/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/samurai . / +COPY --from=stagex/cmake . / +COPY --from=stagex/openssl . / +RUN tar -xf ${SRC_FILE} +WORKDIR brotli-${VERSION} +RUN --network=none <<-EOF + set -eux + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr/lib \ + -DBUILD_SHARED_LIBS=OFF + cmake --build build + + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr/lib \ + -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" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/clang/Containerfile b/packages/clang/Containerfile index c500eff..3587d66 100644 --- a/packages/clang/Containerfile +++ b/packages/clang/Containerfile @@ -9,6 +9,7 @@ ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . FROM fetch AS build COPY --from=stagex/busybox . / +COPY --from=stagex/linux-headers . / COPY --from=stagex/binutils . / COPY --from=stagex/cmake . / COPY --from=stagex/ninja . / @@ -17,28 +18,35 @@ COPY --from=stagex/gcc . / COPY --from=stagex/python . / COPY --from=stagex/py-setuptools . / COPY --from=stagex/openssl . / -COPY --from=stagex/gcc . / +COPY --from=stagex/git . / COPY --from=stagex/llvm . / COPY --from=stagex/zlib . / +COPY --from=stagex/ninja . / +COPY --from=stagex/libxml2 . / +COPY --from=stagex/samurai . / RUN tar -xf ${SRC_FILE} WORKDIR llvm-project-${VERSION}.src RUN --network=none <<-EOF set -eux cmake \ - -S clang \ - -B build \ - -G Ninja \ - -Wno-dev \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/ \ - -DCMAKE_INSTALL_RPATH=/usr/ \ - -DCLANG_BUILT_STANDALONE=ON \ - -DCLANG_LINK_CLANG_DYLIB=ON \ - -DCLANG_PLUGIN_SUPPORT=ON \ - -DCLANG_VENDOR=stagex \ - -DLIBCLANG_BUILD_STATIC=ON - cmake --build build + -S clang \ + -B build \ + -G Ninja \ + -Wno-dev \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/ \ + -DCLANG_BUILT_STANDALONE=ON \ + -DCLANG_CONFIG_FILE_SYSTEM_DIR=/etc/clang16 \ + -DCLANG_ENABLE_ARCMT=ON \ + -DCMAKE_INSTALL_RPATH=/usr/ \ + -DCLANG_LINK_CLANG_DYLIB=ON \ + -DCLANG_PLUGIN_SUPPORT=ON \ + -DCLANG_VENDOR=stagex \ + -DENABLE_LINKER_BUILD_ID=ON \ + -DLIBCLANG_BUILD_STATIC=ON + ninja -C build clang-tblgen + ninja -C build EOF FROM build AS install diff --git a/packages/dbus-glib/Containerfile b/packages/dbus-glib/Containerfile new file mode 100644 index 0000000..0ff10e2 --- /dev/null +++ b/packages/dbus-glib/Containerfile @@ -0,0 +1,44 @@ + +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=0.112 +ENV SRC_HASH=7d550dccdfcd286e33895501829ed971eeb65c614e73aadb4a08aeef719b143a +ENV SRC_FILE=dbus-glib-${VERSION}.tar.gz +ENV SRC_SITE=https://dbus.freedesktop.org/releases/dbus-glib/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch AS build +COPY --from=stagex/glib . / +COPY --from=stagex/gettext . / +COPY --from=stagex/expat . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/dbus . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +RUN tar -xf ${SRC_FILE} +WORKDIR dbus-glib-${VERSION} +RUN ls -la . +RUN --network=none <<-EOF + set -eux \ + CFLAGS="-flto=auto" \ + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --enable-static=no \ + --enable-bash-completion=no + make -j "$(nproc)" +EOF + +FROM build AS install +RUN DESTDIR=/rootfs cmake --install build +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/dbus/Containerfile b/packages/dbus/Containerfile new file mode 100644 index 0000000..c1af810 --- /dev/null +++ b/packages/dbus/Containerfile @@ -0,0 +1,49 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=1.14.10 +ENV SRC_HASH=ba1f21d2bd9d339da2d4aa8780c09df32fea87998b73da24f49ab9df1e36a50f +ENV SRC_FILE=dbus-${VERSION}.tar.xz +ENV SRC_SITE=https://dbus.freedesktop.org/releases/dbus/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch AS build +COPY --from=stagex/glib . / +COPY --from=stagex/gettext . / +COPY --from=stagex/expat . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/meson . / +COPY --from=stagex/busybox . / +COPY --from=stagex/libsm . / +COPY --from=stagex/binutils . / +COPY --from=stagex/m4 . / +COPY --from=stagex/xmlto . / +COPY --from=stagex/make . / +COPY --from=stagex/automake . / +COPY --from=stagex/autoconf . / +RUN tar -xf ${SRC_FILE} +WORKDIR dbus-${VERSION} +RUN ls -la . +RUN --network=none <<-EOF + set -eux + ./autogen.sh + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --with-system-pid-file=/run/dbus/dbus.pid \ + --enable-checks \ + --disable-asserts + make -j "$(nproc)" +EOF + +FROM build AS install +RUN DESTDIR=/rootfs cmake --install build +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/doxygen/Containerfile b/packages/doxygen/Containerfile new file mode 100644 index 0000000..2a9f82f --- /dev/null +++ b/packages/doxygen/Containerfile @@ -0,0 +1,48 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.10.0 +ENV SRC_HASH=dd7c556b4d96ca5e682534bc1f1a78a5cfabce0c425b14c1b8549802686a4442 +ENV SRC_FILE=doxygen-${VERSION}.src.tar.gz +ENV SRC_SITE=https://doxygen.nl/files/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/flex . / +COPY --from=stagex/bison . / +COPY --from=stagex/coreutils . / +COPY --from=stagex/perl . / +COPY --from=stagex/python . / +COPY --from=stagex/cmake . / +COPY --from=stagex/samurai . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/libxml2 . / +COPY --from=stagex/perl . / +COPY --from=stagex/openssl . / +COPY --from=stagex/m4 . / +RUN tar -xf ${SRC_FILE} +WORKDIR doxygen-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux \ + patch -p1 remove-usage-of-fstat64.patch + cmake -B build -G Ninja \ + -DGIT_EXECUTABLE=/bin/false \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -Dbuild_xmlparser=ON + cmake --build build +EOF + +FROM build as install +RUN DESTDIR=/rootfs cmake --install build +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/doxygen/remove-usage-of-fstat64.patch b/packages/doxygen/remove-usage-of-fstat64.patch new file mode 100644 index 0000000..4ec3cd2 --- /dev/null +++ b/packages/doxygen/remove-usage-of-fstat64.patch @@ -0,0 +1,23 @@ +--- a/deps/spdlog/include/spdlog/details/os-inl.h ++++ b/deps/spdlog/include/spdlog/details/os-inl.h +@@ -236,20 +236,11 @@ + # else + int fd = ::fileno(f); + # endif +-// 64 bits(but not in osx or cygwin, where fstat64 is deprecated) +-# if (defined(__linux__) || defined(__sun) || defined(_AIX)) && (defined(__LP64__) || defined(_LP64)) +- struct stat64 st; +- if (::fstat64(fd, &st) == 0) +- { +- return static_cast(st.st_size); +- } +-# else // other unix or linux 32 bits or cygwin + struct stat st; + if (::fstat(fd, &st) == 0) + { + return static_cast(st.st_size); + } +-# endif + #endif + throw_spdlog_ex("Failed getting file size from fd", errno); + return 0; // will not be reached. \ No newline at end of file diff --git a/packages/enchant2/Containerfile b/packages/enchant2/Containerfile new file mode 100644 index 0000000..60873d9 --- /dev/null +++ b/packages/enchant2/Containerfile @@ -0,0 +1,51 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.6.9 +ENV SRC_HASH=d9a5a10dc9b38a43b3a0fa22c76ed6ebb7e09eb535aff62954afcdbd40efff6b +ENV SRC_FILE=enchant-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/AbiWord/enchant/releases/download/v${VERSION}/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/perl . / +COPY --from=stagex/file . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/openssl . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/glib . / +COPY --from=stagex/groff . / +COPY --from=stagex/hunspell . / +COPY --from=stagex/pcre2 . / +COPY --from=stagex/gettext . / +COPY --from=stagex/aspell . / +COPY --from=stagex/file . / +COPY --from=stagex/nuspell . / +RUN tar -xf ${SRC_FILE} +WORKDIR enchant-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --disable-static \ + --with-aspell \ + --with-hunspell \ + --with-nuspell + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/expat/Containerfile b/packages/expat/Containerfile new file mode 100644 index 0000000..9ad6408 --- /dev/null +++ b/packages/expat/Containerfile @@ -0,0 +1,35 @@ + +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.6.2 +ENV SRC_HASH=d4cf38d26e21a56654ffe4acd9cd5481164619626802328506a2869afab29ab3 +ENV SRC_FILE=expat-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/libexpat/libexpat/releases/download/R_2_6_2/${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/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +RUN tar -xf $SRC_FILE +WORKDIR expat-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --enable-static + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/fmt/Containerfile b/packages/fmt/Containerfile new file mode 100644 index 0000000..e4cd9a2 --- /dev/null +++ b/packages/fmt/Containerfile @@ -0,0 +1,45 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=10.2.1 +ENV SRC_HASH=1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811 +ENV SRC_FILE=${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/fmtlib/fmt/archive/refs/tags/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/openssl . / +COPY --from=stagex/postgresql . / +COPY --from=stagex/cmake . / +COPY --from=stagex/samurai . / +COPY --from=stagex/python . / +COPY --from=stagex/doxygen . / +RUN tar -xf ${SRC_FILE} +WORKDIR fmt-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux \ + patch -p1 fix-handling-of-static-separator.patch + # Build in-tree so the prebuilt docs get installed correctly. + # See https://github.com/fmtlib/fmt/issues/2837 + cmake -B . -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=None \ + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + cmake --build . +EOF + +FROM build as install +RUN DESTDIR=/rootfs cmake --install . +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/fmt/fix-handling-of-static-separator.patch b/packages/fmt/fix-handling-of-static-separator.patch new file mode 100644 index 0000000..4a44c8c --- /dev/null +++ b/packages/fmt/fix-handling-of-static-separator.patch @@ -0,0 +1,31 @@ +From 44c3fe1ebb466ab5c296e1a1a6991c7c7b51b72e Mon Sep 17 00:00:00 2001 +From: Victor Zverovich +Date: Fri, 9 Feb 2024 15:58:56 -0800 +Subject: [PATCH] Fix handling of static separator + +--- + include/fmt/format-inl.h | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/include/fmt/format-inl.h ++++ b/include/fmt/format-inl.h +@@ -114,7 +114,11 @@ template FMT_FUNC Char d + + FMT_FUNC auto write_loc(appender out, loc_value value, + const format_specs<>& specs, locale_ref loc) -> bool { +-#ifndef FMT_STATIC_THOUSANDS_SEPARATOR ++#ifdef FMT_STATIC_THOUSANDS_SEPARATOR ++ value.visit(loc_writer<>{ ++ out, specs, std::string(1, FMT_STATIC_THOUSANDS_SEPARATOR), "\3", "."}); ++ return true; ++#else + auto locale = loc.get(); + // We cannot use the num_put facet because it may produce output in + // a wrong encoding. +@@ -123,7 +127,6 @@ FMT_FUNC auto write_loc(appender out, lo + return std::use_facet(locale).put(out, value, specs); + return facet(locale).put(out, value, specs); + #endif +- return false; + } + } // namespace detail diff --git a/packages/freetds/Containerfile b/packages/freetds/Containerfile new file mode 100644 index 0000000..158f3b8 --- /dev/null +++ b/packages/freetds/Containerfile @@ -0,0 +1,48 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=1.4.22 +ENV SRC_HASH=a9a7f24f0a7a871617e76e8cc6e6556ae788042f1c006195665505499b2334b1 +ENV SRC_FILE=freetds-${VERSION}.tar.bz2 +ENV SRC_SITE=https://www.freetds.org/files/stable/${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/libtool . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/readline . / +COPY --from=stagex/unixodbc . / +COPY --from=stagex/openssl . / +COPY --from=stagex/perl . / +RUN tar -xf ${SRC_FILE} +WORKDIR freetds-${VERSION} +RUN --network=none <<-EOF + set -ex + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --enable-msdblib \ + --with-openssl=/usr \ + --enable-odbc \ + --with-unixodbc=/usr + 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/. / diff --git a/packages/gdbm/Containerfile b/packages/gdbm/Containerfile new file mode 100644 index 0000000..10ec402 --- /dev/null +++ b/packages/gdbm/Containerfile @@ -0,0 +1,40 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.23 +ENV SRC_HASH=74b1081d21fff13ae4bd7c16e5d6e504a4c26f7cde1dca0d963a484174bbcacd +ENV SRC_FILE=gdbm-${VERSION}.tar.gz +ENV SRC_SITE=https://ftp.gnu.org/gnu/gdbm/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/openssl . / +RUN tar -xf ${SRC_FILE} +WORKDIR gdbm-${VERSION} +ENV SOURCE_DATE_EPOCH=1 +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --enable-libgdbm-compat \ + --disable-largefile \ + --disable-dependency-tracking \ + --enable-fast-install + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/glib/Containerfile b/packages/glib/Containerfile new file mode 100644 index 0000000..fc8f17d --- /dev/null +++ b/packages/glib/Containerfile @@ -0,0 +1,71 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.80.0 +ENV SRC_HASH=8228a92f92a412160b139ae68b6345bd28f24434a7b5af150ebe21ff587a561d +ENV SRC_FILE=glib-${VERSION}.tar.xz +ENV SRC_SITE=https://download.gnome.org/sources/glib/2.80/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/python . / +COPY --from=stagex/zlib . / +COPY --from=stagex/bzip2 . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/ncurses . / +COPY --from=stagex/meson . / +COPY --from=stagex/busybox . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/cmake . / +COPY --from=stagex/pcre2 . / +COPY --from=stagex/python . / +COPY --from=stagex/bison . / +COPY --from=stagex/flex . / +COPY --from=stagex/py-packaging . / +COPY --from=stagex/libxslt . / +COPY --from=stagex/libffi . / +COPY --from=stagex/xz . / +COPY --from=stagex/expat . / +COPY --from=stagex/rhash . / +COPY --from=stagex/libxml2 . / +COPY --from=stagex/util-linux . / +COPY --from=stagex/libxslt . / +COPY --from=stagex/gettext . / +COPY --from=stagex/ninja . / +RUN tar -xf ${SRC_FILE} +WORKDIR glib-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + # set -eux \ + patch -p1 alwaysbash.patch + patch -p1 deprecated-no-warn.patch + patch -p1 fix-tests.patch + patch -p1 flaky-tests.patch + patch -p1 tests-machine-id.patch + export CFLAGS="-ffat-lto-objects -O2" + export CXXFLAGS="-O2" + export CPPFLAGS="-O2" + meson setup \ + --default-library=shared \ + --prefix=/usr \ + -Dman-pages=disabled \ + -Dlibmount=disabled \ + -Dtests=false \ + -Dintrospection=disabled \ + -Dnls=disabled \ + . output + meson compile -C output + meson install --no-rebuild -C output +EOF + +FROM build as install +RUN DESTDIR=/rootfs meson install --no-rebuild -C output +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/glib/alwaysbash.patch b/packages/glib/alwaysbash.patch new file mode 100644 index 0000000..8351dd8 --- /dev/null +++ b/packages/glib/alwaysbash.patch @@ -0,0 +1,16 @@ +the completions only install if bash is detected. +instead of adding bash to makedeps, just always install them +-- +diff --git a/gio/meson.build b/gio/meson.build +index 462606f..bb3e19d 100644 +--- a/gio/meson.build ++++ b/gio/meson.build +@@ -805,7 +805,7 @@ if host_system == 'windows' + internal_deps += [ giowin32_lib ] + endif + +-if have_bash ++if true + bash_comp_inst_dir = '' + if bash_comp_dep.found() + bash_comp_dir_override = bash_comp_dep.version().version_compare('>= 2.10') ? ['datadir', get_option('datadir')] : ['prefix', get_option('prefix')] diff --git a/packages/glib/deprecated-no-warn.patch b/packages/glib/deprecated-no-warn.patch new file mode 100644 index 0000000..4322406 --- /dev/null +++ b/packages/glib/deprecated-no-warn.patch @@ -0,0 +1,22 @@ +diff -Naur a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c +--- a/gio/glib-compile-schemas.c 2018-09-21 15:23:52.000000000 +0100 ++++ b/gio/glib-compile-schemas.c 2019-02-10 14:37:30.034879344 +0000 +@@ -1233,19 +1233,6 @@ + return; + } + +- if (path && (g_str_has_prefix (path, "/apps/") || +- g_str_has_prefix (path, "/desktop/") || +- g_str_has_prefix (path, "/system/"))) +- { +- gchar *message = NULL; +- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. " +- "Paths starting with " +- "“/apps/”, “/desktop/” or “/system/” are deprecated."), +- id, path); +- g_printerr ("%s\n", message); +- g_free (message); +- } +- + state->schema_state = schema_state_new (path, gettext_domain, + extends, extends_name, list_of); \ No newline at end of file diff --git a/packages/glib/fix-tests.patch b/packages/glib/fix-tests.patch new file mode 100644 index 0000000..2230732 --- /dev/null +++ b/packages/glib/fix-tests.patch @@ -0,0 +1,456 @@ +From 01304c97693a7c789bde9c543979872fc63c387c Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 3 Apr 2024 21:11:24 +0200 +Subject: [PATCH 1/3] tests: skip test that requires shared-mime-info when its + missing + +shared-mime-info required glib to build and will not be there during +bootstrap. Skip the test if it is missing. + +ref: https://gitlab.gnome.org/GNOME/glib/-/issues/3317 +Signed-off-by: Natanael Copa +--- + gio/tests/contenttype.c | 47 +++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 45 insertions(+), 2 deletions(-) + +diff --git a/gio/tests/contenttype.c b/gio/tests/contenttype.c +index 8784374f2..b442d5352 100644 +--- a/gio/tests/contenttype.c ++++ b/gio/tests/contenttype.c +@@ -13,6 +13,20 @@ + __s1, " == ", __s2); \ + } while (0) + ++static gboolean ++skip_missing_shared_mime_info (void) ++{ ++ const gchar *path = g_find_program_in_path("update-mime-database"); ++ ++ if (path == NULL) ++ { ++ g_test_skip ("shared-mime-info is required to run this test"); ++ return TRUE; ++ } ++ g_free(path); ++ return FALSE; ++} ++ + static void + test_guess (void) + { +@@ -26,6 +40,9 @@ test_guess (void) + "Name=appinfo-test\n" + "Exec=./appinfo-test --option\n"; + ++ if (skip_missing_shared_mime_info ()) ++ return; ++ + #ifdef G_OS_WIN32 + existing_directory = (gchar *) g_getenv ("SYSTEMROOT"); + +@@ -150,6 +167,9 @@ test_subtype (void) + gchar *plain; + gchar *xml; + ++ if (skip_missing_shared_mime_info ()) ++ return; ++ + plain = g_content_type_from_mime_type ("text/plain"); + xml = g_content_type_from_mime_type ("application/xml"); + +@@ -175,6 +195,9 @@ test_list (void) + gchar *plain; + gchar *xml; + ++ if (skip_missing_shared_mime_info ()) ++ return; ++ + #ifdef __APPLE__ + g_test_skip ("The OSX backend does not implement g_content_types_get_registered()"); + return; +@@ -202,6 +225,9 @@ test_executable (void) + { + gchar *type; + ++ if (skip_missing_shared_mime_info ()) ++ return; ++ + #ifdef G_OS_WIN32 + type = g_content_type_from_mime_type ("application/vnd.microsoft.portable-executable"); + /* FIXME: the MIME is not in the default `MIME\Database\Content Type` registry. +@@ -228,6 +254,9 @@ test_description (void) + gchar *type; + gchar *desc; + ++ if (skip_missing_shared_mime_info ()) ++ return; ++ + type = g_content_type_from_mime_type ("text/plain"); + desc = g_content_type_get_description (type); + g_assert_nonnull (desc); +@@ -242,6 +271,9 @@ test_icon (void) + gchar *type; + GIcon *icon; + ++ if (skip_missing_shared_mime_info ()) ++ return; ++ + type = g_content_type_from_mime_type ("text/plain"); + icon = g_content_type_get_icon (type); + g_assert_true (G_IS_ICON (icon)); +@@ -290,6 +322,9 @@ test_symbolic_icon (void) + gchar *type; + GIcon *icon; + ++ if (skip_missing_shared_mime_info ()) ++ return; ++ + type = g_content_type_from_mime_type ("text/plain"); + icon = g_content_type_get_symbolic_icon (type); + g_assert_true (G_IS_ICON (icon)); +@@ -344,6 +379,9 @@ test_tree (void) + gchar **types; + gsize i; + ++ if (skip_missing_shared_mime_info ()) ++ return; ++ + #if defined(__APPLE__) || defined(G_OS_WIN32) + g_test_skip ("The OSX & Windows backends do not implement g_content_type_guess_for_tree()"); + return; +@@ -437,8 +475,13 @@ test_guess_svg_from_data (void) + \n"; + + gboolean uncertain = TRUE; +- gchar *res = g_content_type_guess (NULL, (guchar *)svgfilecontent, +- sizeof (svgfilecontent) - 1, &uncertain); ++ gchar *res; ++ ++ if (skip_missing_shared_mime_info ()) ++ return; ++ ++ res = g_content_type_guess (NULL, (guchar *)svgfilecontent, ++ sizeof (svgfilecontent) - 1, &uncertain); + #ifdef __APPLE__ + g_assert_cmpstr (res, ==, "public.svg-image"); + #elif defined(G_OS_WIN32) +-- +2.44.0 + + +From a77fdc4cae8deb7ef9f47e81f81a8db139434093 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Thu, 4 Apr 2024 17:08:46 +0200 +Subject: [PATCH 2/3] tests: skip tests that requires dbus-daemon when its + missing + +dbus may not be built yet during bootstrap, because it needs glib to +build. + +Ref: https://gitlab.gnome.org/GNOME/glib/-/issues/3317 +Signed-off-by: Natanael Copa +--- + gio/tests/appinfo.c | 22 ++++++++++++++++++++++ + gio/tests/desktop-app-info.c | 19 +++++++++++++++++++ + 2 files changed, 41 insertions(+) + +diff --git a/gio/tests/appinfo.c b/gio/tests/appinfo.c +index d9c53c853..81bc48191 100644 +--- a/gio/tests/appinfo.c ++++ b/gio/tests/appinfo.c +@@ -49,6 +49,19 @@ test_launch_for_app_info (GAppInfo *appinfo) + g_free (uri); + } + ++static gboolean ++skip_missing_dbus_daemon (void) ++{ ++ const gchar *path = g_find_program_in_path ("dbus-daemon"); ++ if (path == NULL) ++ { ++ g_test_skip ("dbus-daemon is required to run this test"); ++ return TRUE; ++ } ++ g_free (path); ++ return FALSE; ++} ++ + static void + test_launch (void) + { +@@ -56,6 +69,9 @@ test_launch (void) + GAppInfo *appinfo; + const gchar *path; + ++ if (skip_missing_dbus_daemon ()) ++ return; ++ + /* Set up a test session bus to keep D-Bus traffic off the real session bus. */ + bus = g_test_dbus_new (G_TEST_DBUS_NONE); + g_test_dbus_up (bus); +@@ -96,6 +112,9 @@ test_launch_no_app_id (void) + gchar *exec_line_variants[2]; + gsize i; + ++ if (skip_missing_dbus_daemon ()) ++ return; ++ + exec_line_variants[0] = g_strdup_printf ( + "Exec=%s/appinfo-test --option %%U %%i --name %%c --filename %%k %%m %%%%", + g_test_get_dir (G_TEST_BUILT)); +@@ -356,6 +375,9 @@ test_launch_context_signals (void) + gboolean success; + gchar *cmdline; + ++ if (skip_missing_dbus_daemon ()) ++ return; ++ + /* Set up a test session bus to keep D-Bus traffic off the real session bus. */ + bus = g_test_dbus_new (G_TEST_DBUS_NONE); + g_test_dbus_up (bus); +diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c +index e82e2dd31..ec65b7618 100644 +--- a/gio/tests/desktop-app-info.c ++++ b/gio/tests/desktop-app-info.c +@@ -593,6 +593,19 @@ wait_for_file (const gchar *want_this, + unlink (or_this); + } + ++static gboolean ++skip_missing_dbus_daemon (void) ++{ ++ const gchar *path = g_find_program_in_path ("dbus-daemon"); ++ if (path == NULL) ++ { ++ g_test_skip ("dbus-daemon is required to run this test"); ++ return TRUE; ++ } ++ g_free (path); ++ return FALSE; ++} ++ + static void + test_actions (void) + { +@@ -606,6 +619,9 @@ test_actions (void) + gchar *tweak_path; + gchar *twiddle_path; + ++ if (skip_missing_dbus_daemon ()) ++ return; ++ + /* Set up a test session bus to keep D-Bus traffic off the real session bus. */ + bus = g_test_dbus_new (G_TEST_DBUS_NONE); + g_test_dbus_up (bus); +@@ -1833,6 +1849,9 @@ test_launch_fail_dbus (void) + GAsyncResult *result = NULL; + GError *error = NULL; + ++ if (skip_missing_dbus_daemon ()) ++ return; ++ + /* Set up a test session bus to ensure that launching the app happens using + * D-Bus rather than spawning. */ + bus = g_test_dbus_new (G_TEST_DBUS_NONE); +-- +2.44.0 + + +From 0ec9c399c7d2755147e409d065690b2ff53fda40 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 3 Apr 2024 22:10:18 +0200 +Subject: [PATCH 3/3] tests: find update-desktop-database + +Disable tests that require update-desktop-database when it is missing. + +It requires glib to build so it will be missing when bootstrapping glib. + +Refactor the ifdef for Windows and MacOS while at it and reduce number +of ifdefs. + +Ref: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3658 +Signed-off-by: Natanael Copa +--- + gio/tests/desktop-app-info.c | 35 +++++++++++++++++++++++++++++ + gio/tests/file.c | 43 ++++++++++++++++++++++-------------- + 2 files changed, 62 insertions(+), 16 deletions(-) + +diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c +index ec65b7618..e492b1346 100644 +--- a/gio/tests/desktop-app-info.c ++++ b/gio/tests/desktop-app-info.c +@@ -125,6 +125,20 @@ create_app_info (const char *name) + return info; + } + ++static gboolean ++skip_missing_update_desktop_database (void) ++{ ++ const gchar *path = g_find_program_in_path ("update-desktop-database"); ++ ++ if (path == NULL) ++ { ++ g_test_skip ("update-desktop-database is required to run this test"); ++ return TRUE; ++ } ++ g_free (path); ++ return FALSE; ++} ++ + static void + test_delete (void) + { +@@ -134,6 +148,9 @@ test_delete (void) + char *filename; + gboolean res; + ++ if (skip_missing_update_desktop_database ()) ++ return; ++ + info = create_app_info ("Blah"); + + id = g_app_info_get_id (info); +@@ -177,6 +194,9 @@ test_default (void) + GList *list; + GError *error = NULL; + ++if (skip_missing_update_desktop_database ()) ++ return; ++ + info1 = create_app_info ("Blah1"); + info2 = create_app_info ("Blah2"); + info3 = create_app_info ("Blah3"); +@@ -316,6 +336,9 @@ test_default_async (void) + GList *list; + GError *error = NULL; + ++ if (skip_missing_update_desktop_database ()) ++ return; ++ + data.loop = g_main_loop_new (NULL, TRUE); + + info1 = create_app_info ("Blah1"); +@@ -418,6 +441,9 @@ test_fallback (void) + GError *error = NULL; + gint old_length; + ++ if (skip_missing_update_desktop_database ()) ++ return; ++ + info1 = create_app_info ("Test1"); + info2 = create_app_info ("Test2"); + +@@ -492,6 +518,9 @@ test_last_used (void) + GAppInfo *info1, *info2, *default_app; + GError *error = NULL; + ++ if (skip_missing_update_desktop_database ()) ++ return; ++ + info1 = create_app_info ("Test1"); + info2 = create_app_info ("Test2"); + +@@ -1222,6 +1251,9 @@ test_default_uri_handler (void) + gchar *file_path = NULL; + GAppInfo *info; + ++ if (skip_missing_update_desktop_database ()) ++ return; ++ + info = create_app_info_toucher ("Touch Handled", "handled", + "x-scheme-handler/glib-touch", + &file_path); +@@ -1298,6 +1330,9 @@ test_default_uri_handler_async (void) + gboolean called = FALSE; + gint64 start_time, touch_time; + ++ if (skip_missing_update_desktop_database ()) ++ return; ++ + loop = g_main_loop_new (NULL, FALSE); + info = create_app_info_toucher ("Touch Handled", "handled-async", + "x-scheme-handler/glib-async-touch", +diff --git a/gio/tests/file.c b/gio/tests/file.c +index 72296d008..dba5fe66c 100644 +--- a/gio/tests/file.c ++++ b/gio/tests/file.c +@@ -3784,6 +3784,25 @@ create_command_line_app_info (const char *name, + return g_steal_pointer (&info); + } + ++static gboolean ++skip_missing_update_desktop_database (void) ++{ ++#if defined(G_OS_WIN32) || defined(__APPLE__) ++ g_test_skip ("Default URI handlers are not currently supported on Windows or macOS"); ++ return TRUE; ++#else ++ const gchar *path = g_find_program_in_path ("update-desktop-database"); ++ ++ if (path == NULL) ++ { ++ g_test_skip ("update-desktop-database is required to run this test"); ++ return TRUE; ++ } ++ g_free (path); ++ return FALSE; ++#endif ++} ++ + static void + test_query_default_handler_uri (void) + { +@@ -3793,10 +3812,8 @@ test_query_default_handler_uri (void) + GFile *file; + GFile *invalid_file; + +-#if defined(G_OS_WIN32) || defined(__APPLE__) +- g_test_skip ("Default URI handlers are not currently supported on Windows or macOS"); +- return; +-#endif ++ if (skip_missing_update_desktop_database ()) ++ return; + + info = create_command_line_app_info ("Gio File Handler", "true", + "x-scheme-handler/gio-file"); +@@ -3878,10 +3895,8 @@ test_query_default_handler_file (void) + const char buffer[] = "Text file!\n"; + const guint8 binary_buffer[] = "\xde\xad\xbe\xff"; + +-#if defined(G_OS_WIN32) || defined(__APPLE__) +- g_test_skip ("Default URI handlers are not currently supported on Windows or macOS"); +- return; +-#endif ++ if (skip_missing_update_desktop_database ()) ++ return; + + text_file = g_file_new_tmp ("query-default-handler-XXXXXX", &iostream, &error); + g_assert_no_error (error); +@@ -3974,10 +3989,8 @@ test_query_default_handler_file_async (void) + const guint8 binary_buffer[] = "\xde\xad\xbe\xff"; + GError *error = NULL; + +-#if defined(G_OS_WIN32) || defined(__APPLE__) +- g_test_skip ("Default URI handlers are not currently supported on Windows or macOS"); +- return; +-#endif ++ if (skip_missing_update_desktop_database ()) ++ return; + + data.loop = g_main_loop_new (NULL, FALSE); + +@@ -4064,10 +4077,8 @@ test_query_default_handler_uri_async (void) + GFile *file; + GFile *invalid_file; + +-#if defined(G_OS_WIN32) || defined(__APPLE__) +- g_test_skip ("Default URI handlers are not currently supported on Windows or macOS"); +- return; +-#endif ++ if (skip_missing_update_desktop_database ()) ++ return; + + info = create_command_line_app_info ("Gio File Handler", "true", + "x-scheme-handler/gio-file"); +-- +2.44.0 \ No newline at end of file diff --git a/packages/glib/flaky-tests.patch b/packages/glib/flaky-tests.patch new file mode 100644 index 0000000..3ce30c6 --- /dev/null +++ b/packages/glib/flaky-tests.patch @@ -0,0 +1,83 @@ +https://gitlab.gnome.org/GNOME/glib/-/issues/3318 +https://gitlab.gnome.org/GNOME/glib/-/issues/3320 + +diff --git a/glib/tests/meson.build b/glib/tests/meson.build +index 85f40d2e1..059a786d3 100644 +--- a/glib/tests/meson.build ++++ b/glib/tests/meson.build +@@ -54,6 +54,7 @@ glib_tests = { + 'gwakeup' : { + 'source' : ['gwakeuptest.c', '../gwakeup.c'], + 'install' : false, ++ 'can_fail': host_machine.cpu_family() == 's390x', + }, + 'hash' : {}, + 'hmac' : {}, +@@ -226,6 +227,7 @@ if glib_conf.has('HAVE_EVENTFD') + 'source' : ['gwakeuptest.c', '../gwakeup.c'], + 'c_args' : ['-DTEST_EVENTFD_FALLBACK'], + 'install' : false, ++ 'can_fail': host_machine.cpu_family() == 's390x', + }, + } + endif +diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build +index a163e5f91..12c449519 100644 +--- a/gobject/tests/meson.build ++++ b/gobject/tests/meson.build +@@ -78,7 +78,7 @@ gobject_tests = { + 'references' : {}, + 'basic-signals' : {}, + 'singleton' : {}, +- 'threadtests' : {}, ++ 'threadtests' : { 'can_fail': 'aarch64' in host_machine.cpu_family() or 'riscv' in host_machine.cpu_family() }, + 'dynamictests' : {}, + 'binding' : {}, + 'bindinggroup' : {}, +From ad2925ef361a7c889ff696a1ba9e677accaecd08 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Thu, 4 Apr 2024 10:15:07 +0200 +Subject: [PATCH] tests: increase timeout on slow architectures + +Prevent tests to timeout on architectures that are slow. + +Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/3319 + +Signed-off-by: Natanael Copa +--- + meson.build | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/meson.build b/meson.build +index f0c5e070b..4c6c87766 100644 +--- a/meson.build ++++ b/meson.build +@@ -182,6 +182,12 @@ test_protocol = 'tap' + test_timeout = 30 + test_timeout_slow = 90 + ++# give more time on slow architectures ++if 'riscv' in host_machine.cpu_family() ++ test_timeout = test_timeout * 4 ++ test_timeout_slow = test_timeout_slow * 4 ++endif ++ + add_test_setup('default', + is_default: true, + exclude_suites: ['flaky', 'failing'], +-- +2.44.0 + +diff --git a/glib/tests/meson.build b/glib/tests/meson.build +index 85f40d2e1..f2ee59678 100644 +--- a/glib/tests/meson.build ++++ b/glib/tests/meson.build +@@ -113,6 +113,8 @@ glib_tests = { + 'regex' : { + 'dependencies' : [pcre2], + 'c_args' : use_pcre2_static_flag ? ['-DPCRE2_STATIC'] : [], ++ # https://gitlab.gnome.org/GNOME/glib/-/issues/3321 ++ 'can_fail': host_machine.cpu_family() == 'riscv64', + }, + 'relation' : {}, + 'rwlock' : {}, diff --git a/packages/glib/tests-machine-id.patch b/packages/glib/tests-machine-id.patch new file mode 100644 index 0000000..fdbc536 --- /dev/null +++ b/packages/glib/tests-machine-id.patch @@ -0,0 +1,41 @@ +From 5cf08a9a1041a9dc9975371fb62f8f22c3be76c4 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 3 Apr 2024 21:25:04 +0200 +Subject: [PATCH 2/3] tests: skip gio tests which fails with missing machine-id + +Signed-off-by: Natanael Copa +--- + gio/tests/meson.build | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/gio/tests/meson.build b/gio/tests/meson.build +index f04ff43ff..71ec09750 100644 +--- a/gio/tests/meson.build ++++ b/gio/tests/meson.build +@@ -46,6 +46,8 @@ if glib_build_shared + subdir('modules') + endif + ++have_machine_id = import('fs').is_file('/etc/machine-id') ++ + # Test programs buildable on all platforms + gio_tests = { + 'application-command-line': {}, +@@ -98,7 +100,7 @@ gio_tests = { + 'install_rpath' : installed_tests_execdir, + # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 + # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/3148 +- 'can_fail' : host_system in ['darwin', 'windows', 'gnu'], ++ 'can_fail' : host_system in ['darwin', 'windows', 'gnu'] or not have_machine_id, + }, + 'inet-address' : {}, + 'io-stream' : {}, +@@ -147,7 +149,7 @@ gio_tests = { + 'extra_programs': host_system != 'windows' ? ['dbus-launch'] : [], + # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392 + # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/3148 +- 'can_fail' : host_system in ['darwin', 'gnu'], ++ 'can_fail' : host_system in ['darwin', 'gnu'] or not have_machine_id, + }, + 'win32-appinfo' : {}, + } diff --git a/packages/groff/Containerfile b/packages/groff/Containerfile new file mode 100644 index 0000000..c14ccd7 --- /dev/null +++ b/packages/groff/Containerfile @@ -0,0 +1,37 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.23.0 +ENV SRC_HASH=6b9757f592b7518b4902eb6af7e54570bdccba37a871fddb2d30ae3863511c13 +ENV SRC_FILE=groff-${VERSION}.tar.gz +ENV SRC_SITE=https://ftp.gnu.org/gnu/groff/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} +FROM fetch as build +COPY --from=stagex/perl . / +COPY --from=stagex/m4 . / +COPY --from=stagex/busybox . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +RUN tar -xf $SRC_FILE +WORKDIR groff-${VERSION} +ENV SOURCE_DATE_EPOCH=1 +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --without-x \ + --disable-rpath + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/hunspell/Containerfile b/packages/hunspell/Containerfile new file mode 100644 index 0000000..12759bc --- /dev/null +++ b/packages/hunspell/Containerfile @@ -0,0 +1,38 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.7.2 +ENV SRC_HASH=11ddfa39afe28c28539fe65fc4f1592d410c1e9b6dd7d8a91ca25d85e9ec65b8 +ENV SRC_FILE=hunspell-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/hunspell/hunspell/releases/download/v${VERSION}/${SRC_FILE} +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/openssl . / +RUN tar -xf ${SRC_FILE} +WORKDIR hunspell-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --with-ui \ + --with-readline \ + --disable-static \ + --without-included-gettext + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/krb5/Containerfile b/packages/krb5/Containerfile new file mode 100644 index 0000000..ea58b2e --- /dev/null +++ b/packages/krb5/Containerfile @@ -0,0 +1,62 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.21.2 +ENV SRC_HASH=9560941a9d843c0243a71b17a7ac6fe31c7cebb5bce3983db79e52ae7e850491 +ENV SRC_FILE=krb5-${VERSION}.tar.gz +ENV SRC_SITE=https://kerberos.org/dist/krb5/1.21/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} +FROM fetch as build +COPY --from=stagex/perl . / +COPY --from=stagex/bash . / +COPY --from=stagex/m4 . / +COPY --from=stagex/curl . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/util-linux . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/busybox . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/e2fsprogs . / +COPY --from=stagex/python . / +COPY --from=stagex/openldap . / +COPY --from=stagex/openssl . / +COPY --from=stagex/groff . / +COPY --from=stagex/libevent . / +COPY --from=stagex/bison . / +COPY --from=stagex/libtool . / +COPY --from=stagex/libverto . / +COPY --from=stagex/pkgconf . / +RUN tar -xf $SRC_FILE +WORKDIR krb5-${VERSION}/src +RUN --network=none <<-EOF + set -eux + ./configure \ + CPPFLAGS="-fPIC -I/usr/include/et" \ + WARN_CFLAGS= \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --localstatedir=/var/lib \ + --enable-shared \ + --disable-nls \ + --disable-static \ + --disable-rpath \ + --with-system-et \ + --with-system-ss \ + --with-system-verto \ + --without-tcl \ + --with-ldap + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/libaio/Containerfile b/packages/libaio/Containerfile new file mode 100644 index 0000000..f15148d --- /dev/null +++ b/packages/libaio/Containerfile @@ -0,0 +1,37 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=0.3.113 +ENV SRC_HASH=716c7059703247344eb066b54ecbc3ca2134f0103307192e6c2b7dab5f9528ab +ENV SRC_FILE=libaio-libaio-${VERSION}.tar.gz +ENV SRC_SITE=https://pagure.io/libaio/archive/libaio-${VERSION}/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/bash . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/linux-headers . / + +RUN tar -xf ${SRC_FILE} +WORKDIR libaio-libaio-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux \ + patch -p1 libaio-cppflags.patch + patch -p1 libaio-errno.patch + patch -p1 test-poll.patch + patch -p1 test.patch + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/libaio/libaio-cppflags.patch b/packages/libaio/libaio-cppflags.patch new file mode 100644 index 0000000..9579327 --- /dev/null +++ b/packages/libaio/libaio-cppflags.patch @@ -0,0 +1,16 @@ +respect env CPPFLAGS + +--- a/src/Makefile ++++ b/src/Makefile +@@ -2,8 +2,9 @@ prefix=/usr + includedir=$(prefix)/include + libdir=$(prefix)/lib + +-CFLAGS ?= -g -fomit-frame-pointer -O2 +-CFLAGS += -Wall -I. -fPIC ++CFLAGS ?= -fomit-frame-pointer -O2 ++CFLAGS += -I. -fPIC ++CFLAGS += $(CPPFLAGS) + SO_CFLAGS=-shared $(CFLAGS) + L_CFLAGS=$(CFLAGS) + LINK_FLAGS= diff --git a/packages/libaio/libaio-errno.patch b/packages/libaio/libaio-errno.patch new file mode 100644 index 0000000..7ead880 --- /dev/null +++ b/packages/libaio/libaio-errno.patch @@ -0,0 +1,11 @@ +--- libaio-0.3.112.orig/src/compat-0_1.c ++++ libaio-0.3.112/src/compat-0_1.c +@@ -19,7 +19,7 @@ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include +-#include ++#include + + #include "libaio.h" + #include "vsys_def.h" \ No newline at end of file diff --git a/packages/libaio/test-poll.patch b/packages/libaio/test-poll.patch new file mode 100644 index 0000000..b851926 --- /dev/null +++ b/packages/libaio/test-poll.patch @@ -0,0 +1,11 @@ +diff -Nurp a/harness/cases/22.t b/harness/cases/22.t +--- a/harness/cases/22.t 2018-10-22 20:59:34.000000000 +0100 ++++ b/harness/cases/22.t 2022-02-26 09:48:59.421311473 +0000 +@@ -11,7 +11,7 @@ + #include + #include + #include +-#include ++#include + #include + #include diff --git a/packages/libaio/test.patch b/packages/libaio/test.patch new file mode 100644 index 0000000..0822723 --- /dev/null +++ b/packages/libaio/test.patch @@ -0,0 +1,55 @@ +From: Lee Duncan +Date: Thu, 11 Feb 2021 11:34:42 -0800 +Subject: [PATCH] Fix test issue with gcc-11 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Test 3.t exercises io_submit() with invalid addresses, +and one test attempted to pass in "-1" as an invalid +pointer. But gcc-11 realizes you cannot take an offset +from an invalid pointer, making it impossible to +compile or run this test: + +> sh# make CC=gcc-11 partcheck +> make[1]: Entering directory '/alt/public_software/libaio/src' +> make[1]: Nothing to be done for 'all'. +> make[1]: Leaving directory '/alt/public_software/libaio/src' +> make[1]: Entering directory '/alt/public_software/libaio/harness' +> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/2.t\" -o cases/2.p main.c ../src/libaio.a -lpthread +> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/3.t\" -o cases/3.p main.c ../src/libaio.a -lpthread +> In file included from main.c:24: +> cases/3.t: In function ‘test_main’: +> cases/3.t:18:19: error: ‘attempt_io_submit’ accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=] +> 18 | status |= attempt_io_submit( io_ctx, 1, (void *)-1, -EFAULT); +> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +> cases/3.t:18:19: note: referencing argument 3 of type ‘struct iocb **’ +> In file included from cases/3.t:5, +> from main.c:24: +> cases/aio_setup.h:15:5: note: in a call to function ‘attempt_io_submit’ +> 15 | int attempt_io_submit(io_context_t ctx, long nr, struct iocb *ios[], int expect) +> | ^~~~~~~~~~~~~~~~~ +> cc1: all warnings being treated as errors +> make[1]: *** [Makefile:19: cases/3.p] Error 1 +> make[1]: Leaving directory '/alt/public_software/libaio/harness' +> make: *** [Makefile:23: partcheck] Error 2 + +The fix is to remove this one test case, since the compiler now +ensures the running code will never see this case. + +Signed-off-by: Lee Duncan +--- + harness/cases/3.t | 1 - + 1 file changed, 1 deletion(-) + +diff -Nurp a/harness/cases/3.t b/harness/cases/3.t +--- a/harness/cases/3.t 2018-10-22 20:59:34.000000000 +0100 ++++ b/harness/cases/3.t 2022-02-26 09:46:51.969845084 +0000 +@@ -15,7 +15,6 @@ int test_main(void) + status |= attempt_io_submit(BAD_CTX, 1, good_ios, -EINVAL); + status |= attempt_io_submit( io_ctx, 0, good_ios, 0); + status |= attempt_io_submit( io_ctx, 1, NULL, -EFAULT); +- status |= attempt_io_submit( io_ctx, 1, (void *)-1, -EFAULT); + status |= attempt_io_submit( io_ctx, 2, bad1_ios, -EFAULT); + status |= attempt_io_submit( io_ctx, 2, bad2_ios, -EFAULT); + status |= attempt_io_submit( io_ctx, -1, good_ios, -EINVAL); diff --git a/packages/libedit/Containerfile b/packages/libedit/Containerfile new file mode 100644 index 0000000..8fd9f15 --- /dev/null +++ b/packages/libedit/Containerfile @@ -0,0 +1,43 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=20230828-3.1 +ENV SRC_HASH=4ee8182b6e569290e7d1f44f0f78dac8716b35f656b76528f699c69c98814dad +ENV SRC_FILE=libedit-${VERSION}.tar.gz +ENV SRC_SITE=https://www.thrysoee.dk/editline/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} +FROM fetch as build +COPY --from=stagex/perl . / +COPY --from=stagex/ncurses . / +COPY --from=stagex/gawk . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/busybox . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +RUN tar -xf $SRC_FILE +WORKDIR libedit-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / + + diff --git a/packages/libevent/Containerfile b/packages/libevent/Containerfile new file mode 100644 index 0000000..90afaa2 --- /dev/null +++ b/packages/libevent/Containerfile @@ -0,0 +1,45 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.1.12 +ENV SRC_HASH=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb +ENV SRC_FILE=libevent-${VERSION}-stable.tar.gz +ENV SRC_SITE=https://github.com/libevent/libevent/releases/download/release-${VERSION}-stable/${SRC_FILE} + # https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz + # https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz + # https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} +FROM fetch as build +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/openssl . / +RUN ls -lah +RUN tar -xf $SRC_FILE +WORKDIR libevent-${VERSION}-stable +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / + + + + + + diff --git a/packages/libical/Containerfile b/packages/libical/Containerfile new file mode 100644 index 0000000..b30addc --- /dev/null +++ b/packages/libical/Containerfile @@ -0,0 +1,43 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=5.1.4 +ENV SRC_HASH=bdf344c5adbcc6797940f8f8cb75cb59f5a3794eb21b9547751a11782a792ef7 +ENV SRC_FILE=nuspell-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/nuspell/nuspell/archive/refs/tags/v${VERSION}.tar.gz + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . + +FROM fetch AS build +COPY --from=stagex/busybox . / +COPY --from=stagex/perl . / +COPY --from=stagex/binutils . / +COPY --from=stagex/cmake . / +COPY --from=stagex/ninja . / +COPY --from=stagex/samurai . / +COPY --from=stagex/musl . / +COPY --from=stagex/openssl . / +COPY --from=stagex/icu . / +COPY --from=stagex/make . / +COPY --from=stagex/gcc . / +RUN tar -xf v${VERSION}.tar.gz +WORKDIR nuspell-${VERSION} +RUN --network=none <<-EOF + set -ex + CXXFLAGS="$CXXFLAGS -flto=auto" \ + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=None \ + -DBUILD_TESTING="$(want_check && echo ON || echo OFF)" \ + -DBUILD_DOCS=OFF + cmake --build build +EOF + +FROM build AS install +RUN --network=none DESTDIR="/rootfs" cmake --install build +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/libiconv/Containerfile b/packages/libiconv/Containerfile new file mode 100644 index 0000000..6be6a8b --- /dev/null +++ b/packages/libiconv/Containerfile @@ -0,0 +1,37 @@ + +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.17 +ENV SRC_HASH=8e7d1a8ccac0143c8fe9b68ebac67d485df119ea17a613f4038cda52f84ef52a +ENV SRC_FILE=libiconv-${VERSION}.tar.gz +ENV SRC_SITE=https://ftp.gnu.org/gnu/libiconv/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/openssl . / +RUN tar -xf ${SRC_FILE} +WORKDIR libiconv-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --enable-openssl \ + --disable-openssl-runtime + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/libsm/Containerfile b/packages/libsm/Containerfile new file mode 100644 index 0000000..9d50110 --- /dev/null +++ b/packages/libsm/Containerfile @@ -0,0 +1,44 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=1.2.4 +ENV SRC_HASH=fdcbe51e4d1276b1183da77a8a4e74a137ca203e0bcfb20972dd5f3347e97b84 +ENV SRC_FILE=libSM-${VERSION}.tar.xz +ENV SRC_SITE=https://www.x.org/releases/individual/lib/${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/xmlto . / +COPY --from=stagex/xorgproto . / +RUN tar -xf ${SRC_FILE} +WORKDIR libSM-${VERSION} +RUN --network=none <<-EOF + set -ex + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc \ + --with-libuuid \ + --enable-docs \ + --with-xmlto \ + --without-fop + make + + 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/. / diff --git a/packages/libsodium/Containerfile b/packages/libsodium/Containerfile new file mode 100644 index 0000000..a6547f5 --- /dev/null +++ b/packages/libsodium/Containerfile @@ -0,0 +1,37 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=1.0.20 +ENV SRC_HASH=ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19 +ENV SRC_FILE=libsodium-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/jedisct1/libsodium/releases/download/${VERSION}-RELEASE/libsodium-${VERSION}.tar.gz + +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 libsodium-${VERSION} +RUN --network=none <<-EOF + set -ex + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr + make + + 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/. / diff --git a/packages/libverto/Containerfile b/packages/libverto/Containerfile new file mode 100644 index 0000000..e305436 --- /dev/null +++ b/packages/libverto/Containerfile @@ -0,0 +1,64 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=0.3.2 +ENV SRC_HASH=8d1756fd704f147549f606cd987050fb94b0b1ff621ea6aa4d6bf0b74450468a +ENV SRC_FILE=libverto-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/latchset/libverto/releases/download/0.3.2/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} +FROM fetch as build +COPY --from=stagex/perl . / +COPY --from=stagex/bash . / +COPY --from=stagex/m4 . / +COPY --from=stagex/curl . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/util-linux . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/busybox . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/e2fsprogs . / +COPY --from=stagex/python . / +COPY --from=stagex/openldap . / +COPY --from=stagex/libtool . / +COPY --from=stagex/openssl . / +COPY --from=stagex/groff . / +COPY --from=stagex/busybox . / +COPY --from=stagex/perl . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/libedit . / +COPY --from=stagex/python . / +COPY --from=stagex/libevent . / +COPY --from=stagex/pkgconf . / + +RUN tar -xf $SRC_FILE +WORKDIR libverto-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --localstatedir=/var/lib \ + --with-libdev \ + --with-libevent + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN ls -la . +RUN find /rootfs -exec touch -hcd "@0" "{}" + +RUN mv /rootfs/usr/lib/libverto-libevent.so.* /rootfs/usr/lib/ + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/libx11/Containerfile b/packages/libx11/Containerfile new file mode 100644 index 0000000..6109a4c --- /dev/null +++ b/packages/libx11/Containerfile @@ -0,0 +1,40 @@ + +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.8.9 +ENV SRC_HASH=57ca5f07d263788ad661a86f4139412e8b699662e6b60c20f1f028c25a935e48 +ENV SRC_FILE=libX11-${VERSION}.tar.gz +ENV SRC_SITE=https://www.x.org/releases/individual/lib/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/libxslt . / +RUN tar -xf ${SRC_FILE} +WORKDIR libX11-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --disable-xf86bigfont + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/libxcb/Containerfile b/packages/libxcb/Containerfile new file mode 100644 index 0000000..2437fb2 --- /dev/null +++ b/packages/libxcb/Containerfile @@ -0,0 +1,42 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.16.1 +ENV SRC_HASH=ba1f21d2bd9d339da2d4aa8780c09df32fea87998b73da24f49ab9df1e36a50f +ENV SRC_FILE=libxcb-${VERSION}.tar.xz +ENV SRC_SITE=https://xorg.freedesktop.org/archive/individual/lib/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/expat . / +COPY --from=stagex/busybox . / +COPY --from=stagex/bash . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/meson . / +COPY --from=stagex/glib . / +RUN tar -xf ${SRC_FILE} +WORKDIR libxcb-${VERSION} +RUN --network=none <<-EOF + set -eux + export CFLAGS="-flto=auto" + ./configure + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --enable-xkb \ + --enable-xinput \ + --disable-xprint + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/linux-pam/Containerfile b/packages/linux-pam/Containerfile new file mode 100644 index 0000000..4190963 --- /dev/null +++ b/packages/linux-pam/Containerfile @@ -0,0 +1,57 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.6.1 +ENV SRC_HASH=f8923c740159052d719dbfc2a2f81942d68dd34fcaf61c706a02c9b80feeef8e +ENV SRC_FILE=Linux-PAM-${VERSION}.tar.xz +ENV SRC_SITE=https://github.com/linux-pam/linux-pam/releases/download/v${VERSION}/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/bison . / +COPY --from=stagex/cmake . / +COPY --from=stagex/perl . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/utmps . / +COPY --from=stagex/libtool . / +COPY --from=stagex/gettext . / +COPY --from=stagex/flex . / +COPY --from=stagex/pkgconf . / +RUN tar -xf ${SRC_FILE} +WORKDIR Linux-PAM-${VERSION} +RUN --network=none <<-EOF + set -eux + export CFLAGS="-flto=auto $(pkg-config --cflags utmps)" + export LDFLAGS=$(pkg-config --libs utmps) + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --libdir=/usr/lib \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --disable-nls \ + --disable-db \ + --disable-examples \ + --sbindir=/usr/sbin \ + --enable-securedir=/usr/lib/security + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN ls -la /rootfs +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/lmdb/Containerfile b/packages/lmdb/Containerfile new file mode 100644 index 0000000..da56059 --- /dev/null +++ b/packages/lmdb/Containerfile @@ -0,0 +1,34 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=0.9.31 +ENV SRC_HASH=f7aecdd1bcc69fb32bb33d8544cfe50f8e9e916f366d598a268e1f43ee9c7603 +ENV SRC_FILE=openldap-LMDB_${VERSION}.tar.gz +ENV SRC_SITE=https://git.openldap.org/openldap/openldap/-/archive/LMDB_${VERSION}/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch AS build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/openssl . / +RUN tar -xf ${SRC_FILE} +WORKDIR openldap-LMDB_${VERSION}/libraries/liblmdb +COPY *.patch . +RUN --network=none <<-EOF + set -eux \ + patch -p1 lmdb-make.patch + export CFLAGS="-O2 -fPIC" + make +EOF + +FROM build AS install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/lmdb/lmdb-make.patch b/packages/lmdb/lmdb-make.patch new file mode 100644 index 0000000..dabb6b0 --- /dev/null +++ b/packages/lmdb/lmdb-make.patch @@ -0,0 +1,83 @@ +diff --git a/Makefile b/Makefile +index f254511..949d9ae 100644 +--- a/Makefile ++++ b/Makefile +@@ -26,6 +26,10 @@ OPT = -O2 -g + CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS) + LDLIBS = + SOLIBS = ++SOVER_MAJ = 0 ++SOVER_MIN = 0 ++SOVER_PATCH = 0 ++SOVERSION = $(SOVER_MAJ).$(SOVER_MIN).$(SOVER_PATCH) + SOEXT = .so + prefix = /usr/local + exec_prefix = $(prefix) +@@ -38,7 +42,7 @@ mandir = $(datarootdir)/man + ######################################################################## + + IHDRS = lmdb.h +-ILIBS = liblmdb.a liblmdb$(SOEXT) ++ILIBS = liblmdb$(SOEXT) liblmdb$(SOEXT).$(SOVERSION) liblmdb$(SOEXT).$(SOVER_MAJ) + IPROGS = mdb_stat mdb_copy mdb_dump mdb_load + IDOCS = mdb_stat.1 mdb_copy.1 mdb_dump.1 mdb_load.1 + PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5 +@@ -49,13 +53,13 @@ install: $(ILIBS) $(IPROGS) $(IHDRS) + mkdir -p $(DESTDIR)$(libdir) + mkdir -p $(DESTDIR)$(includedir) + mkdir -p $(DESTDIR)$(mandir)/man1 +- for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done +- for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done +- for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done +- for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done ++ for f in $(IPROGS); do cp -a $$f $(DESTDIR)$(bindir); done ++ for f in $(ILIBS); do cp -a $$f $(DESTDIR)$(libdir); done ++ for f in $(IHDRS); do cp -a $$f $(DESTDIR)$(includedir); done ++ for f in $(IDOCS); do cp -a $$f $(DESTDIR)$(mandir)/man1; done + + clean: +- rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb ++ rm -rf $(PROGS) *.[ao] *.[ls]o* *~ testdb + + test: all + rm -rf testdb && mkdir testdb +@@ -64,21 +68,25 @@ test: all + liblmdb.a: mdb.o midl.o + $(AR) rs $@ mdb.o midl.o + +-liblmdb$(SOEXT): mdb.lo midl.lo ++liblmdb$(SOEXT) liblmdb$(SOEXT).$(SOVER_MAJ): liblmdb$(SOEXT).$(SOVERSION) ++ rm -f $@ ++ ln -s $< $@ ++ ++liblmdb$(SOEXT).$(SOVERSION): mdb.lo midl.lo + # $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS) +- $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS) +- +-mdb_stat: mdb_stat.o liblmdb.a +-mdb_copy: mdb_copy.o liblmdb.a +-mdb_dump: mdb_dump.o liblmdb.a +-mdb_load: mdb_load.o liblmdb.a +-mtest: mtest.o liblmdb.a +-mtest2: mtest2.o liblmdb.a +-mtest3: mtest3.o liblmdb.a +-mtest4: mtest4.o liblmdb.a +-mtest5: mtest5.o liblmdb.a +-mtest6: mtest6.o liblmdb.a +-mplay: mplay.o liblmdb.a ++ $(CC) $(LDFLAGS) -pthread -shared -Wl,-soname,liblmdb$(SOEXT).$(SOVER_MAJ) -o $@ mdb.lo midl.lo $(SOLIBS) ++ ++mdb_stat: mdb_stat.o liblmdb.so ++mdb_copy: mdb_copy.o liblmdb.so ++mdb_dump: mdb_dump.o liblmdb.so ++mdb_load: mdb_load.o liblmdb.so ++mtest: mtest.o liblmdb.so ++mtest2: mtest2.o liblmdb.so ++mtest3: mtest3.o liblmdb.so ++mtest4: mtest4.o liblmdb.so ++mtest5: mtest5.o liblmdb.so ++mtest6: mtest6.o liblmdb.so ++mplay: mplay.o liblmdb.so + + mdb.o: mdb.c lmdb.h midl.h + $(CC) $(CFLAGS) $(CPPFLAGS) -c mdb.c diff --git a/packages/mariadb-connector-c/Containerfile b/packages/mariadb-connector-c/Containerfile new file mode 100644 index 0000000..3bf7492 --- /dev/null +++ b/packages/mariadb-connector-c/Containerfile @@ -0,0 +1,50 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=3.3.9 +ENV SRC_HASH=062b9ec5c26cbb236a78f0ba26981272053f59bdfc113040bab904a9da36d31f +ENV SRC_FILE=v${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/mariadb-corporation/mariadb-connector-c/archive/refs/tags/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/cmake . / +COPY --from=stagex/samurai . / +COPY --from=stagex/openssl . / +COPY --from=stagex/libzstd . / +COPY --from=stagex/zlib . / +COPY --from=stagex/ninja . / +COPY --from=stagex/linux-headers . / +RUN tar -xf ${SRC_FILE} +WORKDIR mariadb-connector-c-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux + patch -p1 < incorrect-sys-poll.patch + patch -p1 < unused-parameter.patch + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=True \ + -DINSTALL_LIBDIR=lib \ + -DINSTALL_INCLUDEDIR=include/mysql \ + \ + -DMARIADB_PORT=3306 \ + -DMARIADB_UNIX_ADDR=/run/mysqld/mysqld.sock \ + -DWITH_EXTERNAL_ZLIB=YES \ + -DWITH_MYSQLCOMPAT=ON \ + -DWITH_SSL=OPENSSL + cmake --build build +EOF + +FROM build as install +RUN DESTDIR=/rootfs cmake --install build + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/mariadb-connector-c/incorrect-sys-poll.patch b/packages/mariadb-connector-c/incorrect-sys-poll.patch new file mode 100644 index 0000000..764ab46 --- /dev/null +++ b/packages/mariadb-connector-c/incorrect-sys-poll.patch @@ -0,0 +1,11 @@ +--- a/plugins/pvio/pvio_socket.c ++++ b/plugins/pvio/pvio_socket.c +@@ -39,7 +39,7 @@ + #include + #endif + #ifdef HAVE_POLL +-#include ++#include + #endif + #ifdef HAVE_SYS_IOCTL_H + #include \ No newline at end of file diff --git a/packages/mariadb-connector-c/unused-paramater.patch b/packages/mariadb-connector-c/unused-paramater.patch new file mode 100644 index 0000000..384a2c7 --- /dev/null +++ b/packages/mariadb-connector-c/unused-paramater.patch @@ -0,0 +1,25 @@ +These functions are implemented in assembly for x86 and x86_64. +On other architectures, they are no-ops, and so parameters are unused. + +Starting from version 3.3.7, mariadb-connector-c is compiled with "-Werror" +turned on, so allow unused parameters here with GCC's Diagnostic Pragma: +https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html + +--- a/libmariadb/ma_context.c ++++ b/libmariadb/ma_context.c +@@ -692,6 +692,9 @@ + #endif /* MY_CONTEXT_USE_WIN32_FIBERS */ + + #ifdef MY_CONTEXT_DISABLE ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wunused-parameter" ++ + int + my_context_continue(struct my_context *c) + { +@@ -723,4 +726,5 @@ + { + } + ++#pragma GCC diagnostic pop + #endif \ No newline at end of file diff --git a/packages/mariadb/Containerfile b/packages/mariadb/Containerfile new file mode 100644 index 0000000..30c995f --- /dev/null +++ b/packages/mariadb/Containerfile @@ -0,0 +1,121 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=10.11.7 +ENV SRC_HASH=5239a245ed90517e96396605cd01ccd8f73cd7442d1b3076b6ffe258110e5157 +ENV SRC_FILE=mariadb-${VERSION}.tar.gz +ENV SRC_SITE=https://rsync.osuosl.org/pub/mariadb/mariadb-${VERSION}/source/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/perl . / +COPY --from=stagex/bison . / +COPY --from=stagex/cmake . / +COPY --from=stagex/libaio . / +COPY --from=stagex/libarchive . / +COPY --from=stagex/libevent . / +COPY --from=stagex/libxml2 . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/linux-pam . / +COPY --from=stagex/ncurses . / +COPY --from=stagex/pcre2 . / +COPY --from=stagex/samurai . / +COPY --from=stagex/xz . / +COPY --from=stagex/openssl . / +COPY --from=stagex/readline . / +COPY --from=stagex/fmt . / +COPY --from=stagex/libzstd . / +COPY --from=stagex/mariadb-connector-c . / +RUN tar -xf ${SRC_FILE} +WORKDIR mariadb-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux + # patch -p1 < disable-failing-test.patch + # patch -p1 < gcc13.patch + # patch -p1 < have-stacktrace.patch + # patch -p1 < lfs64.patch + # patch -p1 < pcc-remove-glibc-dep.patch + cmake -B build -G Ninja -Wno-dev \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCOMPILATION_COMMENT="StageX" \ + -DSYSCONFDIR=/etc \ + -DSYSCONF2DIR=/etc/my.cnf.d \ + -DMYSQL_DATADIR=/var/lib/mysql \ + -DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock \ + -DDEFAULT_CHARSET=utf8mb4 \ + -DDEFAULT_COLLATION=utf8mb4_general_ci \ + -DENABLED_LOCAL_INFILE=ON \ + -DINSTALL_INFODIR=share/info \ + -DINSTALL_MANDIR=share/man \ + -DINSTALL_PAMDIR=/lib/security \ + -DINSTALL_PLUGINDIR=lib/mariadb/plugin \ + -DINSTALL_SCRIPTDIR=bin \ + -DINSTALL_INCLUDEDIR=include/mysql \ + -DINSTALL_DOCREADMEDIR=share/doc/mariadb \ + -DINSTALL_SUPPORTFILESDIR=share/mariadb \ + -DINSTALL_MYSQLSHAREDIR=share/mariadb \ + -DINSTALL_DOCDIR=share/doc/mariadb \ + -DTMPDIR=/var/tmp \ + -DCONNECT_WITH_MYSQL=ON \ + -DCONNECT_WITH_LIBXML2=system \ + -DCONNECT_WITH_ODBC=NO \ + -DCONNECT_WITH_JDBC=NO \ + -DPLUGIN_ARCHIVE=YES \ + -DPLUGIN_ARIA=YES \ + -DPLUGIN_BLACKHOLE=YES \ + -DPLUGIN_CASSANDRA=NO \ + -DPLUGIN_CSV=YES \ + -DPLUGIN_MYISAM=YES \ + -DPLUGIN_MROONGA=NO \ + -DPLUGIN_OQGRAPH=NO \ + -DPLUGIN_PARTITION=STATIC \ + -DPLUGIN_ROCKSDB=NO \ + -DPLUGIN_SPHINX=NO \ + -DPLUGIN_TOKUDB=NO \ + -DPLUGIN_AUTH_GSSAPI=NO \ + -DPLUGIN_AUTH_GSSAPI_CLIENT=OFF \ + -DPLUGIN_CRACKLIB_PASSWORD_CHECK=NO \ + -DWITH_ASAN=OFF \ + -DWITH_EMBEDDED_SERVER=ON \ + -DWITH_EXTRA_CHARSETS=complex \ + -DWITH_INNODB_BZIP2=OFF \ + -DWITH_INNODB_LZ4=OFF \ + -DWITH_INNODB_LZMA=ON \ + -DWITH_INNODB_LZO=OFF \ + -DWITH_INNODB_SNAPPY=OFF \ + -DWITH_ROCKSDB_BZIP2=OFF \ + -DWITH_ROCKSDB_JEMALLOC=OFF \ + -DWITH_ROCKSDB_LZ4=OFF \ + -DWITH_ROCKSDB_ZSTD=ON \ + -DWITH_ROCKSDB_SNAPPY=OFF \ + -DWITH_JEMALLOC=NO \ + -DWITH_LIBARCHIVE=system \ + -DWITH_LIBFMT=system \ + -DWITH_LIBNUMA=NO \ + -DWITH_LIBWRAP=OFF \ + -DWITH_LIBWSEP=OFF \ + -DWITH_MARIABACKUP=ON \ + -DWITH_PCRE=system \ + -DWITH_READLINE=ON \ + -DWITH_SYSTEMD=no \ + -DWITH_SSL=system \ + -DWITH_VALGRIND=OFF \ + -DWITH_ZLIB=system \ + -DSKIP_TESTS=ON + cmake --build build +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/mariadb/disable-failing-test.patch b/packages/mariadb/disable-failing-test.patch new file mode 100644 index 0000000..62ab944 --- /dev/null +++ b/packages/mariadb/disable-failing-test.patch @@ -0,0 +1,30 @@ +diff --git a/storage/maria/unittest/CMakeLists.txt b/storage/maria/unittest/CMakeLists.txt +index a2da150..fd04ef4 100644 +--- a/storage/maria/unittest/CMakeLists.txt ++++ b/storage/maria/unittest/CMakeLists.txt +@@ -60,10 +60,10 @@ ADD_EXECUTABLE(ma_test_loghandler_readonly-t + ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c sequence_storage.c) + MY_ADD_TEST(ma_test_loghandler_readonly) + +-SET_TARGET_PROPERTIES(ma_test_loghandler_readonly-t PROPERTIES COMPILE_FLAGS "-DREADONLY_TEST") +-ADD_EXECUTABLE(ma_test_loghandler_nologs-t +- ma_test_loghandler_nologs-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c) +-MY_ADD_TEST(ma_test_loghandler_nologs) ++#SET_TARGET_PROPERTIES(ma_test_loghandler_readonly-t PROPERTIES COMPILE_FLAGS "-DREADONLY_TEST") ++#ADD_EXECUTABLE(ma_test_loghandler_nologs-t ++# ma_test_loghandler_nologs-t.c ma_maria_log_cleanup.c ma_loghandler_examples.c) ++#MY_ADD_TEST(ma_test_loghandler_nologs) + + SET(ma_pagecache_single_src ma_pagecache_single.c test_file.c test_file.h) + SET(ma_pagecache_consist_src ma_pagecache_consist.c test_file.c test_file.h) +--- a/unittest/mysys/CMakeLists.txt 2020-11-10 14:15:06.000000000 +0100 ++++ b/unittest/mysys/CMakeLists.txt 2020-11-24 21:08:46.721183004 +0100 +@@ -15,7 +15,7 @@ + + MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring + byte_order +- queues stacktrace crc32 LINK_LIBRARIES mysys) ++ queues crc32 LINK_LIBRARIES mysys) + MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys) + MY_ADD_TESTS(aes LINK_LIBRARIES mysys mysys_ssl) + ADD_DEFINITIONS(${SSL_DEFINES}) \ No newline at end of file diff --git a/packages/mariadb/gcc13.patch b/packages/mariadb/gcc13.patch new file mode 100644 index 0000000..67123a0 --- /dev/null +++ b/packages/mariadb/gcc13.patch @@ -0,0 +1,40 @@ +--- a/storage/rocksdb/rocksdb/util/string_util.h ++++ b/storage/rocksdb/rocksdb/util/string_util.h +@@ -6,6 +6,7 @@ + + #pragma once + ++#include + #include + #include + #include +--- a/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h ++++ b/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h +@@ -8,6 +8,7 @@ + #pragma once + #ifndef ROCKSDB_LITE + ++#include + #include + #include + #include "rocksdb/status.h" +--- a/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h ++++ b/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h +@@ -5,6 +5,7 @@ + + #pragma once + ++#include + #include + #include + +--- a/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h ++++ b/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h +@@ -6,6 +6,7 @@ + #pragma once + + #include "rocksdb/rocksdb_namespace.h" ++#include + + struct CompactionIterationStats { + // Compaction statistics diff --git a/packages/mariadb/have-stacktrace.patch b/packages/mariadb/have-stacktrace.patch new file mode 100644 index 0000000..24f8b3f --- /dev/null +++ b/packages/mariadb/have-stacktrace.patch @@ -0,0 +1,21 @@ +https://jira.mariadb.org/browse/MDEV-24131 + +diff --git a/unittest/mysys/stacktrace-t.c b/unittest/mysys/stacktrace-t.c +index 8fa0db15b36..67eb099028e 100644 +--- a/unittest/mysys/stacktrace-t.c ++++ b/unittest/mysys/stacktrace-t.c +@@ -22,6 +22,14 @@ + + char b_bss[10]; + ++#ifndef HAVE_STACKTRACE ++int my_safe_print_str(const char* val, size_t max_len) ++{ ++ printf("%*s\n", (int) max_len, val); ++ return 0; ++} ++#endif ++ + void test_my_safe_print_str() + { + char b_stack[10]; \ No newline at end of file diff --git a/packages/mariadb/lfs64.patch b/packages/mariadb/lfs64.patch new file mode 100644 index 0000000..d08f1a1 --- /dev/null +++ b/packages/mariadb/lfs64.patch @@ -0,0 +1,936 @@ +needed since https://github.com/bminor/musl/commit/25e6fee27f4a293728dd15b659170e7b9c7db9bc +-- +diff --git a/storage/columnstore/columnstore/dbcon/execplan/objectidmanager.h b/storage/columnstore/columnstore/dbcon/execplan/objectidmanager.h +index 0a389db6..6e3c900f 100644 +--- a/storage/columnstore/columnstore/dbcon/execplan/objectidmanager.h ++++ b/storage/columnstore/columnstore/dbcon/execplan/objectidmanager.h +@@ -129,7 +129,7 @@ class ObjectIDManager + * @param offset the offset to start reading at + * @param size the number of bytes to read into buf + */ +- void readData(uint8_t* buf, off64_t offset, int size) const; ++ void readData(uint8_t* buf, off_t offset, int size) const; + + /** @brief Reliably writes data to the bitmap file + * +@@ -140,7 +140,7 @@ class ObjectIDManager + * @param offset the offset to start writing at + * @param size the number of bytes to write + */ +- void writeData(uint8_t* buf, off64_t offset, int size) const; ++ void writeData(uint8_t* buf, off_t offset, int size) const; + + /** @brief If there is no bitmap file yet, this is used to make one + * +diff --git a/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp.single-read b/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp.single-read +index d5368cfa..18754df4 100644 +--- a/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp.single-read ++++ b/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp.single-read +@@ -115,7 +115,7 @@ void* thr_popper(void* arg) { + #endif + + longSeekOffset=(uint64_t)offset * (uint64_t)fileBlockSize; +- lseek64(fd, longSeekOffset, SEEK_SET); ++ lseek(fd, longSeekOffset, SEEK_SET); + totalRqst++; + dlen = (fr->BlocksRequested() > extentSize ? extentSize : fr->BlocksRequested()); + sz=0; +diff --git a/storage/columnstore/columnstore/utils/cloudio/SMComm.cpp b/storage/columnstore/columnstore/utils/cloudio/SMComm.cpp +index e2e9b3a9..3bb30fd1 100644 +--- a/storage/columnstore/columnstore/utils/cloudio/SMComm.cpp ++++ b/storage/columnstore/columnstore/utils/cloudio/SMComm.cpp +@@ -192,7 +192,7 @@ int SMComm::stat(const string& filename, struct stat* statbuf) + common_exit(command, response, err); + } + +-int SMComm::truncate(const string& filename, const off64_t length) ++int SMComm::truncate(const string& filename, const off_t length) + { + ByteStream* command = buffers.getByteStream(); + ByteStream* response = buffers.getByteStream(); +diff --git a/storage/columnstore/columnstore/utils/cloudio/SMComm.h b/storage/columnstore/columnstore/utils/cloudio/SMComm.h +index bb46304b..51edc0be 100644 +--- a/storage/columnstore/columnstore/utils/cloudio/SMComm.h ++++ b/storage/columnstore/columnstore/utils/cloudio/SMComm.h +@@ -50,7 +50,7 @@ class SMComm : public boost::noncopyable + + // added this one because it should be trivial to implement in SM, and prevents a large + // operation in SMDataFile. +- int truncate(const std::string& filename, const off64_t length); ++ int truncate(const std::string& filename, const off_t length); + + int listDirectory(const std::string& path, std::list* entries); + +diff --git a/storage/columnstore/columnstore/utils/cloudio/SMDataFile.cpp b/storage/columnstore/columnstore/utils/cloudio/SMDataFile.cpp +index 84eab1ac..0d827c16 100644 +--- a/storage/columnstore/columnstore/utils/cloudio/SMDataFile.cpp ++++ b/storage/columnstore/columnstore/utils/cloudio/SMDataFile.cpp +@@ -38,7 +38,7 @@ SMDataFile::SMDataFile(const char* name, int _openmode, const struct stat& _stat + comm = SMComm::get(); + } + +-ssize_t SMDataFile::pread(void* buf, off64_t offset, size_t count) ++ssize_t SMDataFile::pread(void* buf, off_t offset, size_t count) + { + return comm->pread(name(), buf, count, offset); + } +@@ -63,7 +63,7 @@ ssize_t SMDataFile::write(const void* buf, size_t count) + return ret; + } + +-int SMDataFile::seek(off64_t offset, int whence) ++int SMDataFile::seek(off_t offset, int whence) + { + switch (whence) + { +@@ -83,18 +83,18 @@ int SMDataFile::seek(off64_t offset, int whence) + return 0; + } + +-int SMDataFile::truncate(off64_t length) ++int SMDataFile::truncate(off_t length) + { + return comm->truncate(name(), length); + } + +-int SMDataFile::fallocate(int mode, off64_t offset, off64_t length) ++int SMDataFile::fallocate(int mode, off_t offset, off_t length) + { + idbassert_s(mode == 0, "SMDataFile::fallocate() does not support mode != 0 right now."); + return comm->truncate(name(), offset + length); + } + +-off64_t SMDataFile::size() ++off_t SMDataFile::size() + { + struct stat _stat; + int err = comm->stat(name(), &_stat); +@@ -104,7 +104,7 @@ off64_t SMDataFile::size() + return _stat.st_size; + } + +-off64_t SMDataFile::tell() ++off_t SMDataFile::tell() + { + return position; + } +diff --git a/storage/columnstore/columnstore/utils/cloudio/SMDataFile.h b/storage/columnstore/columnstore/utils/cloudio/SMDataFile.h +index 1d77edd6..6bd9b20f 100644 +--- a/storage/columnstore/columnstore/utils/cloudio/SMDataFile.h ++++ b/storage/columnstore/columnstore/utils/cloudio/SMDataFile.h +@@ -30,14 +30,14 @@ class SMDataFile : public IDBDataFile + public: + virtual ~SMDataFile(); + +- ssize_t pread(void* ptr, off64_t offset, size_t count); ++ ssize_t pread(void* ptr, off_t offset, size_t count); + ssize_t read(void* ptr, size_t count); + ssize_t write(const void* ptr, size_t count); +- int seek(off64_t offset, int whence); +- int truncate(off64_t length); +- int fallocate(int mode, off64_t offset, off64_t length); +- off64_t size(); +- off64_t tell(); ++ int seek(off_t offset, int whence); ++ int truncate(off_t length); ++ int fallocate(int mode, off_t offset, off_t length); ++ off_t size(); ++ off_t tell(); + int flush(); + time_t mtime(); + int close(); +@@ -48,7 +48,7 @@ class SMDataFile : public IDBDataFile + private: + SMDataFile(); + SMDataFile(const char* fname, int openmode, const struct stat&); +- off64_t position; ++ off_t position; + int openmode; + SMComm* comm; + +diff --git a/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.cpp b/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.cpp +index 96fe25d3..c15653ad 100644 +--- a/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.cpp ++++ b/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.cpp +@@ -38,7 +38,7 @@ int SMFileSystem::mkdir(const char* path) + return 0; + } + +-off64_t SMFileSystem::size(const char* filename) const ++off_t SMFileSystem::size(const char* filename) const + { + struct stat _stat; + +@@ -50,7 +50,7 @@ off64_t SMFileSystem::size(const char* filename) const + return _stat.st_size; + } + +-off64_t SMFileSystem::compressedSize(const char* filename) const ++off_t SMFileSystem::compressedSize(const char* filename) const + { + // Yikes, punting on this one. + throw NotImplementedYet(__func__); +diff --git a/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.h b/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.h +index 0e60f533..bace23fb 100644 +--- a/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.h ++++ b/storage/columnstore/columnstore/utils/cloudio/SMFileSystem.h +@@ -33,8 +33,8 @@ class SMFileSystem : public IDBFileSystem, boost::noncopyable + + // why are some of these const and some not const in IDBFileSystem? + int mkdir(const char* pathname); +- off64_t size(const char* path) const; +- off64_t compressedSize(const char* path) const; ++ off_t size(const char* path) const; ++ off_t compressedSize(const char* path) const; + int remove(const char* pathname); + int rename(const char* oldpath, const char* newpath); + bool exists(const char* pathname) const; +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.cpp b/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.cpp +index 6d7c5834..cb3f2510 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.cpp ++++ b/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.cpp +@@ -67,7 +67,7 @@ BufferedFile::~BufferedFile() + delete[] m_buffer; + } + +-ssize_t BufferedFile::pread(void* ptr, off64_t offset, size_t count) ++ssize_t BufferedFile::pread(void* ptr, off_t offset, size_t count) + { + ssize_t ret = 0; + int savedErrno; +@@ -122,7 +122,7 @@ ssize_t BufferedFile::read(void* ptr, size_t count) + ssize_t BufferedFile::write(const void* ptr, size_t count) + { + ssize_t ret = 0; +- off64_t offset = tell(); ++ off_t offset = tell(); + int savedErrno = 0; + size_t progress = 0; + uint8_t* ptr8 = (uint8_t*)ptr; +@@ -150,7 +150,7 @@ ssize_t BufferedFile::write(const void* ptr, size_t count) + return progress; + } + +-int BufferedFile::seek(off64_t offset, int whence) ++int BufferedFile::seek(off_t offset, int whence) + { + int ret = 0; + int savedErrno; +@@ -168,7 +168,7 @@ int BufferedFile::seek(off64_t offset, int whence) + return ret; + } + +-int BufferedFile::truncate(off64_t length) ++int BufferedFile::truncate(off_t length) + { + int ret = 0; + int savedErrno; +@@ -187,14 +187,14 @@ int BufferedFile::truncate(off64_t length) + return ret; + } + +-off64_t BufferedFile::size() ++off_t BufferedFile::size() + { + #ifdef _MSC_VER + return _filelengthi64(fileno(m_fp)); // Interestingly, implemented as fseek/ftell in the windows crt + #else + // going to calculate size 2 ways - first, via seek +- off64_t length = -1; +- off64_t here; ++ off_t length = -1; ++ off_t here; + + flockfile(m_fp); + +@@ -220,7 +220,7 @@ off64_t BufferedFile::size() + #endif + } + +-off64_t BufferedFile::tell() ++off_t BufferedFile::tell() + { + #ifdef _MSC_VER + return _ftelli64(m_fp); +@@ -282,7 +282,7 @@ int BufferedFile::close() + @see + This one is used in shared/we_fileop.cpp to skip expensive file preallocation. + */ +-int BufferedFile::fallocate(int mode, off64_t offset, off64_t length) ++int BufferedFile::fallocate(int mode, off_t offset, off_t length) + { + int ret = 0; + int savedErrno = 0; +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.h b/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.h +index 09646b44..ba688a10 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.h ++++ b/storage/columnstore/columnstore/utils/idbdatafile/BufferedFile.h +@@ -40,16 +40,16 @@ class BufferedFile : public IDBDataFile, boost::noncopyable + BufferedFile(const char* fname, const char* mode, unsigned opts); + /* virtual */ ~BufferedFile(); + +- /* virtual */ ssize_t pread(void* ptr, off64_t offset, size_t count); ++ /* virtual */ ssize_t pread(void* ptr, off_t offset, size_t count); + /* virtual */ ssize_t read(void* ptr, size_t count); + /* virtual */ ssize_t write(const void* ptr, size_t count); +- /* virtual */ int seek(off64_t offset, int whence); +- /* virtual */ int truncate(off64_t length); +- /* virtual */ off64_t size(); +- /* virtual */ off64_t tell(); ++ /* virtual */ int seek(off_t offset, int whence); ++ /* virtual */ int truncate(off_t length); ++ /* virtual */ off_t size(); ++ /* virtual */ off_t tell(); + /* virtual */ int flush(); + /* virtual */ time_t mtime(); +- /* virtual */ int fallocate(int mode, off64_t offset, off64_t length); ++ /* virtual */ int fallocate(int mode, off_t offset, off_t length); + + protected: + /* virtual */ +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBDataFile.h b/storage/columnstore/columnstore/utils/idbdatafile/IDBDataFile.h +index 1747189e..739e7717 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBDataFile.h ++++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBDataFile.h +@@ -124,7 +124,7 @@ class IDBDataFile + * or fseek followed by read for C-library FILE*. Return value + * is the number of bytes read. + */ +- virtual ssize_t pread(void* ptr, off64_t offset, size_t count) = 0; ++ virtual ssize_t pread(void* ptr, off_t offset, size_t count) = 0; + + /** + * This is a read method similar to kernel style read or C library +@@ -148,7 +148,7 @@ class IDBDataFile + * operation - ex. HDFS will not support it for files opened for writing + * Returns 0 on success, -1 on error + */ +- virtual int seek(off64_t offset, int whence) = 0; ++ virtual int seek(off_t offset, int whence) = 0; + + /** + * The truncate() method is equivalent to the ftruncate method. Note +@@ -156,7 +156,7 @@ class IDBDataFile + * or write or append do not, but HDFS files opened for modification do. + * Returns 0 on success, -1 on error. + */ +- virtual int truncate(off64_t length) = 0; ++ virtual int truncate(off_t length) = 0; + + /** + * The size() method returns the size of the file in a manner consistent +@@ -166,14 +166,14 @@ class IDBDataFile + * external view of size may differ (ex. if writing buffered i/o before + * a flush/sync or if writing an open HDFS file). Returns -1 on error. + */ +- virtual off64_t size() = 0; ++ virtual off_t size() = 0; + + /** + * The tell() call returns the current offset in the file. This is + * similar to lseek with 0 offset in the standard library and ftell + * for buffered FILE *s. + */ +- virtual off64_t tell() = 0; ++ virtual off_t tell() = 0; + + /** + * The flush() method instructs the file to write any buffered contents +@@ -194,7 +194,7 @@ class IDBDataFile + * only. + * Returns -1 on error. + */ +- virtual int fallocate(int mode, off64_t offset, off64_t length) = 0; ++ virtual int fallocate(int mode, off_t offset, off_t length) = 0; + + int colWidth() + { +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h b/storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h +index 4ca4a285..54e58540 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h ++++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h +@@ -82,14 +82,14 @@ class IDBFileSystem + * size() returns the size of the file specified by path. + * Returns the size on success, -1 on error + */ +- virtual off64_t size(const char* path) const = 0; ++ virtual off_t size(const char* path) const = 0; + + /** + * compressedSize() returns the decompressed size of the file + * speicified by path. + * Returns the size on success, -1 on error + */ +- virtual off64_t compressedSize(const char* path) const = 0; ++ virtual off_t compressedSize(const char* path) const = 0; + + /** + * exists() checks for the existence of a particular path. +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.cpp b/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.cpp +index 37d4cb3c..8111d00c 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.cpp ++++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.cpp +@@ -117,14 +117,14 @@ void IDBLogger::logRW(const char* op, const std::string& fname, const IDBDataFil + writeLog(logmsg.str()); + } + +-void IDBLogger::logSeek(const std::string& fname, const IDBDataFile* ptr, off64_t offset, int whence, int ret) ++void IDBLogger::logSeek(const std::string& fname, const IDBDataFile* ptr, off_t offset, int whence, int ret) + { + ostringstream logmsg; + logmsg << fname << "," << ptr << ",seek," << offset << "," << whence << "," << ret; + writeLog(logmsg.str()); + } + +-void IDBLogger::logTruncate(const std::string& fname, const IDBDataFile* ptr, off64_t length, int ret) ++void IDBLogger::logTruncate(const std::string& fname, const IDBDataFile* ptr, off_t length, int ret) + { + ostringstream logmsg; + logmsg << fname << "," << ptr << ",truncate," << length << ",," << ret; +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.h b/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.h +index b200c914..c4d6d0a5 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.h ++++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBLogger.h +@@ -36,8 +36,8 @@ class IDBLogger + static void logNoArg(const std::string& fname, const IDBDataFile* ptr, const char* op, int ret); + static void logRW(const char* op, const std::string& fname, const IDBDataFile* ptr, size_t offset, + size_t count, size_t bytesRead); +- static void logSeek(const std::string& fname, const IDBDataFile* ptr, off64_t offset, int whence, int ret); +- static void logTruncate(const std::string& fname, const IDBDataFile* ptr, off64_t length, int ret); ++ static void logSeek(const std::string& fname, const IDBDataFile* ptr, off_t offset, int whence, int ret); ++ static void logTruncate(const std::string& fname, const IDBDataFile* ptr, off_t length, int ret); + static void logSize(const std::string& fname, const IDBDataFile* ptr, long long ret); + + static void logFSop(IDBFileSystem::Types type, const char* op, const char* pathname, +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/IDBPolicy.h b/storage/columnstore/columnstore/utils/idbdatafile/IDBPolicy.h +index 117f1e8d..d53fbfa0 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/IDBPolicy.h ++++ b/storage/columnstore/columnstore/utils/idbdatafile/IDBPolicy.h +@@ -125,8 +125,8 @@ class IDBPolicy + * please see IDBFileSystem.h. + */ + static int mkdir(const char* pathname); +- static off64_t size(const char* path); +- static off64_t compressedSize(const char* path); ++ static off_t size(const char* path); ++ static off_t compressedSize(const char* path); + static int remove(const char* pathname); + static int rename(const char* oldpath, const char* newpath); + static bool exists(const char* pathname); +@@ -194,12 +194,12 @@ inline int IDBPolicy::mkdir(const char* pathname) + return IDBPolicy::getFs(pathname).mkdir(pathname); + } + +-inline off64_t IDBPolicy::size(const char* path) ++inline off_t IDBPolicy::size(const char* path) + { + return IDBPolicy::getFs(path).size(path); + } + +-inline off64_t IDBPolicy::compressedSize(const char* path) ++inline off_t IDBPolicy::compressedSize(const char* path) + { + return IDBPolicy::getFs(path).compressedSize(path); + } +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp b/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp +index bd3e1c4b..6c9d04a5 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp ++++ b/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp +@@ -115,13 +115,13 @@ int PosixFileSystem::rename(const char* oldpath, const char* newpath) + return ret; + } + +-off64_t PosixFileSystem::size(const char* path) const ++off_t PosixFileSystem::size(const char* path) const + { + // should this use Boost?? + struct stat statBuf; + int rc = ::stat(path, &statBuf); + int savedErrno = errno; +- off64_t ret = ((rc == 0) ? statBuf.st_size : -1); ++ off_t ret = ((rc == 0) ? statBuf.st_size : -1); + + if (IDBLogger::isEnabled()) + IDBLogger::logFSop(POSIX, "fs:size", path, this, ret); +@@ -156,11 +156,11 @@ size_t readFillBuffer(idbdatafile::IDBDataFile* pFile, char* buffer, size_t byte + return totalBytesRead; + } + +-off64_t PosixFileSystem::compressedSize(const char* path) const ++off_t PosixFileSystem::compressedSize(const char* path) const + { + IDBDataFile* pFile = NULL; + size_t nBytes; +- off64_t dataSize = 0; ++ off_t dataSize = 0; + + try + { +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h b/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h +index c1f4e5ff..6e18ca45 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h ++++ b/storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h +@@ -29,8 +29,8 @@ class PosixFileSystem : public IDBFileSystem + ~PosixFileSystem(); + + int mkdir(const char* pathname) override; +- off64_t size(const char* path) const override; +- off64_t compressedSize(const char* path) const override; ++ off_t size(const char* path) const override; ++ off_t compressedSize(const char* path) const override; + int remove(const char* pathname) override; + int rename(const char* oldpath, const char* newpath) override; + bool exists(const char* pathname) const override; +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/UnbufferedFile.cpp b/storage/columnstore/columnstore/utils/idbdatafile/UnbufferedFile.cpp +index 07a7630b..97dcb97c 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/UnbufferedFile.cpp ++++ b/storage/columnstore/columnstore/utils/idbdatafile/UnbufferedFile.cpp +@@ -75,7 +75,7 @@ UnbufferedFile::~UnbufferedFile() + close(); + } + +-ssize_t UnbufferedFile::pread(void* ptr, off64_t offset, size_t count) ++ssize_t UnbufferedFile::pread(void* ptr, off_t offset, size_t count) + { + ssize_t ret; + int savedErrno; +@@ -161,7 +161,7 @@ ssize_t UnbufferedFile::write(const void* ptr, size_t count) + return ret; + } + +-int UnbufferedFile::seek(off64_t offset, int whence) ++int UnbufferedFile::seek(off_t offset, int whence) + { + int ret; + int savedErrno; +@@ -182,7 +182,7 @@ int UnbufferedFile::seek(off64_t offset, int whence) + return ret; + } + +-int UnbufferedFile::truncate(off64_t length) ++int UnbufferedFile::truncate(off_t length) + { + int ret; + int savedErrno; +@@ -207,15 +207,15 @@ int UnbufferedFile::truncate(off64_t length) + return ret; + } + +-off64_t UnbufferedFile::size() ++off_t UnbufferedFile::size() + { +- off64_t ret = 0; ++ off_t ret = 0; + int savedErrno; + + #ifdef _MSC_VER + DWORD hi = 0; + DWORD lo = GetFileSize(m_fd, &hi); +- ret = off64_t(((uint64_t)hi) << 32) | lo; ++ ret = off_t(((uint64_t)hi) << 32) | lo; + #else + struct stat statBuf; + int rc = ::fstat(m_fd, &statBuf); +@@ -230,9 +230,9 @@ off64_t UnbufferedFile::size() + return ret; + } + +-off64_t UnbufferedFile::tell() ++off_t UnbufferedFile::tell() + { +- off64_t ret; ++ off_t ret; + #ifdef _MSC_VER + LARGE_INTEGER wRet; + LARGE_INTEGER dist; +@@ -333,7 +333,7 @@ int UnbufferedFile::close() + @see + This one is used in shared/we_fileop.cpp to skip expensive file preallocation. + */ +-int UnbufferedFile::fallocate(int mode, off64_t offset, off64_t length) ++int UnbufferedFile::fallocate(int mode, off_t offset, off_t length) + { + int ret = 0; + int savedErrno = 0; +diff --git a/storage/columnstore/columnstore/utils/idbdatafile/tdriver.cpp b/storage/columnstore/columnstore/utils/idbdatafile/tdriver.cpp +index 42b46873..0cef9ebb 100644 +--- a/storage/columnstore/columnstore/utils/idbdatafile/tdriver.cpp ++++ b/storage/columnstore/columnstore/utils/idbdatafile/tdriver.cpp +@@ -623,9 +623,9 @@ bool TestRunner::truncateTest(IDBDataFile::Types filetype) + blk_num = m_opts.numblocks; + } + +- off64_t fsize = m_file->size(); ++ off_t fsize = m_file->size(); + +- if (fsize != (off64_t)(blk_num * BLK_SIZE)) ++ if (fsize != (off_t)(blk_num * BLK_SIZE)) + { + ostringstream errstr; + errstr << "wrong file size after truncate, " << fsize << " != " << blk_num * BLK_SIZE; +@@ -645,7 +645,7 @@ bool TestRunner::renameTest(IDBDataFile::Types type) + IDBFileSystem& fs = IDBFileSystem::getFs(type); + + // get the size before we move for compare purposes. +- off64_t fsize_orig = fs.size(m_fname.c_str()); ++ off_t fsize_orig = fs.size(m_fname.c_str()); + + // choose a path in a different directory that we know already exists + // and make it specific to our thread... +@@ -666,7 +666,7 @@ bool TestRunner::renameTest(IDBDataFile::Types type) + } + + // now check if oldpath exists using size method +- off64_t fsize = fs.size(m_fname.c_str()); ++ off_t fsize = fs.size(m_fname.c_str()); + + if (fsize != -1) + { +@@ -712,7 +712,7 @@ bool TestRunner::copyTest(IDBDataFile::Types type) + IDBFileSystem& fs = IDBFileSystem::getFs(type); + + // get the size before we copy for compare purposes. +- off64_t fsize_orig = fs.size(m_fname.c_str()); ++ off_t fsize_orig = fs.size(m_fname.c_str()); + + // choose a path in a different directory that we know already exists + // and make it specific to our thread... +@@ -733,7 +733,7 @@ bool TestRunner::copyTest(IDBDataFile::Types type) + } + + // now check if newpath exists using size method +- off64_t fsize = fs.size(newpath.c_str()); ++ off_t fsize = fs.size(newpath.c_str()); + + if (fsize != fsize_orig) + { +@@ -1023,9 +1023,9 @@ bool TestRunner::tellTest(IDBDataFile::Types filetype) + return false; + } + +- off64_t filepos = m_file->tell(); ++ off_t filepos = m_file->tell(); + +- if (filepos != off64_t(BLK_SIZE)) ++ if (filepos != off_t(BLK_SIZE)) + { + ostringstream errstr; + errstr << "tellTest: File position not at correct block, " << filepos << " != " << BLK_SIZE; +diff --git a/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp b/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp +index 9678501c..4bb33049 100644 +--- a/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp ++++ b/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp +@@ -393,7 +393,7 @@ int ColumnBufferCompressed::compressAndFlush(bool bFinishingFile) + Stats::startParseEvent(WE_STATS_WRITE_COL); + #endif + +- off64_t fileOffset = fFile->tell(); ++ off_t fileOffset = fFile->tell(); + size_t nitems = fFile->write(compressedOutBuf, outputLen) / outputLen; + + if (nitems != 1) +diff --git a/storage/columnstore/columnstore/writeengine/bulk/we_columninfo.cpp b/storage/columnstore/columnstore/writeengine/bulk/we_columninfo.cpp +index 3f89c28a..57f74352 100644 +--- a/storage/columnstore/columnstore/writeengine/bulk/we_columninfo.cpp ++++ b/storage/columnstore/columnstore/writeengine/bulk/we_columninfo.cpp +@@ -955,7 +955,7 @@ int ColumnInfo::expandAbbrevExtent(bool bRetainFilePos) + { + if (fLoadingAbbreviatedExtent) + { +- off64_t oldOffset = 0; ++ off_t oldOffset = 0; + + if (bRetainFilePos) + { +diff --git a/storage/columnstore/columnstore/writeengine/dictionary/we_dctnry.cpp b/storage/columnstore/columnstore/writeengine/dictionary/we_dctnry.cpp +index 0a4f5e90..c7eb5fe6 100644 +--- a/storage/columnstore/columnstore/writeengine/dictionary/we_dctnry.cpp ++++ b/storage/columnstore/columnstore/writeengine/dictionary/we_dctnry.cpp +@@ -318,7 +318,7 @@ int Dctnry::expandDctnryExtent() + { + RETURN_ON_NULL(m_dFile, ERR_FILE_SEEK); + +- off64_t oldOffset = m_dFile->tell(); ++ off_t oldOffset = m_dFile->tell(); + + RETURN_ON_ERROR(setFileOffset(m_dFile, 0, SEEK_END)); + +diff --git a/storage/columnstore/columnstore/writeengine/server/we_getfilesizes.cpp b/storage/columnstore/columnstore/writeengine/server/we_getfilesizes.cpp +index 194b260e..4f9ce81b 100644 +--- a/storage/columnstore/columnstore/writeengine/server/we_getfilesizes.cpp ++++ b/storage/columnstore/columnstore/writeengine/server/we_getfilesizes.cpp +@@ -93,9 +93,9 @@ size_t readFillBuffer(idbdatafile::IDBDataFile* pFile, char* buffer, size_t byte + return totalBytesRead; + } + +-static off64_t getCompressedDataSize(string& fileName) ++static off_t getCompressedDataSize(string& fileName) + { +- off64_t dataSize = 0; ++ off_t dataSize = 0; + IDBDataFile* pFile = 0; + size_t nBytes; + // Some IDBPolicy functions can throw exceptions, caller will catch it +@@ -198,7 +198,7 @@ struct ColumnThread + char fileName[200]; + (void)fileOp.getFileName(fOid, fileName, rootList[i], entries[0].partitionNum, entries[0].segmentNum); + string aFile(fileName); // convert between char* and string +- off64_t fileSize = 0; ++ off_t fileSize = 0; + + if (fReportRealUse && (fCompressionType > 0)) + { +diff --git a/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.cpp b/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.cpp +index b34535c7..474a44a8 100644 +--- a/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.cpp ++++ b/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.cpp +@@ -1183,7 +1183,7 @@ int ChunkManager::openFile(CompFileData* fileData, const char* mode, int colWidt + // (ex __LINE__); this is used for logging error messages. Likewise, filename + // is used for logging any error message. + //------------------------------------------------------------------------------ +-int ChunkManager::setFileOffset(IDBDataFile* pFile, const string& fileName, off64_t offset, int ln) const ++int ChunkManager::setFileOffset(IDBDataFile* pFile, const string& fileName, off_t offset, int ln) const + { + int rc = NO_ERROR; + +diff --git a/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.h b/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.h +index 30a9862f..bc22a451 100644 +--- a/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.h ++++ b/storage/columnstore/columnstore/writeengine/shared/we_chunkmanager.h +@@ -309,7 +309,7 @@ class ChunkManager + int openFile(CompFileData* fileData, const char* mode, int colWidth, bool useTmpSuffix, int ln) const; + + // @brief set offset in a compressed DB file from beginning. +- int setFileOffset(IDBDataFile* pFile, const std::string& fileName, off64_t offset, int ln) const; ++ int setFileOffset(IDBDataFile* pFile, const std::string& fileName, off_t offset, int ln) const; + + // @brief read from a compressed DB file. + int readFile(IDBDataFile* pFile, const std::string& fileName, void* buf, size_t size, int ln) const; +diff --git a/storage/columnstore/columnstore/writeengine/shared/we_fileop.cpp b/storage/columnstore/columnstore/writeengine/shared/we_fileop.cpp +index 1db08a92..2c783325 100644 +--- a/storage/columnstore/columnstore/writeengine/shared/we_fileop.cpp ++++ b/storage/columnstore/columnstore/writeengine/shared/we_fileop.cpp +@@ -1310,7 +1310,7 @@ int FileOp::fillCompColumnExtentEmptyChunks(OID oid, int colWidth, const uint8_t + getLogger()->logMsg(oss.str(), MSGLVL_INFO2); + } + +- off64_t endHdrsOffset = pFile->tell(); ++ off_t endHdrsOffset = pFile->tell(); + rc = expandAbbrevColumnExtent(pFile, dbRoot, emptyVal, colWidth, colDataType); + + if (rc != NO_ERROR) +@@ -1374,7 +1374,7 @@ int FileOp::fillCompColumnExtentEmptyChunks(OID oid, int colWidth, const uint8_t + std::endl << std::endl; + #endif + +- off64_t endOffset = 0; ++ off_t endOffset = 0; + + // Fill in or add necessary remaining empty chunks + if (numChunksToFill > 0) +@@ -1416,7 +1416,7 @@ int FileOp::fillCompColumnExtentEmptyChunks(OID oid, int colWidth, const uint8_t + + // Position file to write empty chunks; default to end of headers + // in case there are no chunks listed in the header +- off64_t startOffset = pFile->tell(); ++ off_t startOffset = pFile->tell(); + + if (chunkPtrs.size() > 0) + { +diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp +index 3298a833..ec256a2a 100644 +--- a/storage/connect/filamfix.cpp ++++ b/storage/connect/filamfix.cpp +@@ -695,7 +695,7 @@ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org) + return true; + } // endif + #else // !_WIN32 +- if (lseek64(h, pos, org) < 0) { ++ if (lseek(h, pos, org) < 0) { + snprintf(g->Message, sizeof(g->Message), "lseek64: %s", strerror(errno)); + printf("%s\n", g->Message); + return true; +@@ -1022,7 +1022,7 @@ int BGXFAM::Cardinality(PGLOBAL g) + + #else // UNIX + if (Hfile == INVALID_HANDLE_VALUE) { +- int h = open64(filename, O_RDONLY, 0); ++ int h = open(filename, O_RDONLY, 0); + + if (trace(1)) + htrc(" h=%d\n", h); +@@ -1041,13 +1041,13 @@ int BGXFAM::Cardinality(PGLOBAL g) + } // endif h + + // Get the size of the file (can be greater than 4 GB) +- fsize = lseek64(h, 0, SEEK_END); ++ fsize = lseek(h, 0, SEEK_END); + close(h); + } else { +- BIGINT curpos = lseek64(Hfile, 0, SEEK_CUR); ++ BIGINT curpos = lseek(Hfile, 0, SEEK_CUR); + +- fsize = lseek64(Hfile, 0, SEEK_END); +- lseek64(Hfile, curpos, SEEK_SET); ++ fsize = lseek(Hfile, 0, SEEK_END); ++ lseek(Hfile, curpos, SEEK_SET); + } // endif Hfile + + if (fsize < 0) { +@@ -1357,7 +1357,7 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc) + return RC_FX; + } // endif error + #else // !_WIN32 +- if (ftruncate64(Hfile, (BIGINT)(Tpos * Lrecl))) { ++ if (ftruncate(Hfile, (BIGINT)(Tpos * Lrecl))) { + snprintf(g->Message, sizeof(g->Message), MSG(TRUNCATE_ERROR), strerror(errno)); + return RC_FX; + } // endif +@@ -1402,7 +1402,7 @@ bool BGXFAM::OpenTempFile(PGLOBAL g) + return true; + } // endif Tfile + #else // UNIX +- Tfile = open64(tempname, O_WRONLY | O_TRUNC, S_IWRITE); ++ Tfile = open(tempname, O_WRONLY | O_TRUNC, S_IWRITE); + + if (Tfile == INVALID_HANDLE_VALUE) { + int rc = errno; +@@ -1531,7 +1531,7 @@ void BGXFAM::Rewind(void) + #if defined(_WIN32) //OB + SetFilePointer(Hfile, 0, NULL, FILE_BEGIN); + #else // UNIX +- lseek64(Hfile, 0, SEEK_SET); ++ lseek(Hfile, 0, SEEK_SET); + #endif // UNIX + #endif // 0 + CurBlk = -1; +diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp +index 184df646..f462060a 100644 +--- a/storage/connect/filamvct.cpp ++++ b/storage/connect/filamvct.cpp +@@ -3084,7 +3084,7 @@ bool BGVFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, bool b) + return true; + } // endif + #else // !_WIN32 +- if (lseek64(h, pos, (b) ? SEEK_END : SEEK_SET) < 0) { ++ if (lseek(h, pos, (b) ? SEEK_END : SEEK_SET) < 0) { + snprintf(g->Message, sizeof(g->Message), MSG(ERROR_IN_LSK), errno); + return true; + } // endif +@@ -3238,7 +3238,7 @@ int BGVFAM::GetBlockInfo(PGLOBAL g) + + if (h == INVALID_HANDLE_VALUE || !len.QuadPart) { + #else // !_WIN32 +- h = open64(filename, O_RDONLY, 0); ++ h = open(filename, O_RDONLY, 0); + + if (h == INVALID_HANDLE_VALUE || !_filelength(h)) { + #endif // !_WIN32 +@@ -3314,7 +3314,7 @@ bool BGVFAM::SetBlockInfo(PGLOBAL g) + #else // !_WIN32 + int oflag = (b) ? O_RDWR : O_RDWR | O_TRUNC; + +- h = open64(filename, oflag, 0); ++ h = open(filename, oflag, 0); + #endif // !_WIN32 + + if (h == INVALID_HANDLE_VALUE) { +@@ -3409,7 +3409,7 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn) + int h; + BIGINT pos; + +- h= open64(filename, O_CREAT | O_WRONLY, S_IREAD | S_IWRITE); ++ h= open(filename, O_CREAT | O_WRONLY, S_IREAD | S_IWRITE); + + if (h == -1) + return true; +@@ -3420,7 +3420,7 @@ bool BGVFAM::MakeEmptyFile(PGLOBAL g, PCSZ fn) + htrc("MEF: pos=%lld n=%d maxblk=%d blksize=%d\n", + pos, n, MaxBlk, Blksize); + +- if (lseek64(h, pos, SEEK_SET) < 0) ++ if (lseek(h, pos, SEEK_SET) < 0) + goto err; + + // This actually fills the empty file +@@ -3619,7 +3619,7 @@ bool BGVFAM::OpenTableFile(PGLOBAL g) + return true; + } // endswitch + +- Hfile = open64(filename, oflag, pmd); // Enable file size > 2G ++ Hfile = open(filename, oflag, pmd); // Enable file size > 2G + + if (Hfile == INVALID_HANDLE_VALUE) { + rc = errno; +@@ -3933,7 +3933,7 @@ int BGVFAM::DeleteRecords(PGLOBAL g, int irc) + return RC_FX; + } // endif error + #else // !_WIN32 +- if (ftruncate64(Hfile, (BIGINT)(Tpos * Lrecl))) { ++ if (ftruncate(Hfile, (BIGINT)(Tpos * Lrecl))) { + snprintf(g->Message, sizeof(g->Message), MSG(TRUNCATE_ERROR), strerror(errno)); + return RC_FX; + } // endif +@@ -3993,7 +3993,7 @@ bool BGVFAM::OpenTempFile(PGLOBAL g) + #else // UNIX + int oflag = (MaxBlk) ? O_WRONLY : O_WRONLY | O_TRUNC; + +- Tfile = open64(tempname, oflag, S_IWRITE); ++ Tfile = open(tempname, oflag, S_IWRITE); + + if (Tfile == INVALID_HANDLE_VALUE) { + int rc = errno; +@@ -4250,7 +4250,7 @@ void BGVFAM::Rewind(void) + #if defined(_WIN32) //OB + SetFilePointer(Hfile, 0, NULL, FILE_BEGIN); + #else // UNIX +- lseek64(Hfile, 0, SEEK_SET); ++ lseek(Hfile, 0, SEEK_SET); + #endif // UNIX + #endif // 0 + } // end of Rewind +diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp +index 4bcbbfd4..1144f89a 100644 +--- a/storage/connect/xindex.cpp ++++ b/storage/connect/xindex.cpp +@@ -2652,7 +2652,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) + /*******************************************************************/ + /* Position the cursor at end of file so ftell returns file size. */ + /*******************************************************************/ +- if (!(NewOff.Val = (longlong)lseek64(Hfile, 0LL, SEEK_END))) { ++ if (!(NewOff.Val = (longlong)lseek(Hfile, 0LL, SEEK_END))) { + snprintf(g->Message, sizeof(g->Message), MSG(FUNC_ERRNO), errno, "Seek"); + return true; + } // endif +@@ -2681,7 +2681,7 @@ bool XHUGE::Open(PGLOBAL g, char *filename, int id, MODE mode) + htrc("noff[%d]=%lld\n", id, noff[id].Val); + + // Position the cursor at the offset of this index +- if (lseek64(Hfile, noff[id].Val, SEEK_SET) < 0) { ++ if (lseek(Hfile, noff[id].Val, SEEK_SET) < 0) { + snprintf(g->Message, sizeof(g->Message), "(XHUGE)lseek64: %s (%lld)", strerror(errno), noff[id].Val); + printf("%s\n", g->Message); + // snprintf(g->Message, sizeof(g->Message), MSG(FUNC_ERRNO), errno, "Hseek"); +@@ -2709,10 +2709,10 @@ bool XHUGE::Seek(PGLOBAL g, int low, int high, int origin) + } // endif + + #else // UNIX +- off64_t pos = (off64_t)low +- + (off64_t)high * ((off64_t)0x100 * (off64_t)0x1000000); ++ off_t pos = (off_t)low ++ + (off_t)high * ((off_t)0x100 * (off_t)0x1000000); + +- if (lseek64(Hfile, pos, origin) < 0) { ++ if (lseek(Hfile, pos, origin) < 0) { + snprintf(g->Message, sizeof(g->Message), MSG(ERROR_IN_LSK), errno); + + if (trace(1)) +@@ -2841,7 +2841,7 @@ void XHUGE::Close(char *fn, int id) + #else // !_WIN32 + if (id >= 0 && fn) { + if (Hfile != INVALID_HANDLE_VALUE) { +- if (lseek64(Hfile, id * sizeof(IOFF), SEEK_SET) >= 0) { ++ if (lseek(Hfile, id * sizeof(IOFF), SEEK_SET) >= 0) { + ssize_t nbw = write(Hfile, &NewOff, sizeof(IOFF)); + + if (nbw != (signed)sizeof(IOFF)) \ No newline at end of file diff --git a/packages/mariadb/pcc-remove-glibc-dep.patch b/packages/mariadb/pcc-remove-glibc-dep.patch new file mode 100644 index 0000000..725cb8c --- /dev/null +++ b/packages/mariadb/pcc-remove-glibc-dep.patch @@ -0,0 +1,36 @@ +diff --git a/include/my_cpu.h b/include/my_cpu.h +index f2e26fca..94599b74 100644 +--- a/include/my_cpu.h ++++ b/include/my_cpu.h +@@ -24,17 +24,16 @@ + */ + + #ifdef _ARCH_PWR8 +-#include + /* Very low priority */ +-#define HMT_very_low() __ppc_set_ppr_very_low() ++#define HMT_very_low() asm volatile("or 31,31,31") + /* Low priority */ +-#define HMT_low() __ppc_set_ppr_low() ++#define HMT_low() asm volatile ("or 1,1,1") + /* Medium low priority */ +-#define HMT_medium_low() __ppc_set_ppr_med_low() ++#define HMT_medium_low() asm volatile ("or 6,6,6") + /* Medium priority */ +-#define HMT_medium() __ppc_set_ppr_med() ++#define HMT_medium() asm volatile ("or 2,2,2") + /* Medium high priority */ +-#define HMT_medium_high() __ppc_set_ppr_med_high() ++#define HMT_medium_high() asm volatile("or 5,5,5") + /* High priority */ + #define HMT_high() asm volatile("or 3,3,3") + #else +@@ -72,7 +71,7 @@ static inline void MY_RELAX_CPU(void) + __asm__ __volatile__ ("pause"); + #endif + #elif defined(_ARCH_PWR8) +- __ppc_get_timebase(); ++ __builtin_ppc_get_timebase(); + #elif defined __GNUC__ && (defined __arm__ || defined __aarch64__) + /* Mainly, prevent the compiler from optimizing away delay loops */ + __asm__ __volatile__ ("":::"memory"); \ No newline at end of file diff --git a/packages/mariadb/revert-c432c9ef.patch b/packages/mariadb/revert-c432c9ef.patch new file mode 100644 index 0000000..e69de29 diff --git a/packages/nasm/Containerfile b/packages/nasm/Containerfile new file mode 100644 index 0000000..ccde570 --- /dev/null +++ b/packages/nasm/Containerfile @@ -0,0 +1,38 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=2.16.03 +ENV SRC_HASH=1412a1c760bbd05db026b6c0d1657affd6631cd0a63cddb6f73cc6d4aa616148 +ENV SRC_FILE=nasm-${VERSION}.tar.xz +ENV SRC_SITE=https://www.nasm.us/pub/nasm/releasebuilds/${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/perl . / +COPY --from=stagex/cmake . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/musl . / +COPY --from=stagex/openssl . / +COPY --from=stagex/make . / +COPY --from=stagex/bash . / +RUN tar -xf ${SRC_FILE} +WORKDIR nasm-${VERSION} +RUN --network=none <<-EOF + set -eux + CFLAGS="-O2 -flto=auto" \ + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr + make -j "$(nproc)" +EOF + +FROM build AS install +RUN --network=none DESTDIR="/rootfs" cmake --install build +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/nuspell/Containerfile b/packages/nuspell/Containerfile new file mode 100644 index 0000000..b30addc --- /dev/null +++ b/packages/nuspell/Containerfile @@ -0,0 +1,43 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=5.1.4 +ENV SRC_HASH=bdf344c5adbcc6797940f8f8cb75cb59f5a3794eb21b9547751a11782a792ef7 +ENV SRC_FILE=nuspell-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/nuspell/nuspell/archive/refs/tags/v${VERSION}.tar.gz + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . + +FROM fetch AS build +COPY --from=stagex/busybox . / +COPY --from=stagex/perl . / +COPY --from=stagex/binutils . / +COPY --from=stagex/cmake . / +COPY --from=stagex/ninja . / +COPY --from=stagex/samurai . / +COPY --from=stagex/musl . / +COPY --from=stagex/openssl . / +COPY --from=stagex/icu . / +COPY --from=stagex/make . / +COPY --from=stagex/gcc . / +RUN tar -xf v${VERSION}.tar.gz +WORKDIR nuspell-${VERSION} +RUN --network=none <<-EOF + set -ex + CXXFLAGS="$CXXFLAGS -flto=auto" \ + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=None \ + -DBUILD_TESTING="$(want_check && echo ON || echo OFF)" \ + -DBUILD_DOCS=OFF + cmake --build build +EOF + +FROM build AS install +RUN --network=none DESTDIR="/rootfs" cmake --install build +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/oniguruma/Containerfile b/packages/oniguruma/Containerfile new file mode 100644 index 0000000..22c9f15 --- /dev/null +++ b/packages/oniguruma/Containerfile @@ -0,0 +1,44 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=6.9.9 +ENV SRC_HASH=001aa1202e78448f4c0bf1a48c76e556876b36f16d92ce3207eccfd61d99f2a0 +ENV SRC_FILE=v${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/kkos/oniguruma/archive/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . + +FROM fetch AS build +COPY --from=stagex/busybox . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/libtool . / +COPY --from=stagex/automake . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/musl . / +COPY --from=stagex/openssl . / +COPY --from=stagex/make . / +RUN tar -xf ${SRC_FILE} +WORKDIR oniguruma-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux + autoreconf -vfi + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --enable-posix-api + make +EOF + +FROM build AS install +RUN --network=none DESTDIR="/rootfs" cmake --install build +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/openldap/Containerfile b/packages/openldap/Containerfile new file mode 100644 index 0000000..a7869da --- /dev/null +++ b/packages/openldap/Containerfile @@ -0,0 +1,56 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.5.17 +ENV SRC_HASH=d706a34b348ae38a9e3e4eb0d2cd5afeb939f2b2db95e6ae3d410d6a75e90e3c +ENV SRC_FILE=openldap-${VERSION}.tgz +ENV SRC_SITE=https://www.openldap.org/software/download/OpenLDAP/openldap-release/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} +FROM fetch as build +COPY --from=stagex/perl . / +COPY --from=stagex/bash . / +COPY --from=stagex/m4 . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/busybox . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/libtool . / +COPY --from=stagex/unixodbc . / +COPY --from=stagex/libedit . / +COPY --from=stagex/libevent . / +COPY --from=stagex/openssl . / +COPY --from=stagex/argon2 . / +COPY --from=stagex/groff . / +RUN tar -xf $SRC_FILE +WORKDIR openldap-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --enable-slapd \ + --enable-modules \ + --enable-dnssrv=mod \ + --enable-ldap=mod \ + --enable-mdb=mod \ + --enable-meta=mod \ + --enable-asyncmeta=mod \ + --enable-null=mod \ + --enable-passwd=mod \ + --enable-relay=mod \ + --enable-sock=mod \ + --enable-sql=mod \ + --enable-overlays=mod \ + --enable-balancer=mod \ + --enable-argon2 + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/pcre2/Containerfile b/packages/pcre2/Containerfile new file mode 100644 index 0000000..92874b8 --- /dev/null +++ b/packages/pcre2/Containerfile @@ -0,0 +1,57 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=10.43 +ENV SRC_HASH=f0048e26b02bdfaf43b8cec75030a9c2fe28552bf5caa693d3ccbf4d886fa930 +ENV SRC_FILE=pcre2-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/PCRE2Project/pcre2/archive/refs/tags/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} +FROM fetch as build +COPY --from=stagex/zlib . / +COPY --from=stagex/gawk . / +COPY --from=stagex/bzip2 . / +COPY --from=stagex/readline . / +COPY --from=stagex/libzstd . / +COPY --from=stagex/perl . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/busybox . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/libtool . / +COPY --from=stagex/m4 . / +COPY --from=stagex/libedit . / +COPY --from=stagex/ncurses . / +RUN tar -xf $SRC_FILE +WORKDIR pcre2-pcre2-${VERSION} +RUN --network=none <<-EOF + set -eux + ./autogen.sh + ./configure \ + CFLAGS="-O3" \ + --disable-shared \ + --build=${ARCH}-unknown-linux-musl \ + --host=${ARCH}-unknown-linux-musl \ + --prefix=/usr \ + --docdir=/usr/share/doc/pcre2-10.43 \ + --htmldir=/usr/share/doc/pcre2-10.43/html \ + --enable-pcre2-16 \ + --enable-pcre2-32 \ + --enable-pcre2grep-libz \ + --enable-pcre2test-libedit \ + # --enable-jit + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / + + diff --git a/packages/perl-dbd-mysql/Containerfile b/packages/perl-dbd-mysql/Containerfile new file mode 100644 index 0000000..f751884 --- /dev/null +++ b/packages/perl-dbd-mysql/Containerfile @@ -0,0 +1,36 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=4.052 +ENV SRC_HASH=a83f57af7817787de0ef56fb15fdfaf4f1c952c8f32ff907153b66d2da78ff5b +ENV SRC_FILE=DBD-mysql-${VERSION}.tar.gz +ENV SRC_SITE=https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/perl . / +COPY --from=stagex/zlib . / +COPY --from=stagex/mariadb-connector-c . / +COPY --from=stagex/perl-dbi . / +COPY --from=stagex/make . / +RUN tar -xf ${SRC_FILE} +WORKDIR DBD-mysql-${VERSION} +RUN --network=none <<-EOF + set -eux + perl Makefile.PL + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/perl-dbi/Containerfile b/packages/perl-dbi/Containerfile new file mode 100644 index 0000000..15b2f57 --- /dev/null +++ b/packages/perl-dbi/Containerfile @@ -0,0 +1,34 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.643 +ENV SRC_HASH=8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa +ENV SRC_FILE=DBI-${VERSION}.tar.gz +ENV SRC_SITE=https://cpan.metacpan.org/authors/id/T/TI/TIMB/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/perl . / +COPY --from=stagex/make . / +RUN tar -xf ${SRC_FILE} +WORKDIR DBI-${VERSION} +RUN --network=none <<-EOF + set -eux + perl Makefile.PL + PERL_MM_USE_DEFAULT="1 perl -I. Makefile.PL INSTALLDIRS=vendor" + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/perl-yaml-syck/Containerfile b/packages/perl-yaml-syck/Containerfile new file mode 100644 index 0000000..2fb8b56 --- /dev/null +++ b/packages/perl-yaml-syck/Containerfile @@ -0,0 +1,33 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=1.34 +ENV SRC_HASH=cc9156ccaebda798ebfe2f31b619e806577f860ed1704262f17ffad3c6e34159 +ENV SRC_FILE=YAML-Syck-${VERSION}.tar.gz +ENV SRC_SITE=https://cpan.metacpan.org/authors/id/T/TO/TODDR/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch AS build +COPY --from=stagex/perl . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / + +RUN tar -xf ${SRC_FILE} +WORKDIR YAML-Syck-${VERSION} +RUN --network=none <<-EOF + set -eux \ + export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') + PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor + make -j "$(nproc)" +EOF + +FROM build AS install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/php/Containerfile b/packages/php/Containerfile new file mode 100644 index 0000000..be46920 --- /dev/null +++ b/packages/php/Containerfile @@ -0,0 +1,180 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV PKG_NAME=php83 +ENV VERSION=8.3.4 +ENV SRC_HASH=c458cf3a9e83764055c6cf15f3348b06645ab499f424b32e33339ada954928db +ENV SRC_FILE=php-${VERSION}RC1.tar.gz +ENV SRC_SITE=https://github.com/php/php-src/archive/refs/tags/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . + +FROM fetch AS build +COPY --from=stagex/libunwind . / +COPY --from=stagex/acl . / +COPY --from=stagex/automake . / +COPY --from=stagex/bash . / +COPY --from=stagex/bc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/libzstd . / +COPY --from=stagex/lld . / +COPY --from=stagex/binutils . / +COPY --from=stagex/llvm . / +COPY --from=stagex/clang . / +COPY --from=stagex/bison . / +COPY --from=stagex/curl . / +COPY --from=stagex/gdbm . / +COPY --from=stagex/lmdb . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/make . / +COPY --from=stagex/gcc . / +COPY --from=stagex/gmp . / +COPY --from=stagex/icu . / +COPY --from=stagex/gettext . / +COPY --from=stagex/openssl . / +COPY --from=stagex/expat . / +COPY --from=stagex/libxml2 . / +COPY --from=stagex/re2c . / +COPY --from=stagex/musl . / +COPY --from=stagex/perl . / +COPY --from=stagex/m4 . / +COPY --from=stagex/zlib . / +COPY --from=stagex/lzip . / +COPY --from=stagex/pcre2 . / +COPY --from=stagex/bzip2 . / +COPY --from=stagex/python . / +COPY --from=stagex/libedit . / +COPY --from=stagex/linux-headers . / +COPY --from=stagex/sqlite3 . / +RUN tar -xf php-${VERSION}RC1.tar.gz +WORKDIR php-src-php-${VERSION}RC1 +COPY *.patch . +RUN --network=none <<-EOF + set -eux + export CFLAGS="-O2" + export CXXFLAGS="-O2" + patch -p1 fix-lfs64-2.patch + patch -p1 fix-tests-devserver.patch + patch -p1 includedir.patch + patch -p1 install-pear.patch + patch -p1 php83-fpm-verison-suffix.patch + patch -p1 phpinfo-avif.patch + patch -p1 sharedir.patch + export CC=clang-18 + export CXX=clang++-18 + ./buildconf --force || { echo "buildconf failed"; cat config.log;} + EXTENSION_DIR=/usr/lib/modules ./configure \ + --build=x86_64-linux-musl \ + --host=x86_64-linux-musl \ + --prefix=/usr \ + --program-suffix=php83#php \ + --libdir=/usr/lib \ + --datadir=/usr/share/php83 \ + --sysconfdir=/etc/php83 \ + --localstatedir=/var \ + --with-layout=GNU \ + --with-pic \ + --with-config-file-path=/etc/php83 \ + --with-config-file-scan-dir=/etc/php83/conf.d \ + --disable-rpath \ + --disable-short-tags \ + --disable-all \ + \ + # --enable-bcmath=shared \ + # --with-bz2=shared \ + # --enable-calendar=shared \ + # --enable-ctype=shared \ + # --with-curl=shared \ + # --enable-dba=shared \ + # --with-dbmaker=shared \ + # --with-gdbm \ + # --with-lmdb \ + # --enable-dom=shared \ + # --with-enchant=shared \ + # --enable-exif=shared \ + # --with-ffi=shared \ + # --enable-fileinfo=shared \ + # --enable-ftp=shared \ + # --enable-gd=shared \ + # --with-avif \ + # --with-freetype \ + # --with-jpeg \ + # --with-webp \ + # --with-xpm \ + # --disable-gd-jis-conv \ + # --with-gettext=shared \ + # --with-gmp=shared \ + # --with-iconv=shared \ + # --with-imap=shared \ + # --with-imap-ssl \ + # --enable-intl=shared \ + # --with-ldap=shared \ + # --with-ldap-sasl \ + # --with-libedit \ + # --with-libxml \ + # --enable-mbstring=shared \ + # --with-mysqli=shared \ + # --with-mysql-sock=/run/mysqld/mysqld.sock \ + # --enable-mysqlnd=shared \ + # --enable-opcache=shared \ + # --with-openssl=shared \ + # --with-kerberos \ + # --with-system-ciphers \ + # --with-password-argon2 \ + # --enable-pcntl=shared \ + # --with-external-pcre \ + # #$without_pcre_jit \ + # --enable-pdo=shared \ + # --with-pdo-dblib=shared,/usr \ + # --with-pdo-mysql=shared,mysqlnd \ + # --with-pdo-odbc=shared,unixODBC,/usr \ + # --with-pdo-pgsql=shared \ + # --with-pdo-sqlite=shared \ + # --with-pgsql=shared \ + # --enable-phar=shared \ + # --enable-posix=shared \ + # --with-pspell=shared \ + # --without-readline \ + # --enable-session=shared \ + # --enable-shmop=shared \ + # --enable-simplexml=shared \ + # --with-snmp=shared \ + # --enable-soap=shared \ + # --with-sodium=shared \ + # --enable-sockets=shared \ + # --with-sqlite3=shared \ + # --enable-sysvmsg=shared \ + # --enable-sysvsem=shared \ + # --enable-sysvshm=shared \ + # --with-tidy=shared \ + # --enable-tokenizer=shared \ + # --with-unixODBC=shared,/usr \ + # --enable-xml=shared \ + # --enable-xmlreader=shared \ + # --enable-xmlwriter=shared \ + # --with-xsl=shared \ + # --with-zip=shared \ + # --with-zlib \ + # --enable-zend-test=shared \ + "$@" + make || { echo "Make failed"; cat config.log; } +EOF + +FROM build AS install +RUN --network=none make INSTALL_ROOT=/rootfs install + +FROM build AS test +RUN /bin/sh -c 'set -eux; \ + if ! make TEST_PHP_ARGS=-j$(nproc) test; then \ + echo "PHP test failed"; \ + exit 1; \ + fi' + +FROM stagex/filesystem AS package +COPY --from=stagex/busybox . / +USER root +RUN rm -rf /var/run +RUN mkdir -p /var && mkdir -p /var/run && chown -R root:root /var/run && chmod -R 755 /var/run +COPY --from=install /rootfs/. / + diff --git a/packages/php/fix-lfs64-2.patch b/packages/php/fix-lfs64-2.patch new file mode 100644 index 0000000..ff66e40 --- /dev/null +++ b/packages/php/fix-lfs64-2.patch @@ -0,0 +1,39 @@ +Patch-Source: https://github.com/php/php-src/commit/577b8ae4226368e66fee7a9b5c58f9e2428372fc +From 577b8ae4226368e66fee7a9b5c58f9e2428372fc Mon Sep 17 00:00:00 2001 +From: Arnaud Le Blanc +Date: Mon, 8 Apr 2024 14:58:12 +0200 +Subject: [PATCH] Fix cookie_seek_function_t signature under musl (#13890) + +Fixes GH-11678 +--- + main/streams/cast.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/main/streams/cast.c b/main/streams/cast.c +index 3bad65fbac1f5..8d9f4a9d2d54b 100644 +--- a/main/streams/cast.c ++++ b/main/streams/cast.c +@@ -104,6 +104,9 @@ static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t siz + + # ifdef COOKIE_SEEKER_USES_OFF64_T + static int stream_cookie_seeker(void *cookie, off64_t *position, int whence) ++# else ++static int stream_cookie_seeker(void *cookie, off_t *position, int whence) ++# endif + { + + *position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence); +@@ -113,13 +116,6 @@ static int stream_cookie_seeker(void *cookie, off64_t *position, int whence) + } + return 0; + } +-# else +-static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence) +-{ +- +- return php_stream_seek((php_stream *)cookie, position, whence); +-} +-# endif + + static int stream_cookie_closer(void *cookie) + { diff --git a/packages/php/fix-tests-devserver.patch b/packages/php/fix-tests-devserver.patch new file mode 100644 index 0000000..ec335f2 --- /dev/null +++ b/packages/php/fix-tests-devserver.patch @@ -0,0 +1,22 @@ +From: Jakub Jirutka +Date: Mon, 01 May 2017 01:33:00 +0200 +Subject: [PATCH] Fix tests failing due to extra message from built-in web server + +Remove messages like: + + PHP 7.1.4 Development Server started at Mon May 1 00:42:39 2017 + +from test outputs, because tests do not expect them. I have no clue what +happens here... + +--- a/run-tests.php ++++ b/run-tests.php +@@ -2563,6 +2563,9 @@ + // Does the output match what is expected? + $output = preg_replace("/\r\n/", "\n", trim($out)); + ++ // Remove message from built-in development server. ++ $output = preg_replace("/^PHP [0-9.]+ Development Server started at .*\n\n?/m", "", $output); ++ + /* when using CGI, strip the headers from the output */ + $headers = [] \ No newline at end of file diff --git a/packages/php/includedir.patch b/packages/php/includedir.patch new file mode 100644 index 0000000..2aaa2cb --- /dev/null +++ b/packages/php/includedir.patch @@ -0,0 +1,40 @@ +--- a/scripts/Makefile.frag ++++ b/scripts/Makefile.frag +@@ -2,7 +2,7 @@ + # Build environment install + # + +-phpincludedir = $(includedir)/php ++phpincludedir = $(includedir)/php83 + phpbuilddir = $(libdir)/build + + BUILD_FILES = \ +--- a/ext/pdo/Makefile.frag ++++ b/ext/pdo/Makefile.frag +@@ -1,4 +1,4 @@ +-phpincludedir=$(prefix)/include/php ++phpincludedir=$(prefix)/include/php83 + + PDO_HEADER_FILES= \ + php_pdo.h \ +--- a/scripts/php-config.in ++++ b/scripts/php-config.in +@@ -6,7 +6,7 @@ + exec_prefix="@exec_prefix@" + version="@PHP_VERSION@" + vernum="@PHP_VERSION_ID@" +-include_dir="@includedir@/php" ++include_dir="@includedir@/php83" + includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib" + ldflags="@PHP_LDFLAGS@" + libs="@EXTRA_LIBS@" +--- a/scripts/phpize.in ++++ b/scripts/phpize.in +@@ -5,7 +5,7 @@ + datarootdir='@datarootdir@' + exec_prefix="`eval echo @exec_prefix@`" + phpdir="`eval echo @libdir@`/build" +-includedir="`eval echo @includedir@`/php" ++includedir="`eval echo @includedir@`/php83" + builddir="`pwd`" + SED="@SED@" diff --git a/packages/php/install-pear.patch b/packages/php/install-pear.patch new file mode 100644 index 0000000..54fc64e --- /dev/null +++ b/packages/php/install-pear.patch @@ -0,0 +1,14 @@ +--- ./pear/Makefile.frag.orig 2013-04-12 07:02:27.041602514 +0000 ++++ ./pear/Makefile.frag 2013-04-12 07:04:09.065836822 +0000 +@@ -1,7 +1,10 @@ + peardir=$(PEAR_INSTALLDIR) + ++# help the built php to find xml extension so we can install pear ++PEAR_INSTALL_XML_FLAGS = -d extension="$(top_builddir)/modules/xml.so" -d extension="$(top_builddir)/modules/phar.so" ++ + # Skip all php.ini files altogether +-PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0 ++PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0 $(PEAR_INSTALL_XML_FLAGS) + + WGET = `which wget 2>/dev/null` + FETCH = `which fetch 2>/dev/null` diff --git a/packages/php/loongarch64-support-for-fibers.patch b/packages/php/loongarch64-support-for-fibers.patch new file mode 100644 index 0000000..1a57dbb --- /dev/null +++ b/packages/php/loongarch64-support-for-fibers.patch @@ -0,0 +1,245 @@ +Patch-Source: https://github.com/php/php-src/commit/0766ac6e357282eafb51cbdc5383345e7487260b +From 0766ac6e357282eafb51cbdc5383345e7487260b Mon Sep 17 00:00:00 2001 +From: qiangxuhui +Date: Mon, 1 Apr 2024 07:16:47 +0000 +Subject: [PATCH] loongarch64 support for fibers + +Add loongarch64 assembly files from Boost, needed for fibers support, +and hook up loongarch64 fibers support during configure. + +Close GH-13914 +--- + Zend/asm/jump_loongarch64_sysv_elf_gas.S | 121 +++++++++++++++++++++++ + Zend/asm/make_loongarch64_sysv_elf_gas.S | 72 ++++++++++++++ + configure.ac | 2 + + 3 files changed, 195 insertions(+) + create mode 100644 Zend/asm/jump_loongarch64_sysv_elf_gas.S + create mode 100644 Zend/asm/make_loongarch64_sysv_elf_gas.S + +diff --git a/Zend/asm/jump_loongarch64_sysv_elf_gas.S b/Zend/asm/jump_loongarch64_sysv_elf_gas.S +new file mode 100644 +index 0000000000..74c081e07f +--- /dev/null ++++ b/Zend/asm/jump_loongarch64_sysv_elf_gas.S +@@ -0,0 +1,121 @@ ++/******************************************************* ++ * * ++ * ------------------------------------------------- * ++ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * ++ * ------------------------------------------------- * ++ * | 0 | 8 | 16 | 24 | * ++ * ------------------------------------------------- * ++ * | FS0 | FS1 | FS2 | FS3 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * ++ * ------------------------------------------------- * ++ * | 32 | 40 | 48 | 56 | * ++ * ------------------------------------------------- * ++ * | FS4 | FS5 | FS6 | FS7 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * ++ * ------------------------------------------------- * ++ * | 64 | 72 | 80 | 88 | * ++ * ------------------------------------------------- * ++ * | S0 | S1 | S2 | S3 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * ++ * ------------------------------------------------- * ++ * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * ++ * ------------------------------------------------- * ++ * | S4 | S5 | S6 | S7 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * ++ * ------------------------------------------------- * ++ * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * ++ * ------------------------------------------------- * ++ * | S8 | FP | RA | PC | * ++ * ------------------------------------------------- * ++ * * ++ * *****************************************************/ ++ ++.file "jump_loongarch64_sysv_elf_gas.S" ++.text ++.globl jump_fcontext ++.align 2 ++.type jump_fcontext,@function ++jump_fcontext: ++ # reserve space on stack ++ addi.d $sp, $sp, -160 ++ ++ # save fs0 - fs7 ++ fst.d $fs0, $sp, 0 ++ fst.d $fs1, $sp, 8 ++ fst.d $fs2, $sp, 16 ++ fst.d $fs3, $sp, 24 ++ fst.d $fs4, $sp, 32 ++ fst.d $fs5, $sp, 40 ++ fst.d $fs6, $sp, 48 ++ fst.d $fs7, $sp, 56 ++ ++ # save s0 - s8, fp, ra ++ st.d $s0, $sp, 64 ++ st.d $s1, $sp, 72 ++ st.d $s2, $sp, 80 ++ st.d $s3, $sp, 88 ++ st.d $s4, $sp, 96 ++ st.d $s5, $sp, 104 ++ st.d $s6, $sp, 112 ++ st.d $s7, $sp, 120 ++ st.d $s8, $sp, 128 ++ st.d $fp, $sp, 136 ++ st.d $ra, $sp, 144 ++ ++ # save RA as PC ++ st.d $ra, $sp, 152 ++ ++ # store SP (pointing to context-data) in A2 ++ move $a2, $sp ++ ++ # restore SP (pointing to context-data) from A0 ++ move $sp, $a0 ++ ++ # load fs0 - fs7 ++ fld.d $fs0, $sp, 0 ++ fld.d $fs1, $sp, 8 ++ fld.d $fs2, $sp, 16 ++ fld.d $fs3, $sp, 24 ++ fld.d $fs4, $sp, 32 ++ fld.d $fs5, $sp, 40 ++ fld.d $fs6, $sp, 48 ++ fld.d $fs7, $sp, 56 ++ ++ #load s0 - s7 ++ ld.d $s0, $sp, 64 ++ ld.d $s1, $sp, 72 ++ ld.d $s2, $sp, 80 ++ ld.d $s3, $sp, 88 ++ ld.d $s4, $sp, 96 ++ ld.d $s5, $sp, 104 ++ ld.d $s6, $sp, 112 ++ ld.d $s7, $sp, 120 ++ ld.d $s8, $sp, 128 ++ ld.d $fp, $sp, 136 ++ ld.d $ra, $sp, 144 ++ ++ # return transfer_t from jump ++ # pass transfer_t as first arg in context function ++ # a0 == FCTX, a1 == DATA ++ move $a0, $a2 ++ ++ # load PC ++ ld.d $a2, $sp, 152 ++ ++ # restore stack ++ addi.d $sp, $sp, 160 ++ ++ # jump to context ++ jr $a2 ++.size jump_fcontext, .-jump_fcontext ++ ++/* Mark that we don't need executable stack. */ ++.section .note.GNU-stack,"",%progbits +diff --git a/Zend/asm/make_loongarch64_sysv_elf_gas.S b/Zend/asm/make_loongarch64_sysv_elf_gas.S +new file mode 100644 +index 0000000000..55062702f1 +--- /dev/null ++++ b/Zend/asm/make_loongarch64_sysv_elf_gas.S +@@ -0,0 +1,72 @@ ++/******************************************************* ++ * * ++ * ------------------------------------------------- * ++ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * ++ * ------------------------------------------------- * ++ * | 0 | 8 | 16 | 24 | * ++ * ------------------------------------------------- * ++ * | FS0 | FS1 | FS2 | FS3 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * ++ * ------------------------------------------------- * ++ * | 32 | 40 | 48 | 56 | * ++ * ------------------------------------------------- * ++ * | FS4 | FS5 | FS6 | FS7 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * ++ * ------------------------------------------------- * ++ * | 64 | 72 | 80 | 88 | * ++ * ------------------------------------------------- * ++ * | S0 | S1 | S2 | S3 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * ++ * ------------------------------------------------- * ++ * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * ++ * ------------------------------------------------- * ++ * | S4 | S5 | S6 | S7 | * ++ * ------------------------------------------------- * ++ * ------------------------------------------------- * ++ * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * ++ * ------------------------------------------------- * ++ * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * ++ * ------------------------------------------------- * ++ * | S8 | FP | RA | PC | * ++ * ------------------------------------------------- * ++ * * ++ * *****************************************************/ ++ ++.file "make_loongarch64_sysv_elf_gas.S" ++.text ++.globl make_fcontext ++.align 2 ++.type make_fcontext,@function ++make_fcontext: ++ # shift address in A0 to lower 16 byte boundary ++ bstrins.d $a0, $zero, 3, 0 ++ ++ # reserve space for context-data on context-stack ++ addi.d $a0, $a0, -160 ++ ++ # third arg of make_fcontext() == address of context-function ++ st.d $a2, $a0, 152 ++ ++ # save address of finish as return-address for context-function ++ # will be entered after context-function returns ++ la.local $a4, finish ++ st.d $a4, $a0, 144 ++ ++ # return pointer to context-data ++ jr $ra ++ ++finish: ++ # exit code is zero ++ li.d $a0, 0 ++ # call _exit(0) ++ b %plt(_exit) ++ ++.size make_fcontext, .-make_fcontext ++/* Mark that we don't need executable stack. */ ++.section .note.GNU-stack,"",%progbits +diff --git a/configure.ac b/configure.ac +index 2bf60c434d..da646ac69f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1253,6 +1253,7 @@ AS_CASE([$host_cpu], + [riscv64*], [fiber_cpu="riscv64"], + [sparc64], [fiber_cpu="sparc64"], + [s390x*], [fiber_cpu="s390x"], ++ [loongarch64*], [fiber_cpu="loongarch64"], + [mips64*], [fiber_cpu="mips64"], + [mips*], [fiber_cpu="mips32"], + [fiber_cpu="unknown"] +@@ -1275,6 +1276,7 @@ AS_CASE([$fiber_cpu], + [riscv64], [fiber_asm_file_prefix="riscv64_sysv"], + [sparc64], [fiber_asm_file_prefix="sparc64_sysv"], + [s390x], [fiber_asm_file_prefix="s390x_sysv"], ++ [loongarch64], [fiber_asm_file_prefix="loongarch64_sysv"], + [mips64], [fiber_asm_file_prefix="mips64_n64"], + [mips32], [fiber_asm_file_prefix="mips32_o32"], + [fiber_asm_file_prefix="unknown"] +-- +2.44.0 diff --git a/packages/php/php83-fpm-verson-suffix.patch b/packages/php/php83-fpm-verson-suffix.patch new file mode 100644 index 0000000..0de56c0 --- /dev/null +++ b/packages/php/php83-fpm-verson-suffix.patch @@ -0,0 +1,79 @@ +--- a/sapi/fpm/fpm/fpm_conf.c ++++ b/sapi/fpm/fpm/fpm_conf.c +@@ -1262,7 +1262,7 @@ + } + + if (!fpm_global_config.error_log) { +- fpm_global_config.error_log = strdup("log/php-fpm.log"); ++ fpm_global_config.error_log = strdup("log/php83/error.log"); + } + + #ifdef HAVE_SYSTEMD +@@ -1273,7 +1273,7 @@ + + #ifdef HAVE_SYSLOG_H + if (!fpm_global_config.syslog_ident) { +- fpm_global_config.syslog_ident = strdup("php-fpm"); ++ fpm_global_config.syslog_ident = strdup("php-fpm83"); + } + + if (fpm_global_config.syslog_facility < 0) { +@@ -1777,7 +1777,7 @@ + if (fpm_globals.prefix == NULL) { + spprintf(&tmp, 0, "%s/php-fpm.conf", PHP_SYSCONFDIR); + } else { +- spprintf(&tmp, 0, "%s/etc/php-fpm.conf", fpm_globals.prefix); ++ spprintf(&tmp, 0, "%s/etc/php83/php-fpm.conf", fpm_globals.prefix); + } + + if (!tmp) { + +--- a/sapi/fpm/php-fpm.conf.in ++++ b/sapi/fpm/php-fpm.conf.in +@@ -16,3 +16,3 @@ + ; Default Value: none +-;pid = run/php-fpm.pid ++;pid = run/php-fpm83.pid + +@@ -22,4 +22,4 @@ + ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ +-; Default Value: log/php-fpm.log +-;error_log = log/php-fpm.log ++; Default Value: log/php83/error.log ++;error_log = log/php83/error.log + +@@ -35,4 +35,4 @@ + ; which must suit common needs. +-; Default Value: php-fpm +-;syslog.ident = php-fpm ++; Default Value: php-fpm83 ++;syslog.ident = php-fpm83 + +--- a/sapi/fpm/www.conf.in ++++ b/sapi/fpm/www.conf.in +@@ -273,7 +273,7 @@ + + ; The access log file + ; Default: not set +-;access.log = log/$pool.access.log ++;access.log = log/php83/$pool.access.log + + ; The access log format. + ; The following syntax is allowed +@@ -337,7 +337,7 @@ + ; The log file for slow requests + ; Default Value: not set + ; Note: slowlog is mandatory if request_slowlog_timeout is set +-;slowlog = log/$pool.log.slow ++;slowlog = log/php83/$pool.slow.log + + ; The timeout for serving a single request after which a PHP backtrace will be + ; dumped to the 'slowlog' file. A value of '0s' means 'off'. +@@ -450,6 +450,6 @@ + ; specified at startup with the -d argument + ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com + ;php_flag[display_errors] = off +-;php_admin_value[error_log] = /var/log/fpm-php.www.log ++;php_admin_value[error_log] = /var/log/php83/$pool.error.log + ;php_admin_flag[log_errors] = on + ;php_admin_value[memory_limit] = 32M diff --git a/packages/php/phpinfo-avif.patch b/packages/php/phpinfo-avif.patch new file mode 100644 index 0000000..b2af4ea --- /dev/null +++ b/packages/php/phpinfo-avif.patch @@ -0,0 +1,30 @@ +Patch-Source: https://github.com/php/php-src/pull/7526 +From d3402bfd3e9a87b1d4ce3785e393e698746c645c Mon Sep 17 00:00:00 2001 +From: Andy Postnikov +Date: Tue, 28 Sep 2021 23:35:37 +0300 +Subject: [PATCH] display libavif version and codecs via phpinfo() + +--- + ext/gd/gd.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/ext/gd/gd.c b/ext/gd/gd.c +index 880d6dddc7d7..67349e8749bf 100644 +--- a/ext/gd/gd.c ++++ b/ext/gd/gd.c +@@ -455,6 +455,15 @@ + #endif + #ifdef HAVE_GD_AVIF + php_info_print_table_row(2, "AVIF Support", "enabled"); ++#ifdef HAVE_GD_BUNDLED ++#include ++ { ++ php_info_print_table_row(2, "AVIF Version", avifVersion()); ++ char tmp[256]; ++ avifCodecVersions(tmp); ++ php_info_print_table_row(2, "AVIF Codecs", tmp); ++ } ++#endif + #endif + #ifdef HAVE_GD_TGA + php_info_print_table_row(2, "TGA Read Support", "enabled"); diff --git a/packages/php/sharedir.patch b/packages/php/sharedir.patch new file mode 100644 index 0000000..900c41d --- /dev/null +++ b/packages/php/sharedir.patch @@ -0,0 +1,11 @@ +--- a/php.ini-production ++++ b/php.ini-production +@@ -742,7 +742,7 @@ + ;;;;;;;;;;;;;;;;;;;;;;;;; + + ; UNIX: "/path1:/path2" +-;include_path = ".:/php/includes" ++include_path = ".:/usr/share/php83" + ; + ; Windows: "\path1;\path2" + ;include_path = ".;c:\php\includes" \ No newline at end of file diff --git a/packages/re2c/Containerfile b/packages/re2c/Containerfile new file mode 100644 index 0000000..9476e5f --- /dev/null +++ b/packages/re2c/Containerfile @@ -0,0 +1,37 @@ +FROM scratch as base +ENV VERSION=3.1 +ENV SRC_HASH=087c44de0400fb15caafde09fd72edc7381e688a35ef505ee65e0e3d2fac688b +ENV SRC_FILE=${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/skvadrik/re2c/archive/refs/tags/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . + +FROM fetch as build +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/binutils . / +COPY --from=stagex/busybox . / +COPY --from=stagex/libtool . / +COPY --from=stagex/perl . / +COPY --from=stagex/python . / +COPY --from=stagex/gcc . / +COPY --from=stagex/make . / +COPY --from=stagex/m4 . / +COPY --from=stagex/musl . / +RUN tar -xvf $SRC_FILE +WORKDIR re2c-${VERSION} +RUN --network=none <<-EOF + set -eux + autoreconf -i -W all + ./configure \ + --prefix=/usr + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/rhash/Containerfile b/packages/rhash/Containerfile new file mode 100644 index 0000000..eb0cc15 --- /dev/null +++ b/packages/rhash/Containerfile @@ -0,0 +1,36 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.4.4 +ENV SRC_HASH=8e7d1a8ccac0143c8fe9b68ebac67d485df119ea17a613f4038cda52f84ef52a +ENV SRC_FILE=v${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/rhash/RHash/archive/refs/tags/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/openssl . / +RUN tar -xf ${SRC_FILE} +WORKDIR RHash-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --enable-openssl \ + --disable-openssl-runtime + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/samurai/CVE-2021-30218.patch b/packages/samurai/CVE-2021-30218.patch new file mode 100644 index 0000000..de534d4 --- /dev/null +++ b/packages/samurai/CVE-2021-30218.patch @@ -0,0 +1,29 @@ +From e84b6d99c85043fa1ba54851ee500540ec206918 Mon Sep 17 00:00:00 2001 +From: Michael Forney +Date: Fri, 2 Apr 2021 17:27:48 -0700 +Subject: [PATCH] util: Check for NULL string in writefile + +This check was there previously, but was removed in f549b757 with +the addition of a check during parse that every rule has rspfile +if and only if it has rspfile_content. However, this fails to +consider the possibility of those variables coming from the edge +or global environment. So, re-add the check. + +Fixes #67. +--- + util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util.c b/util.c +index ea5c3ce..2a59881 100644 +--- a/util.c ++++ b/util.c +@@ -258,7 +258,7 @@ writefile(const char *name, struct string *s) + return -1; + } + ret = 0; +- if (fwrite(s->s, 1, s->n, f) != s->n || fflush(f) != 0) { ++ if (s && (fwrite(s->s, 1, s->n, f) != s->n || fflush(f) != 0)) { + warn("write %s:", name); + ret = -1; + } \ No newline at end of file diff --git a/packages/samurai/CVE-2021-30219.patch b/packages/samurai/CVE-2021-30219.patch new file mode 100644 index 0000000..a1b7b8c --- /dev/null +++ b/packages/samurai/CVE-2021-30219.patch @@ -0,0 +1,26 @@ +From d2af3bc375e2a77139c3a28d6128c60cd8d08655 Mon Sep 17 00:00:00 2001 +From: Michael Forney +Date: Sun, 4 Apr 2021 03:50:09 -0700 +Subject: [PATCH] parse: Check for non-empty command/rspfile/rspfile_content + +This matches ninja behavior and prevents the possibility of a rule +with an empty (NULL) command string. + +Fixes #68. +--- + parse.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/parse.c b/parse.c +index f79a5ee..b4b98a1 100644 +--- a/parse.c ++++ b/parse.c +@@ -42,6 +42,8 @@ parserule(struct scanner *s, struct environment *env) + var = scanname(s); + parselet(s, &val); + ruleaddvar(r, var, val); ++ if (!val) ++ continue; + if (strcmp(var, "command") == 0) + hascommand = true; + else if (strcmp(var, "rspfile") == 0) \ No newline at end of file diff --git a/packages/samurai/Containerfile b/packages/samurai/Containerfile new file mode 100644 index 0000000..bbe7f14 --- /dev/null +++ b/packages/samurai/Containerfile @@ -0,0 +1,33 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.2 +ENV SRC_HASH=3b8cf51548dfc49b7efe035e191ff5e1963ebc4fe8f6064a5eefc5343eaf78a5 +ENV SRC_FILE=samurai-${VERSION}.tar.gz +ENV SRC_SITE=https://github.com/michaelforney/samurai/releases/download/${VERSION}/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/pkgconf . / +RUN tar -xf ${SRC_FILE} +WORKDIR samurai-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux \ + patch -p1 CVE-2021-30218.patch + patch -p1 CVE-2021-30219.patch + make CFLAGS="-O2" CC=gcc +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/scdoc/Containerfile b/packages/scdoc/Containerfile new file mode 100644 index 0000000..188e448 --- /dev/null +++ b/packages/scdoc/Containerfile @@ -0,0 +1,30 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.11.3 +ENV SRC_HASH=4c5c6136540384e5455b250f768e7ca11b03fdba1a8efc2341ee0f1111e57612 +ENV SRC_FILE=${VERSION}.tar.gz +ENV SRC_SITE=https://git.sr.ht/~sircmpwn/scdoc/archive/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +RUN tar -xf ${SRC_FILE} +WORKDIR scdoc-${VERSION} +RUN --network=none <<-EOF + set -eux + make PREFIX="/usr" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / + diff --git a/packages/skalibs/Containerfile b/packages/skalibs/Containerfile new file mode 100644 index 0000000..28e24ef --- /dev/null +++ b/packages/skalibs/Containerfile @@ -0,0 +1,34 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.14.1.1 +ENV SRC_HASH=b6b79b816f4ba0b6801676b0ed4179b59c8c7809eeffe26db672e404636befc3 +ENV SRC_FILE=skalibs-${VERSION}.tar.gz +ENV SRC_SITE=https://skarnet.org/software/skalibs/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +RUN tar -xf ${SRC_FILE} +WORKDIR skalibs-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --enable-shared \ + --enable-static \ + --prefix=/usr \ + --libdir=/usr/lib + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/unixodbc/Containerfile b/packages/unixodbc/Containerfile new file mode 100644 index 0000000..17b2ac5 --- /dev/null +++ b/packages/unixodbc/Containerfile @@ -0,0 +1,46 @@ + +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=2.3.12 +ENV SRC_HASH=f210501445ce21bf607ba51ef8c125e10e22dffdffec377646462df5f01915ec +ENV SRC_FILE=unixODBC-${VERSION}.tar.gz +ENV SRC_SITE=https://www.unixodbc.org/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} +FROM fetch as build +COPY --from=stagex/perl . / +COPY --from=stagex/bash . / +COPY --from=stagex/m4 . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/busybox . / +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/libtool . / +COPY --from=stagex/postgresql . / +RUN tar -xf $SRC_FILE +WORKDIR unixODBC-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-nls \ + --enable-gui=no \ + --enable-static + make -j "$(nproc)" +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/util-macros/Containerfile b/packages/util-macros/Containerfile new file mode 100644 index 0000000..6a85a5b --- /dev/null +++ b/packages/util-macros/Containerfile @@ -0,0 +1,37 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=1.20.0 +ENV SRC_HASH=0b86b262dbe971edb4ff233bc370dfad9f241d09f078a3f6d5b7f4b8ea4430db +ENV SRC_FILE=util-macros-${VERSION}.tar.xz +ENV SRC_SITE=https://www.x.org/releases/individual/util/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/bash . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/m4 . / +COPY --from=stagex/gawk . / +RUN tar -xf ${SRC_FILE} +WORKDIR util-macros-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/utmps/Containerfile b/packages/utmps/Containerfile new file mode 100644 index 0000000..035aaaa --- /dev/null +++ b/packages/utmps/Containerfile @@ -0,0 +1,39 @@ +FROM scratch as base +ARG ARCH=x86_64 +ENV VERSION=0.1.2.2 +ENV SRC_HASH=f7ffa3714c65973bb95fbcf1501c06fc0478d93a51cea1b373ec6811c2425f52 +ENV SRC_FILE=utmps-${VERSION}.tar.gz +ENV SRC_SITE=https://skarnet.org/software/utmps/${SRC_FILE} + +FROM base as fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch as build +COPY --from=stagex/musl . / +COPY --from=stagex/gcc . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/make . / +COPY --from=stagex/skalibs . / +RUN tar -xf ${SRC_FILE} +WORKDIR utmps-${VERSION} +RUN --network=none <<-EOF + set -eux + ./configure \ + --enable-shared \ + --enable-static \ + --prefix=/usr \ + --disable-allstatic \ + --libdir=/usr/lib \ + --libexecdir=/lib/utmps \ + --with-lib=/usr/lib \ + --with-dynlib=/lib + make +EOF + +FROM build as install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem as package +COPY --from=install /rootfs/. / diff --git a/packages/vala/0001-posix-Define-_XOPEN_SOURCE-_GNU_SOURCE-for-signal-fu.patch b/packages/vala/0001-posix-Define-_XOPEN_SOURCE-_GNU_SOURCE-for-signal-fu.patch new file mode 100644 index 0000000..e5a2761 --- /dev/null +++ b/packages/vala/0001-posix-Define-_XOPEN_SOURCE-_GNU_SOURCE-for-signal-fu.patch @@ -0,0 +1,76 @@ +From 1d79a03d86a2f10051e902b97a3bf08cf038d06a Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Tue, 6 Aug 2024 12:53:55 +0200 +Subject: [PATCH] posix: Define _XOPEN_SOURCE/_GNU_SOURCE for signal funcs + +Fixes https://gitlab.gnome.org/GNOME/vala/-/issues/1558 +--- + vapi/posix.vapi | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/vapi/posix.vapi b/vapi/posix.vapi +index caa0f41f8..91e03ff5c 100644 +--- a/vapi/posix.vapi ++++ b/vapi/posix.vapi +@@ -1590,35 +1590,35 @@ namespace Posix { + short si_addr_lsb; + } + +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int kill (pid_t pid, int signum); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int killpg (pid_t pgpr, int signum); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_GNU_SOURCE")] + public int raise (int signum); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public void psignal (int signum, string message); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigemptyset (out sigset_t sigset); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigfillset (out sigset_t sigset); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigaddset (ref sigset_t sigset, int signo); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigdelset (ref sigset_t sigset, int __signo); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigismember (sigset_t sigset, int __signo); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigprocmask (int how, sigset_t sigset, out sigset_t oset); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigqueue (pid_t pid, int signum, sigval_t val); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigsuspend (sigset_t sigset); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigpending (sigset_t sigset); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigwait (sigset_t sigset, out int sig); +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_XOPEN_SOURCE")] + public int sigaction (int signum, sigaction_t? act, out sigaction_t? oldact); + + [CCode (has_target = false, cheader_filename = "signal.h", feature_test_macro = "_GNU_SOURCE")] +@@ -1636,7 +1636,7 @@ namespace Posix { + [CCode (cheader_filename = "signal.h")] + public sighandler_t SIG_IGN; + +- [CCode (cheader_filename = "signal.h")] ++ [CCode (cheader_filename = "signal.h", feature_test_macro = "_GNU_SOURCE")] + public sighandler_t signal (int signum, sighandler_t? handler); + + [CCode (cheader_filename = "stdio.h")] +-- +2.46.0 \ No newline at end of file diff --git a/packages/vala/Containerfile b/packages/vala/Containerfile new file mode 100644 index 0000000..ceab7db --- /dev/null +++ b/packages/vala/Containerfile @@ -0,0 +1,46 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=0.56.16 +ENV SRC_HASH=05487b5600f5d2f09e66a753cccd8f39c1bff9f148aea1b7774d505b9c8bca9b +ENV SRC_FILE=vala-${VERSION}.tar.xz +ENV SRC_SITE=https://download.gnome.org/sources/vala/0.56/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . + +FROM fetch AS build +COPY --from=stagex/busybox . / +COPY --from=stagex/glib . / +COPY --from=stagex/gcc . / +COPY --from=stagex/bison . / +COPY --from=stagex/binutils . / +COPY --from=stagex/libunwind . / +COPY --from=stagex/zlib . / +COPY --from=stagex/flex . / +COPY --from=stagex/perl . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/libtool . / +COPY --from=stagex/musl . / +COPY --from=stagex/openssl . / +COPY --from=stagex/make . / +RUN tar -xf ${SRC_FILE} +WORKDIR vala-${VERSION} +COPY *.patch . +RUN --network=none <<-EOF + set -eux + patch -p1 < 0001-posix-Define-_XOPEN_SOURCE-_GNU_SOURCE-for-signal-fu.patch + CFLAGS="-O2 -flto=auto" \ + CXXFLAGS="$-O2 -flto=auto" \ + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr + make -j "$(nproc)" +EOF + +FROM build AS install +RUN --network=none DESTDIR="/rootfs" cmake --install build +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/xmlto/Containerfile b/packages/xmlto/Containerfile new file mode 100644 index 0000000..82cabbe --- /dev/null +++ b/packages/xmlto/Containerfile @@ -0,0 +1,49 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=0.0.29 +ENV SRC_HASH=40504db68718385a4eaa9154a28f59e51e59d006d1aa14f5bc9d6fded1d6017a +ENV SRC_FILE=xmlto-${VERSION}.tar.gz +ENV SRC_SITE=https://www.pagure.io/xmlto/archive/${VERSION}/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch AS build +COPY --from=stagex/perl . / +COPY --from=stagex/glib . / +COPY --from=stagex/bash . / +COPY --from=stagex/gettext . / +COPY --from=stagex/musl . / +COPY --from=stagex/automake . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/gcc . / +COPY --from=stagex/libxslt . / +COPY --from=stagex/docbook-xsl . / +COPY --from=stagex/busybox . / +COPY --from=stagex/zlib . / +COPY --from=stagex/perl-pod-parser . / +COPY --from=stagex/perl-yaml-syck . / +COPY --from=stagex/libtool . / +COPY --from=stagex/binutils . / +COPY --from=stagex/m4 . / +COPY --from=stagex/libxml2 . / +COPY --from=stagex/make . / +RUN tar -xf ${SRC_FILE} +WORKDIR xmlto-${VERSION} +RUN --network=none <<-EOF + set -eux + autoreconf -vfi + ./configure \ + --build=${ARCH}-linux-musl \ + --host=${ARCH}-linux-musl \ + --prefix=/usr \ + --mandir=/usr/share/man + make -j "$(nproc)" +EOF + +FROM build AS install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. / diff --git a/packages/xorgproto/Containerfile b/packages/xorgproto/Containerfile new file mode 100644 index 0000000..67ac2bd --- /dev/null +++ b/packages/xorgproto/Containerfile @@ -0,0 +1,45 @@ +FROM scratch AS base +ARG ARCH=x86_64 +ENV VERSION=2024.1 +ENV SRC_HASH=4f6b9b4faf91e5df8265b71843a91fc73dc895be6210c84117a996545df296ce +ENV SRC_FILE=xorgproto-${VERSION}.tar.gz +ENV SRC_SITE=https://xorg.freedesktop.org/archive/individual/proto/${SRC_FILE} + +FROM base AS fetch +ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} + +FROM fetch AS build +COPY --from=stagex/musl . / +COPY --from=stagex/abuild . / +COPY --from=stagex/ninja . / +COPY --from=stagex/make . / +COPY --from=stagex/gcc . / +COPY --from=stagex/perl . / +COPY --from=stagex/binutils . / +COPY --from=stagex/util-macros . / +COPY --from=stagex/bash . / +COPY --from=stagex/busybox . / +COPY --from=stagex/binutils . / +COPY --from=stagex/pkgconf . / +COPY --from=stagex/meson . / +COPY --from=stagex/m4 . / +COPY --from=stagex/autoconf . / +COPY --from=stagex/automake . / +COPY --from=stagex/zlib . / +RUN tar -xf ${SRC_FILE} +WORKDIR xorgproto-${VERSION} +RUN --network=none <<-EOF + set -eux + abuild-meson \ + --datadir=/usr/lib \ + -Dlegacy=true \ + . output + meson compile -C output +EOF + +FROM build AS install +RUN make DESTDIR=/rootfs install +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM stagex/filesystem AS package +COPY --from=install /rootfs/. /