Extended the Mac support to be able to install multiple configurations in parallel (e.g. for Qt4 and Qt5).

Wed, 02 Jan 2013 16:57:17 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 02 Jan 2013 16:57:17 +0100
changeset 2306
0f020f39977b
parent 2301
cfab9cb261d2
child 2307
1acbc8feb41a

Extended the Mac support to be able to install multiple configurations in parallel (e.g. for Qt4 and Qt5).

README-MacOSX.txt file | annotate | diff | comparison | revisions
install.py file | annotate | diff | comparison | revisions
--- a/README-MacOSX.txt	Tue Jan 01 14:48:06 2013 +0100
+++ b/README-MacOSX.txt	Wed Jan 02 16:57:17 2013 +0100
@@ -43,8 +43,8 @@
 ask for a selection of sub-packages.
 
 
-2. Install Python 3.2
----------------------
+2. Install Python 3.2 or 3.3
+----------------------------
 Although Mac OS X comes with a python installation it is recommended to
 install the python package provided by the Python community. Download it
 from 
@@ -58,12 +58,16 @@
 /Library/Frameworks/Python.framework/Versions/3.2/Resources/English.lproj/Documentation/index.html
 /Applications/Python 3.2/Python Documentation.html
 
+or
 
-3. Install Qt4
---------------
+/Library/Frameworks/Python.framework/Versions/3.3/Resources/English.lproj/Documentation/index.html
+/Applications/Python 3.3/Python Documentation.html
+
+3a. Install Qt4
+---------------
 Download the Qt4 package from
 
-http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x
+http://qt-project.org/downloads
 
 After the download finished open the downloaded package and install it. The
 tools (e.g. Designer, Linguist) can be found in the location
@@ -80,6 +84,28 @@
 /Developer/Applications/Qt/translations
 
 
+3b. Install Qt5
+---------------
+Download the Qt5 package from
+
+http://qt-project.org/downloads
+
+After the download finished open the downloaded package and install it. The
+tools (e.g. Designer, Linguist) can be found in the location
+
+˜/Qt<version>/<version>/<compiler>/bin
+e.g. ˜/Qt5.0.0/5.0.0/clang_64/bin
+
+The documentation can be found in these locations
+
+˜/Qt<version>/<version>/<compiler>/qtdoc (HTML format)
+˜/Qt<version>/<version>/<compiler>/ (QtHelp format)
+
+The translation files can be found in this location
+
+˜/Qt<version>/<version>/<compiler>//translations
+
+
 4. Install QScintilla2
 ----------------------
 Download the QScintilla2 source code package from
@@ -91,10 +117,16 @@
 the Qt4 directory within the extracted folder and enter these commands in a
 terminal window
 
+Qt4:
 qmake qscintilla.pro -spec macx-g++
 make -j x (number of cores including hyper threaded ones)
 sudo make install
 
+Qt5:
+qmake qscintilla.pro
+make -j x (number of cores including hyper threaded ones)
+sudo make install
+
 
 5. Install sip
 --------------
--- a/install.py	Tue Jan 01 14:48:06 2013 +0100
+++ b/install.py	Wed Jan 02 16:57:17 2013 +0100
@@ -33,6 +33,8 @@
 progLanguages = ["Python", "Ruby"]
 sourceDir = "eric"
 configName = 'eric5config.py'
