support bsd for libffi (#1474)

* support bsd for libffi

* support bsd for openssl

* Update xmake.lua
pull/1476/head
ruki 2 years ago committed by GitHub
parent 16f88548da
commit 3a3ee6109e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/l/libffi/xmake.lua
  2. 4
      packages/o/openssl/xmake.lua

@ -15,8 +15,7 @@ package("libffi")
add_extsources("brew::libffi")
end
on_load("macosx", "linux", "iphoneos", function (package)
on_load("macosx", "linux", "bsd", function (package)
if package:gitref() then
package:add("deps", "autoconf", "automake", "libtool")
elseif package:version():le("3.2.1") then
@ -24,7 +23,7 @@ package("libffi")
end
end)
on_install("windows", function (package)
on_install("windows", "iphoneos", function (package)
io.gsub("fficonfig.h.in", "# *undef (.-)\n", "${define %1}\n")
os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua")
import("package.tools.xmake").install(package, {
@ -32,16 +31,13 @@ package("libffi")
})
end)
on_install("macosx", "linux", "iphoneos", function (package)
on_install("macosx", "linux", "bsd", function (package)
local configs = {"--disable-silent-rules", "--disable-dependency-tracking"}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
if package:debug() then
table.insert(configs, "--enable-debug")
end
if package:config("pic") ~= false then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs)
if package:is_plat("linux") and package:is_arch("x86_64") then
local lib64 = path.join(package:installdir(), "lib64")

@ -20,8 +20,6 @@ package("openssl")
add_versions("1.0.2u", "493f8b34574d0cf8598adbdec33c84b8a06f0617787c3710d20827c01291c09c")
add_versions("1.0.0", "9b67e5ad1a4234c1170ada75b66321e914da4f3ebaeaef6b28400173aaa6b378")
on_fetch("fetch")
on_load(function (package)
@ -87,7 +85,7 @@ package("openssl")
import("package.tools.make").make(package, {"install_sw"})
end)
on_install("linux", "macosx", function (package)
on_install("linux", "macosx", "bsd", function (package)
-- https://wiki.openssl.org/index.php/Compilation_and_Installation#PREFIX_and_OPENSSLDIR
local buildenvs = import("package.tools.autoconf").buildenvs(package)
local configs = {"--openssldir=" .. package:installdir(),

Loading…
Cancel
Save