diff mbox series

[meta-oe,PATCHv2] libosinfo: add recipe

Message ID 20230823172528.1003528-1-f_l_k@t-online.de
State Under Review
Headers show
Series [meta-oe,PATCHv2] libosinfo: add recipe | expand

Commit Message

Markus Volk Aug. 23, 2023, 5:25 p.m. UTC
libosinfo
=========

libosinfo is a GObject based library API for managing information about
operating systems, hypervisors and the (virtual) hardware devices they can
support. It includes a database containing device metadata and provides APIs
to match/identify optimal devices for deploying an operating system on a
hypervisor. Via the magic of GObject Introspection, the API is available in all
common programming languages with demos for javascript (GJS/Seed) and python
(PyGObject). Vala bindings are also provided.

libosinfo is a required dependency for gnome-boxes

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 ...meson.build-allow-crosscompiling-gir.patch | 28 ++++++++++++++++
 .../libosinfo/libosinfo_1.10.bb               | 32 +++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta-oe/recipes-support/libosinfo/libosinfo/0001-meson.build-allow-crosscompiling-gir.patch
 create mode 100644 meta-oe/recipes-support/libosinfo/libosinfo_1.10.bb

Comments

Martin Jansa Aug. 30, 2023, 7:21 a.m. UTC | #1
On Wed, Aug 23, 2023 at 7:25 PM Markus Volk <f_l_k@t-online.de> wrote:

> libosinfo
> =========
>
> libosinfo is a GObject based library API for managing information about
> operating systems, hypervisors and the (virtual) hardware devices they can
> support. It includes a database containing device metadata and provides
> APIs
> to match/identify optimal devices for deploying an operating system on a
> hypervisor. Via the magic of GObject Introspection, the API is available
> in all
> common programming languages with demos for javascript (GJS/Seed) and
> python
> (PyGObject). Vala bindings are also provided.
>
> libosinfo is a required dependency for gnome-boxes
>
> Signed-off-by: Markus Volk <f_l_k@t-online.de>
> ---
>  ...meson.build-allow-crosscompiling-gir.patch | 28 ++++++++++++++++
>  .../libosinfo/libosinfo_1.10.bb               | 32 +++++++++++++++++++
>  2 files changed, 60 insertions(+)
>  create mode 100644
> meta-oe/recipes-support/libosinfo/libosinfo/0001-meson.build-allow-crosscompiling-gir.patch
>  create mode 100644 meta-oe/recipes-support/libosinfo/libosinfo_1.10.bb
>
> diff --git
> a/meta-oe/recipes-support/libosinfo/libosinfo/0001-meson.build-allow-crosscompiling-gir.patch
> b/meta-oe/recipes-support/libosinfo/libosinfo/0001-meson.build-allow-crosscompiling-gir.patch
> new file mode 100644
> index 0000000000..778a1f6e1e
> --- /dev/null
> +++
> b/meta-oe/recipes-support/libosinfo/libosinfo/0001-meson.build-allow-crosscompiling-gir.patch
> @@ -0,0 +1,28 @@
> +From 123b5a4c5e09f4262d4545a0bc5edb01a19b6b76 Mon Sep 17 00:00:00 2001
> +From: Markus Volk <f_l_k@t-online.de>
> +Date: Mon, 21 Aug 2023 10:06:55 +0200
> +Subject: [PATCH] meson.build: allow crosscompiling gir
> +
> +Upstream-Status: Inappropriate [oe specific]
> +
> +Signed-off-by: Markus Volk <f_l_k@t-online.de>
> +---
> + meson.build | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/meson.build b/meson.build
> +index 39b739e..46f2252 100644
> +--- a/meson.build
> ++++ b/meson.build
> +@@ -29,7 +29,7 @@ libosinfo_pkgconfdir = join_paths(libosinfo_libdir,
> 'pkgconfig')
> +
> + # gobject introspection
> + gir = find_program('g-ir-scanner', required:
> get_option('enable-introspection'))
> +-enable_introspection = gir.found() and not meson.is_cross_build()
> ++enable_introspection = gir.found()
> +
> + # vala
> + vapi_opt = get_option('enable-vala')
> +--
> +2.41.0
> +
> diff --git a/meta-oe/recipes-support/libosinfo/libosinfo_1.10.bb
> b/meta-oe/recipes-support/libosinfo/libosinfo_1.10.bb
> new file mode 100644
> index 0000000000..b02bc12816
> --- /dev/null
> +++ b/meta-oe/recipes-support/libosinfo/libosinfo_1.10.bb
> @@ -0,0 +1,32 @@
> +SUMMARY = "API for managing information about operating systems,
> hypervisors and the (virtual) hardware devices."
> +HOMEPAGE = "https://libosinfo.org"
> +
> +LICENSE = "LGPL-2.1-only & GPL-2.0-only"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=2b0e9926530c269f5ae95560370195af"
> +LIC_FILES_CHKSUM =
> "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
> +
> +SRC_URI = " \
> +       git://
> gitlab.com/libosinfo/libosinfo.git;branch=main;protocol=https \
> +       file://0001-meson.build-allow-crosscompiling-gir.patch \
> +"
> +
> +SRCREV = "f503ff7a9e13963bcf396776bce0b209a819ba9b"
> +
> +S = "${WORKDIR}/git"
> +
> +inherit meson pkgconfig gtk-doc gobject-introspection vala
> +
> +DEPENDS = "glib-2.0 libsoup libxslt"
> +
> +GIR_MESON_OPTION = "enable-introspection"
> +GIR_MESON_ENABLE_FLAG = 'enabled'
> +GIR_MESON_DISABLE_FLAG = 'disabled'
> +GTKDOC_MESON_OPTION = "enable-gtk-doc"
> +
> +EXTRA_OEMESON = " \
> +       -Dwith-pci-ids-path=${datadir}/pci.ids \
> +       -Dwith-usb-ids-path=${datadir}/usb.ids \
> +       -Denable-vala=enabled \
>

