Build and verify GNU arithmetic libraries for both Vinix architectures
@@ -1,19 +1,21 @@
11defpkgbuild(gmp,
22 #:pkgname, "gmp",
33 #:pkgver, "6.3.0",
4- #:pkgrel, 1,
4+ #:pkgrel, 2,
55 #:pkgdesc, "GNU multiple precision arithmetic library",
6- #:arch, [#:x86-64],
6+ #:arch, [#:x86-64, #:aarch64],
77 #:url, "https://gmplib.org/",
88 #:license, "LGPL-3.0-or-later",
99 #:depends, ["musl"],
1010 #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/gmp-6.3.0.tar.xz"],
1111 #:sha256sums, ["a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898"],
1212 #:build, fn() {
13- root := get-environment-variable("VPAC_MAKEPKG_ROOT")
14- cc := string-append("CC=gcc --sysroot=", root, " -specs=", root, "/usr/lib/musl-gcc-sysroot.specs")
15- run("env", cc, "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "gmp-6.3.0/configure", "--prefix=/usr",
16- "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", "--enable-shared", "--enable-static", "--disable-cxx", "--enable-fat")
13+ selected := get-environment-variable("VPAC_TARGET_ARCH")
14+ arm := if string?(selected) { string=?(selected, "aarch64") } else { memq(string->symbol("aarch64"), features()) }
15+ ; Upstream provides runtime CPU dispatch on x86-64.
16+ dispatch := if arm { "--disable-fat" } else { "--enable-fat" }
17+ run("env", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "vinix-configure", "gmp-6.3.0/configure",
18+ "--enable-shared", "--enable-static", "--disable-cxx", dispatch)
1719 run("make")
1820 },
1921 #:package, fn() {
@@ -1,17 +1,17 @@
11defpkgbuild(mpc,
22 #:pkgname, "mpc",
33 #:pkgver, "1.3.1",
4- #:pkgrel, 1,
4+ #:pkgrel, 2,
55 #:pkgdesc, "Multiple precision complex arithmetic",
6- #:arch, [#:x86-64],
6+ #:arch, [#:x86-64, #:aarch64],
77 #:url, "https://www.multiprecision.org/mpc/",
88 #:license, "LGPL-3.0-or-later",
99 #:depends, ["musl", "gmp", "mpfr"],
1010 #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/mpc-1.3.1.tar.gz"],
1111 #:sha256sums, ["ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8"],
1212 #:build, fn() {
13- run("env", "CC=vinix-cc", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "mpc-1.3.1/configure", "--prefix=/usr",
14- "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", "--enable-shared", "--enable-static")
13+ run("env", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "vinix-configure", "mpc-1.3.1/configure",
14+ "--enable-shared", "--enable-static")
1515 run("make")
1616 },
1717 #:package, fn() {
@@ -1,17 +1,17 @@
11defpkgbuild(mpfr,
22 #:pkgname, "mpfr",
33 #:pkgver, "4.2.1",
4- #:pkgrel, 1,
4+ #:pkgrel, 2,
55 #:pkgdesc, "Multiple precision floating-point arithmetic with correct rounding",
6- #:arch, [#:x86-64],
6+ #:arch, [#:x86-64, #:aarch64],
77 #:url, "https://www.mpfr.org/",
88 #:license, "LGPL-3.0-or-later",
99 #:depends, ["musl", "gmp"],
1010 #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/mpfr-4.2.1.tar.xz"],
1111 #:sha256sums, ["277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcbb2"],
1212 #:build, fn() {
13- run("env", "CC=vinix-cc", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "mpfr-4.2.1/configure", "--prefix=/usr",
14- "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", "--enable-shared", "--enable-static")
13+ run("env", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "vinix-configure", "mpfr-4.2.1/configure",
14+ "--enable-shared", "--enable-static")
1515 run("make")
1616 },
1717 #:package, fn() {