| 1 | defpkgbuild(libffi, |
| 2 | #:pkgname, "libffi", |
| 3 | #:pkgver, "3.8.2", |
| 4 | #:pkgrel, 1, |
| 5 | #:pkgdesc, "Portable foreign function calls and closures", |
| 6 | #:arch, [#:x86-64], |
| 7 | #:license, "MIT", |
| 8 | #:url, "https://sourceware.org/libffi/", |
| 9 | #:depends, ["musl"], |
| 10 | #:source, ["https://github.com/libffi/libffi/releases/download/v3.8.2/libffi-3.8.2.tar.gz"], |
| 11 | #:sha256sums, ["a699fda2b090c4b46cb79cf60c4dacfce480eb05742c0de66acf3af174a47f92"], |
| 12 | |
| 13 | #:build, fn() { |
| 14 | run("env", "CC=vinix-cc", "libffi-3.8.2/configure", "--prefix=/usr", |
| 15 | "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", |
| 16 | "--disable-multi-os-directory", "--disable-docs", "--enable-pax_emutramp", "--enable-portable-binary", "--disable-exec-static-tramp") |
| 17 | run("make") |
| 18 | }, |
| 19 | #:check, fn() { |
| 20 | root := get-environment-variable("VPAC_MAKEPKG_ROOT") |
| 21 | run("vinix-cc", "-Iinclude", "-I.", "libffi-3.8.2/testsuite/libffi.call/strlen2.c", |
| 22 | "-L.libs", "-lffi", "-o", "test-calling-convention") |
| 23 | run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".libs", "./test-calling-convention") |
| 24 | }, |
| 25 | #:package, fn() { |
| 26 | run("make", "install", string-append("DESTDIR=", pkgdir())) |
| 27 | run("rm", string-append(pkgdir(), "/usr/lib/libffi.la")) |
| 28 | run("install", "-Dm644", "libffi-3.8.2/LICENSE", string-append(pkgdir(), "/usr/share/licenses/libffi/LICENSE")) |
| 29 | }) |
| 30 | |