2
0
Эх сурвалжийг харах

update python and boost (#2010)

* add sqlcipher

* sqlcipher on windows

* update sqlchipher

* update sqlcipher

* update sqlcipher

* update sqlchiper

* update sqlcipher

* update sqlcipher

* update sqlcipher

* fixed sqlcipher

* update sqlcipher

* update sqlcipher

* update sqlcipher

* update sqlcipher

* update sqlcipher

* flatbuffers, nng 加入 cross

* update flatbuufers

* nngpp add cross; nng 补充windows下的系统链接库

* update nng

* fixed cmake on aarch64 linux

* update cmake

* update python and boost

* update boost pyver default to 3.10

* update python and boost

* remove boost1.82
fasiondog 2 жил өмнө
parent
commit
34fd43d966

+ 11 - 4
packages/b/boost/xmake.lua

@@ -37,6 +37,7 @@ package("boost")
         add_syslinks("pthread", "dl")
     end
 
+    add_configs("pyver", {description = "python version x.y, etc. 3.10", default = "3.10"})
     local libnames = {"fiber",
                       "coroutine",
                       "context",
@@ -84,9 +85,8 @@ package("boost")
                 linkname = "boost_" .. libname
             end
             if libname == "python" then
-                -- TODO maybe we need improve it, e.g. libboost_python310-mt.a
-                linkname = linkname .. "310"
-            end
+                linkname = linkname .. package:config("pyver"):gsub("%p+", "")
+            end            
             if package:config("multi") then
                 linkname = linkname .. "-mt"
             end
@@ -122,8 +122,12 @@ package("boost")
         if package:is_plat("windows") then
             package:add("defines", "BOOST_ALL_NO_LIB")
         end
+
         if package:config("python") then
-            package:add("deps", "python 3.10.x")
+            if not package:config("shared") then
+                package:add("defines", "BOOST_PYTHON_STATIC_LIB")
+            end
+            package:add("deps", "python " .. package:config("pyver") .. ".x", {configs = {headeronly = true}})
         end
     end)
 
@@ -192,6 +196,9 @@ package("boost")
         if package:config("lto") then
             table.insert(argv, "lto=on")
         end
+        if package:is_arch("aarch64", "arm+.*") then
+            table.insert(argv, "architecture=arm")
+        end
         if package:is_arch(".+64.*") then
             table.insert(argv, "address-model=64")
         else

+ 4 - 2
packages/p/python/fetch.lua

@@ -67,10 +67,12 @@ function _find_library(package, opt)
     if libpath and includepath then
         local result = {
             version = version,
-            links = libpath.link,
-            linkdirs = libpath.linkdir,
             includedirs = includepath
         }
+        if not package:config("headeronly") then
+            result.links = libpath.link
+            result.linkdirs = libpath.linkdir
+        end        
         return result
     end
 end

+ 7 - 1
packages/p/python/xmake.lua

@@ -38,6 +38,8 @@ package("python")
         add_versions("3.10.6", "848cb06a5caa85da5c45bd7a9221bb821e33fc2bdcba088c127c58fad44e6343")
     end
 
+    add_configs("headeronly", {description = "Use header only version.", default = false, type = "boolean"})
+
     if not is_plat(os.host()) or not is_arch(os.arch()) then
         set_kind("binary")
     end
@@ -84,6 +86,10 @@ package("python")
         package:addenv("PYTHONPATH", PYTHONPATH)
         package:addenv("PATH", "bin")
         package:addenv("PATH", "Scripts")
+
+        if package:config("headeronly") then
+            package:set("links", "")
+        end
     end)
 
     on_fetch("fetch")
@@ -256,7 +262,7 @@ package("python")
         os.vrun("python -c \"import pip\"")
         os.vrun("python -c \"import setuptools\"")
         os.vrun("python -c \"import wheel\"")
-        if package:kind() ~= "binary" then
+        if package:kind() ~= "binary" and not package:config("headeronly") then
             assert(package:has_cfuncs("PyModule_New", {includes = "Python.h"}))
         end
     end)