+macAppBundleName = "eric5.app"
+macPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format(sys.exec_prefix)
 
 # Define blacklisted versions of the prerequisites
 BlackLists = {
@@ -81,11 +83,19 @@
 
     @param rcode the return code passed back to the calling process.
     """
-    global progName, platBinDir, modDir, distDir, apisDir
+    global progName, platBinDir, modDir, distDir, apisDir, macAppBundleName
+    global macPythonExe
 
     print()
     print("Usage:")
-    print("    {0} [-chxz] [-a dir] [-b dir] [-d dir] [-f file] [-i dir]"\
+    if sys.platform == "darwin":
+        print("    {0} [-chxz] [-a dir] [-b dir] [-d dir] [-f file] [-i dir] [-m name] [-p python]"\
+        .format(progName))
+    elif sys.platform.startswith("win"):
+        print("    {0} [-chxz] [-a dir] [-b dir] [-d dir] [-f file]"\
+        .format(progName))
+    else:
+        print("    {0} [-chxz] [-a dir] [-b dir] [-d dir] [-f file] [-i dir]"\
         .format(progName))
     print("where:")
     print("    -h        display this help message")
@@ -102,6 +112,11 @@
     if not sys.platform.startswith("win"):
         print("    -i dir    temporary install prefix")
         print("              (default: {0})".format(distDir))
+    if sys.platform == "darwin":
+        print("    -m name   name of the Mac app bundle")
+        print("              (default: {0})".format(macAppBundleName))
+        print("    -p python name of the python executable")
+        print("              (default: {0})".format(macPythonExe))
     print("    -x        don't perform dependency checks (use on your own risk)")
     print("    -c        don't cleanup old installation first")
     print("    -z        don't compile the installed python files")
@@ -293,6 +308,8 @@
     """
     Uninstall the old eric files.
     """
+    global macAppBundleName
+    
     try:
         from eric5config import getConfig
     except ImportError:
@@ -380,8 +397,8 @@
             # delete the Mac app bundle
             if os.path.exists("/Developer/Applications/Eric5"):
                 shutil.rmtree("/Developer/Applications/Eric5")
-            if os.path.exists("/Applications/eric5.app"):
-                shutil.rmtree("/Applications/eric5.app")
+            if os.path.exists("/Applications/" + macAppBundleName):
+                shutil.rmtree("/Applications/" + macAppBundleName)
         
     except IOError as msg:
         sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg))
@@ -585,19 +602,18 @@
     @param pydir the name of the directory where the Python script will eventually
         be installed (string)
     """
-    global cfg, sourceDir
+    global cfg, sourceDir, macAppBundleName, macPythonExe
     
-    dirs = {"contents": "/Applications/eric5.app/Contents/",
-            "exe": "/Applications/eric5.app/Contents/MacOS",
-            "icns": "/Applications/eric5.app/Contents/Resources"}
+    dirs = {"contents": "/Applications/{0}/Contents/".format(macAppBundleName),
+            "exe": "/Applications/{0}/Contents/MacOS".format(macAppBundleName),
+            "icns": "/Applications/{0}/Contents/Resources".format(macAppBundleName)}
     os.makedirs(dirs["contents"])
     os.mkdir(dirs["exe"])
     os.mkdir(dirs["icns"])
     
-    starter = os.path.join(dirs["exe"], "eric")
-    os.symlink(
-        "{0}/Resources/Python.app/Contents/MacOS/Python".format(sys.exec_prefix),
-        starter)
+##    starter = os.path.join(dirs["exe"], "eric")
+##    os.symlink(macPythonExe, starter)
+    starter = "python3"
     
     wname = os.path.join(dirs["exe"], "eric5")
     path = os.getenv("PATH", "")
@@ -638,7 +654,7 @@
     <key>CFBundleInfoDictionaryVersion</key>
     <string>1.0</string>
     <key>CFBundleName</key>
-    <string>eric5</string>
+    <string>{0}</string>
     <key>CFBundlePackageType</key>
     <string>APPL</string>
     <key>CFBundleSignature</key>
@@ -647,7 +663,7 @@
     <string>1.0</string>
 </dict>
 </plist>
-'''
+'''.format(macAppBundleName.replace(".app", ""))
     )
 
 
@@ -972,7 +988,7 @@
 
     # Parse the command line.
     global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir
-    global sourceDir, configName
+    global sourceDir, configName, macAppBundleName, macPythonExe
     
     progName = os.path.basename(argv[0])
     
@@ -984,6 +1000,8 @@
     try:
         if sys.platform.startswith("win"):
             optlist, args = getopt.getopt(argv[1:], "chxza:b:d:f:")
+        elif sys.platform == "darwin":
+            optlist, args = getopt.getopt(argv[1:], "chxza:b:d:f:i:m:p:")
         else:
             optlist, args = getopt.getopt(argv[1:], "chxza:b:d:f:i:")
     except getopt.GetoptError:
@@ -1019,6 +1037,10 @@
                     exit(6)
             except:
                 cfg = {}
+        elif opt == "-m":
+            macAppBundleName = arg
+        elif opt == "-p":
+            macPythonExe = arg
     
     installFromSource = not os.path.isdir(sourceDir)
     if installFromSource:

eric ide

mercurial