AppImage improvements and fixes

- No need to build manually the olm python 3 bindings, pip does it
- make clean in mirage dir if possible, since having build/ files from a
  compiling that happened from another distro can make the process fail
- Save linuxdeployqt and appimagetools outside of the mirage repo
- Lint the AppDir with the script from pkg2appimage
- From python, restore LD_LIBRARY_PATH, PYTHONHOME and PYTHONUSERBASE to
  their original values. The AppRun laucher overwrites them to properly
  launch the program, but it affects external programs too launched e.g.
  when user clicks a link.
This commit is contained in:
miruka
2020-03-18 19:12:38 -04:00
parent 2f46656827
commit 4ab25ada43
3 changed files with 65 additions and 24 deletions

View File

@@ -8,6 +8,7 @@
import asyncio
import logging as log
import os
import signal
import traceback
from concurrent.futures import Future
@@ -126,6 +127,16 @@ class QMLBridge:
remote_pdb.RemotePdb("127.0.0.1", 4444).set_trace()
# The AppImage AppRun script overwrites some environment path variables to
# correctly work, and sets RESTORE_<name> equivalents with the original values.
# If the app is launched from an AppImage, now restore the original values
# to prevent problems like QML Qt.openUrlExternally() failing because
# the external launched program is affected by our AppImage-specific variables.
for var in ("LD_LIBRARY_PATH", "PYTHONHOME", "PYTHONUSERBASE"):
if f"RESTORE_{var}" in os.environ:
os.environ[var] = os.environ[f"RESTORE_{var}"]
# Make CTRL-C work again
try:
signal.signal(signal.SIGINT, signal.SIG_DFL)