From 847b3176d3d6f39478810447f81a13e7bb8a48a2 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 00:22:57 +0100 Subject: [PATCH] Build and test zlib with the selected target toolchain --- zlib/PKGBUILD.vile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/zlib/PKGBUILD.vile b/zlib/PKGBUILD.vile index c0f4b82..5a8fec2 100644 --- a/zlib/PKGBUILD.vile +++ b/zlib/PKGBUILD.vile @@ -1,9 +1,14 @@ +selected := get-environment-variable("VPAC_TARGET_ARCH") +arch := if string?(selected) { selected } else if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" } +cross := get-environment-variable("CROSS_COMPILE") +prefix := if string?(cross) { cross } else { "" } + defpkgbuild(zlib, #:pkgname, "zlib", #:pkgver, "1.4", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "DEFLATE compression library and development headers", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:license, "Zlib", #:url, "https://zlib.net/", #:depends, ["musl"], @@ -11,16 +16,14 @@ defpkgbuild(zlib, #:sha256sums, ["02dd159783677a749c04adbdd02b55b8a2bcc7e054f51b76b549199a916ad584"], #:build, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", - string-append("CC=gcc --sysroot=", root, " -specs=", root, "/usr/lib/musl-gcc-sysroot.specs"), - "CFLAGS=-O2", "CHOST=x86_64-linux-musl", "AR=ar", "RANLIB=ranlib", + "CC=vinix-cc", "CFLAGS=-O2", string-append("CHOST=", arch, "-linux-musl"), + string-append("AR=", prefix, "ar"), string-append("RANLIB=", prefix, "ranlib"), "zlib-1.4/configure", "--prefix=/usr", "--shared", "--disable-crcvx") run("make") }, #:check, fn() { - root := get-environment-variable("VPAC_MAKEPKG_ROOT") - run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".", "./examplesh") + run("vinix-run", "--library-path", ".", "./examplesh") }, #:package, fn() { run("make", "install", string-append("DESTDIR=", pkgdir())) -- 2.56.1