2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-29 05:17:59 +00:00

Merge Fix setuptools version detection in buildpath.py

libraries/libapparmor/swig/python/test/buildpath.py:
The changes introduced in
cc7f549665
targetted a wrong setuptools version (61.2).
The change in build directory naming has been introduced with 62.0.

Fixes #259 
Fixes #39

Closes #39 and #259
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/904
Approved-by: Georgia Garcia <georgia.garcia@canonical.com>
Merged-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
Georgia Garcia 2022-08-03 17:21:50 +00:00
commit a555ccd9f4
2 changed files with 6 additions and 3 deletions

View File

@ -1,9 +1,12 @@
#!/usr/bin/python3 #!/usr/bin/python3
# the build path has changed in setuptools 61.2 # the build path has changed in setuptools 62.1:
# https://github.com/pypa/setuptools/commit/1c23f5e1e4b18b50081cbabb2dea22bf345f5894
import sys import sys
import sysconfig import sysconfig
import setuptools import setuptools
if tuple(map(int,setuptools.__version__.split("."))) >= (61, 2):
if tuple(map(int, setuptools.__version__.split("."))) >= (62, 1):
identifier = sys.implementation.cache_tag identifier = sys.implementation.cache_tag
else: else:
identifier = "%d.%d" % sys.version_info[:2] identifier = "%d.%d" % sys.version_info[:2]

View File

@ -41,7 +41,7 @@ ifdef USE_SYSTEM
LOGPROF?=aa-logprof LOGPROF?=aa-logprof
else else
# PYTHON_DIST_BUILD_PATH based on libapparmor/swig/python/test/Makefile.am # PYTHON_DIST_BUILD_PATH based on libapparmor/swig/python/test/Makefile.am
PYTHON_DIST_BUILD_PATH = ../libraries/libapparmor/swig/python/build/$$($(PYTHON) -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))") PYTHON_DIST_BUILD_PATH = ../libraries/libapparmor/swig/python/build/$$($(PYTHON) ../libraries/libapparmor/swig/python/test/buildpath.py)
LIBAPPARMOR_PATH=../libraries/libapparmor/src/.libs/ LIBAPPARMOR_PATH=../libraries/libapparmor/src/.libs/
LD_LIBRARY_PATH=$(LIBAPPARMOR_PATH):$(PYTHON_DIST_BUILD_PATH) LD_LIBRARY_PATH=$(LIBAPPARMOR_PATH):$(PYTHON_DIST_BUILD_PATH)
PYTHONPATH=../utils/:$(PYTHON_DIST_BUILD_PATH) PYTHONPATH=../utils/:$(PYTHON_DIST_BUILD_PATH)