vinix-ports / xbps / PKGBUILD.vile
36 lines · 36 sloc · 2.05 KB · 659de5cdc6e1eaa7390bf3baab792346f5f9f2ce
Raw
1defpkgbuild(xbps,
2 #:pkgname, "xbps",
3 #:pkgver, "0.59.2",
4 #:pkgrel, 1,
5 #:pkgdesc, "XBPS package database and archive utilities used by the Vinix network layer",
6 #:arch, [#:x86-64, #:aarch64],
7 #:license, "BSD-2-Clause AND BSD-3-Clause AND ISC",
8 #:url, "https://github.com/void-linux/xbps",
9 #:depends, ["musl", "ca-certificates-bundle", "libarchive", "openssl", "zlib"],
10 #:source, ["xbps-0.59.2.tar.gz::https://codeload.github.com/void-linux/xbps/tar.gz/0.59.2",
11 "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/community/xbps/no-werror.patch", "check.py"],
12 #:sha256sums, ["a6607e83fcd654a0ae846d729e43fefd8da9a61323e91430f884caf895b4f59b",
13 "c5cf8d2e0fda5fcf5d3a388cd242e70f746350e3e0141dba9962d3bbee855295", "883c98e7c8f8a4ee3062a3438463b3e0b6d92094a66873225d857f4215a0df35"],
14 #:prepare, fn() {
15 run("patch", "-d", "xbps-0.59.2", "-p1", "-i", string-append(srcdir(), "/no-werror.patch"))
16 },
17 #:build, fn() {
18 target := get-environment-variable("VPAC_TARGET_ARCH")
19 arch := if string?(target) { target } else if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" }
20 root := get-environment-variable("VPAC_MAKEPKG_ROOT")
21 run("env", "-C", "xbps-0.59.2", "CC=vinix-cc",
22 string-append("LDFLAGS=-Wl,--sysroot=", root, " -L", root, "/usr/lib -Wl,-rpath-link,", root, "/usr/lib"),
23 "./configure", string-append("--host=", arch, "-unknown-linux-musl"),
24 "--prefix=/usr", "--bindir=/usr/bin", "--sysconfdir=/etc", "--localstatedir=/var/lib/xbps")
25 run("make", "-C", "xbps-0.59.2", "V=1")
26 },
27 #:check, fn() {
28 run("make", "-C", "xbps-0.59.2", string-append("DESTDIR=", srcdir(), "/checked"), "install")
29 run("python3", "check.py")
30 },
31 #:package, fn() {
32 run("make", "-C", "xbps-0.59.2", string-append("DESTDIR=", pkgdir()), "install")
33 for-each(fn(file) {
34 run("install", "-Dm644", string-append("xbps-0.59.2/", file), string-append(pkgdir(), "/usr/share/licenses/xbps/", file))
35 }, list("LICENSE", "LICENSE.3RDPARTY"))
36 })
37