From 6fd266f8c1f837e31e45cfca8f213a45b00ab866 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 00:38:13 +0100 Subject: [PATCH] Build core libraries and Make with the selected target SDK --- brotli/PKGBUILD.vile | 18 +++++------------- bzip2/PKGBUILD.vile | 12 +++++++----- expat/PKGBUILD.vile | 10 ++++------ libffi/PKGBUILD.vile | 10 ++++------ libuuid/PKGBUILD.vile | 16 +++++----------- make/PKGBUILD.vile | 13 ++++--------- pcre2/PKGBUILD.vile | 17 +++++------------ pkgconf/PKGBUILD.vile | 10 ++++------ xz/PKGBUILD.vile | 18 +++++------------- zstd/PKGBUILD.vile | 17 +++++++++-------- 10 files changed, 52 insertions(+), 89 deletions(-) diff --git a/brotli/PKGBUILD.vile b/brotli/PKGBUILD.vile index 974d272..4da02b5 100644 --- a/brotli/PKGBUILD.vile +++ b/brotli/PKGBUILD.vile @@ -1,29 +1,21 @@ defpkgbuild(brotli, #:pkgname, "brotli", #:pkgver, "1.1.1", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Brotli compressor, decoder and libraries", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "MIT", #:url, "https://github.com/google/brotli", #:depends, ["musl"], #:source, ["brotli-1.1.1.tar.gz::https://github.com/google/brotli/archive/refs/tags/v1.1.1.tar.gz"], #:sha256sums, ["1a84dfaa740994d19254bf78aa7d74a4a8040d1638f3d5f2cdecb188fd520da8"], #:build, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - run("cmake", "-S", "brotli-1.1.1", "-B", "build", "-DCMAKE_BUILD_TYPE=Release", - "-DCMAKE_SYSTEM_NAME=Linux", "-DCMAKE_SYSTEM_PROCESSOR=x86_64", "-DCMAKE_C_COMPILER=vinix-cc", - string-append("-DCMAKE_SYSROOT=", root), "-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY", - "-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY", "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY", - "-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER", "-DCMAKE_INSTALL_PREFIX=/usr", "-DCMAKE_INSTALL_LIBDIR=lib", - "-DBUILD_SHARED_LIBS=ON", "-DBROTLI_DISABLE_TESTS=ON") + run("vinix-cmake", "brotli-1.1.1", "build", "-DBUILD_SHARED_LIBS=ON", "-DBROTLI_DISABLE_TESTS=ON") run("cmake", "--build", "build") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - loader := string-append(root, "/lib/ld-musl-x86_64.so.1") - run(loader, "--library-path", "build", "build/brotli", "-q", "1", "-o", "sample.br", "brotli-1.1.1/README.md") - run(loader, "--library-path", "build", "build/brotli", "-d", "-o", "restored", "sample.br") + run("vinix-run", "--library-path", "build", "build/brotli", "-q", "1", "-o", "sample.br", "brotli-1.1.1/README.md") + run("vinix-run", "--library-path", "build", "build/brotli", "-d", "-o", "restored", "sample.br") run("cmp", "brotli-1.1.1/README.md", "restored") }, #:package, fn() { diff --git a/bzip2/PKGBUILD.vile b/bzip2/PKGBUILD.vile index 1e0f9f8..13d93b2 100644 --- a/bzip2/PKGBUILD.vile +++ b/bzip2/PKGBUILD.vile @@ -1,9 +1,12 @@ +cross := get-environment-variable("CROSS_COMPILE") +prefix := if string?(cross) { cross } else { "" } + defpkgbuild(bzip2, #:pkgname, "bzip2", #:pkgver, "1.0.8", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Block-sorting compressor and libbz2", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "bzip2-1.0.6", #:url, "https://sourceware.org/bzip2/", #:depends, ["musl"], @@ -17,12 +20,11 @@ defpkgbuild(bzip2, #:build, fn() { run("make", "-C", "bzip2-1.0.8", "-f", "Makefile-libbz2_so", "CC=vinix-cc") run("ln", "-s", "libbz2.so.1.0.8", "bzip2-1.0.8/libbz2.so.1") - run("make", "-C", "bzip2-1.0.8", "CC=vinix-cc", "libbz2.a", "bzip2recover") + run("make", "-C", "bzip2-1.0.8", "CC=vinix-cc", string-append("AR=", prefix, "ar"), string-append("RANLIB=", prefix, "ranlib"), "libbz2.a", "bzip2recover") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") run("cp", "bzip2-1.0.8/sample1.bz2", "input.bz2") - run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", "bzip2-1.0.8", + run("vinix-run", "--library-path", "bzip2-1.0.8", "bzip2-1.0.8/bzip2-shared", "-dk", "input.bz2") run("cmp", "input", "bzip2-1.0.8/sample1.ref") }, diff --git a/expat/PKGBUILD.vile b/expat/PKGBUILD.vile index 7825a14..9261e60 100644 --- a/expat/PKGBUILD.vile +++ b/expat/PKGBUILD.vile @@ -1,9 +1,9 @@ defpkgbuild(expat, #:pkgname, "expat", #:pkgver, "2.11.0", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Expat XML parser, headers and xmlwf", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "MIT", #:url, "https://libexpat.github.io/", #:depends, ["musl"], @@ -11,14 +11,12 @@ defpkgbuild(expat, #:sha256sums, ["61e7614b602201c28a189dafee78f5bceaee192bbde46a930752ff09cf5542fa"], #:build, fn() { - run("env", "CC=vinix-cc", "expat-2.11.0/configure", "--prefix=/usr", - "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", + run("vinix-configure", "expat-2.11.0/configure", "--without-docbook", "--without-examples", "--without-tests") run("make") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", "lib/.libs", + run("vinix-run", "--library-path", "lib/.libs", "xmlwf/.libs/xmlwf", "expat-2.11.0/doc/xmlwf.xml") }, #:package, fn() { diff --git a/libffi/PKGBUILD.vile b/libffi/PKGBUILD.vile index eeab2d2..e5ce425 100644 --- a/libffi/PKGBUILD.vile +++ b/libffi/PKGBUILD.vile @@ -1,9 +1,9 @@ defpkgbuild(libffi, #:pkgname, "libffi", #:pkgver, "3.8.2", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Portable foreign function calls and closures", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "MIT", #:url, "https://sourceware.org/libffi/", #:depends, ["musl"], @@ -11,16 +11,14 @@ defpkgbuild(libffi, #:sha256sums, ["a699fda2b090c4b46cb79cf60c4dacfce480eb05742c0de66acf3af174a47f92"], #:build, fn() { - run("env", "CC=vinix-cc", "libffi-3.8.2/configure", "--prefix=/usr", - "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", + run("vinix-configure", "libffi-3.8.2/configure", "--disable-multi-os-directory", "--disable-docs", "--enable-pax_emutramp", "--enable-portable-binary", "--disable-exec-static-tramp") run("make") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") run("vinix-cc", "-Iinclude", "-I.", "libffi-3.8.2/testsuite/libffi.call/strlen2.c", "-L.libs", "-lffi", "-o", "test-calling-convention") - run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".libs", "./test-calling-convention") + run("vinix-run", "--library-path", ".libs", "./test-calling-convention") }, #:package, fn() { run("make", "install", string-append("DESTDIR=", pkgdir())) diff --git a/libuuid/PKGBUILD.vile b/libuuid/PKGBUILD.vile index 48e653c..994d69b 100644 --- a/libuuid/PKGBUILD.vile +++ b/libuuid/PKGBUILD.vile @@ -1,9 +1,9 @@ defpkgbuild(libuuid, #:pkgname, "libuuid", #:pkgver, "2.40.4", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "UUID library and development files from util-linux", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "BSD-3-Clause", #:url, "https://www.kernel.org/pub/linux/utils/util-linux/", #:depends, ["musl"], @@ -12,20 +12,14 @@ defpkgbuild(libuuid, #:sha256sums, ["5c1daf733b04e9859afdc3bd87cc481180ee0f88b5c0946b16fdec931975fb79"], #:build, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", - "CC=vinix-cc", - "PKG_CONFIG_PATH=", string-append("PKG_CONFIG_LIBDIR=", root, "/usr/lib/pkgconfig"), - string-append("PKG_CONFIG_SYSROOT_DIR=", root), - "util-linux-2.40.4/configure", "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", - "--prefix=/usr", "--disable-all-programs", "--enable-libuuid", "--without-python", + run("vinix-configure", "util-linux-2.40.4/configure", + "--disable-all-programs", "--enable-libuuid", "--without-python", "--disable-nls", "--disable-asciidoc") run("make", "libuuid.la", "libuuid/uuid.pc") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") run("make", "test_uuid_parser") - run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".libs", ".libs/test_uuid_parser") + run("vinix-run", "--library-path", ".libs", ".libs/test_uuid_parser") }, #:package, fn() { run("install", "-d", string-append(pkgdir(), "/usr/lib")) diff --git a/make/PKGBUILD.vile b/make/PKGBUILD.vile index f1ad42b..ae0a6bf 100644 --- a/make/PKGBUILD.vile +++ b/make/PKGBUILD.vile @@ -1,25 +1,20 @@ defpkgbuild(make, #:pkgname, "make", #:pkgver, "4.4.1", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "GNU Make for Vinix", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:url, "https://www.gnu.org/software/make/", #:license, "GPL-3.0-or-later", #:depends, ["musl"], #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/make-4.4.1.tar.gz"], #:sha256sums, ["dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3"], #:build, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - cc := string-append("CC=gcc --sysroot=", root, " -specs=", root, "/usr/lib/musl-gcc-sysroot.specs") - run("env", cc, "CFLAGS=-O2 -std=gnu17", "make-4.4.1/configure", "--prefix=/usr", "--build=x86_64-pc-linux-gnu", - "--host=x86_64-linux-musl", "--disable-nls", "--without-guile") + run("env", "CFLAGS=-O2 -std=gnu17", "vinix-configure", "make-4.4.1/configure", "--disable-nls", "--without-guile") run("make") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", string-append(root, "/usr/lib"), - "./make", "-f", "/dev/null", "--eval=all: ; @echo Vinix make works", "all") + run("vinix-run", "./make", "-f", "/dev/null", "--eval=all: ; @echo Vinix make works", "all") }, #:package, fn() { run("make", string-append("DESTDIR=", pkgdir()), "install") diff --git a/pcre2/PKGBUILD.vile b/pcre2/PKGBUILD.vile index 835fee5..0ceb01d 100644 --- a/pcre2/PKGBUILD.vile +++ b/pcre2/PKGBUILD.vile @@ -1,9 +1,9 @@ defpkgbuild(pcre2, #:pkgname, "pcre2", #:pkgver, "10.49", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Perl-compatible regular expressions with 8, 16 and 32-bit code units", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "BSD-3-Clause", #:url, "https://www.pcre.org/", #:depends, ["musl", "zlib"], @@ -11,20 +11,13 @@ defpkgbuild(pcre2, #:sha256sums, ["53c156e1ba416a20da8e65395daa132da0d80e76910424caca3fcdae7831d384"], #:build, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", - "CC=vinix-cc", - "PKG_CONFIG_PATH=", string-append("PKG_CONFIG_LIBDIR=", root, "/usr/lib/pkgconfig"), - string-append("PKG_CONFIG_SYSROOT_DIR=", root), - "pcre2-10.49/configure", "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", - "--prefix=/usr", "--enable-pcre2-16", "--enable-pcre2-32", "--enable-jit", + run("vinix-configure", "pcre2-10.49/configure", + "--enable-pcre2-16", "--enable-pcre2-32", "--enable-jit", "--enable-pcre2grep-libz", "--disable-symvers") run("make") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", - string-append(".libs:", root, "/usr/lib"), ".libs/pcre2grep", "-q", "^defpkgbuild", + run("vinix-run", "--library-path", ".libs", ".libs/pcre2grep", "-q", "^defpkgbuild", string-append(startdir(), "/PKGBUILD.vile")) }, #:package, fn() { diff --git a/pkgconf/PKGBUILD.vile b/pkgconf/PKGBUILD.vile index ff63738..e6dc603 100644 --- a/pkgconf/PKGBUILD.vile +++ b/pkgconf/PKGBUILD.vile @@ -1,9 +1,9 @@ defpkgbuild(pkgconf, #:pkgname, "pkgconf", #:pkgver, "2.3.0", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Query compiler and linker flags for installed libraries", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "ISC", #:url, "https://pkgconf.org/", #:depends, ["musl"], @@ -11,15 +11,13 @@ defpkgbuild(pkgconf, #:sha256sums, ["3a9080ac51d03615e7c1910a0a2a8df08424892b5f13b0628a204d3fcce0ea8b"], #:build, fn() { - run("env", "CC=vinix-cc", "pkgconf-2.3.0/configure", "--prefix=/usr", - "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", + run("vinix-configure", "pkgconf-2.3.0/configure", "--with-pkg-config-dir=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig") run("make") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") run("env", "PKG_CONFIG_PATH=", "PKG_CONFIG_LIBDIR=.", - string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".libs", + "vinix-run", "--library-path", ".libs", ".libs/pkgconf", "--exact-version=2.3.0", "libpkgconf") }, #:package, fn() { diff --git a/xz/PKGBUILD.vile b/xz/PKGBUILD.vile index 5ad15e5..e6d2f21 100644 --- a/xz/PKGBUILD.vile +++ b/xz/PKGBUILD.vile @@ -1,31 +1,23 @@ defpkgbuild(xz, #:pkgname, "xz", #:pkgver, "5.8.4", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "XZ and LZMA compression tools and shared library", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "0BSD AND LGPL-2.1-or-later AND GPL-2.0-or-later", #:url, "https://tukaani.org/xz/", #:depends, ["musl"], #:source, ["https://github.com/tukaani-project/xz/archive/refs/tags/v5.8.4/xz-5.8.4.tar.gz"], #:sha256sums, ["b6b34c52e672e810d339db14e0c10b5b6f5f67a30d8d05cdac5d8cb4d82f78d5"], #:build, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - run("cmake", "-S", "xz-5.8.4", "-B", "build", "-DCMAKE_BUILD_TYPE=Release", - "-DCMAKE_SYSTEM_NAME=Linux", "-DCMAKE_SYSTEM_PROCESSOR=x86_64", "-DCMAKE_C_COMPILER=vinix-cc", - string-append("-DCMAKE_SYSROOT=", root), "-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY", - "-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY", "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY", - "-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER", "-DCMAKE_INSTALL_PREFIX=/usr", "-DCMAKE_INSTALL_LIBDIR=lib", - "-DBUILD_SHARED_LIBS=ON", "-DXZ_NLS=OFF", "-DBUILD_TESTING=OFF") + run("vinix-cmake", "xz-5.8.4", "build", "-DBUILD_SHARED_LIBS=ON", "-DXZ_NLS=OFF", "-DBUILD_TESTING=OFF") run("cmake", "--build", "build") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - loader := string-append(root, "/lib/ld-musl-x86_64.so.1") run("cp", "xz-5.8.4/README", "original") run("cp", "original", "roundtrip") - run(loader, "--library-path", "build", "build/xz", "--threads=1", "roundtrip") - run(loader, "--library-path", "build", "build/xz", "-d", "roundtrip.xz") + run("vinix-run", "--library-path", "build", "build/xz", "--threads=1", "roundtrip") + run("vinix-run", "--library-path", "build", "build/xz", "-d", "roundtrip.xz") run("cmp", "original", "roundtrip") }, #:package, fn() { diff --git a/zstd/PKGBUILD.vile b/zstd/PKGBUILD.vile index 2dcce63..995d977 100644 --- a/zstd/PKGBUILD.vile +++ b/zstd/PKGBUILD.vile @@ -1,32 +1,33 @@ +cross := get-environment-variable("CROSS_COMPILE") +prefix := if string?(cross) { cross } else { "" } + defpkgbuild(zstd, #:pkgname, "zstd", #:pkgver, "1.6.0", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Zstandard compression library and development headers", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "BSD-3-Clause OR GPL-2.0-only", #:url, "https://facebook.github.io/zstd/", #:depends, ["musl"], #:source, ["zstd-1.6.0.tar.gz::https://github.com/facebook/zstd/archive/refs/tags/v1.6.0.tar.gz"], #:sha256sums, ["289bb207935e5b4f241239f9832e665fa6b9636c3f87f479e125371e13842b8e"], #:build, fn() { - run("make", "-C", "zstd-1.6.0/lib", "CC=vinix-cc", "libzstd-release") + run("make", "-C", "zstd-1.6.0/lib", "CC=vinix-cc", string-append("AR=", prefix, "ar"), string-append("RANLIB=", prefix, "ranlib"), "libzstd-release") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - loader := string-append(root, "/lib/ld-musl-x86_64.so.1") for-each(fn(program) { run("vinix-cc", "-Izstd-1.6.0/lib", string-append("zstd-1.6.0/examples/", program, ".c"), "-Lzstd-1.6.0/lib", "-lzstd", "-o", program) }, list("simple_compression", "simple_decompression")) run("cp", "zstd-1.6.0/README.md", "sample") - run(loader, "--library-path", "zstd-1.6.0/lib", "./simple_compression", "sample") - run(loader, "--library-path", "zstd-1.6.0/lib", "./simple_decompression", "sample.zst") + run("vinix-run", "--library-path", "zstd-1.6.0/lib", "./simple_compression", "sample") + run("vinix-run", "--library-path", "zstd-1.6.0/lib", "./simple_decompression", "sample.zst") run("zstd", "--quiet", "--decompress", "sample.zst", "-o", "decoded") run("cmp", "sample", "decoded") }, #:package, fn() { - run("make", "-C", "zstd-1.6.0/lib", "CC=vinix-cc", "PREFIX=/usr", string-append("DESTDIR=", pkgdir()), + run("make", "-C", "zstd-1.6.0/lib", "CC=vinix-cc", string-append("AR=", prefix, "ar"), string-append("RANLIB=", prefix, "ranlib"), "PREFIX=/usr", string-append("DESTDIR=", pkgdir()), "install-shared", "install-includes", "install-pc") for-each(fn(name) { run("install", "-Dm644", string-append("zstd-1.6.0/", name), string-append(pkgdir(), "/usr/share/licenses/zstd/", name)) -- 2.56.1