Przeglądaj źródła

Patch TCl/Tk export

Valentin Niess 5 lat temu
rodzic
commit
5552c1f7cb

+ 10 - 1
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

+ 1 - 6
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 }}