[meld/build-updates: 4/26] build_helpers: Remove help building
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/build-updates: 4/26] build_helpers: Remove help building
- Date: Sun, 11 Sep 2022 02:17:14 +0000 (UTC)
commit 23d4060d98ef32a13814a8e0d6b8d197414fee09
Author: Kai Willadsen <kai willadsen gmail com>
Date: Wed Aug 10 10:20:19 2022 +1000
build_helpers: Remove help building
We have no support for Mallard help on Windows, and just direct users to
the website help version instead.
meld/build_helpers.py | 89 ---------------------------------------------------
1 file changed, 89 deletions(-)
---
diff --git a/meld/build_helpers.py b/meld/build_helpers.py
index eb5041cd..cfb287bb 100644
--- a/meld/build_helpers.py
+++ b/meld/build_helpers.py
@@ -54,7 +54,6 @@ def has_data(self):
cx_Freeze.command.build.Build.sub_commands.extend([
("build_i18n", has_i18n),
("build_icons", has_icons),
- ("build_help", has_help),
("build_data", has_data),
])
@@ -144,94 +143,6 @@ class build_data(distutils.cmd.Command):
data_files.extend(self.get_data_files())
-class build_help(distutils.cmd.Command):
-
- help_dir = 'help'
-
- def initialize_options(self):
- pass
-
- def finalize_options(self):
- pass
-
- def get_data_files(self):
- data_files = []
- name = self.distribution.metadata.name
-
- if "LINGUAS" in os.environ:
- self.selected_languages = os.environ["LINGUAS"].split()
- else:
- self.selected_languages = [
- d for d in os.listdir(self.help_dir) if os.path.isdir(d)
- ]
-
- if 'C' not in self.selected_languages:
- self.selected_languages.append('C')
-
- self.C_PAGES = glob.glob(os.path.join(self.help_dir, 'C', '*.page'))
- self.C_EXTRA = glob.glob(os.path.join(self.help_dir, 'C', '*.xml'))
-
- for lang in self.selected_languages:
- source_path = os.path.join(self.help_dir, lang)
- if not os.path.exists(source_path):
- continue
-
- build_path = os.path.join('build', self.help_dir, lang)
- if not os.path.exists(build_path):
- os.makedirs(build_path)
-
- if lang != 'C':
- po_file = os.path.join(source_path, lang + '.po')
- mo_file = os.path.join(build_path, lang + '.mo')
-
- msgfmt = ['msgfmt', po_file, '-o', mo_file]
- self.spawn(msgfmt)
- for page in self.C_PAGES:
- itstool = [
- 'itstool', '-m', mo_file, '-o', build_path, page]
- self.spawn(itstool)
- for extra in self.C_EXTRA:
- extra_path = os.path.join(
- build_path, os.path.basename(extra))
- if os.path.exists(extra_path):
- os.unlink(extra_path)
- os.symlink(os.path.relpath(extra, source_path), extra_path)
- else:
- distutils.dir_util.copy_tree(source_path, build_path)
-
- xml_files = glob.glob('%s/*.xml' % build_path)
- mallard_files = glob.glob('%s/*.page' % build_path)
- path_help = os.path.join('share', 'help', lang, name)
- path_figures = os.path.join(path_help, 'figures')
- data_files.append((path_help, xml_files + mallard_files))
- figures = glob.glob('%s/figures/*.png' % build_path)
- if figures:
- data_files.append((path_figures, figures))
-
- return data_files
-
- def run(self):
- data_files = self.distribution.data_files
- data_files.extend(self.get_data_files())
- self.check_help()
-
- def check_help(self):
- for lang in self.selected_languages:
- build_path = os.path.join('build', self.help_dir, lang)
- if not os.path.exists(build_path):
- continue
-
- pages = [os.path.basename(p) for p in self.C_PAGES]
- for page in pages:
- page_path = os.path.join(build_path, page)
- if not os.path.exists(page_path):
- info("skipping missing file %s", page_path)
- continue
- lint = ['xmllint', '--noout', '--noent', '--path', build_path,
- '--xinclude', page_path]
- self.spawn(lint)
-
-
class build_icons(distutils.cmd.Command):
icon_dir = os.path.join("data", "icons")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]