Skip to contentSkip to conversation

Add meson option introspection for libsecret

PATCH New kai 1 participant 3 messages May 22, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore

kai

author
#0 lore raw

v2 cover Add meson option introspection for libsecret

From: Kai Kang <[email protected]>

v2:
* revert distro feature check for 'gobject-introspection-data'

Build with/without config

DISTRO_FEATURES_remove = "gobject-introspection-data"

$ bitbake webkitgtk pinentry

Build successfully.

Kai Kang (2):
libsecret: add meson option introspection
Revert "webkitgtk, pinentry: require gobject-introspection-data in
DISTRO_FEATURES when libsecret PACKAGECONFIG is enabled"

 .../0001-meson-add-option-introspection.patch | 137 ++++++++++++++++++
 .../libsecret/libsecret_0.20.3.bb             |   8 +-
 meta/recipes-sato/webkit/webkitgtk_2.28.2.bb  |   6 +-
 .../pinentry/pinentry_1.1.0.bb                |   5 +-
 4 files changed, 144 insertions(+), 12 deletions(-)
 create mode 100644 meta/recipes-gnome/libsecret/files/0001-meson-add-option-introspection.patch

--
2.17.1

author
#1 lore raw

PATCH v2 1/2 libsecret: add meson option introspection

From: Kai Kang <[email protected]>

Add meson option 'introspection' for libsecret. For bsp which doesn't support qemu usermode, it could disable gobject introspection build. Then remove distro feature check for 'gobject-introspection-data' too.

---
 .../0001-meson-add-option-introspection.patch | 137 ++++++++++++++++++
 .../libsecret/libsecret_0.20.3.bb             |   8 +-
 2 files changed, 140 insertions(+), 5 deletions(-)
 create mode 100644 meta/recipes-gnome/libsecret/files/0001-meson-add-option-introspection.patch
