From a47c7f9f5356476c4c316f455e7f6e3667c323e3 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Feb 2021 11:36:48 +0800 Subject: [PATCH] add libxft (#304) * add libxft * Update xmake.lua * Update xmake.lua * revert ci --- packages/b/bzip2/xmake.lua | 2 +- packages/e/expat/xmake.lua | 10 ++++------ packages/f/fontconfig/xmake.lua | 3 +++ packages/l/libuuid/xmake.lua | 11 ++++++++++- packages/l/libxft/xmake.lua | 24 ++++++++++++++++++++++++ packages/u/util-linux/xmake.lua | 8 ++++++++ 6 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 packages/l/libxft/xmake.lua diff --git a/packages/b/bzip2/xmake.lua b/packages/b/bzip2/xmake.lua index 7680ecbc1..558a4a55c 100644 --- a/packages/b/bzip2/xmake.lua +++ b/packages/b/bzip2/xmake.lua @@ -22,7 +22,7 @@ package("bzip2") on_install("macosx", "linux", function (package) local configs = {} - if package:config("shared") then + if package:config("pic") ~= false then table.insert(configs, "CFLAGS=-fPIC") end io.gsub("Makefile", "PREFIX=.-\n", "PREFIX=" .. package:installdir() .. "\n") diff --git a/packages/e/expat/xmake.lua b/packages/e/expat/xmake.lua index b5bc88060..f08485ed3 100644 --- a/packages/e/expat/xmake.lua +++ b/packages/e/expat/xmake.lua @@ -20,12 +20,10 @@ package("expat") on_install("linux", "macosx", function (package) local configs = {"--without-examples", "--without-tests", "--without-docbook"} - if package:config("shared") then - table.insert(configs, "--enable-shared=yes") - table.insert(configs, "--enable-static=no") - else - table.insert(configs, "--enable-shared=no") - table.insert(configs, "--enable-static=yes") + 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) diff --git a/packages/f/fontconfig/xmake.lua b/packages/f/fontconfig/xmake.lua index 10d128624..191af116b 100644 --- a/packages/f/fontconfig/xmake.lua +++ b/packages/f/fontconfig/xmake.lua @@ -35,6 +35,9 @@ package("fontconfig") envs.UUID_CFLAGS = "-I" .. package:dep("util-linux"):installdir("include") end table.insert(configs, "--enable-shared=no") + if package:config("pic") ~= false then + table.insert(configs, "--with-pic") + end autoconf.install(package, configs, {envs = envs}) end) diff --git a/packages/l/libuuid/xmake.lua b/packages/l/libuuid/xmake.lua index fada0231a..428e2a345 100644 --- a/packages/l/libuuid/xmake.lua +++ b/packages/l/libuuid/xmake.lua @@ -9,7 +9,16 @@ package("libuuid") add_versions("1.0.3", "46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644") on_install("linux", "macosx", function(package) - import("package.tools.autoconf").install(package) + 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: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) end) on_test(function(package) diff --git a/packages/l/libxft/xmake.lua b/packages/l/libxft/xmake.lua new file mode 100644 index 000000000..bda7db190 --- /dev/null +++ b/packages/l/libxft/xmake.lua @@ -0,0 +1,24 @@ +package("libxft") + + set_homepage("https://www.x.org/") + set_description("X.Org: X FreeType library") + set_license("MIT") + + set_urls("https://www.x.org/archive/individual/lib/libXft-$(version).tar.bz2") + add_versions("2.3.3", "225c68e616dd29dbb27809e45e9eadf18e4d74c50be43020ef20015274529216") + + if is_plat("macosx", "linux") then + add_deps("pkg-config", "fontconfig", "libxrender") + end + + on_install("macosx", "linux", function (package) + local configs = {"--sysconfdir=" .. package:installdir("etc"), + "--localstatedir=" .. package:installdir("var"), + "--disable-dependency-tracking", + "--disable-silent-rules"} + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_ctypes("XftFont", {includes = "X11/Xft/Xft.h"})) + end) diff --git a/packages/u/util-linux/xmake.lua b/packages/u/util-linux/xmake.lua index 7c2707758..1a48aeb8b 100644 --- a/packages/u/util-linux/xmake.lua +++ b/packages/u/util-linux/xmake.lua @@ -40,6 +40,14 @@ package("util-linux") "--enable-static=yes", "--enable-shared=no", "--with-bashcompletiondir=" .. package:installdir("share/bash-completion")} + 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 for name, enabled in pairs(package:configs()) do if not package:extraconf("configs", name, "builtin") then if enabled then