[meld/build-updates: 2/26] build_helpers: Remove Linux-specific distutils install helpers




commit fe135ee085699dd565b47da6fd4e4ae967c88bd9
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Aug 10 10:18:07 2022 +1000

    build_helpers: Remove Linux-specific distutils install helpers

 meld/build_helpers.py | 63 ---------------------------------------------------
 1 file changed, 63 deletions(-)
---
diff --git a/meld/build_helpers.py b/meld/build_helpers.py
index 0d67f9b3..aab47e31 100644
--- a/meld/build_helpers.py
+++ b/meld/build_helpers.py
@@ -27,19 +27,9 @@ import distutils.dir_util
 import distutils.dist
 import glob
 import os.path
-import platform
 import sys
 from distutils.log import info
 
-try:
-    import distro
-except ImportError:
-    python_version = tuple(int(x) for x in platform.python_version_tuple()[:2])
-    if python_version >= (3, 8):
-        print(
-            'Missing build requirement "distro" Python module; '
-            'install paths may be incorrect', file=sys.stderr)
-
 windows_build = os.name == 'nt'
 if windows_build:
     import cx_Freeze
@@ -72,18 +62,6 @@ command_base.command.build.Build.sub_commands.extend([
 ])
 
 
-class MeldDistribution(distutils.dist.Distribution):
-    global_options = distutils.dist.Distribution.global_options + [
-        ("no-update-icon-cache", None, "Don't run gtk-update-icon-cache"),
-        ("no-compile-schemas", None, "Don't compile gsettings schemas"),
-    ]
-
-    def __init__(self, *args, **kwargs):
-        self.no_update_icon_cache = False
-        self.no_compile_schemas = False
-        super().__init__(*args, **kwargs)
-
-
 class build_data(distutils.cmd.Command):
 
     gschemas = [
@@ -459,44 +437,3 @@ class build_py(distutils.command.build_py.build_py):
 
         distutils.command.build_py.build_py.build_module(
             self, module, module_file, package)
-
-
-class install(distutils.command.install.install):
-
-    def finalize_options(self):
-        special_cases = ('debian', 'ubuntu', 'linuxmint')
-        if platform.system() == 'Linux':
-            # linux_distribution has been removed in Python 3.8; we require
-            # the third-party distro package for future handling.
-            try:
-                distribution = platform.linux_distribution()[0].lower()
-            except AttributeError:
-                try:
-                    distribution = distro.id()
-                except NameError:
-                    distribution = 'unknown'
-
-            if distribution in special_cases:
-                # Maintain an explicit install-layout, but use deb by default
-                specified_layout = getattr(self, 'install_layout', None)
-                self.install_layout = specified_layout or 'deb'
-
-        distutils.command.install.install.finalize_options(self)
-
-
-class install_data(distutils.command.install_data.install_data):
-
-    def run(self):
-        distutils.command.install_data.install_data.run(self)
-
-        if not self.distribution.no_update_icon_cache:
-            # TODO: Generalise to non-hicolor icon themes
-            info("running gtk-update-icon-cache")
-            icon_path = os.path.join(self.install_dir, "share/icons/hicolor")
-            self.spawn(["gtk-update-icon-cache", "-q", "-t", icon_path])
-
-        if not self.distribution.no_compile_schemas:
-            info("compiling gsettings schemas")
-            gschema_path = build_data.gschemas[0][0]
-            gschema_install = os.path.join(self.install_dir, gschema_path)
-            self.spawn(["glib-compile-schemas", gschema_install])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]