vinix-ports / ports / mpc / PKGBUILD.vile
27 lines · 26 sloc · 1.33 KB · c33d8afc2906b8dd9a8b905224eccd49a44f7ad5
Raw
1selected := get-environment-variable("VPAC_TARGET_ARCH")
2arm := if string?(selected) { string=?(selected, "aarch64") } else { memq(string->symbol("aarch64"), features()) }
3libc := if arm { "musl>=1.2.6-4" } else { "musl" }
4
5defpkgbuild(mpc,
6 #:pkgname, "mpc",
7 #:pkgver, "1.3.1",
8 #:pkgrel, if arm { 3 } else { 2 },
9 #:pkgdesc, "Multiple precision complex arithmetic",
10 #:arch, [#:x86-64, #:aarch64],
11 #:url, "https://www.multiprecision.org/mpc/",
12 #:license, "LGPL-3.0-or-later",
13 #:depends, list(libc, if arm { "gmp>=6.3.0-3" } else { "gmp" }, if arm { "mpfr>=4.2.1-3" } else { "mpfr" }),
14 #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/mpc-1.3.1.tar.gz"],
15 #:sha256sums, ["ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8"],
16 #:build, fn() {
17 run("env", "CFLAGS=-O2 -std=gnu17", "CC_FOR_BUILD=gcc", "vinix-configure", "mpc-1.3.1/configure",
18 "--enable-shared", "--enable-static")
19 run("make")
20 },
21 #:package, fn() {
22 run("make", string-append("DESTDIR=", pkgdir()), "install")
23 run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir"))
24 run("test", "-f", string-append(pkgdir(), "/usr/lib/libmpc.so"))
25 run("rm", string-append(pkgdir(), "/usr/lib/libmpc.la"))
26 run("install", "-Dm644", "mpc-1.3.1/COPYING.LESSER", string-append(pkgdir(), "/usr/share/licenses/mpc/COPYING"))
27 })
28