140 print(" -n path path of the directory the Mac app bundle will") |
147 print(" -n path path of the directory the Mac app bundle will") |
141 print(" be created in") |
148 print(" be created in") |
142 print(" (default: {0}".format(macAppBundlePath)) |
149 print(" (default: {0}".format(macAppBundlePath)) |
143 print(" -p python name of the python executable") |
150 print(" -p python name of the python executable") |
144 print(" (default: {0})".format(macPythonExe)) |
151 print(" (default: {0})".format(macPythonExe)) |
|
152 print(" -c don't cleanup old installation first") |
145 print(" -x don't perform dependency checks (use on your own" |
153 print(" -x don't perform dependency checks (use on your own" |
146 " risk)") |
154 " risk)") |
147 print(" -c don't cleanup old installation first") |
155 print(" -y add the Python variant to the executable names") |
148 print(" -z don't compile the installed python files") |
156 print(" -z don't compile the installed python files") |
149 print() |
157 print() |
150 print("The file given to the -f option must be valid Python code" |
158 print("The file given to the -f option must be valid Python code" |
151 " defining a") |
159 " defining a") |
152 print("dictionary called 'cfg' with the keys 'ericDir', 'ericPixDir'," |
160 print("dictionary called 'cfg' with the keys 'ericDir', 'ericPixDir'," |
349 @param dirName name of the directory to prune (string) |
357 @param dirName name of the directory to prune (string) |
350 """ |
358 """ |
351 # step 1: delete all Ui_*.py files without a corresponding |
359 # step 1: delete all Ui_*.py files without a corresponding |
352 # *.ui file |
360 # *.ui file |
353 dirListing = os.listdir(dirName) |
361 dirListing = os.listdir(dirName) |
354 for formName, sourceName in [(f.replace('Ui_',"").replace(".py",".ui"), f) |
362 for formName, sourceName in [ |
355 for f in dirListing |
363 (f.replace('Ui_', "").replace(".py", ".ui"), f) |
356 if fnmatch.fnmatch(f, "Ui_*.py")]: |
364 for f in dirListing if fnmatch.fnmatch(f, "Ui_*.py")]: |
357 if not os.path.exists(os.path.join(dirName, formName)): |
365 if not os.path.exists(os.path.join(dirName, formName)): |
358 os.remove(os.path.join(dirName, sourceName)) |
366 os.remove(os.path.join(dirName, sourceName)) |
359 if os.path.exists(os.path.join(dirName, sourceName + "c")): |
367 if os.path.exists(os.path.join(dirName, sourceName + "c")): |
360 os.remove(os.path.join(dirName, sourceName + "c")) |
368 os.remove(os.path.join(dirName, sourceName + "c")) |
361 |
369 |
405 "eric5-unittest", "eric5", |
413 "eric5-unittest", "eric5", |
406 "eric5-tray", "eric5-editor", |
414 "eric5-tray", "eric5-editor", |
407 "eric5-plugininstall", "eric5-pluginuninstall", |
415 "eric5-plugininstall", "eric5-pluginuninstall", |
408 "eric5-pluginrepository", "eric5-sqlbrowser", |
416 "eric5-pluginrepository", "eric5-sqlbrowser", |
409 "eric5-webbrowser", "eric5-iconeditor", |
417 "eric5-webbrowser", "eric5-iconeditor", |
|
418 ] |
|
419 rem_wnames2 = [ |
410 "eric5_api", "eric5_compare", |
420 "eric5_api", "eric5_compare", |
411 "eric5_configure", "eric5_diff", |
421 "eric5_configure", "eric5_diff", |
412 "eric5_doc", "eric5_qregularexpression", |
422 "eric5_doc", "eric5_qregularexpression", |
413 "eric5_qregexp", "eric5_re", |
423 "eric5_qregexp", "eric5_re", |
414 "eric5_trpreviewer", "eric5_uipreviewer", |
424 "eric5_trpreviewer", "eric5_uipreviewer", |
417 "eric5_plugininstall", "eric5_pluginuninstall", |
427 "eric5_plugininstall", "eric5_pluginuninstall", |
418 "eric5_pluginrepository", "eric5_sqlbrowser", |
428 "eric5_pluginrepository", "eric5_sqlbrowser", |
419 "eric5_webbrowser", "eric5_iconeditor", |
429 "eric5_webbrowser", "eric5_iconeditor", |
420 "eric5_snap", |
430 "eric5_snap", |
421 ] |
431 ] |
|
432 if includePythonVariant: |
|
433 marker = PythonMarkers[sys.version_info.major] |
|
434 rem_wnames.extend([n + marker for n in rem_wnames2]) |
|
435 else: |
|
436 rem_wnames.extend(rem_wnames2) |
422 |
437 |
423 try: |
438 try: |
424 for rem_wname in rem_wnames: |
439 for rem_wname in rem_wnames: |
425 for d in [platBinDir, getConfig('bindir')]: |
440 for d in [platBinDir, getConfig('bindir')]: |
426 rwname = wrapperName(d, rem_wname) |
441 rwname = wrapperName(d, rem_wname) |
506 Actually perform the installation steps. |
520 Actually perform the installation steps. |
507 |
521 |
508 @return result code (integer) |
522 @return result code (integer) |
509 """ |
523 """ |
510 global distDir, doCleanup, cfg, progLanguages, sourceDir, configName |
524 global distDir, doCleanup, cfg, progLanguages, sourceDir, configName |
|
525 global includePythonVariant |
511 |
526 |
512 # Create the platform specific wrappers. |
527 # Create the platform specific wrappers. |
513 wnames = [] |
528 wnames = [] |
514 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_api", False)) |
529 if includePythonVariant: |
515 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_compare")) |
530 marker = PythonMarkers[sys.version_info.major] |
516 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_configure")) |
531 else: |
517 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_diff")) |
532 marker = "" |
518 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_doc", False)) |
533 wnames.append(createPyWrapper(cfg['ericDir'], |
519 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_editor")) |
534 "eric5_api" + marker, |
520 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_iconeditor")) |
535 False)) |
521 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_plugininstall")) |
536 wnames.append(createPyWrapper(cfg['ericDir'], |
522 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_pluginrepository")) |
537 "eric5_compare" + marker)) |
523 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_pluginuninstall")) |
538 wnames.append(createPyWrapper(cfg['ericDir'], |
524 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_qregexp")) |
539 "eric5_configure" + marker)) |
525 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_qregularexpression")) |
540 wnames.append(createPyWrapper(cfg['ericDir'], |
526 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_re")) |
541 "eric5_diff" + marker)) |
527 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_snap")) |
542 wnames.append(createPyWrapper(cfg['ericDir'], |
528 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_sqlbrowser")) |
543 "eric5_doc" + marker, |
529 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_tray")) |
544 False)) |
530 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_trpreviewer")) |
545 wnames.append(createPyWrapper(cfg['ericDir'], |
531 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_uipreviewer")) |
546 "eric5_editor" + marker)) |
532 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_unittest")) |
547 wnames.append(createPyWrapper(cfg['ericDir'], |
533 wnames.append(createPyWrapper(cfg['ericDir'], "eric5_webbrowser")) |
548 "eric5_iconeditor" + marker)) |
534 wnames.append(createPyWrapper(cfg['ericDir'], "eric5")) |
549 wnames.append(createPyWrapper(cfg['ericDir'], |
|
550 "eric5_plugininstall" + marker)) |
|
551 wnames.append(createPyWrapper(cfg['ericDir'], |
|
552 "eric5_pluginrepository" + marker)) |
|
553 wnames.append(createPyWrapper(cfg['ericDir'], |
|
554 "eric5_pluginuninstall" + marker)) |
|
555 wnames.append(createPyWrapper(cfg['ericDir'], |
|
556 "eric5_qregexp" + marker)) |
|
557 wnames.append(createPyWrapper(cfg['ericDir'], |
|
558 "eric5_qregularexpression" + marker)) |
|
559 wnames.append(createPyWrapper(cfg['ericDir'], |
|
560 "eric5_re" + marker)) |
|
561 wnames.append(createPyWrapper(cfg['ericDir'], |
|
562 "eric5_snap" + marker)) |
|
563 wnames.append(createPyWrapper(cfg['ericDir'], |
|
564 "eric5_sqlbrowser" + marker)) |
|
565 wnames.append(createPyWrapper(cfg['ericDir'], |
|
566 "eric5_tray" + marker)) |
|
567 wnames.append(createPyWrapper(cfg['ericDir'], |
|
568 "eric5_trpreviewer" + marker)) |
|
569 wnames.append(createPyWrapper(cfg['ericDir'], |
|
570 "eric5_uipreviewer" + marker)) |
|
571 wnames.append(createPyWrapper(cfg['ericDir'], |
|
572 "eric5_unittest" + marker)) |
|
573 wnames.append(createPyWrapper(cfg['ericDir'], |
|
574 "eric5_webbrowser" + marker)) |
|
575 wnames.append(createPyWrapper(cfg['ericDir'], |
|
576 "eric5" + marker)) |
535 |
577 |
536 # set install prefix, if not None |
578 # set install prefix, if not None |
537 if distDir: |
579 if distDir: |
538 for key in list(cfg.keys()): |
580 for key in list(cfg.keys()): |
539 cfg[key] = os.path.normpath(distDir + os.sep + cfg[key]) |
581 cfg[key] = os.path.normpath(distDir + os.sep + cfg[key]) |
1133 """ |
1175 """ |
1134 import getopt |
1176 import getopt |
1135 |
1177 |
1136 # Parse the command line. |
1178 # Parse the command line. |
1137 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir |
1179 global progName, modDir, doCleanup, doCompile, distDir, cfg, apisDir |
1138 global sourceDir, configName |
1180 global sourceDir, configName, includePythonVariant |
1139 global macAppBundlePath, macAppBundleName, macPythonExe |
1181 global macAppBundlePath, macAppBundleName, macPythonExe |
1140 |
1182 |
1141 if sys.version_info < (2, 6, 0) or sys.version_info > (3, 9, 9): |
1183 if sys.version_info < (2, 6, 0) or sys.version_info > (3, 9, 9): |
1142 print('Sorry, eric5 requires at least Python 2.6 or ' |
1184 print('Sorry, eric5 requires at least Python 2.6 or ' |
1143 'Python 3 for running.') |
1185 'Python 3 for running.') |