11project (' wixl-standalone' , ' c' , ' vala' ,
22 version : ' 0.103' ,
3- meson_version : ' >= 0.62 ' ,
3+ meson_version : ' >= 0.64 ' ,
44 default_options : [
55 ' default_library=static' ,
66 ' prefer_static=true' ,
@@ -14,9 +14,112 @@ gnome = import('gnome')
1414glib = dependency (' glib-2.0' , version : ' >= 2.12' , static : true )
1515gobject = dependency (' gobject-2.0' , version : ' >= 0.9.4' , static : true )
1616gio = dependency (' gio-2.0' , version : ' >= 2.14' , static : true )
17- libxml = dependency (' libxml-2.0' , version : ' >= 2.7' , static : true )
1817zlib = dependency (' zlib' , static : true )
1918
19+ # --- libxml2 (static, built from source) ---
20+ cc = meson .get_compiler(' c' )
21+
22+ xml2_version_config = configuration_data ()
23+ xml2_version_config.set(' VERSION' , ' 2.16.0' )
24+ xml2_version_config.set(' LIBXML_VERSION_NUMBER' , ' 21600' )
25+ xml2_version_config.set(' LIBXML_VERSION_EXTRA' , '' )
26+ xml2_version_config.set(' WITH_THREADS' , 1 )
27+ xml2_version_config.set(' WITH_THREAD_ALLOC' , 0 )
28+ xml2_version_config.set(' WITH_OUTPUT' , 1 )
29+ xml2_version_config.set(' WITH_PUSH' , 1 )
30+ xml2_version_config.set(' WITH_READER' , 0 )
31+ xml2_version_config.set(' WITH_PATTERN' , 0 )
32+ xml2_version_config.set(' WITH_WRITER' , 0 )
33+ xml2_version_config.set(' WITH_SAX1' , 0 )
34+ xml2_version_config.set(' WITH_HTTP' , 0 )
35+ xml2_version_config.set(' WITH_VALID' , 1 )
36+ xml2_version_config.set(' WITH_HTML' , 0 )
37+ xml2_version_config.set(' WITH_C14N' , 0 )
38+ xml2_version_config.set(' WITH_CATALOG' , 0 )
39+ xml2_version_config.set(' WITH_WINPATH' , host_machine .system() == ' windows' ? 1 : 0 )
40+ xml2_version_config.set(' WITH_XPATH' , 0 )
41+ xml2_version_config.set(' WITH_XPTR' , 0 )
42+ xml2_version_config.set(' WITH_XINCLUDE' , 0 )
43+ xml2_version_config.set(' WITH_ICONV' , 1 )
44+ xml2_version_config.set(' WITH_ICU' , 0 )
45+ xml2_version_config.set(' WITH_ISO8859X' , 1 )
46+ xml2_version_config.set(' WITH_DEBUG' , 0 )
47+ xml2_version_config.set(' WITH_REGEXPS' , 0 )
48+ xml2_version_config.set(' WITH_RELAXNG' , 0 )
49+ xml2_version_config.set(' WITH_SCHEMAS' , 0 )
50+ xml2_version_config.set(' WITH_SCHEMATRON' , 0 )
51+ xml2_version_config.set(' WITH_MODULES' , 0 )
52+ xml2_version_config.set(' WITH_ZLIB' , 1 )
53+ xml2_version_config.set(' MODULE_EXTENSION' , '' )
54+
55+ xml2_version_h = configure_file (
56+ input : ' libxml2/include/libxml/xmlversion.h.in' ,
57+ output : ' libxml/xmlversion.h' ,
58+ configuration : xml2_version_config,
59+ )
60+
61+ xml2_config = configuration_data ()
62+ xml2_config.set(' HAVE_STDINT_H' , 1 )
63+ xml2_config.set01(' HAVE_DECL_GETENTROPY' , cc.has_function(' getentropy' , prefix : ' #include <sys/random.h>' ))
64+ xml2_config.set01(' HAVE_DECL_GLOB' , cc.has_function(' glob' , prefix : ' #include <glob.h>' ))
65+ xml2_config.set01(' HAVE_DECL_MMAP' , cc.has_function(' mmap' , prefix : ' #include <sys/mman.h>' ))
66+ xml2_config.set(' HAVE_FUNC_ATTRIBUTE_DESTRUCTOR' , cc.compiles(' void __attribute__((destructor)) f(void) {} int main(void) { return 0; }' ) ? 1 : false )
67+ xml2_config.set(' HAVE_DLOPEN' , cc.has_function(' dlopen' ) ? 1 : false )
68+ xml2_config.set(' XML_THREAD_LOCAL' , ' _Thread_local' )
69+
70+ xml2_config_h = configure_file (
71+ output : ' xml2-config.h' ,
72+ configuration : xml2_config,
73+ )
74+
75+ xml2_inc_dirs = include_directories (
76+ ' libxml2' ,
77+ ' libxml2/include' ,
78+ )
79+
80+ libxml2_sources = files (
81+ ' libxml2/buf.c' ,
82+ ' libxml2/chvalid.c' ,
83+ ' libxml2/dict.c' ,
84+ ' libxml2/encoding.c' ,
85+ ' libxml2/entities.c' ,
86+ ' libxml2/error.c' ,
87+ ' libxml2/globals.c' ,
88+ ' libxml2/hash.c' ,
89+ ' libxml2/list.c' ,
90+ ' libxml2/parser.c' ,
91+ ' libxml2/parserInternals.c' ,
92+ ' libxml2/SAX2.c' ,
93+ ' libxml2/threads.c' ,
94+ ' libxml2/tree.c' ,
95+ ' libxml2/uri.c' ,
96+ ' libxml2/valid.c' ,
97+ ' libxml2/xmlIO.c' ,
98+ ' libxml2/xmlmemory.c' ,
99+ ' libxml2/xmlstring.c' ,
100+ ' libxml2/xmlsave.c' ,
101+ )
102+
103+ libxml2_deps = [zlib]
104+
105+ libxml2 = static_library (' xml2' ,
106+ libxml2_sources,
107+ xml2_config_h,
108+ xml2_version_h,
109+ include_directories : xml2_inc_dirs,
110+ dependencies : libxml2_deps,
111+ c_args : [
112+ ' -include' , meson .project_build_root() / ' xml2-config.h' ,
113+ ],
114+ )
115+
116+ libxml = declare_dependency (
117+ link_with : libxml2,
118+ include_directories : xml2_inc_dirs,
119+ dependencies : libxml2_deps,
120+ sources : xml2_version_h,
121+ )
122+
20123add_project_arguments (' -w' , language : ' c' )
21124
22125if host_machine .system() == ' windows'
@@ -252,7 +355,6 @@ libmsi_dep = declare_dependency(
252355
253356# --- Platform-specific dependencies and link args ---
254357platform_link_deps = []
255- platform_extra_deps = []
256358
257359if host_machine .system() == ' linux'
258360 libeconf = static_library (' econf' ,
@@ -325,7 +427,7 @@ wixl = executable('wixl',
325427 c_args : [' -include' , meson .project_build_root() / ' config.h' ],
326428 include_directories : [inc_dirs, gcab_inc_dirs],
327429 link_with : [libcommon] + platform_link_deps,
328- dependencies : [libmsi_dep, libgcab_dep, glib, gio, libxml] + platform_extra_deps ,
430+ dependencies : [libmsi_dep, libgcab_dep, glib, gio, libxml],
329431 link_args : platform_link_args,
330432 install : true ,
331433)
0 commit comments