improve freetype (#318)

pull/319/head
ruki 4 years ago committed by GitHub
parent d5d7d0e83c
commit b49360fe29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      packages/b/brotli/xmake.lua
  2. 18
      packages/f/freetype/xmake.lua

@ -21,6 +21,30 @@ package("brotli")
package:addenv("PATH", "bin")
end)
if on_fetch then
on_fetch("linux", "macosx", function (package, opt)
if opt.system then
local result
for _, name in ipairs({"libbrotlidec", "libbrotlienc", "libbrotlicommon"}) do
local pkginfo = find_package("pkgconfig::" .. name)
if pkginfo then
if not result then
result = table.copy(pkginfo)
else
result.links = result.links or {}
result.linkdirs = result.linkdirs or {}
result.includedirs = result.includedirs or {}
table.join2(result.includedirs, pkginfo.includedirs)
table.join2(result.linkdirs, pkginfo.linkdirs)
table.join2(result.links, pkginfo.links)
end
end
end
return result
end
end)
end
on_install(function (package)
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
@ -57,4 +81,4 @@ package("brotli")
BrotliEncoderDestroyInstance(s);
}
]], {includes = "brotli/encode.h"}))
end)
end)

@ -19,6 +19,14 @@ package("freetype")
add_includedirs("include/freetype2")
end
if on_fetch then
on_fetch("linux", "macosx", function (package, opt)
if opt.system then
return find_package("pkgconfig::freetype2")
end
end)
end
on_load("linux", "macosx", function (package)
package:add("deps", "libpng", "bzip2", "zlib")
if package:config("woff2") then
@ -33,9 +41,13 @@ package("freetype")
on_install("linux", "macosx", function (package)
local configs = { "--enable-freetype-config",
"--without-harfbuzz",
"--disable-shared",
"--with-pic"}
"--without-harfbuzz"}
local configs = {}
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:config("pic") ~= false then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs)
end)

Loading…
Cancel
Save