Improved installation procedure to also create application icons on ChromeOS. eric7

Sun, 03 Oct 2021 13:06:20 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 03 Oct 2021 13:06:20 +0200
branch
eric7
changeset 8660
1848e8e4b380
parent 8659
0e58d3367e92
child 8662
49781769bc43

Improved installation procedure to also create application icons on ChromeOS.

eric7/APIs/Python3/eric7.api file | annotate | diff | comparison | revisions
eric7/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
eric7/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
eric7/Documentation/Source/eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html file | annotate | diff | comparison | revisions
eric7/Documentation/Source/eric7.eric7_post_install.html file | annotate | diff | comparison | revisions
eric7/Documentation/Source/install.html file | annotate | diff | comparison | revisions
eric7/eric7_post_install.py file | annotate | diff | comparison | revisions
eric7/pixmaps/eric48_icon.png file | annotate | diff | comparison | revisions
scripts/install.py file | annotate | diff | comparison | revisions
setup.py file | annotate | diff | comparison | revisions
--- a/eric7/APIs/Python3/eric7.api	Sat Oct 02 15:35:19 2021 +0200
+++ b/eric7/APIs/Python3/eric7.api	Sun Oct 03 13:06:20 2021 +0200
@@ -5183,6 +5183,8 @@
 eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.HgLogBrowserDialog.BranchColumn?7
 eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.HgLogBrowserDialog.ClosedIndicator?7
 eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.HgLogBrowserDialog.DateColumn?7
+eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.HgLogBrowserDialog.GraftedRe?7
+eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.HgLogBrowserDialog.GraftedTemplate?7
 eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.HgLogBrowserDialog.IconColumn?7
 eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.HgLogBrowserDialog.LargefilesCacheL?7
 eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.HgLogBrowserDialog.LargefilesCacheW?7
@@ -12252,6 +12254,7 @@
 eric7.eric7_pluginuninstall.main?4()
 eric7.eric7_post_install.copyDesktopFile?4(src, dst, scriptsdir)
 eric7.eric7_post_install.copyLinuxMetaData?4()
+eric7.eric7_post_install.copyMetaFile?4(srcname, dstpath, dstname)
 eric7.eric7_post_install.copyMetaFilesTree?4(src, dst)
 eric7.eric7_post_install.createWindowsLinks?4()
 eric7.eric7_post_install.createWindowsShortcut?4(linkPath, targetPath, iconPath)
@@ -12373,6 +12376,7 @@
 install.sourceDir?7
 install.updatePip?4()
 install.usage?4(rcode=2)
+install.verbose?7
 install.versionToStr?4(version)
 install.windowsDesktopEntries?4()
 install.windowsDesktopNames?4()
Binary file eric7/Documentation/Help/source.qch has changed
--- a/eric7/Documentation/Help/source.qhp	Sat Oct 02 15:35:19 2021 +0200
+++ b/eric7/Documentation/Help/source.qhp	Sun Oct 03 13:06:20 2021 +0200
@@ -17830,6 +17830,7 @@
       <keyword name="copyDesktopFile" id="copyDesktopFile" ref="eric7.eric7_post_install.html#copyDesktopFile" />
       <keyword name="copyDesktopFile" id="copyDesktopFile" ref="install.html#copyDesktopFile" />
       <keyword name="copyLinuxMetaData" id="copyLinuxMetaData" ref="eric7.eric7_post_install.html#copyLinuxMetaData" />
+      <keyword name="copyMetaFile" id="copyMetaFile" ref="eric7.eric7_post_install.html#copyMetaFile" />
       <keyword name="copyMetaFilesTree" id="copyMetaFilesTree" ref="eric7.eric7_post_install.html#copyMetaFilesTree" />
       <keyword name="copyToFile" id="copyToFile" ref="install.html#copyToFile" />
       <keyword name="copyTree" id="copyTree" ref="install-debugclients.html#copyTree" />
