defpkgbuild(libseccomp, #:pkgname, "libseccomp", #:pkgver, "2.5.5", #:pkgrel, 1, #:pkgdesc, "Library and tools for Linux syscall filtering", #:arch, [#:x86-64, #:aarch64], #:url, "https://github.com/seccomp/libseccomp", #:license, "LGPL-2.1-or-later", #:depends, ["musl"], #:makedepends, ["linux-headers"], #:source, ["https://github.com/seccomp/libseccomp/releases/download/v2.5.5/libseccomp-2.5.5.tar.gz", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/libseccomp/loongarch64.patch", "remove-redefinition-prctl.patch", "check.py"], #:sha256sums, ["248a2c8a4d9b9858aa6baf52712c34afefcf9c9e94b76dce02c1c9aa25fb3375", "0b7c5782ebf6b996e16147f10b2e366fe75b6275ba589e043ec78ec7779cc651", "3506ffadf6699b78164594b3615043233c9f57d9e6bde0418c552754a505f0dc", "aeb5ec0522d3f9818369587a9a02305db2117db99744b193bed4eca475df157a"], #:prepare, fn() { run("patch", "--batch", "--fuzz=0", "-d", "libseccomp-2.5.5", "-p1", "-i", "../loongarch64.patch") run("patch", "--batch", "--fuzz=0", "-d", "libseccomp-2.5.5", "-p1", "-i", "../remove-redefinition-prctl.patch") }, #:build, fn() { run("vinix-configure", "libseccomp-2.5.5/configure", "--disable-python") run("make") }, #:check, fn() { run("python3", "check.py") }, #:package, fn() { run("make", "install", string-append("DESTDIR=", pkgdir())) run("find", pkgdir(), "-name", "*.la", "-delete") run("install", "-Dm644", "libseccomp-2.5.5/LICENSE", string-append(pkgdir(), "/usr/share/licenses/libseccomp/LICENSE")) })