diff --git a/python_appimage/appimage/__init__.py b/python_appimage/appimage/__init__.py index eeeee14..f976473 100644 --- a/python_appimage/appimage/__init__.py +++ b/python_appimage/appimage/__init__.py @@ -1,6 +1,7 @@ from .build import build_appimage -from .relocate import patch_binary, relocate_python, tcltk_env_string +from .relocate import cert_file_env_string, patch_binary, relocate_python, \ + tcltk_env_string -__all__ = ['build_appimage', 'patch_binary', 'relocate_python', - 'tcltk_env_string'] +__all__ = ['build_appimage', 'cert_file_env_string', 'patch_binary', + 'relocate_python', 'tcltk_env_string'] diff --git a/python_appimage/appimage/relocate.py b/python_appimage/appimage/relocate.py index 5331578..cf39ea5 100644 --- a/python_appimage/appimage/relocate.py +++ b/python_appimage/appimage/relocate.py @@ -12,7 +12,8 @@ from ..utils.system import ldd, system from ..utils.template import copy_template, load_template -__all__ = ["patch_binary", "relocate_python", "tcltk_env_string"] +__all__ = ["cert_file_env_string", "patch_binary", "relocate_python", + "tcltk_env_string"] def _copy_template(name, destination, **kwargs): diff --git a/python_appimage/commands/build/app.py b/python_appimage/commands/build/app.py index 8c9add9..9c7f591 100644 --- a/python_appimage/commands/build/app.py +++ b/python_appimage/commands/build/app.py @@ -7,7 +7,7 @@ import shutil import stat import struct -from ...appimage import build_appimage, tcltk_env_string +from ...appimage import build_appimage, cert_file_env_string, tcltk_env_string from ...utils.compat import decode from ...utils.deps import PREFIX from ...utils.fs import copy_file, make_tree, remove_file, remove_tree @@ -256,9 +256,13 @@ def execute(appdir, name=None, python_version=None, linux_tag=None, entrypoint = load_template(entrypoint_path, **dictionary) python_pkg = 'AppDir/opt/python{0:}/lib/python{0:}'.format( python_version) + cert_file = '/opt/_internal/certs.pem' + if not os.path.exists('AppDir' + cert_file): + cert_file = None dictionary = {'entrypoint': entrypoint, 'shebang': shebang, - 'tcltk-env': tcltk_env_string(python_pkg)} + 'tcltk-env': tcltk_env_string(python_pkg), + 'cert-file': cert_file_env_string(cert_file)} copy_template(PREFIX + '/data/apprun.sh', 'AppDir/AppRun', **dictionary)