--- a/eric7/Documentation/Source/eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html	Sat Oct 02 15:35:19 2021 +0200
+++ b/eric7/Documentation/Source/eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html	Sun Oct 03 13:06:20 2021 +0200
@@ -43,7 +43,7 @@
 <h3>Class Attributes</h3>
 
 <table>
-<tr><td>AuthorColumn</td></tr><tr><td>BookmarksColumn</td></tr><tr><td>BranchColumn</td></tr><tr><td>ClosedIndicator</td></tr><tr><td>DateColumn</td></tr><tr><td>IconColumn</td></tr><tr><td>LargefilesCacheL</td></tr><tr><td>LargefilesCacheW</td></tr><tr><td>MessageColumn</td></tr><tr><td>PathSeparatorRe</td></tr><tr><td>PhaseColumn</td></tr><tr><td>RevisionColumn</td></tr><tr><td>TagsColumn</td></tr>
+<tr><td>AuthorColumn</td></tr><tr><td>BookmarksColumn</td></tr><tr><td>BranchColumn</td></tr><tr><td>ClosedIndicator</td></tr><tr><td>DateColumn</td></tr><tr><td>GraftedRe</td></tr><tr><td>GraftedTemplate</td></tr><tr><td>IconColumn</td></tr><tr><td>LargefilesCacheL</td></tr><tr><td>LargefilesCacheW</td></tr><tr><td>MessageColumn</td></tr><tr><td>PathSeparatorRe</td></tr><tr><td>PhaseColumn</td></tr><tr><td>RevisionColumn</td></tr><tr><td>TagsColumn</td></tr>
 </table>
 <h3>Class Methods</h3>
 
--- a/eric7/Documentation/Source/eric7.eric7_post_install.html	Sat Oct 02 15:35:19 2021 +0200
+++ b/eric7/Documentation/Source/eric7.eric7_post_install.html	Sun Oct 03 13:06:20 2021 +0200
@@ -34,6 +34,10 @@
 <td>Function to copy the meta data files.</td>
 </tr>
 <tr>
+<td><a href="#copyMetaFile">copyMetaFile</a></td>
+<td>Function to copy a file to its destination.</td>
+</tr>
+<tr>
 <td><a href="#copyMetaFilesTree">copyMetaFilesTree</a></td>
 <td>Function to copy the files of a directory tree.</td>
 </tr>
@@ -99,6 +103,31 @@
 <div align="right"><a href="#top">Up</a></div>
 <hr />
 <hr />
+<a NAME="copyMetaFile" ID="copyMetaFile"></a>
+<h2>copyMetaFile</h2>
+<b>copyMetaFile</b>(<i>srcname, dstpath, dstname</i>)
+
+<p>
+    Function to copy a file to its destination.
+</p>
+<dl>
+
+<dt><i>srcname</i> (str)</dt>
+<dd>
+name of the source file
+</dd>
+<dt><i>dstpath</i> (str)</dt>
+<dd>
+name of the destination path
+</dd>
+<dt><i>dstname</i> (str)</dt>
+<dd>
+name of the destination file (without path)
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+<hr />
 <a NAME="copyMetaFilesTree" ID="copyMetaFilesTree"></a>
 <h2>copyMetaFilesTree</h2>
 <b>copyMetaFilesTree</b>(<i>src, dst</i>)
--- a/eric7/Documentation/Source/install.html	Sat Oct 02 15:35:19 2021 +0200
+++ b/eric7/Documentation/Source/install.html	Sun Oct 03 13:06:20 2021 +0200
@@ -14,7 +14,7 @@
 <h3>Global Attributes</h3>
 
 <table>
