!11 fix invalid use of subprojects

From: @yangchen_guang 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
This commit is contained in:
openeuler-ci-bot 2023-01-19 06:30:52 +00:00 committed by Gitee
commit af2265ef25
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,60 @@
From b3eb04485cf4553b0e588a7ca78f7377e1c4f35e Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz93@gmail.com>
Date: Mon, 27 Jun 2022 01:48:02 -0400
Subject: [PATCH] fix invalid use of subprojects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The keycodemapdb Meson subproject provides a program and a source input.
Since it is a subproject, Meson wants to sandbox that and requires it to
be explicitly exported. But this never happened -- instead, we manually
poked at files using the actual string path "subprojects/......"
This was always a Meson sandbox violation, but Meson 0.63.0 started
noticing it and erroring out.
Instead, do the right thing. Update the subproject to a version that has
a meson.build with actually meaningful contents -- namely, a files
variable and a found program. Then use these in order to run the needed
custom_target.
In the process, it is also necessary to correct the argument ordering
when running keymap-gen.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
diff --git a/meson.build b/meson.build
index 995268b..8ce87ae 100644
--- a/meson.build
+++ b/meson.build
@@ -40,9 +40,10 @@ spice_common = subproject('spice-common', default_options : ['generate-code=clie
spice_gtk_config_data.merge_from(spice_common.get_variable('spice_common_config_data'))
spice_glib_deps += spice_common.get_variable('spice_common_client_dep')
-subproject('keycodemapdb')
-keymapgen = files('subprojects/keycodemapdb/tools/keymap-gen')
-keymapcsv = files('subprojects/keycodemapdb/data/keymaps.csv')
+keycodemapdb = subproject('keycodemapdb')
+
+keymapgen = find_program('keymap-gen')
+keymapcsv = keycodemapdb.get_variable('keymaps_csv')
#
# check for system headers
diff --git a/subprojects/keycodemapdb/meson.build b/subprojects/keycodemapdb/meson.build
index eb9416b..ea05720 100644
--- a/subprojects/keycodemapdb/meson.build
+++ b/subprojects/keycodemapdb/meson.build
@@ -1 +1,7 @@
-project('keycodemapdb')
+project('keycodemapdb', meson_version: '>=0.46.0')
+
+keymap_gen = find_program('tools/keymap-gen')
+meson.override_find_program('keymap-gen', keymap_gen)
+
+keymaps_csv = files('data/keymaps.csv')
+
--
2.20.1

View File

@ -1,11 +1,12 @@
Name: spice-gtk
Version: 0.38
Release: 3
Release: 4
Summary: A GIMP Toolkit (GTK+) widget for SPICE clients
License: LGPLv2+
URL: https://www.spice-space.org/spice-gtk.html
Source0: https://www.spice-space.org/download/gtk/%{name}-%{version}.tar.xz
Patch0000: fix-finding-pyparsing.patch
Patch0001: fix-invalid-use-of-subprojects.patch
BuildRequires: git-core meson intltool usbredir-devel >= 0.7.1 libusb1-devel >= 1.0.21 pixman-devel libjpeg-turbo-devel
BuildRequires: opus-devel zlib-devel cyrus-sasl-devel libcacard-devel gobject-introspection-devel libacl-devel polkit-devel
BuildRequires: gtk-doc vala usbutils libsoup-devel >= 2.49.91 libphodav-devel lz4-devel gtk3-devel json-glib-devel
@ -90,6 +91,9 @@ Files for help with spice-gtk.
%{_mandir}/man1/spice-client.1*
%changelog
* Wed Jan 18 2023 yangchenguang <yangchenguang@uniontech.com> - 0.38-4
- fix invalid use of subprojects
* Tue Feb 08 2022 caodongxia<caodongxia@huawei.com> - 0.38-3
- Fix python module pyparsing not found due to pyparsing update