| 1 | defpkgbuild(libffi, |
| 2 | #:pkgname, "libffi", |
| 3 | #:pkgver, "3.8.2", |
| 4 | #:pkgrel, 2, |
| 5 | #:pkgdesc, "Portable foreign function calls and closures", |
| 6 | #:arch, [#:x86-64, #:aarch64], |
| 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("vinix-configure", "libffi-3.8.2/configure", |
| 15 | "--disable-multi-os-directory", "--disable-docs", "--enable-pax_emutramp", "--enable-portable-binary", "--disable-exec-static-tramp") |
| 16 | run("make") |
| 17 | }, |
| 18 | #:check, fn() { |
| 19 | run("vinix-cc", "-Iinclude", "-I.", "libffi-3.8.2/testsuite/libffi.call/strlen2.c", |
| 20 | "-L.libs", "-lffi", "-o", "test-calling-convention") |
| 21 | run("vinix-run", "--library-path", ".libs", "./test-calling-convention") |
| 22 | }, |
| 23 | #:package, fn() { |
| 24 | run("make", "install", string-append("DESTDIR=", pkgdir())) |
| 25 | run("rm", string-append(pkgdir(), "/usr/lib/libffi.la")) |
| 26 | run("install", "-Dm644", "libffi-3.8.2/LICENSE", string-append(pkgdir(), "/usr/share/licenses/libffi/LICENSE")) |
| 27 | }) |
| 28 | |