vala should be enabled only when GIR is otherwise it fails with:
meson.build:40:8: ERROR: Problem encountered: vala support was requested,
but introspection support is mandatory.

+"
> +
> +RDEPENDS:${PN} = "pciutils-ids usbids"
> --
> 2.41.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#104555):
> https://lists.openembedded.org/g/openembedded-devel/message/104555
> Mute This Topic: https://lists.openembedded.org/mt/100919745/3617156
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> Martin.Jansa@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/libosinfo/libosinfo/0001-meson.build-allow-crosscompiling-gir.patch b/meta-oe/recipes-support/libosinfo/libosinfo/0001-meson.build-allow-crosscompiling-gir.patch
new file mode 100644
index 0000000000..778a1f6e1e
--- /dev/null
+++ b/meta-oe/recipes-support/libosinfo/libosinfo/0001-meson.build-allow-crosscompiling-gir.patch
@@ -0,0 +1,28 @@ 
+From 123b5a4c5e09f4262d4545a0bc5edb01a19b6b76 Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Mon, 21 Aug 2023 10:06:55 +0200
+Subject: [PATCH] meson.build: allow crosscompiling gir
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 39b739e..46f2252 100644
+--- a/meson.build
++++ b/meson.build
+@@ -29,7 +29,7 @@ libosinfo_pkgconfdir = join_paths(libosinfo_libdir, 'pkgconfig')
+ 
+ # gobject introspection
+ gir = find_program('g-ir-scanner', required: get_option('enable-introspection'))
+-enable_introspection = gir.found() and not meson.is_cross_build()
++enable_introspection = gir.found()
+ 
+ # vala
+ vapi_opt = get_option('enable-vala')
+-- 
+2.41.0
+
diff --git a/meta-oe/recipes-support/libosinfo/libosinfo_1.10.bb b/meta-oe/recipes-support/libosinfo/libosinfo_1.10.bb
new file mode 100644
index 0000000000..b02bc12816
--- /dev/null
+++ b/meta-oe/recipes-support/libosinfo/libosinfo_1.10.bb
@@ -0,0 +1,32 @@ 
+SUMMARY = "API for managing information about operating systems, hypervisors and the (virtual) hardware devices."
+HOMEPAGE = "https://libosinfo.org"
+
+LICENSE = "LGPL-2.1-only & GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2b0e9926530c269f5ae95560370195af"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = " \
+	git://gitlab.com/libosinfo/libosinfo.git;branch=main;protocol=https \
+	file://0001-meson.build-allow-crosscompiling-gir.patch \
+"
+
+SRCREV = "f503ff7a9e13963bcf396776bce0b209a819ba9b"
+
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig gtk-doc gobject-introspection vala
+
+DEPENDS = "glib-2.0 libsoup libxslt"
+
+GIR_MESON_OPTION = "enable-introspection"
+GIR_MESON_ENABLE_FLAG = 'enabled'
+GIR_MESON_DISABLE_FLAG = 'disabled'
+GTKDOC_MESON_OPTION = "enable-gtk-doc"
+
+EXTRA_OEMESON = " \
+	-Dwith-pci-ids-path=${datadir}/pci.ids \
+	-Dwith-usb-ids-path=${datadir}/usb.ids \
+	-Denable-vala=enabled \
+"
+
+RDEPENDS:${PN} = "pciutils-ids usbids"