aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/boost.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2020-04-01 12:06:11 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2020-04-01 20:39:46 +0300
commit9f2f27a49d9f3a56147a6b56914a925f84bed7a3 (patch)
tree60d940e9c6df8463538f959577bd14612624adfd /mesonbuild/dependencies/boost.py
parent86394132e7920c26e807d4bcae971fc26e7e9313 (diff)
downloadmeson-9f2f27a49d9f3a56147a6b56914a925f84bed7a3.zip
meson-9f2f27a49d9f3a56147a6b56914a925f84bed7a3.tar.gz
meson-9f2f27a49d9f3a56147a6b56914a925f84bed7a3.tar.bz2
boost: Fix boost_python detection on bionic (fixes #6886 #4788)
Diffstat (limited to 'mesonbuild/dependencies/boost.py')
-rw-r--r--mesonbuild/dependencies/boost.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py
index d35069e..ff82a03 100644
--- a/mesonbuild/dependencies/boost.py
+++ b/mesonbuild/dependencies/boost.py
@@ -152,6 +152,9 @@ class BoostLibraryFile():
# Process tags
tags = self.nametags[1:]
+ # Filter out the python version tag and fix modname
+ if self.is_python_lib():
+ tags = self.fix_python_name(tags)
if not tags:
return
@@ -226,6 +229,40 @@ class BoostLibraryFile():
def is_python_lib(self) -> bool:
return any([self.mod_name.startswith(x) for x in BoostLibraryFile.boost_python_libs])
+ def fix_python_name(self, tags: T.List[str]) -> T.List[str]:
+ # Handle the boost_python naming madeness.
+ # See https://github.com/mesonbuild/meson/issues/4788 for some distro
+ # specific naming variantions.
+ other_tags = [] # type: T.List[str]
+
+ # Split the current modname into the base name and the version
+ m_cur = BoostLibraryFile.reg_python_mod_split.match(self.mod_name)
+ cur_name = m_cur.group(1)
+ cur_vers = m_cur.group(2)
+
+ # Update the current version string if the new version string is longer
+ def update_vers(new_vers: str) -> None:
+ nonlocal cur_vers
+ new_vers = new_vers.replace('_', '')
+ new_vers = new_vers.replace('.', '')
+ if not new_vers.isdigit():
+ return
+ if len(new_vers) > len(cur_vers):
+ cur_vers = new_vers
+
+ for i in tags:
+ if i.startswith('py'):
+ update_vers(i[2:])
+ elif i.isdigit():
+ update_vers(i)
+ elif len(i) >= 3 and i[0].isdigit and i[2].isdigit() and i[1] == '.':
+ update_vers(i)
+ else:
+ other_tags += [i]
+
+ self.mod_name = cur_name + cur_vers
+ return other_tags
+
def mod_name_matches(self, mod_name: str) -> bool:
if self.mod_name == mod_name:
return True