meson: import patch for fixing generated .desktop files

resolves void-linux/void-packages#3217 void-linux/void-packages#3222
This commit is contained in:
maxice8 2018-10-10 16:13:04 -03:00 committed by maxice8
parent ea91d55378
commit fea112b238
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,50 @@
From 238710cfab18da9d7c4091133b57e0bf638a6020 Mon Sep 17 00:00:00 2001
From: Jussi Pakkanen <jpakkane@gmail.com>
Date: Mon, 1 Oct 2018 20:31:48 +0300
Subject: [PATCH] Fix handling generated .desktop files. Closes #4304.
---
mesonbuild/modules/i18n.py | 22 ++++++++++---------
.../6 gettext/generated/desktopgenerator.py | 9 ++++++++
.../6 gettext/generated/meson.build | 14 ++++++++++++
.../generated/something.desktop.in.in | 15 +++++++++++++
test cases/frameworks/6 gettext/meson.build | 1 +
5 files changed, 51 insertions(+), 10 deletions(-)
create mode 100644 test cases/frameworks/6 gettext/generated/desktopgenerator.py
create mode 100644 test cases/frameworks/6 gettext/generated/meson.build
create mode 100644 test cases/frameworks/6 gettext/generated/something.desktop.in.in
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index 0fc052b778..8b5e18162f 100644
--- mesonbuild/modules/i18n.py
+++ mesonbuild/modules/i18n.py
@@ -82,17 +82,19 @@ def merge_file(self, state, args, kwargs):
kwargs['command'] = command
inputfile = kwargs['input']
- if isinstance(inputfile, str):
- inputfile = mesonlib.File.from_source_file(state.environment.source_dir,
+ if hasattr(inputfile, 'held_object'):
+ ct = build.CustomTarget(kwargs['output'] + '_merge', state.subdir, state.subproject, kwargs)
+ else:
+ if isinstance(inputfile, str):
+ inputfile = mesonlib.File.from_source_file(state.environment.source_dir,
state.subdir, inputfile)
- output = kwargs['output']
- ifile_abs = inputfile.absolute_path(state.environment.source_dir,
- state.environment.build_dir)
- values = mesonlib.get_filenames_templates_dict([ifile_abs], None)
- outputs = mesonlib.substitute_values([output], values)
- output = outputs[0]
-
- ct = build.CustomTarget(output + '_' + state.subdir + '_merge', state.subdir, state.subproject, kwargs)
+ output = kwargs['output']
+ ifile_abs = inputfile.absolute_path(state.environment.source_dir,
+ state.environment.build_dir)
+ values = mesonlib.get_filenames_templates_dict([ifile_abs], None)
+ outputs = mesonlib.substitute_values([output], values)
+ output = outputs[0]
+ ct = build.CustomTarget(output + '_' + state.subdir + '_merge', state.subdir, state.subproject, kwargs)
return ModuleReturnValue(ct, [ct])
@FeatureNewKwargs('i18n.gettext', '0.37.0', ['preset'])

View File

@ -1,7 +1,7 @@
# Template file for 'meson'
pkgname=meson
version=0.48.0
revision=2
revision=3
noarch=yes
build_style=python3-module
pycompile_module="mesonbuild"