@@ -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 ]
0 commit comments