37 # Define blacklisted versions of the prerequisites |
37 # Define blacklisted versions of the prerequisites |
38 BlackLists = { |
38 BlackLists = { |
39 "sip": ["4.11", "4.12.3"], |
39 "sip": ["4.11", "4.12.3"], |
40 "PyQt4": ["4.7.5"], |
40 "PyQt4": ["4.7.5"], |
41 "QScintilla2": [], |
41 "QScintilla2": [], |
|
42 } |
|
43 PlatformsBlackLists = { |
|
44 "windows": { |
|
45 "sip": [], |
|
46 "PyQt4": ["4.9.2", "4.9.3"], |
|
47 "QScintilla2": [], |
|
48 }, |
|
49 |
|
50 "linux": { |
|
51 "sip": [], |
|
52 "PyQt4": [], |
|
53 "QScintilla2": [], |
|
54 }, |
|
55 |
|
56 "mac": { |
|
57 "sip": [], |
|
58 "PyQt4": ["4.9.2", "4.9.3"], |
|
59 "QScintilla2": [], |
|
60 }, |
42 } |
61 } |
43 |
62 |
44 |
63 |
45 def exit(rcode=0): |
64 def exit(rcode=0): |
46 """ |
65 """ |
753 print("it's PyQt4 wrapper.") |
772 print("it's PyQt4 wrapper.") |
754 print('Error: {0}'.format(msg)) |
773 print('Error: {0}'.format(msg)) |
755 exit(1) |
774 exit(1) |
756 print("Found QScintilla2") |
775 print("Found QScintilla2") |
757 |
776 |
|
777 # determine the platform dependent black list |
|
778 if sys.platform.startswith("win"): |
|
779 PlatformBlackLists = PlatformsBlackLists["windows"] |
|
780 elif sys.platform.startswith("linux"): |
|
781 PlatformBlackLists = PlatformsBlackLists["linux"] |
|
782 else: |
|
783 PlatformBlackLists = PlatformsBlackLists["mac"] |
|
784 |
758 # check version of Qt |
785 # check version of Qt |
759 qtMajor = int(qVersion().split('.')[0]) |
786 qtMajor = int(qVersion().split('.')[0]) |
760 qtMinor = int(qVersion().split('.')[1]) |
787 qtMinor = int(qVersion().split('.')[1]) |
761 if qtMajor < 4 or (qtMajor == 4 and qtMinor < 6): |
788 if qtMajor < 4 or (qtMajor == 4 and qtMinor < 6): |
762 print('Sorry, you must have Qt version 4.6.0 or higher.') |
789 print('Sorry, you must have Qt version 4.6.0 or higher.') |
768 import sipconfig |
795 import sipconfig |
769 sipVersion = sipconfig.Configuration().sip_version_str |
796 sipVersion = sipconfig.Configuration().sip_version_str |
770 # always assume, that snapshots are new enough |
797 # always assume, that snapshots are new enough |
771 if "snapshot" not in sipVersion: |
798 if "snapshot" not in sipVersion: |
772 # check for blacklisted versions |
799 # check for blacklisted versions |
773 for vers in BlackLists["sip"]: |
800 for vers in BlackLists["sip"] + PlatformBlackLists["sip"]: |
774 if vers == sipVersion: |
801 if vers == sipVersion: |
775 print('Sorry, sip version {0} is not compatible with eric5.'\ |
802 print('Sorry, sip version {0} is not compatible with eric5.'\ |
776 .format(vers)) |
803 .format(vers)) |
777 print('Please install another version.') |
804 print('Please install another version.') |
778 exit(3) |
805 exit(3) |
793 if maj < 4 or (maj == 4 and min < 7): |
820 if maj < 4 or (maj == 4 and min < 7): |
794 print('Sorry, you must have PyQt 4.7.0 or higher or' \ |
821 print('Sorry, you must have PyQt 4.7.0 or higher or' \ |
795 ' a recent snapshot release.') |
822 ' a recent snapshot release.') |
796 exit(4) |
823 exit(4) |
797 # check for blacklisted versions |
824 # check for blacklisted versions |
798 for vers in BlackLists["PyQt4"]: |
825 for vers in BlackLists["PyQt4"] + PlatformBlackLists["PyQt4"]: |
799 if vers == pyqtVersion: |
826 if vers == pyqtVersion: |
800 print('Sorry, PyQt4 version {0} is not compatible with eric5.'\ |
827 print('Sorry, PyQt4 version {0} is not compatible with eric5.'\ |
801 .format(vers)) |
828 .format(vers)) |
802 print('Please install another version.') |
829 print('Please install another version.') |
803 exit(4) |
830 exit(4) |
817 if maj < 2 or (maj == 2 and min < 4): |
844 if maj < 2 or (maj == 2 and min < 4): |
818 print('Sorry, you must have QScintilla 2.4.0 or higher or' \ |
845 print('Sorry, you must have QScintilla 2.4.0 or higher or' \ |
819 ' a recent snapshot release.') |
846 ' a recent snapshot release.') |
820 exit(5) |
847 exit(5) |
821 # check for blacklisted versions |
848 # check for blacklisted versions |
822 for vers in BlackLists["QScintilla2"]: |
849 for vers in BlackLists["QScintilla2"] + PlatformBlackLists["QScintilla2"]: |
823 if vers == scintillaVersion: |
850 if vers == scintillaVersion: |
824 print('Sorry, QScintilla2 version {0} is not compatible with eric5.'\ |
851 print('Sorry, QScintilla2 version {0} is not compatible with eric5.'\ |
825 .format(vers)) |
852 .format(vers)) |
826 print('Please install another version.') |
853 print('Please install another version.') |
827 exit(5) |
854 exit(5) |