From 1aa97f840fa1acd94b71373b146699cefec3e0fb Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 6 Dec 2021 22:22:47 +0100 Subject: [PATCH] fix python version comparison Origin: upstream, https://github.com/arvidn/libtorrent/commit/af60b20d44f5ec465bcd5b50d2a79a5ee5ae6ffb Bug: https://github.com/arvidn/libtorrent/issues/6584 Reviewed-By: Sergio Durigan Junior Gbp-Pq: Name fix-python-version-comparison.patch --- bindings/python/Jamfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/bindings/python/Jamfile b/bindings/python/Jamfile index 2da82a1..c5d8f6a 100644 --- a/bindings/python/Jamfile +++ b/bindings/python/Jamfile @@ -85,6 +85,8 @@ else /usr/sfw/include ; + import version ; + rule boost_python_version ( name : type ? : properties * ) { # examples of names for the boost_python library: @@ -110,14 +112,18 @@ else # debian jessie (1.55.0): libboost_python-py34.so.1.55.0 # boost Jamfile: libboost_python38.so.1.73.0 - local py-version = [ $(properties).get ] ; - + local py-version-str = [ $(properties).get ] ; + local py-version = "" ; local infix = "" ; - if $(py-version) < 3.7 && [ $(properties).get ] = linux - { - infix = "-py" ; + if $(py-version-str) { + py-version = [ SPLIT_BY_CHARACTERS $(py-version-str) : "." ] ; + + if [ version.version-less $(py-version) : 3 7 ] && [ $(properties).get ] = linux + { + infix = "-py" ; + } } - local boost-python-lib = "boost_python" $(infix) [ SPLIT_BY_CHARACTERS $(py-version) : "." ] ; + local boost-python-lib = "boost_python" $(infix) $(py-version) ; if $(type) in SEARCHED_LIB { -- 2.30.2