Explorar o código

Libpq/windows (#7882)

* update libpq to version 17.5, use meson instead of autoconf, added windows build

* add meson and ninja as dependencies for libpq package

* fix: disable wasm

* fix: update dependencies for libpq package

* fix: update on_install function to include windows, macosx, and linux platforms

* fix: update on_install function to exclude cross-compilation

* fix: update on_install function to include specific platforms and exclude cross-compilation

* fix: update dependencies to include bsd platform for libpq package

* fix: add libintl as a dependency for libpq package

* fix: move libintl dependency to on_load function for platform-specific inclusion

* fix: refine platform checks in on_load and on_install functions for libpq package

* fix: remove flex from global dependencies and add it conditionally for mingw platform

* fix: remove flex deps when arch is i386

* fix: reorder krb5 dependency inclusion for platform-specific handling

* fix: correct dependency addition for krb5 in libpq package

* fix: refine flex dependency inclusion for specific platforms and architectures

* fix: update platform checks to use package:is_plat and package:is_arch methods

* fix: update platform checks for libpq package to ensure proper dependency handling

* fix: update platform checks in libpq package for consistency in load and install functions

* fix: add readline dependency for bsd

* fix: correct dependency addition for krb5 and readline in libpq package

* fix: remove krb5 dependency for linux and macosx in libpq package

* fix: add libedit dependency for bsd

* fix: disable readline for bsd

* fix: set libedit as preferred dependency for bsd

* fix: remove readline dependency for bsd and ensure libedit is preferred

* fix: clean up xmake.lua by removing unnecessary blank lines and organizing dependencies

* fix: add missing syslinks for windows

* fix: correct dependency declaration for libpq and remove unnecessary syslinks for windows

* fix: correct syntax error

* fix: refine platform checks in libpq package for dependency management

* fix: removed match pattern in on_load

* fix: reverts the previous removal of support for version 14.4
Arthur hai 4 semanas
pai
achega
365bac96a2
Modificáronse 1 ficheiros con 26 adicións e 16 borrados
  1. 26 16
      packages/l/libpq/xmake.lua

+ 26 - 16
packages/l/libpq/xmake.lua

@@ -6,27 +6,37 @@ package("libpq")
     add_urls("https://github.com/postgres/postgres/archive/refs/tags/REL_$(version).tar.gz", {alias = "github", version = function (version)
     add_urls("https://github.com/postgres/postgres/archive/refs/tags/REL_$(version).tar.gz", {alias = "github", version = function (version)
         return version:gsub("%.", "_")
         return version:gsub("%.", "_")
     end})
     end})
+    
+    add_versions("17.5", "476e0522af981352177c12a05295b08d2f49b35c667aecb5bae1af4807999467")
     add_versions("14.1", "14809c9f669851ab89b344a50219e85b77f3e93d9df9e255b9781d8d60fcfbc9")
     add_versions("14.1", "14809c9f669851ab89b344a50219e85b77f3e93d9df9e255b9781d8d60fcfbc9")
 
 
-    add_deps("krb5", "openssl", "zlib")
-    if is_plat("linux") then
-        add_deps("flex", "bison")
-    end
-
-    on_install("macosx", "linux", function (package)
-        local configs = {"--with-openssl", "--without-readline"}
-        table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
-        table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
-        if package:is_plat("macosx") then
-            table.insert(configs, "--with-gssapi")
+    add_deps("pkgconf", "meson", "ninja", "openssl", "zlib", "bison")
+    
+    on_load(function (package)
+        if package:is_plat("macosx", "windows") then
+            package:add("deps", "libintl")
         end
         end
-        if package:debug() then
-            table.insert(configs, "--enable-debug")
+
+        if package:is_plat("macosx", "linux", "bsd", "windows") and package:is_arch("i386") ~= false then
+            package:add("deps", "flex")
+        end
+
+        if package:is_plat("bsd") then
+            package:add("deps", "libedit")
         end
         end
-        if package:config("pic") ~= false then
-            table.insert(configs, "--with-pic")
+    end)
+
+    on_install("windows|!arm64 or macosx|!arm64 or linux|!arm64 or bsd|!arm64", function (package)
+        local configs = {"-Dssl=openssl", "-Dzlib=enabled"}
+
+        table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
+
+        if package:is_plat("bsd") then
+            table.insert(configs, "-Dreadline=disabled")
+            table.insert(configs, "-Dlibedit_preferred=true")
         end
         end
-        import("package.tools.autoconf").install(package, configs, {packagedeps = {"openssl", "zlib"}})
+
+        import("package.tools.meson").install(package, configs)
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)