https://bugs.kde.org/show_bug.cgi?id=387201
caulier.gil...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Version Fixed In|                            |6.0.0
         Resolution|---                         |FIXED
      Latest Commit|                            |https://commits.kde.org/dig
                   |                            |ikam/2eb13d7ceab223675a86bb
                   |                            |dac0a1065b206c2954
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #14 from caulier.gil...@gmail.com ---
Maik,

Problem is now fixed with my Qt5 patch :

// -------------------------------------------------------------------------

Git commit 2eb13d7ceab223675a86bbdac0a1065b206c2954 by Gilles Caulier.
Committed on 14/08/2018 at 21:48.
Pushed by cgilles into branch 'master'.

use system() call instead QProcess

M  +6    -13   project/bundles/3rdparty/ext_qt/qt-appimage-support.patch

https://commits.kde.org/digikam/2eb13d7ceab223675a86bbdac0a1065b206c2954

diff --git a/project/bundles/3rdparty/ext_qt/qt-appimage-support.patch
b/project/bundles/3rdparty/ext_qt/qt-appimage-support.patch
index 781ed92ca8..dd6d99b250 100644
--- a/project/bundles/3rdparty/ext_qt/qt-appimage-support.patch
+++ b/project/bundles/3rdparty/ext_qt/qt-appimage-support.patch
@@ -2,7 +2,7 @@ diff --git
a/qtbase/src/platformsupport/services/genericunix/qgenericunixservice
 index cdb5d33859..5a2bd5f724 100644
 --- a/qtbase/src/platformsupport/services/genericunix/qgenericunixservices.cpp
 +++ b/qtbase/src/platformsupport/services/genericunix/qgenericunixservices.cpp
-@@ -146,7 +146,30 @@ static inline bool launch(const QString &launcher, const
QUrl &url)
+@@ -146,7 +146,23 @@ static inline bool launch(const QString &launcher, const
QUrl &url)
  #if !QT_CONFIG(process)
      const bool ok = ::system(qPrintable(command + QLatin1String(" &")));
  #else
@@ -17,20 +17,13 @@ index cdb5d33859..5a2bd5f724 100644
 +    {
 +        qDebug() << "Adjusting environment variables for AppImage bundle";
 +
-+        env.insert(QLatin1String("LD_LIBRARY_PATH"),
-+                  
env.value(QLatin1String("APPIMAGE_ORIGINAL_LD_LIBRARY_PATH")));
-+        env.insert(QLatin1String("QT_PLUGIN_PATH"),
-+                  
env.value(QLatin1String("APPIMAGE_ORIGINAL_QT_PLUGIN_PATH")));
-+        env.insert(QLatin1String("XDG_DATA_DIRS"),
-+                  
env.value(QLatin1String("APPIMAGE_ORIGINAL_XDG_DATA_DIRS")));
-+        env.insert(QLatin1String("PATH"),
-+                   env.value(QLatin1String("APPIMAGE_ORIGINAL_PATH")));
++        setenv("LD_LIBRARY_PATH",
env.value(QLatin1String("APPIMAGE_ORIGINAL_LD_LIBRARY_PATH")).toLatin1().data(),
1);
++        setenv("QT_PLUGIN_PATH", 
env.value(QLatin1String("APPIMAGE_ORIGINAL_QT_PLUGIN_PATH")).toLatin1().data(),
 1);
++        setenv("XDG_DATA_DIRS",  
env.value(QLatin1String("APPIMAGE_ORIGINAL_XDG_DATA_DIRS")).toLatin1().data(), 
 1);
++        setenv("PATH",           
env.value(QLatin1String("APPIMAGE_ORIGINAL_PATH")).toLatin1().data(),          
 1);
 +    }
 +
-+    QProcess process;
-+    process.setProcessEnvironment(env);
-+    process.setProgram(command);
-+    const bool ok = process.startDetached();
++    const bool ok = ::system(qPrintable(command + QLatin1String(" &")));
  #endif
      if (!ok)
          qWarning("Launch failed (%s)", qPrintable(command));

// -------------------------------------------------------------------------

In fact, internal QDesktopService for Unix do not support AppImage to call an
external binary. This is due to env. variable set at run time by AppImage to
relocate dynamic shared library loader to the bundle contents.

I check Qt 5.11 (in fact git/master code of Qt repository), and Qt team use
another Technic to support FlatPack through DBUS. AppImage is not yet
supported, and this must be reported to Qt bugzilla as upstream.

I don't like the DBUS way, as it give another runtime dependency to Qt which
can be fail if the query used to run a binary is not supported to the Linux
host box.

In my patch i use system() call instead QProcess, as we use Qt 5.9.6 when the
QProcess::startDetached() is a static method which don't care about the env.
variable preset before to call the method. In Qt 5.10, a new non static
QProcess::startDetached() have been introduced with a complete re-write of
internal QProcess implementation.

VoilĂ . this require 3 days of hack to understand the problem, recompile step by
step Qt5, rebuild the bundle and test (:=)))... Outch

Gilles Caulier

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to