-<tr><td>BlackLists</td></tr><tr><td>PlatformsBlackLists</td></tr><tr><td>apisDir</td></tr><tr><td>cfg</td></tr><tr><td>configLength</td></tr><tr><td>configName</td></tr><tr><td>createInstallInfoFile</td></tr><tr><td>currDir</td></tr><tr><td>defaultMacAppBundleName</td></tr><tr><td>defaultMacAppBundlePath</td></tr><tr><td>defaultMacPythonExe</td></tr><tr><td>distDir</td></tr><tr><td>doCleanDesktopLinks</td></tr><tr><td>doCleanup</td></tr><tr><td>doCompile</td></tr><tr><td>eric7SourceDir</td></tr><tr><td>forceCleanDesktopLinks</td></tr><tr><td>ignorePyqt6Tools</td></tr><tr><td>installApis</td></tr><tr><td>installCwd</td></tr><tr><td>installInfo</td></tr><tr><td>installInfoName</td></tr><tr><td>macAppBundleName</td></tr><tr><td>macAppBundlePath</td></tr><tr><td>macPythonExe</td></tr><tr><td>modDir</td></tr><tr><td>platBinDir</td></tr><tr><td>platBinDirOld</td></tr><tr><td>progLanguages</td></tr><tr><td>progName</td></tr><tr><td>pyModDir</td></tr><tr><td>sourceDir</td></tr><tr><td>yes2All</td></tr>
+<tr><td>BlackLists</td></tr><tr><td>PlatformsBlackLists</td></tr><tr><td>apisDir</td></tr><tr><td>cfg</td></tr><tr><td>configLength</td></tr><tr><td>configName</td></tr><tr><td>createInstallInfoFile</td></tr><tr><td>currDir</td></tr><tr><td>defaultMacAppBundleName</td></tr><tr><td>defaultMacAppBundlePath</td></tr><tr><td>defaultMacPythonExe</td></tr><tr><td>distDir</td></tr><tr><td>doCleanDesktopLinks</td></tr><tr><td>doCleanup</td></tr><tr><td>doCompile</td></tr><tr><td>eric7SourceDir</td></tr><tr><td>forceCleanDesktopLinks</td></tr><tr><td>ignorePyqt6Tools</td></tr><tr><td>installApis</td></tr><tr><td>installCwd</td></tr><tr><td>installInfo</td></tr><tr><td>installInfoName</td></tr><tr><td>macAppBundleName</td></tr><tr><td>macAppBundlePath</td></tr><tr><td>macPythonExe</td></tr><tr><td>modDir</td></tr><tr><td>platBinDir</td></tr><tr><td>platBinDirOld</td></tr><tr><td>progLanguages</td></tr><tr><td>progName</td></tr><tr><td>pyModDir</td></tr><tr><td>sourceDir</td></tr><tr><td>verbose</td></tr><tr><td>yes2All</td></tr>
 </table>
 <h3>Classes</h3>
 
--- a/eric7/eric7_post_install.py	Sat Oct 02 15:35:19 2021 +0200
+++ b/eric7/eric7_post_install.py	Sun Oct 03 13:06:20 2021 +0200
@@ -157,6 +157,13 @@
         copyMetaFilesTree(os.path.join(srcDir, metaDir),
                           os.path.join(dstDir, metaDir))
     
