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 """ |
751 print("it's PyQt4 wrapper.") |
770 print("it's PyQt4 wrapper.") |
752 print('Error: {0}'.format(msg)) |
771 print('Error: {0}'.format(msg)) |
753 exit(1) |
772 exit(1) |
754 print("Found QScintilla2") |
773 print("Found QScintilla2") |
755 |
774 |
|
775 # determine the platform dependent black list |
|
776 if sys.platform.startswith("win"): |
|
777 PlatformBlackLists = PlatformsBlackLists["windows"] |
|
778 elif sys.platform.startswith("linux"): |
|
779 PlatformBlackLists = PlatformsBlackLists["linux"] |
|
780 else: |
|
781 PlatformBlackLists = PlatformsBlackLists["mac"] |
|
782 |
756 # check version of Qt |
783 # check version of Qt |
757 qtMajor = int(qVersion().split('.')[0]) |
784 qtMajor = int(qVersion().split('.')[0]) |
758 qtMinor = int(qVersion().split('.')[1]) |
785 qtMinor = int(qVersion().split('.')[1]) |
759 if qtMajor < 4 or (qtMajor == 4 and qtMinor < 6): |
786 if qtMajor < 4 or (qtMajor == 4 and qtMinor < 6): |
760 print('Sorry, you must have Qt version 4.6.0 or higher.') |
787 print('Sorry, you must have Qt version 4.6.0 or higher.') |
766 import sipconfig |
793 import sipconfig |
767 sipVersion = sipconfig.Configuration().sip_version_str |
794 sipVersion = sipconfig.Configuration().sip_version_str |
768 # always assume, that snapshots are new enough |
795 # always assume, that snapshots are new enough |
769 if "snapshot" not in sipVersion: |
796 if "snapshot" not in sipVersion: |
770 # check for blacklisted versions |
797 # check for blacklisted versions |
771 for vers in BlackLists["sip"]: |
798 for vers in BlackLists["sip"] + PlatformBlackLists["sip"]: |
772 if vers == sipVersion: |
799 if vers == sipVersion: |
773 print('Sorry, sip version {0} is not compatible with eric5.'\ |
800 print('Sorry, sip version {0} is not compatible with eric5.'\ |
774 .format(vers)) |
801 .format(vers)) |
775 print('Please install another version.') |
802 print('Please install another version.') |
776 exit(3) |
803 exit(3) |
791 if maj < 4 or (maj == 4 and min < 7): |
818 if maj < 4 or (maj == 4 and min < 7): |
792 print('Sorry, you must have PyQt 4.7.0 or higher or' \ |
819 print('Sorry, you must have PyQt 4.7.0 or higher or' \ |
793 ' a recent snapshot release.') |
820 ' a recent snapshot release.') |
794 exit(4) |
821 exit(4) |
795 # check for blacklisted versions |
822 # check for blacklisted versions |
796 for vers in BlackLists["PyQt4"]: |
823 for vers in BlackLists["PyQt4"] + PlatformBlackLists["PyQt4"]: |
797 if vers == pyqtVersion: |
824 if vers == pyqtVersion: |
798 print('Sorry, PyQt4 version {0} is not compatible with eric5.'\ |
825 print('Sorry, PyQt4 version {0} is not compatible with eric5.'\ |
799 .format(vers)) |
826 .format(vers)) |
800 print('Please install another version.') |
827 print('Please install another version.') |
801 exit(4) |
828 exit(4) |
815 if maj < 2 or (maj == 2 and min < 4): |
842 if maj < 2 or (maj == 2 and min < 4): |
816 print('Sorry, you must have QScintilla 2.4.0 or higher or' \ |
843 print('Sorry, you must have QScintilla 2.4.0 or higher or' \ |
817 ' a recent snapshot release.') |
844 ' a recent snapshot release.') |
818 exit(5) |
845 exit(5) |
819 # check for blacklisted versions |
846 # check for blacklisted versions |
820 for vers in BlackLists["QScintilla2"]: |
847 for vers in BlackLists["QScintilla2"] + PlatformBlackLists["QScintilla2"]: |
821 if vers == scintillaVersion: |
848 if vers == scintillaVersion: |
822 print('Sorry, QScintilla2 version {0} is not compatible with eric5.'\ |
849 print('Sorry, QScintilla2 version {0} is not compatible with eric5.'\ |
823 .format(vers)) |
850 .format(vers)) |
824 print('Please install another version.') |
851 print('Please install another version.') |
825 exit(5) |
852 exit(5) |