From b7c1f288cd58534c4d4cf916617c0c6bebafb503 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 01:38:09 +0100 Subject: [PATCH] Build and verify GNU arithmetic libraries for both Vinix architectures --- gmp/PKGBUILD.vile | 14 ++++++++------ mpc/PKGBUILD.vile | 8 ++++---- mpfr/PKGBUILD.vile | 8 ++++---- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/gmp/PKGBUILD.vile b/gmp/PKGBUILD.vile index 2547b4f..92f564a 100644 --- a/gmp/PKGBUILD.vile +++ b/gmp/PKGBUILD.vile @@ -1,19 +1,21 @@ defpkgbuild(gmp, #:pkgname, "gmp", #:pkgver, "6.3.0", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "GNU multiple precision arithmetic library", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:url, "https://gmplib.org/", #:license, "LGPL-3.0-or-later", #:depends, ["musl"], #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/gmp-6.3.0.tar.xz"], #:sha256sums, ["a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898"], #: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", "CC_FOR_BUILD=gcc", "gmp-6.3.0/configure", "--prefix=/usr", - "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", "--enable-shared", "--enable-static", "--disable-cxx", "--enable-fat") + selected := get-environment-variable("VPAC_TARGET_ARCH") + arm := if string?(selected) { string=?(selected, "aarch64") } else { memq(string->symbol("aarch64"), features()) } + ; Upstream provides runtime CPU dispatch on x86-64. + dispatch := if arm { "--disable-fat" } else { "--enable-fat" } + run("env", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "vinix-configure", "gmp-6.3.0/configure", + "--enable-shared", "--enable-static", "--disable-cxx", dispatch) run("make") }, #:package, fn() { diff --git a/mpc/PKGBUILD.vile b/mpc/PKGBUILD.vile index b89ba3e..7b8d9aa 100644 --- a/mpc/PKGBUILD.vile +++ b/mpc/PKGBUILD.vile @@ -1,17 +1,17 @@ defpkgbuild(mpc, #:pkgname, "mpc", #:pkgver, "1.3.1", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Multiple precision complex arithmetic", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:url, "https://www.multiprecision.org/mpc/", #:license, "LGPL-3.0-or-later", #:depends, ["musl", "gmp", "mpfr"], #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/mpc-1.3.1.tar.gz"], #:sha256sums, ["ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8"], #:build, fn() { - run("env", "CC=vinix-cc", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "mpc-1.3.1/configure", "--prefix=/usr", - "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", "--enable-shared", "--enable-static") + run("env", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "vinix-configure", "mpc-1.3.1/configure", + "--enable-shared", "--enable-static") run("make") }, #:package, fn() { diff --git a/mpfr/PKGBUILD.vile b/mpfr/PKGBUILD.vile index ba2336e..2f7715a 100644 --- a/mpfr/PKGBUILD.vile +++ b/mpfr/PKGBUILD.vile @@ -1,17 +1,17 @@ defpkgbuild(mpfr, #:pkgname, "mpfr", #:pkgver, "4.2.1", - #:pkgrel, 1, + #:pkgrel, 2, #:pkgdesc, "Multiple precision floating-point arithmetic with correct rounding", - #:arch, [#:x86-64], + #:arch, [#:x86-64, #:aarch64], #:url, "https://www.mpfr.org/", #:license, "LGPL-3.0-or-later", #:depends, ["musl", "gmp"], #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/mpfr-4.2.1.tar.xz"], #:sha256sums, ["277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcbb2"], #:build, fn() { - run("env", "CC=vinix-cc", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "mpfr-4.2.1/configure", "--prefix=/usr", - "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", "--enable-shared", "--enable-static") + run("env", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "vinix-configure", "mpfr-4.2.1/configure", + "--enable-shared", "--enable-static") run("make") }, #:package, fn() { -- 2.56.1