579 for name in [ |
581 for name in [ |
580 "/usr/share/appdata/eric7.appdata.xml", |
582 "/usr/share/appdata/eric7.appdata.xml", |
581 "/usr/share/metainfo/eric7.appdata.xml", |
583 "/usr/share/metainfo/eric7.appdata.xml", |
582 "/usr/share/applications/eric7_browser.desktop", |
584 "/usr/share/applications/eric7_browser.desktop", |
583 "/usr/share/applications/eric7_ide.desktop", |
585 "/usr/share/applications/eric7_ide.desktop", |
|
586 "/usr/share/applications/eric7_mpy.desktop", |
584 "/usr/share/icons/eric.png", |
587 "/usr/share/icons/eric.png", |
|
588 "/usr/share/icons/ericMPy.png", |
585 "/usr/share/icons/ericWeb.png", |
589 "/usr/share/icons/ericWeb.png", |
586 "/usr/share/pixmaps/eric.png", |
590 "/usr/share/pixmaps/eric.png", |
|
591 "/usr/share/pixmaps/ericMPy.png", |
587 "/usr/share/pixmaps/ericWeb.png", |
592 "/usr/share/pixmaps/ericWeb.png", |
588 # obsolete entries below |
593 # obsolete entries below |
589 "/usr/share/applications/eric7.desktop", |
594 "/usr/share/applications/eric7.desktop", |
590 ]: |
595 ]: |
591 if os.path.exists(name): |
596 if os.path.exists(name): |
595 for name in [ |
600 for name in [ |
596 "~/.local/share/appdata/eric7.appdata.xml", |
601 "~/.local/share/appdata/eric7.appdata.xml", |
597 "~/.local/share/metainfo/eric7.appdata.xml", |
602 "~/.local/share/metainfo/eric7.appdata.xml", |
598 "~/.local/share/applications/eric7_browser.desktop", |
603 "~/.local/share/applications/eric7_browser.desktop", |
599 "~/.local/share/applications/eric7_ide.desktop", |
604 "~/.local/share/applications/eric7_ide.desktop", |
|
605 "~/.local/share/applications/eric7_mpy.desktop", |
600 "~/.local/share/icons/eric.png", |
606 "~/.local/share/icons/eric.png", |
|
607 "~/.local/share/icons/ericMPy.png", |
601 "~/.local/share/icons/ericWeb.png", |
608 "~/.local/share/icons/ericWeb.png", |
602 "~/.local/share/pixmaps/eric.png", |
609 "~/.local/share/pixmaps/eric.png", |
|
610 "~/.local/share/pixmaps/ericMPy.png", |
603 "~/.local/share/pixmaps/ericWeb.png", |
611 "~/.local/share/pixmaps/ericWeb.png", |
604 # obsolete entries below |
612 # obsolete entries below |
605 "~/.local/share/applications/eric7.desktop", |
613 "~/.local/share/applications/eric7.desktop", |
606 ]: |
614 ]: |
607 path = os.path.expanduser(name) |
615 path = os.path.expanduser(name) |
934 global distDir, sourceDir |
943 global distDir, sourceDir |
935 |
944 |
936 dataSourceDir = os.path.join(eric7SourceDir, "data", "linux") |
945 dataSourceDir = os.path.join(eric7SourceDir, "data", "linux") |
937 |
946 |
938 if distDir: |
947 if distDir: |
|
948 # create directories first |
|
949 for directory in ( |
|
950 os.path.normpath(os.path.join(distDir, name)) |
|
951 for name in ( |
|
952 "usr/share/icons", |
|
953 "usr/share/icons/hicolor/48x48/apps", |
|
954 "usr/share/applications", |
|
955 "usr/share/metainfo", |
|
956 "usr/share/appdata", |
|
957 ) |
|
958 ): |
|
959 if not os.path.exists(directory): |
|
960 os.makedirs(directory) |
|
961 |
939 dst = os.path.normpath(os.path.join(distDir, "usr/share/icons")) |
962 dst = os.path.normpath(os.path.join(distDir, "usr/share/icons")) |
940 if not os.path.exists(dst): |
963 for icon in ("eric_icon.png", "ericMPy48_icon.png", "ericWeb48_icon.png"): |
941 os.makedirs(dst) |
964 shutilCopy( |
942 shutilCopy( |
965 os.path.join(eric7SourceDir, "pixmaps", icon), |
943 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
966 os.path.join(dst, icon.replace("_icon", "").replace("48", "")), |
944 os.path.join(dst, "eric.png"), |
967 ) |
945 ) |
|
946 shutilCopy( |
|
947 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
|
948 os.path.join(dst, "ericWeb.png"), |
|
949 ) |
|
950 |
968 |
951 dst = os.path.normpath( |
969 dst = os.path.normpath( |
952 os.path.join(distDir, "usr/share/icons/hicolor/48x48/apps") |
970 os.path.join(distDir, "usr/share/icons/hicolor/48x48/apps") |
953 ) |
971 ) |
954 if not os.path.exists(dst): |
972 for icon in ("eric48_icon.png", "ericMPy48_icon.png", "ericWeb48_icon.png"): |
955 os.makedirs(dst) |
973 shutilCopy( |
956 shutilCopy( |
974 os.path.join(eric7SourceDir, "pixmaps", icon), |
957 os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"), |
975 os.path.join(dst, icon.replace("48_icon", "")), |
958 os.path.join(dst, "eric.png"), |
976 ) |
959 ) |
|
960 shutilCopy( |
|
961 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
|
962 os.path.join(dst, "ericWeb.png"), |
|
963 ) |
|
964 |
977 |
965 dst = os.path.normpath(os.path.join(distDir, "usr/share/applications")) |
978 dst = os.path.normpath(os.path.join(distDir, "usr/share/applications")) |
966 if not os.path.exists(dst): |
979 for desktop in ("eric7_ide", "eric7_browser", "eric7_mpy"): |
967 os.makedirs(dst) |
980 copyDesktopFile( |
968 copyDesktopFile( |
981 os.path.join(dataSourceDir, desktop + ".desktop.in"), |
969 os.path.join(dataSourceDir, "eric7_ide.desktop.in"), |
982 os.path.join(dst, desktop + ".desktop"), |
970 os.path.join(dst, "eric7_ide.desktop"), |
983 ) |
971 ) |
984 |
972 copyDesktopFile( |
985 for dst in ( |
973 os.path.join(dataSourceDir, "eric7_browser.desktop.in"), |
986 os.path.normpath(os.path.join(distDir, "usr/share/metainfo")), |
974 os.path.join(dst, "eric7_browser.desktop"), |
987 os.path.normpath(os.path.join(distDir, "usr/share/appdata")), |
975 ) |
988 ): |
976 |
989 copyAppStreamFile( |
977 dst = os.path.normpath(os.path.join(distDir, "usr/share/metainfo")) |
990 os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
978 if not os.path.exists(dst): |
991 os.path.join(dst, "eric7.appdata.xml"), |
979 os.makedirs(dst) |
992 ) |
980 copyAppStreamFile( |
993 |
981 os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
|
982 os.path.join(dst, "eric7.appdata.xml"), |
|
983 ) |
|
984 elif os.getuid() == 0: |
994 elif os.getuid() == 0: |
|
995 # eric meta data |
985 shutilCopy( |
996 shutilCopy( |
986 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
997 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
987 "/usr/share/icons/eric.png", |
998 "/usr/share/icons/eric.png", |
988 ) |
999 ) |
989 shutilCopy( |
1000 shutilCopy( |
1002 elif os.path.exists("/usr/share/appdata"): |
1013 elif os.path.exists("/usr/share/appdata"): |
1003 copyAppStreamFile( |
1014 copyAppStreamFile( |
1004 os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
1015 os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
1005 "/usr/share/appdata/eric7.appdata.xml", |
1016 "/usr/share/appdata/eric7.appdata.xml", |
1006 ) |
1017 ) |
|
1018 |
|
1019 # eric MicroPython meta data |
|
1020 shutilCopy( |
|
1021 os.path.join(eric7SourceDir, "pixmaps", "ericMPy48_icon.png"), |
|
1022 "/usr/share/icons/ericMPy.png", |
|
1023 ) |
|
1024 shutilCopy( |
|
1025 os.path.join(eric7SourceDir, "pixmaps", "ericMPy48_icon.png"), |
|
1026 "/usr/share/icons/hicolor/48x48/apps/ericMPy.png", |
|
1027 ) |
|
1028 copyDesktopFile( |
|
1029 os.path.join(dataSourceDir, "eric7_mpy.desktop.in"), |
|
1030 "/usr/share/applications/eric7_mpy.desktop", |
|
1031 ) |
|
1032 |
|
1033 # eric web browser meta data |
1007 shutilCopy( |
1034 shutilCopy( |
1008 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
1035 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
1009 "/usr/share/icons/ericWeb.png", |
1036 "/usr/share/icons/ericWeb.png", |
1010 ) |
1037 ) |
1011 shutilCopy( |
1038 shutilCopy( |
1051 ) |
1081 ) |
1052 copyAppStreamFile( |
1082 copyAppStreamFile( |
1053 os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
1083 os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
1054 os.path.join(localPath, "appdata", "eric7.appdata.xml"), |
1084 os.path.join(localPath, "appdata", "eric7.appdata.xml"), |
1055 ) |
1085 ) |
|
1086 |
|
1087 # eric MicroPython meta data |
|
1088 shutilCopy( |
|
1089 os.path.join(eric7SourceDir, "pixmaps", "ericMPy48_icon.png"), |
|
1090 os.path.join(localPath, "icons", "ericMPy.png"), |
|
1091 ) |
|
1092 shutilCopy( |
|
1093 os.path.join(eric7SourceDir, "pixmaps", "ericMPy48_icon.png"), |
|
1094 os.path.join(localPath, "icons/hicolor/48x48/apps", "ericMPy.png"), |
|
1095 ) |
|
1096 copyDesktopFile( |
|
1097 os.path.join(dataSourceDir, "eric7_mpy.desktop.in"), |
|
1098 os.path.join(localPath, "applications", "eric7_mpy.desktop"), |
|
1099 ) |
|
1100 |
|
1101 # eric web browser meta data |
1056 shutilCopy( |
1102 shutilCopy( |
1057 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
1103 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
1058 os.path.join(localPath, "icons", "ericWeb.png"), |
1104 os.path.join(localPath, "icons", "ericWeb.png"), |
1059 ) |
1105 ) |
1060 shutilCopy( |
1106 shutilCopy( |
1735 |
1781 |
1736 if requiredMissing and optionalMissing: |
1782 if requiredMissing and optionalMissing: |
1737 print("Alternatively you may install all of them with:") |
1783 print("Alternatively you may install all of them with:") |
1738 print(" {0} install-dependencies.py --all".format(sys.executable)) |
1784 print(" {0} install-dependencies.py --all".format(sys.executable)) |
1739 |
1785 |
1740 # determine the platform dependent black list |
1786 # determine the platform dependent block list |
1741 if sys.platform.startswith(("win", "cygwin")): |
1787 if sys.platform.startswith(("win", "cygwin")): |
1742 PlatformBlackLists = PlatformsBlackLists["windows"] |
1788 PlatformBlockLists = PlatformsBlockLists["windows"] |
1743 elif sys.platform.startswith("linux"): |
1789 elif sys.platform.startswith("linux"): |
1744 PlatformBlackLists = PlatformsBlackLists["linux"] |
1790 PlatformBlockLists = PlatformsBlockLists["linux"] |
1745 elif sys.platform.startswith("freebsd"): |
1791 elif sys.platform.startswith("freebsd"): |
1746 PlatformBlackLists = PlatformsBlackLists["freebsd"] |
1792 PlatformBlockLists = PlatformsBlockLists["freebsd"] |
1747 else: |
1793 else: |
1748 PlatformBlackLists = PlatformsBlackLists["mac"] |
1794 PlatformBlockLists = PlatformsBlockLists["mac"] |
1749 |
1795 |
1750 print("\nVersion Information") |
1796 print("\nVersion Information") |
1751 print("-------------------") |
1797 print("-------------------") |
1752 |
1798 |
1753 print("Python: {0:d}.{1:d}.{2:d}".format(*sys.version_info[:3])) |
1799 print("Python: {0:d}.{1:d}.{2:d}".format(*sys.version_info[:3])) |
2067 entriesTemplates = [ |
2113 entriesTemplates = [ |
2068 ( |
2114 ( |
2069 "eric7 IDE (Python {0}.{1}).lnk", |
2115 "eric7 IDE (Python {0}.{1}).lnk", |
2070 os.path.join(cfg["bindir"], "eric7_ide.cmd"), |
2116 os.path.join(cfg["bindir"], "eric7_ide.cmd"), |
2071 os.path.join(cfg["ericPixDir"], "eric7.ico"), |
2117 os.path.join(cfg["ericPixDir"], "eric7.ico"), |
|
2118 ), |
|
2119 ( |
|
2120 "eric7 MicroPython (Python {0}.{1}).lnk", |
|
2121 os.path.join(cfg["bindir"], "eric7_mpy.cmd"), |
|
2122 os.path.join(cfg["ericPixDir"], "ericMPy48.ico"), |
2072 ), |
2123 ), |
2073 ( |
2124 ( |
2074 "eric7 Browser (Python {0}.{1}).lnk", |
2125 "eric7 Browser (Python {0}.{1}).lnk", |
2075 os.path.join(cfg["bindir"], "eric7_browser.cmd"), |
2126 os.path.join(cfg["bindir"], "eric7_browser.cmd"), |
2076 os.path.join(cfg["ericPixDir"], "ericWeb48.ico"), |
2127 os.path.join(cfg["ericPixDir"], "ericWeb48.ico"), |