Browse Source

add libxft (#304)

* add libxft

* Update xmake.lua

* Update xmake.lua

* revert ci
ruki 4 years ago
parent
commit
a47c7f9f53

+ 1 - 1
packages/b/bzip2/xmake.lua

@@ -22,7 +22,7 @@ package("bzip2")
 
 
     on_install("macosx", "linux", function (package)
     on_install("macosx", "linux", function (package)
         local configs = {}
         local configs = {}
-        if package:config("shared") then
+        if package:config("pic") ~= false then
             table.insert(configs, "CFLAGS=-fPIC")
             table.insert(configs, "CFLAGS=-fPIC")
         end
         end
         io.gsub("Makefile", "PREFIX=.-\n", "PREFIX=" .. package:installdir() .. "\n")
         io.gsub("Makefile", "PREFIX=.-\n", "PREFIX=" .. package:installdir() .. "\n")

+ 4 - 6
packages/e/expat/xmake.lua

@@ -20,12 +20,10 @@ package("expat")
 
 
     on_install("linux", "macosx", function (package)
     on_install("linux", "macosx", function (package)
         local configs = {"--without-examples", "--without-tests", "--without-docbook"}
         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
         end
         import("package.tools.autoconf").install(package, configs)
         import("package.tools.autoconf").install(package, configs)
     end)
     end)

+ 3 - 0
packages/f/fontconfig/xmake.lua

@@ -35,6 +35,9 @@ package("fontconfig")
             envs.UUID_CFLAGS = "-I" .. package:dep("util-linux"):installdir("include")
             envs.UUID_CFLAGS = "-I" .. package:dep("util-linux"):installdir("include")
         end
         end
         table.insert(configs, "--enable-shared=no")
         table.insert(configs, "--enable-shared=no")
+        if package:config("pic") ~= false then
+            table.insert(configs, "--with-pic")
+        end
         autoconf.install(package, configs, {envs = envs})
         autoconf.install(package, configs, {envs = envs})
     end)
     end)
 
 

+ 10 - 1
packages/l/libuuid/xmake.lua

@@ -9,7 +9,16 @@ package("libuuid")
     add_versions("1.0.3", "46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644")
     add_versions("1.0.3", "46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644")
 
 
     on_install("linux", "macosx", function(package)
     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)
     end)
 
 
     on_test(function(package)
     on_test(function(package)

+ 24 - 0
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)

+ 8 - 0
packages/u/util-linux/xmake.lua

@@ -40,6 +40,14 @@ package("util-linux")
                          "--enable-static=yes",
                          "--enable-static=yes",
                          "--enable-shared=no",
                          "--enable-shared=no",
                          "--with-bashcompletiondir=" .. package:installdir("share/bash-completion")}
                          "--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
         for name, enabled in pairs(package:configs()) do
             if not package:extraconf("configs", name, "builtin") then
             if not package:extraconf("configs", name, "builtin") then
                 if enabled then
                 if enabled then