Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.

Mon, 17 Aug 2015 13:17:39 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 17 Aug 2015 13:17:39 +0200
changeset 4374
627e3d0b4ba1
parent 4371
e09838aa0a9f
child 4376
7847a37ee71d

Changed the installer to create a Mac app bundle script containg a DYLD_FRAMEWORK_PATH line as recommended by PyQt for Qt 5.5.0 and newer.

install.py file | annotate | diff | comparison | revisions
--- a/install.py	Mon Aug 17 12:16:43 2015 +0200
+++ b/install.py	Mon Aug 17 13:17:39 2015 +0200
@@ -847,7 +847,8 @@
     @param pydir the name of the directory where the Python script will
         eventually be installed (string)
     """
-    global cfg, sourceDir, macAppBundleName, macPythonExe, macAppBundlePath
+    global cfg, sourceDir, macAppBundleName, macPythonExe, macAppBundlePath, \
+        pyqtVariant
     
     dirs = {
         "contents": "{0}/{1}/Contents/".format(
@@ -868,23 +869,36 @@
         starter = "python{0}".format(sys.version_info.major)
     
     wname = os.path.join(dirs["exe"], "eric6")
+    
+    # determine entry for DYLD_FRAMEWORK_PATH
+    dyldLine = ""
+    try:
+        if pyqtVariant == "PyQt4":
+            from PyQt4.QtCore import QLibraryInfo
+        else:
+            from PyQt5.QtCore import QLibraryInfo
+        qtLibraryDir = QLibraryInfo.location(QLibraryInfo.LibrariesPath)
+    except ImportError:
+        qtLibraryDir = ""
+    if qtLibraryDir:
+        dyldLine = "DYLD_FRAMEWORK_PATH={0}\n".format(qtLibraryDir)
+    
+    # determine entry for PATH
+    pathLine = ""
     path = os.getenv("PATH", "")
     if path:
         pybin = os.path.join(sys.exec_prefix, "bin")
         pathlist = path.split(os.pathsep)
         if pybin not in pathlist:
-            pathlist.insert(0, pybin)
-        path = os.pathsep.join(pathlist)
-        wrapper = ('''#!/bin/sh\n'''
-                   '''\n'''
-                   '''PATH={0}\n'''
-                   '''exec "{1}" "{2}/{3}.py" "$@"\n'''
-                   .format(path, starter, pydir, "eric6"))
-    else:
-        wrapper = ('''#!/bin/sh\n'''
-                   '''\n'''
-                   '''exec "{0}" "{1}/{2}.py" "$@"\n'''
-                   .format(starter, pydir, "eric6"))
+            pathLine = "PATH={0}{1}{2}\n".format(pybin, os.pathsep, path)
+        else:
+            pathLine = "PATH={0}\n".format(path)
+    wrapper = ('''#!/bin/sh\n'''
+               '''\n'''
+               '''{0}'''
+               '''{1}'''
+               '''exec "{2}" "{3}/{4}.py" "$@"\n'''
+               .format(pathLine, dyldLine, starter, pydir, "eric6"))
     copyToFile(wname, wrapper)
     os.chmod(wname, 0o755)
     

eric ide

mercurial