| 1 | selected := get-environment-variable("VPAC_TARGET_ARCH") |
| 2 | arch := if string?(selected) { selected } else if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" } |
| 3 | arm := string=?(arch, "aarch64") |
| 4 | musl := if arm { "musl>=1.2.6-4" } else { "musl" } |
| 5 | |
| 6 | defpkgbuild(nettle, |
| 7 | #:pkgname, "nettle", |
| 8 | #:pkgver, "3.10.2", |
| 9 | #:pkgrel, if arm { 2 } else { 1 }, |
| 10 | #:pkgdesc, "Nettle and Hogweed cryptographic libraries and utilities", |
| 11 | #:arch, [#:x86-64, #:aarch64], |
| 12 | #:url, "https://www.lysator.liu.se/~nisse/nettle/", |
| 13 | #:license, "GPL-2.0-or-later OR LGPL-3.0-or-later", |
| 14 | #:depends, [musl, "gmp"], |
| 15 | #:source, ["https://ftp.gnu.org/gnu/nettle/nettle-3.10.2.tar.gz"], |
| 16 | #:sha256sums, ["fe9ff51cb1f2abb5e65a6b8c10a92da0ab5ab6eaf26e7fc2b675c45f1fb519b5"], |
| 17 | #:build, fn() { |
| 18 | run("vinix-configure", "nettle-3.10.2/configure", "--enable-fat", "--enable-shared", "--enable-static", "--disable-openssl") |
| 19 | run("make") |
| 20 | }, |
| 21 | #:check, fn() { |
| 22 | run("make", "-C", "testsuite", "sha256-test", "rsa-test") |
| 23 | run("make", "install", string-append("DESTDIR=", srcdir(), "/check-root")) |
| 24 | run("vinix-run", "--library-path", "check-root/usr/lib", "testsuite/sha256-test") |
| 25 | run("vinix-run", "--library-path", "check-root/usr/lib", "testsuite/rsa-test") |
| 26 | }, |
| 27 | #:package, fn() { |
| 28 | run("make", "install", string-append("DESTDIR=", pkgdir())) |
| 29 | run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir")) |
| 30 | for-each(fn(file) { |
| 31 | run("install", "-Dm644", string-append("nettle-3.10.2/", file), string-append(pkgdir(), "/usr/share/licenses/nettle/", file)) |
| 32 | }, list("COPYINGv2", "COPYING.LESSERv3")) |
| 33 | }) |
| 34 | |