vinix-ports / libseccomp / PKGBUILD.vile
38 lines · 37 sloc · 1.9 KB · 94543b2f8076afb9ff47c15b8c4ea094dabe718d
Raw
1selected := get-environment-variable("VPAC_TARGET_ARCH")
2arch := if string?(selected) { selected } else if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" }
3arm := string=?(arch, "aarch64")
4musl := if arm { "musl>=1.2.6-4" } else { "musl" }
5
6defpkgbuild(libseccomp,
7 #:pkgname, "libseccomp",
8 #:pkgver, "2.5.5",
9 #:pkgrel, if arm { 2 } else { 1 },
10 #:pkgdesc, "Library and tools for Linux syscall filtering",
11 #:arch, [#:x86-64, #:aarch64],
12 #:url, "https://github.com/seccomp/libseccomp",
13 #:license, "LGPL-2.1-or-later",
14 #:depends, [musl],
15 #:makedepends, ["linux-headers"],
16 #:source, ["https://github.com/seccomp/libseccomp/releases/download/v2.5.5/libseccomp-2.5.5.tar.gz",
17 "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/libseccomp/loongarch64.patch",
18 "remove-redefinition-prctl.patch", "check.py"],
19 #:sha256sums, ["248a2c8a4d9b9858aa6baf52712c34afefcf9c9e94b76dce02c1c9aa25fb3375",
20 "0b7c5782ebf6b996e16147f10b2e366fe75b6275ba589e043ec78ec7779cc651",
21 "3506ffadf6699b78164594b3615043233c9f57d9e6bde0418c552754a505f0dc",
22 "aeb5ec0522d3f9818369587a9a02305db2117db99744b193bed4eca475df157a"],
23 #:prepare, fn() {
24 run("patch", "--batch", "--fuzz=0", "-d", "libseccomp-2.5.5", "-p1", "-i", "../loongarch64.patch")
25 run("patch", "--batch", "--fuzz=0", "-d", "libseccomp-2.5.5", "-p1", "-i", "../remove-redefinition-prctl.patch")
26 },
27 #:build, fn() {
28 run("vinix-configure", "libseccomp-2.5.5/configure", "--disable-python")
29 run("make")
30 },
31 #:check, fn() {
32 run("python3", "check.py")
33 },
34 #:package, fn() {
35 run("make", "install", string-append("DESTDIR=", pkgdir()))
36 run("find", pkgdir(), "-name", "*.la", "-delete")
37 run("install", "-Dm644", "libseccomp-2.5.5/LICENSE", string-append(pkgdir(), "/usr/share/licenses/libseccomp/LICENSE"))
38 })
39