distribution/packages/misc/shared-mime-info/patches/migrate-from-custom-itstool-to-builtin-msgfmt-for-creating-translated-XML.patch
fewtarius e3c2ecee27
* Start work on PS2 support, thanks in part to @CoreELEC and @batocera-linux.
* Add LMSensors for sensor and fan control (work in progress).
2022-09-04 17:43:37 -04:00

71 lines
2.1 KiB
Diff

From 0944c4d73819fd93a7857d56a967c638beb01141 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@archlinux.org>
Date: Mon, 8 Nov 2021 18:22:47 -0500
Subject: [PATCH] migrate from custom itstool to builtin msgfmt for creating
translated XML
gettext upstream has supported this for a very long time, and using it
means we don't need to jump through hoops to run ninja inside ninja in
order to generate the .mo files for itstool.
Although meson 0.60.0 added support for real targets for the built .mo
files, this changed the rules for output filenames, breaking the script.
But msgfmt does not care, and anyways comes with builtin meson functions
for convenient use.
Fixes #170
---
data/freedesktop_generate.sh | 12 ------------
data/meson.build | 16 +++++-----------
2 files changed, 5 insertions(+), 23 deletions(-)
delete mode 100755 data/freedesktop_generate.sh
diff --git a/data/freedesktop_generate.sh b/data/freedesktop_generate.sh
deleted file mode 100755
index 62ccffa..0000000
--- a/data/freedesktop_generate.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh -e
-
-src_root="$1"
-build_root="$2"
-
-ninja -C "${build_root}" shared-mime-info-gmo
-
-itstool \
- --its "${src_root}/data/its/shared-mime-info.its" \
- --join "${src_root}/data/freedesktop.org.xml.in" \
- -o "${build_root}/data/freedesktop.org.xml" \
- "${build_root}/po/"*".gmo"
diff --git a/data/meson.build b/data/meson.build
index 24361c9..09ed7a9 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,18 +1,12 @@
install_man('update-mime-database.1')
-freedesktop_org_xml = custom_target('freedesktop.org.xml',
- input : files(
- 'freedesktop.org.xml.in',
- 'its/shared-mime-info.its',
- 'its/shared-mime-info.loc',
- ),
+freedesktop_org_xml = i18n.merge_file(
+ input: 'freedesktop.org.xml.in',
output: 'freedesktop.org.xml',
- command: [
- find_program('freedesktop_generate.sh'),
- meson.source_root(),
- meson.build_root()
- ],
+ data_dirs: '.',
+ po_dir: '../po',
+ type: 'xml',
install: true,
install_dir: get_option('datadir') / 'mime' / 'packages',
)
--
GitLab