defpkgbuild(fortify-headers, #:pkgname, "fortify-headers", #:pkgver, "1.1", #:pkgrel, 1, #:pkgdesc, "Compile-time and runtime checks for musl C library calls", #:url, "https://git.2f30.org/fortify-headers/", #:license, "0BSD", #:arch, [#:x86-64, #:aarch64], #:depends, ["musl"], #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/fortify-headers-1.1.tar.gz", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/fortify-headers/0001-add-initial-clang-support.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/fortify-headers/0002-avoid-__extension__-with-clang.patch", "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/fortify-headers/0003-Disable-wrapping-of-ppoll.patch", "checked.c"], #:sha256sums, ["6ba5d860a2d2ba4c3346924b93930c34856eafe148bdbdf271ecab8065201fb6", "41b0e73131959af228928c3a96403e9831c53033fc07494b63cc3d72252118a5", "2e8a14f08e6d77b7ec7d78c16a16b0bd96e147bafd1d35a54fba866cf13cf336", "356e3a8f090a4bfd21bc2ed615a7ad6c0c90c5ffd82e7c8457e63c1bda5ac82c", "e139b9456913c83543b63b16c9972c129f620aa0169a6e8eea382664be2bd85d"], #:prepare, fn() { for-each(fn(patch) { run("patch", "--batch", "--fuzz=0", "-d", "fortify-headers-1.1", "-p1", "-i", string-append(srcdir(), "/", patch)) }, list("0001-add-initial-clang-support.patch", "0002-avoid-__extension__-with-clang.patch", "0003-Disable-wrapping-of-ppoll.patch")) }, #:check, fn() { run("vinix-cc", "-O2", "-D_FORTIFY_SOURCE=2", "-Ifortify-headers-1.1/include", "checked.c", "-o", "checked") run("vinix-run", "./checked", "Vinix") }, #:package, fn() { run("make", "-C", "fortify-headers-1.1", "PREFIX=/usr", string-append("DESTDIR=", pkgdir()), "install") run("install", "-Dm644", "fortify-headers-1.1/LICENSE", string-append(pkgdir(), "/usr/share/licenses/fortify-headers/LICENSE")) })