Kaynağa Gözat

libxml2: set some configs default true (#5289)

star9029 10 ay önce
ebeveyn
işleme
6b600a1a0e

+ 0 - 4
packages/a/aravis/xmake.lua

@@ -49,10 +49,6 @@ package("aravis")
         if libusb and not libusb:is_system() then
             io.replace("meson.build", "libusb-1.0", "libusb", {plain = true})
         end
-        local libxml2 = package:dep("libxml2")
-        if not libxml2:is_system() then
-            io.replace("meson.build", "libxml-2.0", "libxml2", {plain = true})
-        end
 
         local configs = {"-Dviewer=disabled", "-Dtests=false"}
         table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))

+ 32 - 32
packages/l/libxml2/configs.lua

@@ -1,37 +1,37 @@
 local libxml2_configs = {
-    catalog  = "Add the Catalog support",
-    -- debug    = "Add the debugging module",
-    html     = "Add the HTML support",
-    http     = "Add the HTTP support",
-    iconv    = "Add ICONV support",
-    icu      = "Add ICU support",
-    iso8859x = "Add ISO8859X support if no iconv",
-    legacy   = "Add deprecated APIs for compatibility",
-    lzma     = "Use liblzma",
-    modules  = "Add the dynamic modules support",
-    output   = "Add the serialization support",
-    pattern  = "Add the xmlPattern selection interface",
-    programs = "Build programs",
-    push     = "Add the PUSH parser interfaces",
-    python   = "Build Python bindings",
-    readline = "readline support for xmllint shell",
-    regexps  = "Add Regular Expressions support",
-    sax1     = "Add the older SAX1 interface",
-    threads  = "Add multithread support",
-    tls      = "Enable thread-local storage",
-    valid    = "Add the DTD validation support",
-    xpath    = "Add the XPATH support",
-    zlib     = "Use libz",
+    catalog      = {"Add the Catalog support",                true },
+    -- debug        = {"Add the debugging module",               true },
+    html         = {"Add the HTML support",                   true },
+    http         = {"Add the HTTP support",                   false},
+    iconv        = {"Add ICONV support",                      false},
+    icu          = {"Add ICU support",                        false},
+    iso8859x     = {"Add ISO8859X support if no iconv",       true },
+    legacy       = {"Add deprecated APIs for compatibility",  false},
+    lzma         = {"Use liblzma",                            false},
+    modules      = {"Add the dynamic modules support",        true },
+    output       = {"Add the serialization support",          true },
+    pattern      = {"Add the xmlPattern selection interface", true },
+    programs     = {"Build programs",                         false},
+    push         = {"Add the PUSH parser interfaces",         true },
+    python       = {"Build Python bindings",                  false},
+    readline     = {"readline support for xmllint shell",     false},
+    regexps      = {"Add Regular Expressions support",        true },
+    sax1         = {"Add the older SAX1 interface",           true },
+    threads      = {"Add multithread support",                true },
+    tls          = {"Enable thread-local storage",            false},
+    valid        = {"Add the DTD validation support",         true },
+    xpath        = {"Add the XPATH support",                  true },
+    zlib         = {"Use libz",                               false},
 
-    c14n = "Add the Canonicalization support",
-    history = "history support for xmllint shell",
-    reader = "Add the xmlReader parsing interface",
-    schemas = "Add Relax-NG and Schemas support",
-    schematron = "Add Schematron support",
-    thread_alloc = "Add per-thread malloc hooks",
-    writer = "Add the xmlWriter saving interface",
-    xinclude = "Add the XInclude support",
-    xptr = "Add the XPointer support",
+    c14n         = {"Add the Canonicalization support",    true },
+    history      = {"history support for xmllint shell",   false},
+    reader       = {"Add the xmlReader parsing interface", true },
+    schemas      = {"Add Relax-NG and Schemas support",    true },
+    schematron   = {"Add Schematron support",              true },
+    thread_alloc = {"Add per-thread malloc hooks",         false},
+    writer       = {"Add the xmlWriter saving interface",  true },
+    xinclude     = {"Add the XInclude support",            true },
+    xptr         = {"Add the XPointer support",            true },
 }
 
 function get_libxml2_configs()

+ 6 - 1
packages/l/libxml2/xmake.lua

@@ -14,7 +14,7 @@ package("libxml2")
 
     includes(path.join(os.scriptdir(), "configs.lua"))
     for name, desc in pairs(get_libxml2_configs()) do
-        add_configs(name, {description = desc, default = false, type = "boolean"})
+        add_configs(name, {description = desc[1], default = desc[2], type = "boolean"})
     end
     add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
     add_configs("all", {description = "Enable all configs, exclude python", default = false, type = "boolean"})
@@ -104,6 +104,11 @@ package("libxml2")
             opt.cxflags = "-DLZMA_API_STATIC"
         end
         import("package.tools.cmake").install(package, configs, opt)
+        if package:is_plat("windows") then
+            local libfiles = os.files(package:installdir("lib/*xml2*.lib"))[1]
+            local pc = package:installdir("lib/pkgconfig/libxml-2.0.pc")
+            io.replace(pc, "-lxml2", "-l" .. path.basename(libfiles), {plain = true})
+        end
     end)
 
     on_test(function (package)