From efc41b6079640a6c5661fcb39e8ae8872183a618 Mon Sep 17 00:00:00 2001 From: Valentin Niess Date: Fri, 11 Oct 2024 11:44:50 +0200 Subject: [PATCH] Alternative packages location --- python_appimage/appimage/relocate.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/python_appimage/appimage/relocate.py b/python_appimage/appimage/relocate.py index 163f383..78157c6 100644 --- a/python_appimage/appimage/relocate.py +++ b/python_appimage/appimage/relocate.py @@ -202,9 +202,21 @@ def relocate_python(python=None, appdir=None): PYTHON_LIB = PYTHON_PREFIX + '/lib' PYTHON_PKG = PYTHON_LIB + '/' + PYTHON_X_Y + if not os.path.exists(HOST_PKG): + paths = glob.glob(HOST_PKG + '*') + if paths: + HOST_PKG = paths[0] + PYTHON_PKG = PYTHON_LIB + '/' + os.path.basename(HOST_PKG) + else: + raise ValueError('could not find {0:}'.format(HOST_PKG)) + if not os.path.exists(HOST_INC): - HOST_INC += 'm' - PYTHON_INC += 'm' + paths = glob.glob(HOST_INC + '*') + if paths: + HOST_INC = paths[0] + PYTHON_INC = PYTHON_INC + '/' + os.path.basename(HOST_INC) + else: + raise ValueError('could not find {0:}'.format(HOST_INC)) # Copy the running Python's install