From 19f9785ff6225f1d4093cb3eeb7b56a3cc29bb50 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 01:27:40 +0100 Subject: [PATCH] Build OpenSSL against the selected Vinix target SDK --- openssl/PKGBUILD.vile | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/openssl/PKGBUILD.vile b/openssl/PKGBUILD.vile index c9c94c6..48e799f 100644 --- a/openssl/PKGBUILD.vile +++ b/openssl/PKGBUILD.vile @@ -1,11 +1,16 @@ ; Keep the libssl.so.3 and libcrypto.so.3 ABI used by the Alpine 3.21 userland. ; Use upstream's supported 3.5 LTS branch and Alpine's corresponding fixes. +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(openssl, #:pkgname, "openssl", #:pkgver, "3.5.9", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "OpenSSL TLS toolkit, libraries and development headers for Vinix", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:url, "https://openssl-library.org/", #:license, "Apache-2.0", #:depends, ["musl"], @@ -27,19 +32,19 @@ defpkgbuild(openssl, run("patch", "--batch", "--fuzz=0", "-p1", "-d", "openssl-3.5.9", "-i", string-append("../", patch)) }, list("CVE-2026-88822.patch", "CVE-2026-88823.patch", "CVE-2026-95691.patch", "CVE-2026-95692.patch", "CVE-2026-107496.patch")) - run("ln", "-s", get-environment-variable("VPAC_MAKEPKG_ROOT"), "vinix-sysroot") }, #:build, fn() { - run("env", "CC=gcc --sysroot=vinix-sysroot -specs=vinix-sysroot/usr/lib/musl-gcc-sysroot.specs", - "perl", "openssl-3.5.9/Configure", "linux-x86_64", "--prefix=/usr", "--libdir=lib", + ; OpenSSL prefixes tool names itself. vinix-cc selects the real target + ; compiler and sysroot, so pass the archive tools to Configure explicitly. + run("env", "-u", "CROSS_COMPILE", "CC=vinix-cc", string-append("VINIX_REAL_CC=", prefix, "gcc"), + string-append("AR=", prefix, "ar"), string-append("RANLIB=", prefix, "ranlib"), + "perl", "openssl-3.5.9/Configure", string-append("linux-", arch), "--prefix=/usr", "--libdir=lib", "--openssldir=/etc/ssl", "shared", "no-tests", "no-docs", "no-zlib", "no-async", "no-afalgeng") run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", "make", "build_sw") }, #:check, fn() { - run("vinix-sysroot/lib/ld-musl-x86_64.so.1", "--library-path", ".:vinix-sysroot/usr/lib", - "apps/openssl", "version") - run("vinix-sysroot/lib/ld-musl-x86_64.so.1", "--library-path", ".:vinix-sysroot/usr/lib", - "apps/openssl", "dgst", "-sha256", "/dev/null") + run("vinix-run", "--library-path", ".", "apps/openssl", "version") + run("vinix-run", "--library-path", ".", "apps/openssl", "dgst", "-sha256", "/dev/null") }, #:package, fn() { ; The core command implements 'openssl rehash'. Optional upstream Perl -- 2.56.1