From 53e27c86b1d66e321c06b659299fd9a1dd5dc374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Thu, 17 Nov 2022 09:21:40 +0100 Subject: [PATCH] Python 3.10 requires OpenSSL 1.1.1 (#1637) * Python requires OpenSSL 1.1.1 * Update xmake.lua * Update xmake.lua --- packages/p/python/xmake.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/p/python/xmake.lua b/packages/p/python/xmake.lua index 9d1cacd1f..c182de7da 100644 --- a/packages/p/python/xmake.lua +++ b/packages/p/python/xmake.lua @@ -42,10 +42,6 @@ package("python") set_kind("binary") end - if is_host("macosx", "linux", "bsd") then - add_deps("openssl", "ca-certificates", {host = true}) - end - if is_host("linux", "bsd") then add_deps("libffi", "zlib", {host = true}) add_syslinks("util", "pthread", "dl") @@ -64,9 +60,18 @@ package("python") end) on_load("@macosx", "@linux", "@bsd", function (package) + local version = package:version() + + -- set openssl dep + if version:ge("3.10") then + -- starting with Python 3.10, Python requires OpenSSL 1.1.1 or newer + -- see https://peps.python.org/pep-0644/ + package:add("deps", "openssl >=1.1.1-a", "ca-certificates", {host = true}) + else + package:add("deps", "openssl", "ca-certificates", {host = true}) + end -- set includedirs - local version = package:version() local pyver = ("python%d.%d"):format(version:major(), version:minor()) if version:ge("3.0") and version:le("3.8") then package:add("includedirs", path.join("include", pyver .. "m"))