Browse Source

Work around wrongly linked libraries of QtWebEngineProcess

Tobias Hieta 9 years ago
parent
commit
d6830ed63a
2 changed files with 11 additions and 7 deletions
  1. 10 6
      CMakeModules/CompleteBundleOSX.cmake.in
  2. 1 1
      scripts/fix-install-names.py

+ 10 - 6
CMakeModules/CompleteBundleOSX.cmake.in

@@ -1,4 +1,5 @@
 set(app "${CMAKE_INSTALL_PREFIX}/@EXE@")
+set(weprocess "${app}/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app")
 
 list(APPEND BINS "Contents/Resources/updater")
 list(APPEND BINS "Contents/Resources/@HELPER_NAME@")
@@ -13,6 +14,7 @@ endforeach(BIN ${BINS})
 set(ENV{DYLD_LIBRARY_PATH} @QTROOT@/lib:@DEPENDENCY_ROOT@/lib)
 set(ENV{DYLD_FRAMEWORK_PATH} @QTROOT@/lib:@DEPENDENCY_ROOT@/lib)
 
+# Write qt.conf in the Qt depends directory so that the Qt tools can find QML files
 set(QTCONFCONTENT "[Paths]
 Prefix=@QTROOT@
 ")
@@ -24,6 +26,13 @@ execute_process(
   WORKING_DIRECTORY @QTROOT@/bin
 )
 
+# Run the macdeploy command again to be able to fixup the linked paths for QtWebEngineProcess that
+# is deployed by the first run.
+execute_process(
+  COMMAND @QTROOT@/bin/macdeployqt ${app} -executable=${weprocess}/Contents/MacOS/QtWebEngineProcess
+  WORKING_DIRECTORY @QTROOT@/bin
+)
+
 #set(ENTITLEMENTS --entitlements @SOURCE_ROOT@/bundle/osx/Konvergo.entitlements)
 set(CODESIGN codesign ${ENTITLEMENTS} --force --sign "Developer ID Application: Plex Inc.")
 
@@ -39,12 +48,6 @@ macro(sign_binary BIN)
 endmacro(sign_binary BIN)
 
 if(@DO_SIGN@)
-
-  # we need to sign the webengine helper before the framework
-  # add --entitlements @SOURCE_ROOT@/bundle/osx/WebEngine.entitlements when we want to sandbox
-  set(WEB_PROC "${CMAKE_INSTALL_PREFIX}/@EXE@/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app")
-  sign_binary(${WEB_PROC})
-
   file(GLOB_RECURSE LIBS
     FOLLOW_SYMLINKS
     "${app}/*.dylib"
@@ -58,6 +61,7 @@ if(@DO_SIGN@)
     sign_binary(${app}/${BIN})
   endforeach(BIN ${BINS})
 
+  sign_binary(${weprocess})
   sign_binary(${app})
 
   message("Verifing signature")

+ 1 - 1
scripts/fix-install-names.py

@@ -10,7 +10,7 @@ import sys
 import shutil
 
 exts = (".dylib", ".so")
-exes = ("fc-cache", "macdeployqt", "qmake", "moc", "rcc", "qmlimportscanner")
+exes = ("fc-cache", "macdeployqt", "qmake", "moc", "rcc", "qmlimportscanner", "QtWebEngineProcess")
 
 def exec_cmd(args, env={}, supress_output=False):
     cmd = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, env = env)