diff --git a/python_appimage/appimage/relocate.py b/python_appimage/appimage/relocate.py index ef27f58..9460b45 100644 --- a/python_appimage/appimage/relocate.py +++ b/python_appimage/appimage/relocate.py @@ -268,6 +268,14 @@ def relocate_python(python=None, appdir=None): if not tkpath: raise ValueError('could not find ' + tkpath) copy_tree(tkpath, tcltkdir + '/tk' + tk_version) + tcltk_env = ''' +# Export TCl/Tk +export TCL_LIBRARY="${{APPDIR}}/usr/share/tcltk/tcl{tk_version:}" +export TK_LIBRARY="${{APPDIR}}/usr/share/tcltk/tk{tk_version:}" +export TKPATH="${{TK_LIBRARY}}" +'''.format(tk_version=tk_version) + else: + tcltk_env = '' # Bundle the entry point @@ -276,7 +284,8 @@ def relocate_python(python=None, appdir=None): log('INSTALL', 'AppRun') entrypoint_path = PREFIX + '/data/entrypoint.sh' entrypoint = load_template(entrypoint_path, python=PYTHON_X_Y) - _copy_template('apprun.sh', apprun, entrypoint=entrypoint) + dictionary = {'entrypoint': entrypoint, 'tcltk-env': tcltk_env} + _copy_template('apprun.sh', apprun, **dictionary) # Bundle the desktop file diff --git a/python_appimage/data/apprun.sh b/python_appimage/data/apprun.sh index 41f0518..af416de 100755 --- a/python_appimage/data/apprun.sh +++ b/python_appimage/data/apprun.sh @@ -4,11 +4,6 @@ self="$(readlink -f -- $0)" here="${self%/*}" APPDIR="${APPDIR:-${here}}" - -# Export TCl/Tk -export TCL_LIBRARY="${APPDIR}/usr/share/tcltk/tcl{{ tcl-version }}" -export TK_LIBRARY="${APPDIR}/usr/share/tcltk/tk{{ tk-version }}" -export TKPATH="${TK_LIBRARY}" - +{{ tcltk-env }} # Call the entry point {{ entrypoint }}