meta/recipes-gnome/libsecret/files/0001-meson-add-option-introspection.patch new file +137 -0
new file mode 100644
index 0000000000..51ee66f42b
@@ -0,0 +1,137 @@
+meson: add option introspection
+
+Add an option 'introspection' for meson which could control whether
+build GIR files or not.
+
+Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/libsecret/-/merge_requests/53]
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+ libsecret/meson.build | 86 ++++++++++++++++++++++---------------------
+ meson.build           |  1 +
+ meson_options.txt     |  1 +
+ 3 files changed, 46 insertions(+), 42 deletions(-)
+
+diff --git a/libsecret/meson.build b/libsecret/meson.build
+index 759b5ef..2ee8850 100644
+--- a/libsecret/meson.build
++++ b/libsecret/meson.build
+@@ -104,50 +104,52 @@ libsecret_dep = declare_dependency(
+ )
+ 
+ # GObject Introspection
+-libsecret_gir_sources = [
+-  'secret-attributes.c',
+-  'secret-attributes.h',
+-  'secret-backend.c',
+-  'secret-backend.h',
+-  'secret-collection.c',
+-  'secret-collection.h',
+-  'secret-item.c',
+-  'secret-item.h',
+-  'secret-methods.c',
+-  'secret-password.c',
+-  'secret-password.h',
+-  'secret-paths.c',
+-  'secret-paths.h',
+-  'secret-prompt.c',
+-  'secret-prompt.h',
+-  'secret-retrievable.c',
+-  'secret-retrievable.h',
+-  'secret-schema.c',
+-  'secret-schema.h',
+-  'secret-schemas.c',
+-  'secret-schemas.h',
+-  'secret-service.c',
+-  'secret-service.h',
+-  'secret-types.h',
+-  'secret-value.c',
+-  'secret-value.h',
+-]
+-libsecret_gir_sources += version_h
+-libsecret_gir_sources += _enums_generated
+-
+-libsecret_gir = gnome.generate_gir(libsecret,
+-  sources: libsecret_gir_sources,
+-  namespace: 'Secret',
+-  nsversion: api_version_major,
+-  export_packages: 'libsecret-@0@'.format(api_version_major),
+-  includes: [ 'GObject-2.0', 'Gio-2.0' ],
+-  header: 'libsecret/secret.h',
+-  extra_args: [ '-D SECRET_COMPILATION'],
+-  install: true,
+-)
++if with_gir
++  libsecret_gir_sources = [
++    'secret-attributes.c',
++    'secret-attributes.h',
++    'secret-backend.c',
++    'secret-backend.h',
++    'secret-collection.c',
++    'secret-collection.h',
++    'secret-item.c',
++    'secret-item.h',
++    'secret-methods.c',
++    'secret-password.c',
++    'secret-password.h',
++    'secret-paths.c',
++    'secret-paths.h',
++    'secret-prompt.c',
++    'secret-prompt.h',
++    'secret-retrievable.c',
++    'secret-retrievable.h',
++    'secret-schema.c',
++    'secret-schema.h',
++    'secret-schemas.c',
++    'secret-schemas.h',
++    'secret-service.c',
++    'secret-service.h',
++    'secret-types.h',
++    'secret-value.c',
++    'secret-value.h',
++  ]
++  libsecret_gir_sources += version_h
++  libsecret_gir_sources += _enums_generated
++
++  libsecret_gir = gnome.generate_gir(libsecret,
++    sources: libsecret_gir_sources,
++    namespace: 'Secret',
++    nsversion: api_version_major,
++    export_packages: 'libsecret-@0@'.format(api_version_major),
++    includes: [ 'GObject-2.0', 'Gio-2.0' ],
++    header: 'libsecret/secret.h',
++    extra_args: [ '-D SECRET_COMPILATION'],
++    install: true,
++  )
++endif
+ 
+ # Vapi
+-if with_vapi
++if with_vapi and with_gir
+   libsecret_vapi = gnome.generate_vapi('libsecret-@0@'.format(api_version_major),
+     sources: libsecret_gir[0],
+     metadata_dirs: meson.source_root() / 'libsecret',
+diff --git a/meson.build b/meson.build
+index a26d046..d22e008 100644
+--- a/meson.build
++++ b/meson.build
+@@ -22,6 +22,7 @@ with_gcrypt = get_option('gcrypt')
+ enable_debug = get_option('debugging')
+ with_vapi = get_option('vapi')
+ with_gtkdoc = get_option('gtk_doc')
++with_gir = get_option('introspection')
+ 
+ # Some variables
+ config_h_dir = include_directories('.')
+diff --git a/meson_options.txt b/meson_options.txt
+index c1fda5d..445aeb0 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -3,3 +3,4 @@ option('gcrypt', type: 'boolean', value: true, description: 'With gcrypt and tra
+ option('debugging', type: 'boolean', value: false, description: 'Turn debugging on/off')
+ option('vapi', type: 'boolean', value: true, description: 'Create VAPI file.')
+ option('gtk_doc', type: 'boolean', value: true, description: 'Build reference documentation using gtk-doc')
++option('introspection', type: 'boolean', value: true, description: 'Create GIR file.')
+-- 
+2.17.1
+
meta/recipes-gnome/libsecret/libsecret_0.20.3.bb +3 -5
index 8d317c8efc..533015a1e4 100644
@@ -9,19 +9,17 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=23c2a5e0106b99d75238986559bb5fc6"
 
 GNOMEBASEBUILDCLASS = "meson"
 
-inherit gnomebase gtk-doc vala gobject-introspection manpages features_check
+inherit gnomebase gtk-doc vala gobject-introspection manpages
 
 DEPENDS += "glib-2.0 libgcrypt gettext-native"
 
+SRC_URI += "file://0001-meson-add-option-introspection.patch"
+
 SRC_URI[archive.md5sum] = "47c3fdfeb111a87b509ad271e4a6f496"
 SRC_URI[archive.sha256sum] = "4fcb3c56f8ac4ab9c75b66901fb0104ec7f22aa9a012315a14c0d6dffa5290e4"
 
 GTKDOC_MESON_OPTION = 'gtk_doc'
 
-# gobject-introspection is mandatory and cannot be configured
-REQUIRED_DISTRO_FEATURES = "gobject-introspection-data"
-UNKNOWN_CONFIGURE_WHITELIST_append = " introspection"
-
 PACKAGECONFIG[manpages] = "-Dmanpage=true,-Dmanpage=false,libxslt-native xmlto-native"
 
 # http://errors.yoctoproject.org/Errors/Details/20228/
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH v2 2/2 Revert "webkitgtk, pinentry: require gobject-introspection-data in DISTRO_FEATURES when libsecret PACKAGECONFIG is enabled"

In reply to kai

From: Kai Kang <[email protected]>

This reverts commit 91264e5e0ab40b796e214edd84c72bc88b363778.

It adds meson options 'instrospection' to disable gobject introspection files build. So no need to check distro feature 'gobject-introspection-data' any longer.

Keep the spaces adjustment and comment removal.

---
 meta/recipes-sato/webkit/webkitgtk_2.28.2.bb    | 6 ++----
 meta/recipes-support/pinentry/pinentry_1.1.0.bb | 5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)
meta/recipes-sato/webkit/webkitgtk_2.28.2.bb +2 -4
index 51596077b4..e9941c7a2c 100644
@@ -26,9 +26,7 @@ SRC_URI[sha256sum] = "b9d23525cfd8d22c37b5d964a9fe9a8ce7583042a2f8d3922e71e6bbc6
 inherit cmake pkgconfig gobject-introspection perlnative features_check upstream-version-is-even gtk-doc
 
 ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
-REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'opengl', '', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'libsecret', 'gobject-introspection-data', '', d)} \
-"
+REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'opengl', '', d)}"
 
 CVE_PRODUCT = "webkitgtk webkitgtk\+"
 
