package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.2 KiB

6 years ago
package("libffi")
set_homepage("https://sourceware.org/libffi/")
set_description("Portable Foreign Function Interface library.")
set_urls("https://sourceware.org/pub/libffi/libffi-$(version).tar.gz",
"https://deb.debian.org/debian/pool/main/libf/libffi/libffi_$(version).orig.tar.gz",
"https://github.com/atgreen/libffi.git")
add_versions("3.2.1", "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37")
on_load(function (package)
6 years ago
if package:gitref() then
6 years ago
package:add("deps", "autoconf", "automake", "libtool")
6 years ago
else
package:add("includedirs", "lib/libffi-" .. package:version_str() .. "/include")
6 years ago
end
end)
on_install("macosx", "linux", "iphoneos", function (package)
local configs = {"--disable-silent-rules", "--disable-dependency-tracking", "--enable-shared=no"}
if package:debug() then
table.insert(configs, "--enable-debug")
else
table.insert(configs, "--disable-debug")
end
import("package.tools.autoconf").install(package, configs)
6 years ago
end)
on_test(function (package)
assert(package:has_cfuncs("ffi_closure_alloc", {includes = "ffi.h"}))
end)