1177 eventually be installed |
1177 eventually be installed |
1178 @type str |
1178 @type str |
1179 """ |
1179 """ |
1180 global cfg, macAppBundleName, macPythonExe, macAppBundlePath, pyqtVariant |
1180 global cfg, macAppBundleName, macPythonExe, macAppBundlePath, pyqtVariant |
1181 |
1181 |
1182 dirs = { |
1182 directories = { |
1183 "contents": "{0}/{1}/Contents/".format( |
1183 "contents": "{0}/{1}/Contents/".format( |
1184 macAppBundlePath, macAppBundleName), |
1184 macAppBundlePath, macAppBundleName), |
1185 "exe": "{0}/{1}/Contents/MacOS".format( |
1185 "exe": "{0}/{1}/Contents/MacOS".format( |
1186 macAppBundlePath, macAppBundleName), |
1186 macAppBundlePath, macAppBundleName), |
1187 "icns": "{0}/{1}/Contents/Resources".format( |
1187 "icns": "{0}/{1}/Contents/Resources".format( |
1188 macAppBundlePath, macAppBundleName) |
1188 macAppBundlePath, macAppBundleName) |
1189 } |
1189 } |
1190 os.makedirs(dirs["contents"]) |
1190 for directory in directories: |
1191 os.makedirs(dirs["exe"]) |
1191 if not os.path.exists(directory): |
1192 os.makedirs(dirs["icns"]) |
1192 os.makedirs(directory) |
1193 |
1193 |
1194 if macPythonExe == defaultMacPythonExe: |
1194 if macPythonExe == defaultMacPythonExe: |
1195 starter = os.path.join(dirs["exe"], "eric") |
1195 starter = os.path.join(directories["exe"], "eric") |
1196 os.symlink(macPythonExe, starter) |
1196 os.symlink(macPythonExe, starter) |
1197 else: |
1197 else: |
1198 starter = "python{0}".format(sys.version_info.major) |
1198 starter = "python{0}".format(sys.version_info.major) |
1199 |
1199 |
1200 wname = os.path.join(dirs["exe"], "eric6") |
1200 wname = os.path.join(directories["exe"], "eric6") |
1201 |
1201 |
1202 # determine entry for DYLD_FRAMEWORK_PATH |
1202 # determine entry for DYLD_FRAMEWORK_PATH |
1203 dyldLine = "" |
1203 dyldLine = "" |
1204 try: |
1204 try: |
1205 if pyqtVariant == "PyQt4": |
1205 if pyqtVariant == "PyQt4": |
1233 .format(pathLine, dyldLine, starter, pydir, "eric6")) |
1233 .format(pathLine, dyldLine, starter, pydir, "eric6")) |
1234 copyToFile(wname, wrapper) |
1234 copyToFile(wname, wrapper) |
1235 os.chmod(wname, 0o755) |
1235 os.chmod(wname, 0o755) |
1236 |
1236 |
1237 shutilCopy(os.path.join(eric6SourceDir, "pixmaps", "eric_2.icns"), |
1237 shutilCopy(os.path.join(eric6SourceDir, "pixmaps", "eric_2.icns"), |
1238 os.path.join(dirs["icns"], "eric.icns")) |
1238 os.path.join(directories["icns"], "eric.icns")) |
1239 |
1239 |
1240 if os.path.exists(os.path.join("eric", "eric6", "UI", "Info.py")): |
1240 if os.path.exists(os.path.join("eric", "eric6", "UI", "Info.py")): |
1241 # Installing from archive |
1241 # Installing from archive |
1242 from eric.eric6.UI.Info import Version, CopyrightShort |
1242 from eric.eric6.UI.Info import Version, CopyrightShort |
1243 elif os.path.exists(os.path.join("eric6", "UI", "Info.py")): |
1243 elif os.path.exists(os.path.join("eric6", "UI", "Info.py")): |
1246 else: |
1246 else: |
1247 Version = "Unknown" |
1247 Version = "Unknown" |
1248 CopyrightShort = "(c) 2002 - 2019 Detlev Offenbach" |
1248 CopyrightShort = "(c) 2002 - 2019 Detlev Offenbach" |
1249 |
1249 |
1250 copyToFile( |
1250 copyToFile( |
1251 os.path.join(dirs["contents"], "Info.plist"), |
1251 os.path.join(directories["contents"], "Info.plist"), |
1252 '''<?xml version="1.0" encoding="UTF-8"?>\n''' |
1252 '''<?xml version="1.0" encoding="UTF-8"?>\n''' |
1253 '''<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"\n''' |
1253 '''<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"\n''' |
1254 ''' "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n''' |
1254 ''' "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n''' |
1255 '''<plist version="1.0">\n''' |
1255 '''<plist version="1.0">\n''' |
1256 '''<dict>\n''' |
1256 '''<dict>\n''' |