@@ -44,7 +42,7 @@ PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'webgl opengl', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'webgl gles2', d)} \
                    enchant \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'gobject-introspection-data', 'libsecret', '', d)} \
+                   libsecret \
                   "
 
 PACKAGECONFIG[wayland] = "-DENABLE_WAYLAND_TARGET=ON,-DENABLE_WAYLAND_TARGET=OFF,wayland libwpe wpebackend-fdo wayland-native"
meta/recipes-support/pinentry/pinentry_1.1.0.bb +2 -3
index dc9069b9d5..d9ca0732f7 100644
@@ -19,9 +19,7 @@ SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
 SRC_URI[md5sum] = "3829315cb0a1e9cedc05ffe6def7a2c6"
 SRC_URI[sha256sum] = "68076686fa724a290ea49cdf0d1c0c1500907d1b759a3bcbfbec0293e8f56570"
 
-inherit autotools pkgconfig features_check
-
-REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('PACKAGECONFIG', 'libsecret', 'gobject-introspection-data', '', d)}"
+inherit autotools pkgconfig
 
 PACKAGECONFIG ??= "ncurses libcap"
 
@@ -29,6 +27,7 @@ PACKAGECONFIG[ncurses] = "--enable-ncurses  --with-ncurses-include-dir=${STAGING
 PACKAGECONFIG[libcap] = "--with-libcap, --without-libcap, libcap"
 PACKAGECONFIG[qt] = "--enable-pinentry-qt, --disable-pinentry-qt, qtbase-native qtbase"
 PACKAGECONFIG[gtk2] = "--enable-pinentry-gtk2, --disable-pinentry-gtk2, gtk+ glib-2.0"
+
 PACKAGECONFIG[secret] = "--enable-libsecret, --disable-libsecret, libsecret"
 
 EXTRA_OECONF = " \
Signature · 1 line
2.17.1