Browse Source

add harfbuzz (#434)

* add harfbuzz

* switch freetype default to false

* fix harfbuzz again

* update util-linux

* disable cairo

* disable glib

* fix util-linux
Hoildkv 4 years ago
parent
commit
51a1598458

+ 1 - 1
packages/f/freetype/xmake.lua

@@ -21,7 +21,7 @@ package("freetype")
 
     if not is_plat("windows") then
         for conf, dep in pairs(configdeps) do
-            add_configs(conf, {description = "Enable " .. conf .. " support.", default = true, type = "boolean"})
+            add_configs(conf, {description = "Enable " .. conf .. " support.", default = false, type = "boolean"})
         end
         add_includedirs("include/freetype2")
     end

+ 37 - 0
packages/h/harfbuzz/xmake.lua

@@ -0,0 +1,37 @@
+package("harfbuzz")
+
+    set_homepage("https://harfbuzz.github.io/")
+    set_description("HarfBuzz is a text shaping library.")
+    set_license("MIT")
+
+    add_urls("https://github.com/harfbuzz/harfbuzz/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/harfbuzz/harfbuzz.git")
+    add_versions("2.8.1", "b3f17394c5bccee456172b2b30ddec0bb87e9c5df38b4559a973d14ccd04509d")
+
+    add_configs("icu", {description = "Use the ICU library.", default = false, type = "boolean"})
+
+    add_deps("meson")
+    if not is_plat("windows") then
+        add_deps("freetype")
+    end
+    on_load("windows", "linux", "macosx", function (package)
+        if package:config("icu") then
+            package:add("deps", "icu4c")
+        end
+    end)
+
+    on_install("windows", "linux", "macosx", function (package)
+        local configs = {"-Dtests=disabled", "-Ddocs=disabled", "-Dbenchmark=disabled", "-Dcairo=disabled", "-Dfontconfig=disabled", "-Dglib=disabled", "-Dgobject=disabled"}
+        table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
+        if package:config("icu") then
+            table.insert(configs, "-Dicu=enabled")
+        end
+        if package:is_plat("windows") then
+            table.insert(configs, "-Dfreetype=disabled")
+        end
+        import("package.tools.meson").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("hb_buffer_add_utf8", {includes = "harfbuzz/hb.h"}))
+    end)

+ 1 - 0
packages/n/ncurses/xmake.lua

@@ -7,6 +7,7 @@ package("ncurses")
              "https://invisible-mirror.net/archives/ncurses/ncurses-$(version).tar.gz",
              "ftp://ftp.gnu.org/gnu/ncurses/ncurses-$(version).tar.gz")
     add_versions("6.1", "aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17")
+    add_versions("6.2", "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d")
 
     add_configs("widec", { description = "Compile with wide-char/UTF-8 code.", default = true, type = "boolean"})
 

+ 30 - 0
packages/u/util-linux/patches/2.36.2/includes.patch

@@ -0,0 +1,30 @@
+diff --git a/lib/procutils.c b/lib/procutils.c
+--- a/lib/procutils.c
++++ b/lib/procutils.c
+@@ -13,7 +13,12 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <sys/stat.h>
++#ifndef __APPLE__
+ #include <sys/vfs.h>
++#else
++#include <sys/param.h>
++#include <sys/mount.h>
++#endif
+ #include <sys/types.h>
+ #include <dirent.h>
+ #include <ctype.h>
+
+diff --git a/include/statfs_magic.c b/include/statfs_magic.c
+--- a/include/statfs_magic.h
++++ b/include/statfs_magic.h
+@@ -1,7 +1,9 @@
+ #ifndef UTIL_LINUX_STATFS_MAGIC_H
+ #define UTIL_LINUX_STATFS_MAGIC_H
+ 
++#ifndef __APPLE__
+ #include <sys/statfs.h>
++#endif
+ 
+ /*
+  * If possible then don't depend on internal libc __SWORD_TYPE type.

+ 6 - 1
packages/u/util-linux/xmake.lua

@@ -3,8 +3,13 @@ package("util-linux")
     set_homepage("https://github.com/karelzak/util-linux")
     set_description("Collection of Linux utilities.")
 
-    set_urls("https://www.kernel.org/pub/linux/utils/util-linux/v2.32/util-linux-$(version).tar.xz")
+    set_urls("https://www.kernel.org/pub/linux/utils/util-linux/v$(version).tar.xz", {version = function (version)
+        return format("%s.%s/util-linux-%s", version:major(), version:minor(), version)
+    end})
     add_versions("2.32.1", "86e6707a379c7ff5489c218cfaf1e3464b0b95acf7817db0bc5f179e356a67b2")
+    add_versions("2.36.2", "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f")
+
+    add_patches("2.36.2", path.join(os.scriptdir(), "patches", "2.36.2", "includes.patch"), "7274762cac2810b5f0d17ecb5ac69c7069e7ff2b880df663b7072628df0867f3")
 
     if not is_plat("macosx") then
         add_deps("ncurses", "zlib")