archrelease: copy trunk to extra-x86_64
[arch-packages.git] / shared-mime-info / repos / extra-x86_64 / MR_162.patch
blob0c554aa5eed8cde0f3b862bca06956a04c5bead4
1 From 5a406b06792e26a83c7346b3c2443c0bd8d4cdb2 Mon Sep 17 00:00:00 2001
2 From: Eli Schwartz <eschwartz@archlinux.org>
3 Date: Mon, 8 Nov 2021 18:22:47 -0500
4 Subject: [PATCH] migrate from custom itstool to builtin msgfmt for creating
5 translated XML
7 gettext upstream has supported this for a very long time (since 0.19.7
8 via commit b3c2a5a242c36fbbaa0c5b17f975d6c638598a23, released in 2015),
9 and itstool is (mostly) a legacy of the time before gettext had proper
10 support for these sorts of use cases.
12 This is similar to the state of intltool, which is described at
13 https://wiki.gnome.org/MigratingFromIntltoolToGettext
15 During the port from autotools to meson, the legacy use of itstool was
16 faithfully translated to meson in the only way possible: by jumping
17 through hoops to run ninja inside ninja in order to generate the .mo
18 files for itstool, because meson's i18n module used a flawed design and
19 there was no "real" target to create those files, only a .PHONY
20 run_target which other rules cannot depend on.
22 Although meson 0.60.0 added support for real targets for the built .mo
23 files, this changed the rules for output filenames, breaking the script.
25 But msgfmt does not care, and anyways comes with builtin meson functions
26 for convenient use with XML files. So let's take this opportunity to
27 drop legacy dependencies and use the modern, builtin tooling, which
28 fixes this bug as a side effect.
30 Fixes #170
31 ---
32 .gitlab-ci.yml | 2 --
33 README.md | 2 +-
34 data/freedesktop_generate.sh | 12 ------------
35 data/meson.build | 16 +++++-----------
36 meson.build | 1 -
37 5 files changed, 6 insertions(+), 27 deletions(-)
38 delete mode 100755 data/freedesktop_generate.sh
40 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
41 index 985dfe9..345e1ce 100644
42 --- a/.gitlab-ci.yml
43 +++ b/.gitlab-ci.yml
44 @@ -9,7 +9,6 @@ variables:
45 glib2-devel
46 gettext
47 git
48 - itstool
49 xmlto
50 findutils
51 gettext-devel
52 @@ -34,4 +33,3 @@ build:meson:
53 paths:
54 - _build/meson-logs/*.txt
55 - _build/meson-dist/*.*
57 diff --git a/README.md b/README.md
58 index c23d9d5..b2fb0ac 100644
59 --- a/README.md
60 +++ b/README.md
61 @@ -19,7 +19,7 @@ $ ninja -v -C _build install
62 ```
64 It requires the glib development package to be installed as well as
65 -gettext and itstool.
66 +gettext.
67 This database is translated at Transifex.
70 diff --git a/data/freedesktop_generate.sh b/data/freedesktop_generate.sh
71 deleted file mode 100755
72 index 62ccffa..0000000
73 --- a/data/freedesktop_generate.sh
74 +++ /dev/null
75 @@ -1,12 +0,0 @@
76 -#!/bin/sh -e
78 -src_root="$1"
79 -build_root="$2"
81 -${NINJA:-ninja} -C "${build_root}" shared-mime-info-gmo
83 -itstool \
84 - --its "${src_root}/data/its/shared-mime-info.its" \
85 - --join "${src_root}/data/freedesktop.org.xml.in" \
86 - -o "${build_root}/data/freedesktop.org.xml" \
87 - "${build_root}/po/"*".gmo"
88 diff --git a/data/meson.build b/data/meson.build
89 index 24361c9..09ed7a9 100644
90 --- a/data/meson.build
91 +++ b/data/meson.build
92 @@ -1,18 +1,12 @@
94 install_man('update-mime-database.1')
96 -freedesktop_org_xml = custom_target('freedesktop.org.xml',
97 - input : files(
98 - 'freedesktop.org.xml.in',
99 - 'its/shared-mime-info.its',
100 - 'its/shared-mime-info.loc',
101 - ),
102 +freedesktop_org_xml = i18n.merge_file(
103 + input: 'freedesktop.org.xml.in',
104 output: 'freedesktop.org.xml',
105 - command: [
106 - find_program('freedesktop_generate.sh'),
107 - meson.source_root(),
108 - meson.build_root()
109 - ],
110 + data_dirs: '.',
111 + po_dir: '../po',
112 + type: 'xml',
113 install: true,
114 install_dir: get_option('datadir') / 'mime' / 'packages',
116 diff --git a/meson.build b/meson.build
117 index 0d08c8a..60f17ae 100644
118 --- a/meson.build
119 +++ b/meson.build
120 @@ -20,7 +20,6 @@ config.set_quoted('VERSION', meson.project_version())
121 ###############################################################################
122 # Find tools
124 -itstool = find_program('itstool')
125 xmllint = find_program('xmllint')
126 xmlto = find_program('xmlto', required: false)
129 GitLab