+    copyMetaFile(os.path.join(srcDir, "icons", "eric48_icon.png"),
+                 os.path.join(dstDir, "icons", "hicolor", "48x48", "apps"),
+                 "eric.png")
+    copyMetaFile(os.path.join(srcDir, "icons", "ericWeb48_icon.png"),
+                 os.path.join(dstDir, "icons", "hicolor", "48x48", "apps"),
+                 "ericWeb.png")
+    
     for desktop in ["eric7.desktop", "eric7_browser.desktop"]:
         copyDesktopFile(
             os.path.join(srcDir, "applications", desktop),
@@ -190,6 +197,24 @@
             copyMetaFilesTree(srcname, dstname)
 
 
+def copyMetaFile(srcname, dstpath, dstname):
+    """
+    Function to copy a file to its destination.
+    
+    @param srcname name of the source file
+    @type str
+    @param dstpath name of the destination path
+    @type str
+    @param dstname name of the destination file (without path)
+    @type str
+    """
+    if not os.path.isdir(dstpath):
+        os.makedirs(dstpath)
+    dstname = os.path.join(dstpath, dstname)
+    shutil.copy2(srcname, dstname)
+    os.chmod(dstname, 0o644)
+
+
 def copyDesktopFile(src, dst, scriptsdir):
     """
     Modify a desktop file and write it to its destination.
Binary file eric7/pixmaps/eric48_icon.png has changed
--- a/scripts/install.py	Sat Oct 02 15:35:19 2021 +0200
+++ b/scripts/install.py	Sun Oct 03 13:06:20 2021 +0200
@@ -930,6 +930,18 @@
         shutilCopy(
             os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"),
             os.path.join(dst, "ericWeb.png"))
+        
+        dst = os.path.normpath(
+            os.path.join(distDir, "usr/share/icons/hicolor/48x48/apps"))
+        if not os.path.exists(dst):
+            os.makedirs(dst)
+        shutilCopy(
+            os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"),
+            os.path.join(dst, "eric.png"))
+        shutilCopy(
+            os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"),
+            os.path.join(dst, "ericWeb.png"))
+        
         dst = os.path.normpath(
             os.path.join(distDir, "usr/share/applications"))
         if not os.path.exists(dst):
@@ -939,6 +951,7 @@
         copyDesktopFile(
             os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"),
             os.path.join(dst, "eric7_browser.desktop"))
+        
         dst = os.path.normpath(
             os.path.join(distDir, "usr/share/metainfo"))
         if not os.path.exists(dst):
@@ -950,6 +963,9 @@
         shutilCopy(
             os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"),
             "/usr/share/icons/eric.png")
+        shutilCopy(
+            os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"),
+            "/usr/share/icons/hicolor/48x48/apps/eric.png")
         copyDesktopFile(
             os.path.join(sourceDir, "linux", "eric7.desktop.in"),
             "/usr/share/applications/eric7.desktop")
@@ -964,6 +980,9 @@
         shutilCopy(
             os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"),
             "/usr/share/icons/ericWeb.png")
+        shutilCopy(
+            os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"),
+            "/usr/share/icons/hicolor/48x48/apps/ericWeb.png")
         copyDesktopFile(
             os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"),
             "/usr/share/applications/eric7_browser.desktop")
@@ -973,14 +992,17 @@
                                  ".local", "share")
         # create directories first
         for directory in [os.path.join(localPath, name)
-                          for name in ("icons", "applications",
-                                       "metainfo", "appdata")]:
+                          for name in ("icons", "icons/hicolor/48x48/apps",
+                                       "applications", "metainfo", "appdata")]:
             if not os.path.isdir(directory):
                 os.makedirs(directory)
         # now copy the files
         shutilCopy(
             os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"),
             os.path.join(localPath, "icons", "eric.png"))
+        shutilCopy(
+            os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"),
+            os.path.join(localPath, "icons/hicolor/48x48/apps", "eric.png"))
         copyDesktopFile(
             os.path.join(sourceDir, "linux", "eric7.desktop.in"),
             os.path.join(localPath, "applications", "eric7.desktop"))
@@ -993,6 +1015,9 @@
         shutilCopy(
             os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"),
             os.path.join(localPath, "icons", "ericWeb.png"))
+        shutilCopy(
+            os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"),
+            os.path.join(localPath, "icons/hicolor/48x48/apps", "ericWeb.png"))
         copyDesktopFile(
             os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"),
             os.path.join(localPath, "applications",
--- a/setup.py	Sat Oct 02 15:35:19 2021 +0200
+++ b/setup.py	Sun Oct 03 13:06:20 2021 +0200
@@ -84,7 +84,9 @@
             ]),
             ('share/icons', [
                 'eric7/icons/breeze-dark/eric.svg',
-                'eric7/icons/breeze-dark/ericWeb48.svg'
+                'eric7/icons/breeze-dark/ericWeb48.svg',
+                'eric7/pixmaps/eric48_icon.png',
+                'eric7/pixmaps/ericWeb48_icon.png'
             ]),
             ('share/appdata', ['linux/eric7.appdata.xml']),
             ('share/metainfo', ['linux/eric7.appdata.xml']),

eric ide

mercurial