Skip to content

Commit e910c9c

Browse files
committed
libxml2
1 parent 49dcefe commit e910c9c

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

packages/l/libxml2/configs.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ local libxml2_configs = {
44
html = {"Add the HTML support", true },
55
http = {"Add the HTTP support", false},
66
iconv = {"Add ICONV support", true },
7-
icu = {"Add ICU support", true },
7+
icu = {"Add ICU support", false},
88
iso8859x = {"Add ISO8859X support if no iconv", true },
99
legacy = {"Add deprecated APIs for compatibility", false},
10-
lzma = {"Use liblzma", true },
10+
lzma = {"Use liblzma", false},
1111
modules = {"Add the dynamic modules support", true },
1212
output = {"Add the serialization support", true },
1313
pattern = {"Add the xmlPattern selection interface", true },

packages/l/libxml2/xmake.lua

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ package("libxml2")
4848
end
4949

5050
on_load(function (package)
51+
if not (package:is_plat("android") and is_subhost("windows")) then
52+
package:config_set("lzma", true)
53+
end
54+
if not package:is_plat("wasm", "iphoneos", "android") or (package:is_plat("android") and not is_subhost("windows")) then
55+
package:config_set("icu", true)
56+
end
5157
if package:config("all") then
5258
for name, _ in pairs(import("configs").get_libxml2_configs()) do
5359
if name ~= "python" then
@@ -77,7 +83,7 @@ package("libxml2")
7783
package:add("deps", "libiconv")
7884
end
7985
if package:config("icu") then
80-
package:add("deps", "icu4c")
86+
package:add("deps", "icu4c", {configs = {shared = package:config("shared")}})
8187
end
8288
if package:config("lzma") then
8389
package:add("deps", "xz")
@@ -139,10 +145,10 @@ package("libxml2")
139145
if lzma and not lzma:config("shared") then
140146
table.insert(cxflags, "-DLZMA_API_STATIC")
141147
end
142-
import("package.tools.cmake")
143-
local envs = cmake.buildenvs(package, {cxflags = cxflags, shflags = shflags})
144-
utils.dump(envs)
145-
cmake.install(package, configs, {cxflags = cxflags, shflags = shflags})
148+
utils.dump(cxflags, shflags)
149+
import("package.tools.cmake").install(package, configs, {cxflags = cxflags, shflags = shflags
150+
--, packagedeps = {"libiconv", "xz", "zlib"}
151+
})
146152

147153
if package:is_plat("windows") then
148154
local libfiles = os.files(package:installdir("lib/*xml2*.lib"))[1]

packages/x/xz/xmake.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ package("xz")
1010
add_versions("5.2.10", "eb7a3b2623c9d0135da70ca12808a214be9c019132baaa61c9e1d198d1d9ded3")
1111
add_versions("5.4.1", "e4b0f81582efa155ccf27bb88275254a429d44968e488fc94b806f2a61cd3e22")
1212

13+
if is_plat("wasm") then
14+
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
15+
end
16+
1317
on_load(function (package)
1418
if package:is_plat("windows") and not package:config("shared") then
1519
package:add("defines", "LZMA_API_STATIC")
1620
end
1721
end)
1822

19-
on_install("windows", "mingw@windows,msys", function (package)
23+
on_install("windows", "mingw@windows", function (package)
2024
io.writefile("xmake.lua", [[
2125
add_rules("mode.release", "mode.debug")
2226
target("lzma")
@@ -51,7 +55,7 @@ package("xz")
5155
import("package.tools.xmake").install(package)
5256
end)
5357

54-
on_install("macosx", "linux", "mingw@linux,macosx", function (package)
58+
on_install("@!windows", function (package)
5559
local configs = {"--disable-dependency-tracking", "--disable-silent-rules"}
5660
if package:debug() then
5761
table.insert(configs, "--enable-debug")

0 commit comments

Comments
 (0)