From ea2e194fd4dadb5fb75ceb0f9f380ffca1b97358 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 30 Jan 2022 09:32:10 +0800 Subject: [PATCH] improve python and xcb (#961) * add bspwm * improve xcb * add version * improve to find python * fix xcb * improve bspwm * improve bspwm * remove bspwm --- packages/l/libxcb/xmake.lua | 12 +++++++----- packages/p/python/xmake.lua | 10 ++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/l/libxcb/xmake.lua b/packages/l/libxcb/xmake.lua index 101ca4b27..7f4ad4082 100644 --- a/packages/l/libxcb/xmake.lua +++ b/packages/l/libxcb/xmake.lua @@ -36,7 +36,7 @@ package("libxcb") add_versions("1.13.1", "f09a76971437780a602303170fd51b5f7474051722bc39d566a272d2c4bde1b5") add_versions("1.14", "2c7fcddd1da34d9b238c9caeda20d3bd7486456fc50b3cc6567185dbd5b0ad02") - for name, opt in pairs(components) do + for name, opt in pairs(components) do add_configs(name, {description = format("Enable %s submodule (default is %s).", name, opt.default_value), default = opt.default_value}) end @@ -50,7 +50,7 @@ package("libxcb") end on_load("linux", function(package) - for name, opt in pairs(components) do + for name, opt in pairs(components) do if opt.apt_package and package:config(name) then package:add("extsources", opt.apt_package) end @@ -64,11 +64,13 @@ package("libxcb") "--disable-silent-rules", "--enable-devel-docs=no", "--with-doxygen=no"} - + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + if package:is_plat("linux") and package:config("pic") ~= false then + table.insert(configs, "--with-pic") + end for name, opt in pairs(components) do - table.insert(configs, format("--enable-%s=%s", name, package:config(name))) + table.insert(configs, format("--enable-%s=%s", name, package:config(name) and "yes" or "no")) end - import("package.tools.autoconf").install(package, configs) end) diff --git a/packages/p/python/xmake.lua b/packages/p/python/xmake.lua index 82ff4d6d7..9b2f60026 100644 --- a/packages/p/python/xmake.lua +++ b/packages/p/python/xmake.lua @@ -72,6 +72,16 @@ package("python") package:addenv("PATH", "Scripts") end) + on_fetch(function (package, opt) + if opt.system then + local result = package:find_tool("python3", opt) + if not result then + result = package:find_tool("python", opt) + end + return result + end + end) + on_install("@windows", "@msys", "@cygwin", function (package) if package:version():ge("3.0") then os.cp("python.exe", path.join(package:installdir("bin"), "python3.exe"))