All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH 1/3] libgusb: Allow building in native mode
@ 2023-03-30 13:43 Zoltán Böszörményi
  2023-03-30 13:43 ` [meta-oe][PATCH 2/3] libfprint: New recipe Zoltán Böszörményi
  2023-03-30 13:43 ` [meta-oe][PATCH 3/3] fprintd: " Zoltán Böszörményi
  0 siblings, 2 replies; 14+ messages in thread
From: Zoltán Böszörményi @ 2023-03-30 13:43 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Zoltán Böszörményi

Dependency of libfprint-native.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
 meta-oe/recipes-support/libgusb/libgusb_0.3.10.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta-oe/recipes-support/libgusb/libgusb_0.3.10.bb b/meta-oe/recipes-support/libgusb/libgusb_0.3.10.bb
index c208a2090..491b6a7a1 100644
--- a/meta-oe/recipes-support/libgusb/libgusb_0.3.10.bb
+++ b/meta-oe/recipes-support/libgusb/libgusb_0.3.10.bb
@@ -6,9 +6,13 @@ DEPENDS = "glib-2.0 libusb"
 
 inherit meson gobject-introspection gtk-doc gettext vala
 
-PACKAGECONFIG ??= "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'vapi', '', d)}"
+PACKAGECONFIG:class-target ??= "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'vapi', '', d)}"
 PACKAGECONFIG[vapi] = "-Dvapi=true,-Dvapi=false"
 
+EXTRA_OEMESON:append:class-native = " -Dtests=false -Dintrospection=false"
+
 SRC_URI = "git://github.com/hughsie/libgusb.git;branch=main;protocol=https"
 SRCREV = "332d5b987ffecb824426e88518e05547faf2b520"
 S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native"
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 13:43 [meta-oe][PATCH 1/3] libgusb: Allow building in native mode Zoltán Böszörményi
@ 2023-03-30 13:43 ` Zoltán Böszörményi
  2023-03-30 13:50   ` [oe] " Alexander Kanavin
  2023-03-31 17:41   ` Khem Raj
  2023-03-30 13:43 ` [meta-oe][PATCH 3/3] fprintd: " Zoltán Böszörményi
  1 sibling, 2 replies; 14+ messages in thread
From: Zoltán Böszörményi @ 2023-03-30 13:43 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Zoltán Böszörményi

libfprint is the library used by fprintd.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
 ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
 .../0002-Make-building-tests-optional.patch   |  47 ++++++++
 .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
 3 files changed, 203 insertions(+)
 create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
 create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
 create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb

diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
new file mode 100644
index 000000000..779d78c28
--- /dev/null
+++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
@@ -0,0 +1,111 @@
+From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Thu, 30 Mar 2023 09:45:31 +0200
+Subject: [PATCH 1/2] Optionally use native generators
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+fprint-list-udev-hwdb and fprint-list-udev-rules are run
+during the build to generate autosuspend.hwdb and 70-*.rules,
+respectively.
+
+Since they are not marked as "native: true", a cross-compiled
+version is not possible.
+
+Since these binaries are linked with the libfprint_drivers target,
+marking them as native binaries would also need libfprint_drivers
+to be duplicated as a native version and possibly other library
+targets, too.
+
+Instead, make it the responsibility of the cross-compiler
+framework to build the native variant separately and allow
+the external binaries to be passed in.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+---
+ libfprint/meson.build | 30 ++++++++++++++++++++----------
+ meson_options.txt     |  8 ++++++++
+ 2 files changed, 28 insertions(+), 10 deletions(-)
+
+diff --git a/libfprint/meson.build b/libfprint/meson.build
+index d3c8b03..2a4de67 100644
+--- a/libfprint/meson.build
++++ b/libfprint/meson.build
+@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
+     ]
+ )
+ 
+-udev_hwdb = executable('fprint-list-udev-hwdb',
+-    'fprint-list-udev-hwdb.c',
+-    dependencies: libfprint_private_dep,
+-    link_with: libfprint_drivers,
+-    install: false)
++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
++if udev_hwdb_cmd == ''
++    udev_hwdb = executable('fprint-list-udev-hwdb',
++        'fprint-list-udev-hwdb.c',
++        dependencies: libfprint_private_dep,
++        link_with: libfprint_drivers,
++        install: false)
++else
++    udev_hwdb = find_program(udev_hwdb_cmd)
++endif
+ 
+ udev_hwdb_generator = custom_target('udev-hwdb',
+     output: 'autosuspend.hwdb',
+@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
+     install: false,
+ )
+ 
++udev_rules_cmd = get_option('udev_rules_cmd')
+ if install_udev_rules
+-    udev_rules = executable('fprint-list-udev-rules',
+-        'fprint-list-udev-rules.c',
+-        dependencies: libfprint_private_dep,
+-        link_with: libfprint_drivers,
+-        install: false)
++    if udev_rules_cmd == ''
++        udev_rules = executable('fprint-list-udev-rules',
++            'fprint-list-udev-rules.c',
++            dependencies: libfprint_private_dep,
++            link_with: libfprint_drivers,
++            install: false)
++    else
++        udev_rules = find_program(udev_rules_cmd)
++    endif
+ 
+     custom_target('udev-rules',
+         output: '70-@0@.rules'.format(versioned_libname),
+diff --git a/meson_options.txt b/meson_options.txt
+index f9b801f..a6f0c4d 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -14,6 +14,10 @@ option('udev_rules_dir',
+        description: 'Installation path for udev rules',
+        type: 'string',
+        value: 'auto')
++option('udev_rules_cmd',
++       description : 'Optional path for native build of fprint-list-udev-rules',
++       type : 'string',
++       value : '')
+ option('udev_hwdb',
+        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
+        type: 'feature',
+@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
+        description: 'Installation path for udev hwdb',
+        type: 'string',
+        value: 'auto')
++option('udev_hwdb_cmd',
++       description : 'Optional path for native build of fprint-list-udev-hwdb',
++       type : 'string',
++       value : '')
+ option('gtk-examples',
+        description: 'Whether to build GTK+ example applications',
+        type: 'boolean',
+-- 
+2.39.2
+
diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
new file mode 100644
index 000000000..c83ea95e1
--- /dev/null
+++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
@@ -0,0 +1,47 @@
+From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Thu, 30 Mar 2023 09:57:35 +0200
+Subject: [PATCH 2/2] Make building tests optional
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Submitted
+
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+---
+ meson.build       | 4 +++-
+ meson_options.txt | 4 ++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 1badb16..05edb8d 100644
+--- a/meson.build
++++ b/meson.build
+@@ -309,7 +309,9 @@ if get_option('gtk-examples')
+ endif
+ 
+ subdir('data')
+-subdir('tests')
++if get_option('tests')
++    subdir('tests')
++endif
+ 
+ pkgconfig = import('pkgconfig')
+ pkgconfig.generate(
+diff --git a/meson_options.txt b/meson_options.txt
+index a6f0c4d..175710d 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -38,3 +38,7 @@ option('doc',
+        description: 'Whether to build the API documentation',
+        type: 'boolean',
+        value: true)
++option('tests',
++       description: 'Whether to build the tests',
++       type: 'boolean',
++       value: true)
+-- 
+2.39.2
+
diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
new file mode 100644
index 000000000..b0133409a
--- /dev/null
+++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Library for fingerprint readers"
+DESCRIPTION = "libfprint is an open source software library \
+designed to make it easy for application developers to add \
+support for consumer fingerprint readers to their software."
+HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
+
+DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
+
+DEPENDS:append:class-target = " libfprint-native "
+
+LICENSE = "LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+
+#PR = "r1"
+
+SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
+
+SRC_URI = " \
+	git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
+	file://0001-Optionally-use-native-generators.patch \
+	file://0002-Make-building-tests-optional.patch \
+"
+
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig useradd python3native gobject-introspection
+
+EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
+
+EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
+	-Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
+	-Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
+	-Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
+"
+
+do_install:append:class-native () {
+	install -d ${D}${bindir}
+	install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
+	install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
+}
+
+BBCLASSEXTEND = "native"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM:${PN} = "fprint"
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [meta-oe][PATCH 3/3] fprintd: New recipe
  2023-03-30 13:43 [meta-oe][PATCH 1/3] libgusb: Allow building in native mode Zoltán Böszörményi
  2023-03-30 13:43 ` [meta-oe][PATCH 2/3] libfprint: New recipe Zoltán Böszörményi
@ 2023-03-30 13:43 ` Zoltán Böszörményi
  1 sibling, 0 replies; 14+ messages in thread
From: Zoltán Böszörményi @ 2023-03-30 13:43 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Zoltán Böszörményi

This is the DBus daemon that may be used for biometric authentication.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
 .../0001-Make-building-tests-optional.patch   | 81 +++++++++++++++++++
 .../recipes-support/fprintd/fprintd_git.bb    | 51 ++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 meta-oe/recipes-support/fprintd/fprintd/0001-Make-building-tests-optional.patch
 create mode 100644 meta-oe/recipes-support/fprintd/fprintd_git.bb

diff --git a/meta-oe/recipes-support/fprintd/fprintd/0001-Make-building-tests-optional.patch b/meta-oe/recipes-support/fprintd/fprintd/0001-Make-building-tests-optional.patch
new file mode 100644
index 000000000..5b1f3a2d2
--- /dev/null
+++ b/meta-oe/recipes-support/fprintd/fprintd/0001-Make-building-tests-optional.patch
@@ -0,0 +1,81 @@
+From 494df63b916bbf3ebf5e0bfc843a1b5298de63b6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Thu, 30 Mar 2023 15:06:14 +0200
+Subject: [PATCH] Make building tests optional
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Submitted
+
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+---
+ meson.build       | 10 +++++++++-
+ meson_options.txt |  4 ++++
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 859bcf2..2abdd1f 100644
+--- a/meson.build
++++ b/meson.build
+@@ -137,13 +137,16 @@ endif
+ polkit_policy_directory = polkit_gobject_dep.get_pkgconfig_variable('policydir')
+ 
+ # Tests dependencies
++if get_option('tests')
+ pam_wrapper_dep = dependency('pam_wrapper', required: false)
+ if get_option('pam') and not pam_wrapper_dep.found()
+     warning('Dependency "pam_wrapper" required by test suite not found')
+ endif
++endif
+ 
+ xmllint = find_program('xmllint', required: false)
+ python3 = find_program('python3') # No meson without it!
++if get_option('tests')
+ python3_test_modules = {
+     'cairo': true,
+     'dbus': true,
+@@ -159,6 +162,7 @@ foreach module, required : python3_test_modules
+         warning('Python3 module \'' + module + '\' required by test suite not found')
+     endif
+ endforeach
++endif
+ 
+ cdata = configuration_data()
+ cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+@@ -182,7 +186,9 @@ endif
+ if get_option('gtk_doc')
+     subdir('doc')
+ endif
+-subdir('tests')
++if get_option('tests')
++    subdir('tests')
++endif
+ subdir('po')
+ 
+ output = []
+@@ -205,6 +211,8 @@ output += '  Manuals: ' + get_option('man').to_string()
+ output += '  GTK Doc: ' + get_option('gtk_doc').to_string()
+ output += '  XML Linter ' + xmllint.found().to_string()
+ output += '\nTest setup:\n'
++if get_option('tests')
+ output += '  With address sanitizer: ' + address_sanitizer.to_string()
++endif
+ 
+ message('\n'+'\n'.join(output)+'\n')
+diff --git a/meson_options.txt b/meson_options.txt
+index 286889e..73b28f2 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -28,3 +28,7 @@ option('gtk_doc',
+     type: 'boolean',
+     value: false,
+     description: 'Use gtk-doc to build documentation')
++option('tests',
++    type: 'boolean',
++    value: true,
++    description: 'Run tests')
+-- 
+2.39.2
+
diff --git a/meta-oe/recipes-support/fprintd/fprintd_git.bb b/meta-oe/recipes-support/fprintd/fprintd_git.bb
new file mode 100644
index 000000000..6d8e69bd3
--- /dev/null
+++ b/meta-oe/recipes-support/fprintd/fprintd_git.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Daemon for fingerprint readers"
+DESCRIPTION = "fprintd is a D-Bus daemon that offers libfprint \
+functionality over the D-Bus interprocess communication bus."
+HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/fprintd/"
+
+DEPENDS = " \
+	intltool-native glib-2.0 glib-2.0-native \
+	dbus-glib dbus-glib-native \
+	libpam libxslt libxslt-native libfprint polkit \
+"
+
+LICENSE = "GPL-2.0-or-later"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1f6f1c0be32491a0c8d2915607a28f36"
+
+#PR = "r1"
+
+# This is current master, the submitted patch does not apply to v1.94.2
+SRCREV = "09a3e5cf496e0ba0fe274003532c761e518fdfea"
+PV = "1.94.2"
+
+SRC_URI = " \
+	git://anongit.freedesktop.org/git/libfprint/fprintd.git;branch=master;protocol=https \
+	file://0001-Make-building-tests-optional.patch \
+"
+
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig gettext systemd
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+
+PACKAGECONFIG[pam] = "-Dpam=true -Dpam_modules_dir=${libdir}/security,-Dpam=false,libpam"
+
+EXTRA_OEMESON = "-Dtests=false -Dgtk_doc=false -Dsystemd_system_unit_dir=${systemd_system_unitdir} -Dpam_modules_dir=${base_libdir}/security"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE:${PN} = "fprintd.service"
+
+PACKAGES =+ "${PN}-pam ${PN}-conf"
+
+FILES:${PN}-pam = "${base_libdir}/security/pam_fprintd.so"
+
+FILES:${PN}-conf = "${sysconfdir}/fprintd.conf"
+
+FILES:${PN} += " \
+	${datadir}/dbus-1/ \
+	${datadir}/polkit-1/ \
+"
+
+FILES:${PN}-dev = "${base_libdir}/security/*.la"
+FILES:${PN}-staticdev += "${base_libdir}/security/*.a"
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 13:43 ` [meta-oe][PATCH 2/3] libfprint: New recipe Zoltán Böszörményi
@ 2023-03-30 13:50   ` Alexander Kanavin
  2023-03-30 14:22     ` Böszörményi Zoltán
                       ` (2 more replies)
  2023-03-31 17:41   ` Khem Raj
  1 sibling, 3 replies; 14+ messages in thread
From: Alexander Kanavin @ 2023-03-30 13:50 UTC (permalink / raw)
  To: Zoltan Boszormenyi; +Cc: openembedded-devel

Meson is specifically configured in yocto to user qemu usermode as the
wrapper to run cross binaries, so can libfprint build configuration be
tweaked to use that? This would avoid all the nasty -native extensions
and modifications.

Alex

On Thu, 30 Mar 2023 at 15:43, Zoltan Boszormenyi <zboszor@gmail.com> wrote:
>
> libfprint is the library used by fprintd.
>
> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> ---
>  ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
>  .../0002-Make-building-tests-optional.patch   |  47 ++++++++
>  .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
>  3 files changed, 203 insertions(+)
>  create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>  create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>  create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>
> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> new file mode 100644
> index 000000000..779d78c28
> --- /dev/null
> +++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> @@ -0,0 +1,111 @@
> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> + <zboszor@gmail.com>
> +Date: Thu, 30 Mar 2023 09:45:31 +0200
> +Subject: [PATCH 1/2] Optionally use native generators
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
> +during the build to generate autosuspend.hwdb and 70-*.rules,
> +respectively.
> +
> +Since they are not marked as "native: true", a cross-compiled
> +version is not possible.
> +
> +Since these binaries are linked with the libfprint_drivers target,
> +marking them as native binaries would also need libfprint_drivers
> +to be duplicated as a native version and possibly other library
> +targets, too.
> +
> +Instead, make it the responsibility of the cross-compiler
> +framework to build the native variant separately and allow
> +the external binaries to be passed in.
> +
> +Upstream-Status: Submitted
> +
> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> +---
> + libfprint/meson.build | 30 ++++++++++++++++++++----------
> + meson_options.txt     |  8 ++++++++
> + 2 files changed, 28 insertions(+), 10 deletions(-)
> +
> +diff --git a/libfprint/meson.build b/libfprint/meson.build
> +index d3c8b03..2a4de67 100644
> +--- a/libfprint/meson.build
> ++++ b/libfprint/meson.build
> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
> +     ]
> + )
> +
> +-udev_hwdb = executable('fprint-list-udev-hwdb',
> +-    'fprint-list-udev-hwdb.c',
> +-    dependencies: libfprint_private_dep,
> +-    link_with: libfprint_drivers,
> +-    install: false)
> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
> ++if udev_hwdb_cmd == ''
> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
> ++        'fprint-list-udev-hwdb.c',
> ++        dependencies: libfprint_private_dep,
> ++        link_with: libfprint_drivers,
> ++        install: false)
> ++else
> ++    udev_hwdb = find_program(udev_hwdb_cmd)
> ++endif
> +
> + udev_hwdb_generator = custom_target('udev-hwdb',
> +     output: 'autosuspend.hwdb',
> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
> +     install: false,
> + )
> +
> ++udev_rules_cmd = get_option('udev_rules_cmd')
> + if install_udev_rules
> +-    udev_rules = executable('fprint-list-udev-rules',
> +-        'fprint-list-udev-rules.c',
> +-        dependencies: libfprint_private_dep,
> +-        link_with: libfprint_drivers,
> +-        install: false)
> ++    if udev_rules_cmd == ''
> ++        udev_rules = executable('fprint-list-udev-rules',
> ++            'fprint-list-udev-rules.c',
> ++            dependencies: libfprint_private_dep,
> ++            link_with: libfprint_drivers,
> ++            install: false)
> ++    else
> ++        udev_rules = find_program(udev_rules_cmd)
> ++    endif
> +
> +     custom_target('udev-rules',
> +         output: '70-@0@.rules'.format(versioned_libname),
> +diff --git a/meson_options.txt b/meson_options.txt
> +index f9b801f..a6f0c4d 100644
> +--- a/meson_options.txt
> ++++ b/meson_options.txt
> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
> +        description: 'Installation path for udev rules',
> +        type: 'string',
> +        value: 'auto')
> ++option('udev_rules_cmd',
> ++       description : 'Optional path for native build of fprint-list-udev-rules',
> ++       type : 'string',
> ++       value : '')
> + option('udev_hwdb',
> +        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
> +        type: 'feature',
> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
> +        description: 'Installation path for udev hwdb',
> +        type: 'string',
> +        value: 'auto')
> ++option('udev_hwdb_cmd',
> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
> ++       type : 'string',
> ++       value : '')
> + option('gtk-examples',
> +        description: 'Whether to build GTK+ example applications',
> +        type: 'boolean',
> +--
> +2.39.2
> +
> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> new file mode 100644
> index 000000000..c83ea95e1
> --- /dev/null
> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> @@ -0,0 +1,47 @@
> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> + <zboszor@gmail.com>
> +Date: Thu, 30 Mar 2023 09:57:35 +0200
> +Subject: [PATCH 2/2] Make building tests optional
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Upstream-Status: Submitted
> +
> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> +---
> + meson.build       | 4 +++-
> + meson_options.txt | 4 ++++
> + 2 files changed, 7 insertions(+), 1 deletion(-)
> +
> +diff --git a/meson.build b/meson.build
> +index 1badb16..05edb8d 100644
> +--- a/meson.build
> ++++ b/meson.build
> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
> + endif
> +
> + subdir('data')
> +-subdir('tests')
> ++if get_option('tests')
> ++    subdir('tests')
> ++endif
> +
> + pkgconfig = import('pkgconfig')
> + pkgconfig.generate(
> +diff --git a/meson_options.txt b/meson_options.txt
> +index a6f0c4d..175710d 100644
> +--- a/meson_options.txt
> ++++ b/meson_options.txt
> +@@ -38,3 +38,7 @@ option('doc',
> +        description: 'Whether to build the API documentation',
> +        type: 'boolean',
> +        value: true)
> ++option('tests',
> ++       description: 'Whether to build the tests',
> ++       type: 'boolean',
> ++       value: true)
> +--
> +2.39.2
> +
> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> new file mode 100644
> index 000000000..b0133409a
> --- /dev/null
> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> @@ -0,0 +1,45 @@
> +SUMMARY = "Library for fingerprint readers"
> +DESCRIPTION = "libfprint is an open source software library \
> +designed to make it easy for application developers to add \
> +support for consumer fingerprint readers to their software."
> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
> +
> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
> +
> +DEPENDS:append:class-target = " libfprint-native "
> +
> +LICENSE = "LGPL-2.1-only"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
> +
> +#PR = "r1"
> +
> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
> +
> +SRC_URI = " \
> +       git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
> +       file://0001-Optionally-use-native-generators.patch \
> +       file://0002-Make-building-tests-optional.patch \
> +"
> +
> +S = "${WORKDIR}/git"
> +
> +inherit meson pkgconfig useradd python3native gobject-introspection
> +
> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
> +
> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
> +       -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
> +       -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
> +"
> +
> +do_install:append:class-native () {
> +       install -d ${D}${bindir}
> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
> +}
> +
> +BBCLASSEXTEND = "native"
> +
> +USERADD_PACKAGES = "${PN}"
> +GROUPADD_PARAM:${PN} = "fprint"
> --
> 2.39.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#101836): https://lists.openembedded.org/g/openembedded-devel/message/101836
> Mute This Topic: https://lists.openembedded.org/mt/97950767/1686489
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 13:50   ` [oe] " Alexander Kanavin
@ 2023-03-30 14:22     ` Böszörményi Zoltán
  2023-03-30 15:24     ` Böszörményi Zoltán
       [not found]     ` <17513BCD51B17AEE.27612@lists.openembedded.org>
  2 siblings, 0 replies; 14+ messages in thread
From: Böszörményi Zoltán @ 2023-03-30 14:22 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-devel

2023. 03. 30. 15:50 keltezéssel, Alexander Kanavin írta:
> Meson is specifically configured in yocto to user qemu usermode as the
> wrapper to run cross binaries, so can libfprint build configuration be
> tweaked to use that? This would avoid all the nasty -native extensions
> and modifications.

Wasn't the mariadb change I made about 2 years ago
to use cmake's CROSSCOMPILING_EMULATOR that saved
building the whole mariadb-native just for one small binary
reverted recently because qemu doesn't emulate certain
parts of the instruction set and caused crashes?

The same principle applies to meson running binaries via qemu, too.

>
> Alex
>
> On Thu, 30 Mar 2023 at 15:43, Zoltan Boszormenyi <zboszor@gmail.com> wrote:
>> libfprint is the library used by fprintd.
>>
>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> ---
>>   ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
>>   .../0002-Make-building-tests-optional.patch   |  47 ++++++++
>>   .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
>>   3 files changed, 203 insertions(+)
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>> new file mode 100644
>> index 000000000..779d78c28
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>> @@ -0,0 +1,111 @@
>> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>> + <zboszor@gmail.com>
>> +Date: Thu, 30 Mar 2023 09:45:31 +0200
>> +Subject: [PATCH 1/2] Optionally use native generators
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
>> +during the build to generate autosuspend.hwdb and 70-*.rules,
>> +respectively.
>> +
>> +Since they are not marked as "native: true", a cross-compiled
>> +version is not possible.
>> +
>> +Since these binaries are linked with the libfprint_drivers target,
>> +marking them as native binaries would also need libfprint_drivers
>> +to be duplicated as a native version and possibly other library
>> +targets, too.
>> +
>> +Instead, make it the responsibility of the cross-compiler
>> +framework to build the native variant separately and allow
>> +the external binaries to be passed in.
>> +
>> +Upstream-Status: Submitted
>> +
>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> +---
>> + libfprint/meson.build | 30 ++++++++++++++++++++----------
>> + meson_options.txt     |  8 ++++++++
>> + 2 files changed, 28 insertions(+), 10 deletions(-)
>> +
>> +diff --git a/libfprint/meson.build b/libfprint/meson.build
>> +index d3c8b03..2a4de67 100644
>> +--- a/libfprint/meson.build
>> ++++ b/libfprint/meson.build
>> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
>> +     ]
>> + )
>> +
>> +-udev_hwdb = executable('fprint-list-udev-hwdb',
>> +-    'fprint-list-udev-hwdb.c',
>> +-    dependencies: libfprint_private_dep,
>> +-    link_with: libfprint_drivers,
>> +-    install: false)
>> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
>> ++if udev_hwdb_cmd == ''
>> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
>> ++        'fprint-list-udev-hwdb.c',
>> ++        dependencies: libfprint_private_dep,
>> ++        link_with: libfprint_drivers,
>> ++        install: false)
>> ++else
>> ++    udev_hwdb = find_program(udev_hwdb_cmd)
>> ++endif
>> +
>> + udev_hwdb_generator = custom_target('udev-hwdb',
>> +     output: 'autosuspend.hwdb',
>> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
>> +     install: false,
>> + )
>> +
>> ++udev_rules_cmd = get_option('udev_rules_cmd')
>> + if install_udev_rules
>> +-    udev_rules = executable('fprint-list-udev-rules',
>> +-        'fprint-list-udev-rules.c',
>> +-        dependencies: libfprint_private_dep,
>> +-        link_with: libfprint_drivers,
>> +-        install: false)
>> ++    if udev_rules_cmd == ''
>> ++        udev_rules = executable('fprint-list-udev-rules',
>> ++            'fprint-list-udev-rules.c',
>> ++            dependencies: libfprint_private_dep,
>> ++            link_with: libfprint_drivers,
>> ++            install: false)
>> ++    else
>> ++        udev_rules = find_program(udev_rules_cmd)
>> ++    endif
>> +
>> +     custom_target('udev-rules',
>> +         output: '70-@0@.rules'.format(versioned_libname),
>> +diff --git a/meson_options.txt b/meson_options.txt
>> +index f9b801f..a6f0c4d 100644
>> +--- a/meson_options.txt
>> ++++ b/meson_options.txt
>> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
>> +        description: 'Installation path for udev rules',
>> +        type: 'string',
>> +        value: 'auto')
>> ++option('udev_rules_cmd',
>> ++       description : 'Optional path for native build of fprint-list-udev-rules',
>> ++       type : 'string',
>> ++       value : '')
>> + option('udev_hwdb',
>> +        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
>> +        type: 'feature',
>> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
>> +        description: 'Installation path for udev hwdb',
>> +        type: 'string',
>> +        value: 'auto')
>> ++option('udev_hwdb_cmd',
>> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
>> ++       type : 'string',
>> ++       value : '')
>> + option('gtk-examples',
>> +        description: 'Whether to build GTK+ example applications',
>> +        type: 'boolean',
>> +--
>> +2.39.2
>> +
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>> new file mode 100644
>> index 000000000..c83ea95e1
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>> @@ -0,0 +1,47 @@
>> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>> + <zboszor@gmail.com>
>> +Date: Thu, 30 Mar 2023 09:57:35 +0200
>> +Subject: [PATCH 2/2] Make building tests optional
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +Upstream-Status: Submitted
>> +
>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> +---
>> + meson.build       | 4 +++-
>> + meson_options.txt | 4 ++++
>> + 2 files changed, 7 insertions(+), 1 deletion(-)
>> +
>> +diff --git a/meson.build b/meson.build
>> +index 1badb16..05edb8d 100644
>> +--- a/meson.build
>> ++++ b/meson.build
>> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
>> + endif
>> +
>> + subdir('data')
>> +-subdir('tests')
>> ++if get_option('tests')
>> ++    subdir('tests')
>> ++endif
>> +
>> + pkgconfig = import('pkgconfig')
>> + pkgconfig.generate(
>> +diff --git a/meson_options.txt b/meson_options.txt
>> +index a6f0c4d..175710d 100644
>> +--- a/meson_options.txt
>> ++++ b/meson_options.txt
>> +@@ -38,3 +38,7 @@ option('doc',
>> +        description: 'Whether to build the API documentation',
>> +        type: 'boolean',
>> +        value: true)
>> ++option('tests',
>> ++       description: 'Whether to build the tests',
>> ++       type: 'boolean',
>> ++       value: true)
>> +--
>> +2.39.2
>> +
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>> new file mode 100644
>> index 000000000..b0133409a
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>> @@ -0,0 +1,45 @@
>> +SUMMARY = "Library for fingerprint readers"
>> +DESCRIPTION = "libfprint is an open source software library \
>> +designed to make it easy for application developers to add \
>> +support for consumer fingerprint readers to their software."
>> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
>> +
>> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
>> +
>> +DEPENDS:append:class-target = " libfprint-native "
>> +
>> +LICENSE = "LGPL-2.1-only"
>> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
>> +
>> +#PR = "r1"
>> +
>> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
>> +
>> +SRC_URI = " \
>> +       git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
>> +       file://0001-Optionally-use-native-generators.patch \
>> +       file://0002-Make-building-tests-optional.patch \
>> +"
>> +
>> +S = "${WORKDIR}/git"
>> +
>> +inherit meson pkgconfig useradd python3native gobject-introspection
>> +
>> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
>> +
>> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
>> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
>> +       -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
>> +       -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
>> +"
>> +
>> +do_install:append:class-native () {
>> +       install -d ${D}${bindir}
>> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
>> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
>> +}
>> +
>> +BBCLASSEXTEND = "native"
>> +
>> +USERADD_PACKAGES = "${PN}"
>> +GROUPADD_PARAM:${PN} = "fprint"
>> --
>> 2.39.2
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#101836): https://lists.openembedded.org/g/openembedded-devel/message/101836
>> Mute This Topic: https://lists.openembedded.org/mt/97950767/1686489
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [alex.kanavin@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 13:50   ` [oe] " Alexander Kanavin
  2023-03-30 14:22     ` Böszörményi Zoltán
@ 2023-03-30 15:24     ` Böszörményi Zoltán
  2023-03-30 15:40       ` Alexander Kanavin
       [not found]     ` <17513BCD51B17AEE.27612@lists.openembedded.org>
  2 siblings, 1 reply; 14+ messages in thread
From: Böszörményi Zoltán @ 2023-03-30 15:24 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-devel

2023. 03. 30. 15:50 keltezéssel, Alexander Kanavin írta:
> Meson is specifically configured in yocto to user qemu usermode as the
> wrapper to run cross binaries, so can libfprint build configuration be
> tweaked to use that? This would avoid all the nasty -native extensions
> and modifications.

How would I do that? This is the error if I not use the
externally built executables:

| [122/124] 
/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real 
--internal exe --capture libfprint/70-libfprint-2.rules -- 
/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
| FAILED: libfprint/70-libfprint-2.rules
| 
/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real 
--internal exe --capture libfprint/70-libfprint-2.rules -- 
/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
| Traceback (most recent call last):
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real", 
line 8, in <module>
|     sys.exit(main())
|              ^^^^^^
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py", 
line 287, in main
|     return run(sys.argv[1:], launcher)
|            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py", 
line 275, in run
|     return run_script_command(args[1], args[2:])
|            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py", 
line 223, in run_script_command
|     return module.run(script_args)
|            ^^^^^^^^^^^^^^^^^^^^^^^
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py", 
line 121, in run
|     return run_exe(exe)
|            ^^^^^^^^^^^^
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py", 
line 66, in run_exe
|     p = subprocess.Popen(cmd_args, env=child_env, cwd=exe.workdir,
|         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py", 
line 1024, in __init__
|     self._execute_child(args, executable, preexec_fn, close_fds,
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py", 
line 1789, in _execute_child
|     self._posix_spawn(args, executable, env, restore_signals,
|   File 
"/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py", 
line 1733, in _posix_spawn
|     self.pid = os.posix_spawn(executable, args, env, **kwargs)
|                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| FileNotFoundError: [Errno 2] No such file or directory: 
'/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules'

The executable is built, it is there, and it's using the target system's
runtime linker path.

Obviously, meson doesn't run it through the exe_wrapper.

>
> Alex
>
> On Thu, 30 Mar 2023 at 15:43, Zoltan Boszormenyi <zboszor@gmail.com> wrote:
>> libfprint is the library used by fprintd.
>>
>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> ---
>>   ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
>>   .../0002-Make-building-tests-optional.patch   |  47 ++++++++
>>   .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
>>   3 files changed, 203 insertions(+)
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>> new file mode 100644
>> index 000000000..779d78c28
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>> @@ -0,0 +1,111 @@
>> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>> + <zboszor@gmail.com>
>> +Date: Thu, 30 Mar 2023 09:45:31 +0200
>> +Subject: [PATCH 1/2] Optionally use native generators
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
>> +during the build to generate autosuspend.hwdb and 70-*.rules,
>> +respectively.
>> +
>> +Since they are not marked as "native: true", a cross-compiled
>> +version is not possible.
>> +
>> +Since these binaries are linked with the libfprint_drivers target,
>> +marking them as native binaries would also need libfprint_drivers
>> +to be duplicated as a native version and possibly other library
>> +targets, too.
>> +
>> +Instead, make it the responsibility of the cross-compiler
>> +framework to build the native variant separately and allow
>> +the external binaries to be passed in.
>> +
>> +Upstream-Status: Submitted
>> +
>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> +---
>> + libfprint/meson.build | 30 ++++++++++++++++++++----------
>> + meson_options.txt     |  8 ++++++++
>> + 2 files changed, 28 insertions(+), 10 deletions(-)
>> +
>> +diff --git a/libfprint/meson.build b/libfprint/meson.build
>> +index d3c8b03..2a4de67 100644
>> +--- a/libfprint/meson.build
>> ++++ b/libfprint/meson.build
>> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
>> +     ]
>> + )
>> +
>> +-udev_hwdb = executable('fprint-list-udev-hwdb',
>> +-    'fprint-list-udev-hwdb.c',
>> +-    dependencies: libfprint_private_dep,
>> +-    link_with: libfprint_drivers,
>> +-    install: false)
>> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
>> ++if udev_hwdb_cmd == ''
>> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
>> ++        'fprint-list-udev-hwdb.c',
>> ++        dependencies: libfprint_private_dep,
>> ++        link_with: libfprint_drivers,
>> ++        install: false)
>> ++else
>> ++    udev_hwdb = find_program(udev_hwdb_cmd)
>> ++endif
>> +
>> + udev_hwdb_generator = custom_target('udev-hwdb',
>> +     output: 'autosuspend.hwdb',
>> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
>> +     install: false,
>> + )
>> +
>> ++udev_rules_cmd = get_option('udev_rules_cmd')
>> + if install_udev_rules
>> +-    udev_rules = executable('fprint-list-udev-rules',
>> +-        'fprint-list-udev-rules.c',
>> +-        dependencies: libfprint_private_dep,
>> +-        link_with: libfprint_drivers,
>> +-        install: false)
>> ++    if udev_rules_cmd == ''
>> ++        udev_rules = executable('fprint-list-udev-rules',
>> ++            'fprint-list-udev-rules.c',
>> ++            dependencies: libfprint_private_dep,
>> ++            link_with: libfprint_drivers,
>> ++            install: false)
>> ++    else
>> ++        udev_rules = find_program(udev_rules_cmd)
>> ++    endif
>> +
>> +     custom_target('udev-rules',
>> +         output: '70-@0@.rules'.format(versioned_libname),
>> +diff --git a/meson_options.txt b/meson_options.txt
>> +index f9b801f..a6f0c4d 100644
>> +--- a/meson_options.txt
>> ++++ b/meson_options.txt
>> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
>> +        description: 'Installation path for udev rules',
>> +        type: 'string',
>> +        value: 'auto')
>> ++option('udev_rules_cmd',
>> ++       description : 'Optional path for native build of fprint-list-udev-rules',
>> ++       type : 'string',
>> ++       value : '')
>> + option('udev_hwdb',
>> +        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
>> +        type: 'feature',
>> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
>> +        description: 'Installation path for udev hwdb',
>> +        type: 'string',
>> +        value: 'auto')
>> ++option('udev_hwdb_cmd',
>> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
>> ++       type : 'string',
>> ++       value : '')
>> + option('gtk-examples',
>> +        description: 'Whether to build GTK+ example applications',
>> +        type: 'boolean',
>> +--
>> +2.39.2
>> +
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>> new file mode 100644
>> index 000000000..c83ea95e1
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>> @@ -0,0 +1,47 @@
>> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>> + <zboszor@gmail.com>
>> +Date: Thu, 30 Mar 2023 09:57:35 +0200
>> +Subject: [PATCH 2/2] Make building tests optional
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +Upstream-Status: Submitted
>> +
>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> +---
>> + meson.build       | 4 +++-
>> + meson_options.txt | 4 ++++
>> + 2 files changed, 7 insertions(+), 1 deletion(-)
>> +
>> +diff --git a/meson.build b/meson.build
>> +index 1badb16..05edb8d 100644
>> +--- a/meson.build
>> ++++ b/meson.build
>> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
>> + endif
>> +
>> + subdir('data')
>> +-subdir('tests')
>> ++if get_option('tests')
>> ++    subdir('tests')
>> ++endif
>> +
>> + pkgconfig = import('pkgconfig')
>> + pkgconfig.generate(
>> +diff --git a/meson_options.txt b/meson_options.txt
>> +index a6f0c4d..175710d 100644
>> +--- a/meson_options.txt
>> ++++ b/meson_options.txt
>> +@@ -38,3 +38,7 @@ option('doc',
>> +        description: 'Whether to build the API documentation',
>> +        type: 'boolean',
>> +        value: true)
>> ++option('tests',
>> ++       description: 'Whether to build the tests',
>> ++       type: 'boolean',
>> ++       value: true)
>> +--
>> +2.39.2
>> +
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>> new file mode 100644
>> index 000000000..b0133409a
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>> @@ -0,0 +1,45 @@
>> +SUMMARY = "Library for fingerprint readers"
>> +DESCRIPTION = "libfprint is an open source software library \
>> +designed to make it easy for application developers to add \
>> +support for consumer fingerprint readers to their software."
>> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
>> +
>> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
>> +
>> +DEPENDS:append:class-target = " libfprint-native "
>> +
>> +LICENSE = "LGPL-2.1-only"
>> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
>> +
>> +#PR = "r1"
>> +
>> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
>> +
>> +SRC_URI = " \
>> +       git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
>> +       file://0001-Optionally-use-native-generators.patch \
>> +       file://0002-Make-building-tests-optional.patch \
>> +"
>> +
>> +S = "${WORKDIR}/git"
>> +
>> +inherit meson pkgconfig useradd python3native gobject-introspection
>> +
>> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
>> +
>> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
>> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
>> +       -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
>> +       -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
>> +"
>> +
>> +do_install:append:class-native () {
>> +       install -d ${D}${bindir}
>> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
>> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
>> +}
>> +
>> +BBCLASSEXTEND = "native"
>> +
>> +USERADD_PACKAGES = "${PN}"
>> +GROUPADD_PARAM:${PN} = "fprint"
>> --
>> 2.39.2
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#101836): https://lists.openembedded.org/g/openembedded-devel/message/101836
>> Mute This Topic: https://lists.openembedded.org/mt/97950767/1686489
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [alex.kanavin@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 15:24     ` Böszörményi Zoltán
@ 2023-03-30 15:40       ` Alexander Kanavin
  2023-03-30 17:20         ` Böszörményi Zoltán
  0 siblings, 1 reply; 14+ messages in thread
From: Alexander Kanavin @ 2023-03-30 15:40 UTC (permalink / raw)
  To: Böszörményi Zoltán; +Cc: openembedded-devel

How do libfprint's meson rules for producing the executable and then
running it look like?

Any meson based recipe has a similar entry in ${WORKDIR}/meson.cross:

exe_wrapper = '/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/glib-2.0/1_2.74.6-r0/meson-qemuwrapper'

And the use of the exe_wrapper is documented here:
https://mesonbuild.com/Cross-compilation.html

Alex

On Thu, 30 Mar 2023 at 17:24, Böszörményi Zoltán <zboszor@gmail.com> wrote:
>
> 2023. 03. 30. 15:50 keltezéssel, Alexander Kanavin írta:
> > Meson is specifically configured in yocto to user qemu usermode as the
> > wrapper to run cross binaries, so can libfprint build configuration be
> > tweaked to use that? This would avoid all the nasty -native extensions
> > and modifications.
>
> How would I do that? This is the error if I not use the
> externally built executables:
>
> | [122/124]
> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real
> --internal exe --capture libfprint/70-libfprint-2.rules --
> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
> | FAILED: libfprint/70-libfprint-2.rules
> |
> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real
> --internal exe --capture libfprint/70-libfprint-2.rules --
> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
> | Traceback (most recent call last):
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real",
> line 8, in <module>
> |     sys.exit(main())
> |              ^^^^^^
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
> line 287, in main
> |     return run(sys.argv[1:], launcher)
> |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
> line 275, in run
> |     return run_script_command(args[1], args[2:])
> |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
> line 223, in run_script_command
> |     return module.run(script_args)
> |            ^^^^^^^^^^^^^^^^^^^^^^^
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py",
> line 121, in run
> |     return run_exe(exe)
> |            ^^^^^^^^^^^^
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py",
> line 66, in run_exe
> |     p = subprocess.Popen(cmd_args, env=child_env, cwd=exe.workdir,
> |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
> line 1024, in __init__
> |     self._execute_child(args, executable, preexec_fn, close_fds,
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
> line 1789, in _execute_child
> |     self._posix_spawn(args, executable, env, restore_signals,
> |   File
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
> line 1733, in _posix_spawn
> |     self.pid = os.posix_spawn(executable, args, env, **kwargs)
> |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> | FileNotFoundError: [Errno 2] No such file or directory:
> '/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules'
>
> The executable is built, it is there, and it's using the target system's
> runtime linker path.
>
> Obviously, meson doesn't run it through the exe_wrapper.
>
> >
> > Alex
> >
> > On Thu, 30 Mar 2023 at 15:43, Zoltan Boszormenyi <zboszor@gmail.com> wrote:
> >> libfprint is the library used by fprintd.
> >>
> >> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >> ---
> >>   ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
> >>   .../0002-Make-building-tests-optional.patch   |  47 ++++++++
> >>   .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
> >>   3 files changed, 203 insertions(+)
> >>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >>
> >> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >> new file mode 100644
> >> index 000000000..779d78c28
> >> --- /dev/null
> >> +++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >> @@ -0,0 +1,111 @@
> >> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
> >> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> >> + <zboszor@gmail.com>
> >> +Date: Thu, 30 Mar 2023 09:45:31 +0200
> >> +Subject: [PATCH 1/2] Optionally use native generators
> >> +MIME-Version: 1.0
> >> +Content-Type: text/plain; charset=UTF-8
> >> +Content-Transfer-Encoding: 8bit
> >> +
> >> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
> >> +during the build to generate autosuspend.hwdb and 70-*.rules,
> >> +respectively.
> >> +
> >> +Since they are not marked as "native: true", a cross-compiled
> >> +version is not possible.
> >> +
> >> +Since these binaries are linked with the libfprint_drivers target,
> >> +marking them as native binaries would also need libfprint_drivers
> >> +to be duplicated as a native version and possibly other library
> >> +targets, too.
> >> +
> >> +Instead, make it the responsibility of the cross-compiler
> >> +framework to build the native variant separately and allow
> >> +the external binaries to be passed in.
> >> +
> >> +Upstream-Status: Submitted
> >> +
> >> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >> +---
> >> + libfprint/meson.build | 30 ++++++++++++++++++++----------
> >> + meson_options.txt     |  8 ++++++++
> >> + 2 files changed, 28 insertions(+), 10 deletions(-)
> >> +
> >> +diff --git a/libfprint/meson.build b/libfprint/meson.build
> >> +index d3c8b03..2a4de67 100644
> >> +--- a/libfprint/meson.build
> >> ++++ b/libfprint/meson.build
> >> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
> >> +     ]
> >> + )
> >> +
> >> +-udev_hwdb = executable('fprint-list-udev-hwdb',
> >> +-    'fprint-list-udev-hwdb.c',
> >> +-    dependencies: libfprint_private_dep,
> >> +-    link_with: libfprint_drivers,
> >> +-    install: false)
> >> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
> >> ++if udev_hwdb_cmd == ''
> >> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
> >> ++        'fprint-list-udev-hwdb.c',
> >> ++        dependencies: libfprint_private_dep,
> >> ++        link_with: libfprint_drivers,
> >> ++        install: false)
> >> ++else
> >> ++    udev_hwdb = find_program(udev_hwdb_cmd)
> >> ++endif
> >> +
> >> + udev_hwdb_generator = custom_target('udev-hwdb',
> >> +     output: 'autosuspend.hwdb',
> >> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
> >> +     install: false,
> >> + )
> >> +
> >> ++udev_rules_cmd = get_option('udev_rules_cmd')
> >> + if install_udev_rules
> >> +-    udev_rules = executable('fprint-list-udev-rules',
> >> +-        'fprint-list-udev-rules.c',
> >> +-        dependencies: libfprint_private_dep,
> >> +-        link_with: libfprint_drivers,
> >> +-        install: false)
> >> ++    if udev_rules_cmd == ''
> >> ++        udev_rules = executable('fprint-list-udev-rules',
> >> ++            'fprint-list-udev-rules.c',
> >> ++            dependencies: libfprint_private_dep,
> >> ++            link_with: libfprint_drivers,
> >> ++            install: false)
> >> ++    else
> >> ++        udev_rules = find_program(udev_rules_cmd)
> >> ++    endif
> >> +
> >> +     custom_target('udev-rules',
> >> +         output: '70-@0@.rules'.format(versioned_libname),
> >> +diff --git a/meson_options.txt b/meson_options.txt
> >> +index f9b801f..a6f0c4d 100644
> >> +--- a/meson_options.txt
> >> ++++ b/meson_options.txt
> >> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
> >> +        description: 'Installation path for udev rules',
> >> +        type: 'string',
> >> +        value: 'auto')
> >> ++option('udev_rules_cmd',
> >> ++       description : 'Optional path for native build of fprint-list-udev-rules',
> >> ++       type : 'string',
> >> ++       value : '')
> >> + option('udev_hwdb',
> >> +        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
> >> +        type: 'feature',
> >> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
> >> +        description: 'Installation path for udev hwdb',
> >> +        type: 'string',
> >> +        value: 'auto')
> >> ++option('udev_hwdb_cmd',
> >> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
> >> ++       type : 'string',
> >> ++       value : '')
> >> + option('gtk-examples',
> >> +        description: 'Whether to build GTK+ example applications',
> >> +        type: 'boolean',
> >> +--
> >> +2.39.2
> >> +
> >> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >> new file mode 100644
> >> index 000000000..c83ea95e1
> >> --- /dev/null
> >> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >> @@ -0,0 +1,47 @@
> >> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
> >> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> >> + <zboszor@gmail.com>
> >> +Date: Thu, 30 Mar 2023 09:57:35 +0200
> >> +Subject: [PATCH 2/2] Make building tests optional
> >> +MIME-Version: 1.0
> >> +Content-Type: text/plain; charset=UTF-8
> >> +Content-Transfer-Encoding: 8bit
> >> +
> >> +Upstream-Status: Submitted
> >> +
> >> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >> +---
> >> + meson.build       | 4 +++-
> >> + meson_options.txt | 4 ++++
> >> + 2 files changed, 7 insertions(+), 1 deletion(-)
> >> +
> >> +diff --git a/meson.build b/meson.build
> >> +index 1badb16..05edb8d 100644
> >> +--- a/meson.build
> >> ++++ b/meson.build
> >> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
> >> + endif
> >> +
> >> + subdir('data')
> >> +-subdir('tests')
> >> ++if get_option('tests')
> >> ++    subdir('tests')
> >> ++endif
> >> +
> >> + pkgconfig = import('pkgconfig')
> >> + pkgconfig.generate(
> >> +diff --git a/meson_options.txt b/meson_options.txt
> >> +index a6f0c4d..175710d 100644
> >> +--- a/meson_options.txt
> >> ++++ b/meson_options.txt
> >> +@@ -38,3 +38,7 @@ option('doc',
> >> +        description: 'Whether to build the API documentation',
> >> +        type: 'boolean',
> >> +        value: true)
> >> ++option('tests',
> >> ++       description: 'Whether to build the tests',
> >> ++       type: 'boolean',
> >> ++       value: true)
> >> +--
> >> +2.39.2
> >> +
> >> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >> new file mode 100644
> >> index 000000000..b0133409a
> >> --- /dev/null
> >> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >> @@ -0,0 +1,45 @@
> >> +SUMMARY = "Library for fingerprint readers"
> >> +DESCRIPTION = "libfprint is an open source software library \
> >> +designed to make it easy for application developers to add \
> >> +support for consumer fingerprint readers to their software."
> >> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
> >> +
> >> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
> >> +
> >> +DEPENDS:append:class-target = " libfprint-native "
> >> +
> >> +LICENSE = "LGPL-2.1-only"
> >> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
> >> +
> >> +#PR = "r1"
> >> +
> >> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
> >> +
> >> +SRC_URI = " \
> >> +       git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
> >> +       file://0001-Optionally-use-native-generators.patch \
> >> +       file://0002-Make-building-tests-optional.patch \
> >> +"
> >> +
> >> +S = "${WORKDIR}/git"
> >> +
> >> +inherit meson pkgconfig useradd python3native gobject-introspection
> >> +
> >> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
> >> +
> >> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
> >> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
> >> +       -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
> >> +       -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
> >> +"
> >> +
> >> +do_install:append:class-native () {
> >> +       install -d ${D}${bindir}
> >> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
> >> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
> >> +}
> >> +
> >> +BBCLASSEXTEND = "native"
> >> +
> >> +USERADD_PACKAGES = "${PN}"
> >> +GROUPADD_PARAM:${PN} = "fprint"
> >> --
> >> 2.39.2
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#101836): https://lists.openembedded.org/g/openembedded-devel/message/101836
> >> Mute This Topic: https://lists.openembedded.org/mt/97950767/1686489
> >> Group Owner: openembedded-devel+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [alex.kanavin@gmail.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
       [not found]     ` <17513BCD51B17AEE.27612@lists.openembedded.org>
@ 2023-03-30 15:52       ` Böszörményi Zoltán
  2023-03-30 16:44         ` Alexander Kanavin
  0 siblings, 1 reply; 14+ messages in thread
From: Böszörményi Zoltán @ 2023-03-30 15:52 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-devel

2023. 03. 30. 17:24 keltezéssel, Zoltan Boszormenyi via lists.openembedded.org írta:
> 2023. 03. 30. 15:50 keltezéssel, Alexander Kanavin írta:
>> Meson is specifically configured in yocto to user qemu usermode as the
>> wrapper to run cross binaries, so can libfprint build configuration be
>> tweaked to use that? This would avoid all the nasty -native extensions
>> and modifications.
>
> How would I do that? This is the error if I not use the
> externally built executables:
>
> | [122/124] 
> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real 
> --internal exe --capture libfprint/70-libfprint-2.rules -- 
> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
> | FAILED: libfprint/70-libfprint-2.rules
> | 
> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real 
> --internal exe --capture libfprint/70-libfprint-2.rules -- 
> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
> | Traceback (most recent call last):
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real", 
> line 8, in <module>
> |     sys.exit(main())
> |              ^^^^^^
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py", 
> line 287, in main
> |     return run(sys.argv[1:], launcher)
> |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py", 
> line 275, in run
> |     return run_script_command(args[1], args[2:])
> |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py", 
> line 223, in run_script_command
> |     return module.run(script_args)
> |            ^^^^^^^^^^^^^^^^^^^^^^^
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py", 
> line 121, in run
> |     return run_exe(exe)
> |            ^^^^^^^^^^^^
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py", 
> line 66, in run_exe
> |     p = subprocess.Popen(cmd_args, env=child_env, cwd=exe.workdir,
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py", 
> line 1024, in __init__
> |     self._execute_child(args, executable, preexec_fn, close_fds,
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py", 
> line 1789, in _execute_child
> |     self._posix_spawn(args, executable, env, restore_signals,
> |   File 
> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py", 
> line 1733, in _posix_spawn
> |     self.pid = os.posix_spawn(executable, args, env, **kwargs)
> |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> | FileNotFoundError: [Errno 2] No such file or directory: 
> '/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules'
>
> The executable is built, it is there, and it's using the target system's
> runtime linker path.
>
> Obviously, meson doesn't run it through the exe_wrapper.

It is possible that meson doesn't support running executables
via exe_wrapper whose output is captured in a file?

Maybe rewriting the generators to write their output directly
instead of on stdout will make libfprint more cross compiler
friendly.

>
>>
>> Alex
>>
>> On Thu, 30 Mar 2023 at 15:43, Zoltan Boszormenyi <zboszor@gmail.com> wrote:
>>> libfprint is the library used by fprintd.
>>>
>>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>>> ---
>>>   ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
>>>   .../0002-Make-building-tests-optional.patch   |  47 ++++++++
>>>   .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
>>>   3 files changed, 203 insertions(+)
>>>   create mode 100644 
>>> meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>>   create mode 100644 
>>> meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>>
>>> diff --git 
>>> a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch 
>>> b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>> new file mode 100644
>>> index 000000000..779d78c28
>>> --- /dev/null
>>> +++ 
>>> b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>> @@ -0,0 +1,111 @@
>>> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
>>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>>> + <zboszor@gmail.com>
>>> +Date: Thu, 30 Mar 2023 09:45:31 +0200
>>> +Subject: [PATCH 1/2] Optionally use native generators
>>> +MIME-Version: 1.0
>>> +Content-Type: text/plain; charset=UTF-8
>>> +Content-Transfer-Encoding: 8bit
>>> +
>>> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
>>> +during the build to generate autosuspend.hwdb and 70-*.rules,
>>> +respectively.
>>> +
>>> +Since they are not marked as "native: true", a cross-compiled
>>> +version is not possible.
>>> +
>>> +Since these binaries are linked with the libfprint_drivers target,
>>> +marking them as native binaries would also need libfprint_drivers
>>> +to be duplicated as a native version and possibly other library
>>> +targets, too.
>>> +
>>> +Instead, make it the responsibility of the cross-compiler
>>> +framework to build the native variant separately and allow
>>> +the external binaries to be passed in.
>>> +
>>> +Upstream-Status: Submitted
>>> +
>>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>>> +---
>>> + libfprint/meson.build | 30 ++++++++++++++++++++----------
>>> + meson_options.txt     |  8 ++++++++
>>> + 2 files changed, 28 insertions(+), 10 deletions(-)
>>> +
>>> +diff --git a/libfprint/meson.build b/libfprint/meson.build
>>> +index d3c8b03..2a4de67 100644
>>> +--- a/libfprint/meson.build
>>> ++++ b/libfprint/meson.build
>>> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
>>> +     ]
>>> + )
>>> +
>>> +-udev_hwdb = executable('fprint-list-udev-hwdb',
>>> +-    'fprint-list-udev-hwdb.c',
>>> +-    dependencies: libfprint_private_dep,
>>> +-    link_with: libfprint_drivers,
>>> +-    install: false)
>>> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
>>> ++if udev_hwdb_cmd == ''
>>> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
>>> ++        'fprint-list-udev-hwdb.c',
>>> ++        dependencies: libfprint_private_dep,
>>> ++        link_with: libfprint_drivers,
>>> ++        install: false)
>>> ++else
>>> ++    udev_hwdb = find_program(udev_hwdb_cmd)
>>> ++endif
>>> +
>>> + udev_hwdb_generator = custom_target('udev-hwdb',
>>> +     output: 'autosuspend.hwdb',
>>> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
>>> +     install: false,
>>> + )
>>> +
>>> ++udev_rules_cmd = get_option('udev_rules_cmd')
>>> + if install_udev_rules
>>> +-    udev_rules = executable('fprint-list-udev-rules',
>>> +-        'fprint-list-udev-rules.c',
>>> +-        dependencies: libfprint_private_dep,
>>> +-        link_with: libfprint_drivers,
>>> +-        install: false)
>>> ++    if udev_rules_cmd == ''
>>> ++        udev_rules = executable('fprint-list-udev-rules',
>>> ++            'fprint-list-udev-rules.c',
>>> ++            dependencies: libfprint_private_dep,
>>> ++            link_with: libfprint_drivers,
>>> ++            install: false)
>>> ++    else
>>> ++        udev_rules = find_program(udev_rules_cmd)
>>> ++    endif
>>> +
>>> +     custom_target('udev-rules',
>>> +         output: '70-@0@.rules'.format(versioned_libname),
>>> +diff --git a/meson_options.txt b/meson_options.txt
>>> +index f9b801f..a6f0c4d 100644
>>> +--- a/meson_options.txt
>>> ++++ b/meson_options.txt
>>> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
>>> +        description: 'Installation path for udev rules',
>>> +        type: 'string',
>>> +        value: 'auto')
>>> ++option('udev_rules_cmd',
>>> ++       description : 'Optional path for native build of fprint-list-udev-rules',
>>> ++       type : 'string',
>>> ++       value : '')
>>> + option('udev_hwdb',
>>> +        description: 'Whether to create a udev hwdb for autosuspend (included in 
>>> systemd v248 and later)',
>>> +        type: 'feature',
>>> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
>>> +        description: 'Installation path for udev hwdb',
>>> +        type: 'string',
>>> +        value: 'auto')
>>> ++option('udev_hwdb_cmd',
>>> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
>>> ++       type : 'string',
>>> ++       value : '')
>>> + option('gtk-examples',
>>> +        description: 'Whether to build GTK+ example applications',
>>> +        type: 'boolean',
>>> +--
>>> +2.39.2
>>> +
>>> diff --git 
>>> a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch 
>>> b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>> new file mode 100644
>>> index 000000000..c83ea95e1
>>> --- /dev/null
>>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>> @@ -0,0 +1,47 @@
>>> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
>>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>>> + <zboszor@gmail.com>
>>> +Date: Thu, 30 Mar 2023 09:57:35 +0200
>>> +Subject: [PATCH 2/2] Make building tests optional
>>> +MIME-Version: 1.0
>>> +Content-Type: text/plain; charset=UTF-8
>>> +Content-Transfer-Encoding: 8bit
>>> +
>>> +Upstream-Status: Submitted
>>> +
>>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>>> +---
>>> + meson.build       | 4 +++-
>>> + meson_options.txt | 4 ++++
>>> + 2 files changed, 7 insertions(+), 1 deletion(-)
>>> +
>>> +diff --git a/meson.build b/meson.build
>>> +index 1badb16..05edb8d 100644
>>> +--- a/meson.build
>>> ++++ b/meson.build
>>> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
>>> + endif
>>> +
>>> + subdir('data')
>>> +-subdir('tests')
>>> ++if get_option('tests')
>>> ++    subdir('tests')
>>> ++endif
>>> +
>>> + pkgconfig = import('pkgconfig')
>>> + pkgconfig.generate(
>>> +diff --git a/meson_options.txt b/meson_options.txt
>>> +index a6f0c4d..175710d 100644
>>> +--- a/meson_options.txt
>>> ++++ b/meson_options.txt
>>> +@@ -38,3 +38,7 @@ option('doc',
>>> +        description: 'Whether to build the API documentation',
>>> +        type: 'boolean',
>>> +        value: true)
>>> ++option('tests',
>>> ++       description: 'Whether to build the tests',
>>> ++       type: 'boolean',
>>> ++       value: true)
>>> +--
>>> +2.39.2
>>> +
>>> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb 
>>> b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>> new file mode 100644
>>> index 000000000..b0133409a
>>> --- /dev/null
>>> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>> @@ -0,0 +1,45 @@
>>> +SUMMARY = "Library for fingerprint readers"
>>> +DESCRIPTION = "libfprint is an open source software library \
>>> +designed to make it easy for application developers to add \
>>> +support for consumer fingerprint readers to their software."
>>> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
>>> +
>>> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
>>> +
>>> +DEPENDS:append:class-target = " libfprint-native "
>>> +
>>> +LICENSE = "LGPL-2.1-only"
>>> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
>>> +
>>> +#PR = "r1"
>>> +
>>> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
>>> +
>>> +SRC_URI = " \
>>> + 
>>> git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
>>> +       file://0001-Optionally-use-native-generators.patch \
>>> +       file://0002-Make-building-tests-optional.patch \
>>> +"
>>> +
>>> +S = "${WORKDIR}/git"
>>> +
>>> +inherit meson pkgconfig useradd python3native gobject-introspection
>>> +
>>> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
>>> +
>>> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
>>> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
>>> + -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
>>> + -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
>>> +"
>>> +
>>> +do_install:append:class-native () {
>>> +       install -d ${D}${bindir}
>>> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb 
>>> ${D}${bindir}/fprint-list-udev-hwdb
>>> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules 
>>> ${D}${bindir}/fprint-list-udev-rules
>>> +}
>>> +
>>> +BBCLASSEXTEND = "native"
>>> +
>>> +USERADD_PACKAGES = "${PN}"
>>> +GROUPADD_PARAM:${PN} = "fprint"
>>> -- 
>>> 2.39.2
>>>
>>>
>>>
>>>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#101840): https://lists.openembedded.org/g/openembedded-devel/message/101840
> Mute This Topic: https://lists.openembedded.org/mt/97950767/3617728
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [zboszor@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 15:52       ` Böszörményi Zoltán
@ 2023-03-30 16:44         ` Alexander Kanavin
  0 siblings, 0 replies; 14+ messages in thread
From: Alexander Kanavin @ 2023-03-30 16:44 UTC (permalink / raw)
  To: Böszörményi Zoltán; +Cc: openembedded-devel

Maybe you can raise the concern with upstream and see what they say?
How, in their opinion, should their component be cross-compiled? Can
the need to run target executables be eliminated from the build in
some other way we're not seeing?

Alex

On Thu, 30 Mar 2023 at 17:52, Böszörményi Zoltán <zboszor@gmail.com> wrote:
>
> 2023. 03. 30. 17:24 keltezéssel, Zoltan Boszormenyi via lists.openembedded.org írta:
> > 2023. 03. 30. 15:50 keltezéssel, Alexander Kanavin írta:
> >> Meson is specifically configured in yocto to user qemu usermode as the
> >> wrapper to run cross binaries, so can libfprint build configuration be
> >> tweaked to use that? This would avoid all the nasty -native extensions
> >> and modifications.
> >
> > How would I do that? This is the error if I not use the
> > externally built executables:
> >
> > | [122/124]
> > /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real
> > --internal exe --capture libfprint/70-libfprint-2.rules --
> > /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
> > | FAILED: libfprint/70-libfprint-2.rules
> > |
> > /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real
> > --internal exe --capture libfprint/70-libfprint-2.rules --
> > /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
> > | Traceback (most recent call last):
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real",
> > line 8, in <module>
> > |     sys.exit(main())
> > |              ^^^^^^
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
> > line 287, in main
> > |     return run(sys.argv[1:], launcher)
> > |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
> > line 275, in run
> > |     return run_script_command(args[1], args[2:])
> > |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
> > line 223, in run_script_command
> > |     return module.run(script_args)
> > |            ^^^^^^^^^^^^^^^^^^^^^^^
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py",
> > line 121, in run
> > |     return run_exe(exe)
> > |            ^^^^^^^^^^^^
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py",
> > line 66, in run_exe
> > |     p = subprocess.Popen(cmd_args, env=child_env, cwd=exe.workdir,
> > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
> > line 1024, in __init__
> > |     self._execute_child(args, executable, preexec_fn, close_fds,
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
> > line 1789, in _execute_child
> > |     self._posix_spawn(args, executable, env, restore_signals,
> > |   File
> > "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
> > line 1733, in _posix_spawn
> > |     self.pid = os.posix_spawn(executable, args, env, **kwargs)
> > |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > | FileNotFoundError: [Errno 2] No such file or directory:
> > '/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules'
> >
> > The executable is built, it is there, and it's using the target system's
> > runtime linker path.
> >
> > Obviously, meson doesn't run it through the exe_wrapper.
>
> It is possible that meson doesn't support running executables
> via exe_wrapper whose output is captured in a file?
>
> Maybe rewriting the generators to write their output directly
> instead of on stdout will make libfprint more cross compiler
> friendly.
>
> >
> >>
> >> Alex
> >>
> >> On Thu, 30 Mar 2023 at 15:43, Zoltan Boszormenyi <zboszor@gmail.com> wrote:
> >>> libfprint is the library used by fprintd.
> >>>
> >>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >>> ---
> >>>   ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
> >>>   .../0002-Make-building-tests-optional.patch   |  47 ++++++++
> >>>   .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
> >>>   3 files changed, 203 insertions(+)
> >>>   create mode 100644
> >>> meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >>>   create mode 100644
> >>> meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >>>
> >>> diff --git
> >>> a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >>> b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >>> new file mode 100644
> >>> index 000000000..779d78c28
> >>> --- /dev/null
> >>> +++
> >>> b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >>> @@ -0,0 +1,111 @@
> >>> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
> >>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> >>> + <zboszor@gmail.com>
> >>> +Date: Thu, 30 Mar 2023 09:45:31 +0200
> >>> +Subject: [PATCH 1/2] Optionally use native generators
> >>> +MIME-Version: 1.0
> >>> +Content-Type: text/plain; charset=UTF-8
> >>> +Content-Transfer-Encoding: 8bit
> >>> +
> >>> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
> >>> +during the build to generate autosuspend.hwdb and 70-*.rules,
> >>> +respectively.
> >>> +
> >>> +Since they are not marked as "native: true", a cross-compiled
> >>> +version is not possible.
> >>> +
> >>> +Since these binaries are linked with the libfprint_drivers target,
> >>> +marking them as native binaries would also need libfprint_drivers
> >>> +to be duplicated as a native version and possibly other library
> >>> +targets, too.
> >>> +
> >>> +Instead, make it the responsibility of the cross-compiler
> >>> +framework to build the native variant separately and allow
> >>> +the external binaries to be passed in.
> >>> +
> >>> +Upstream-Status: Submitted
> >>> +
> >>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >>> +---
> >>> + libfprint/meson.build | 30 ++++++++++++++++++++----------
> >>> + meson_options.txt     |  8 ++++++++
> >>> + 2 files changed, 28 insertions(+), 10 deletions(-)
> >>> +
> >>> +diff --git a/libfprint/meson.build b/libfprint/meson.build
> >>> +index d3c8b03..2a4de67 100644
> >>> +--- a/libfprint/meson.build
> >>> ++++ b/libfprint/meson.build
> >>> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
> >>> +     ]
> >>> + )
> >>> +
> >>> +-udev_hwdb = executable('fprint-list-udev-hwdb',
> >>> +-    'fprint-list-udev-hwdb.c',
> >>> +-    dependencies: libfprint_private_dep,
> >>> +-    link_with: libfprint_drivers,
> >>> +-    install: false)
> >>> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
> >>> ++if udev_hwdb_cmd == ''
> >>> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
> >>> ++        'fprint-list-udev-hwdb.c',
> >>> ++        dependencies: libfprint_private_dep,
> >>> ++        link_with: libfprint_drivers,
> >>> ++        install: false)
> >>> ++else
> >>> ++    udev_hwdb = find_program(udev_hwdb_cmd)
> >>> ++endif
> >>> +
> >>> + udev_hwdb_generator = custom_target('udev-hwdb',
> >>> +     output: 'autosuspend.hwdb',
> >>> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
> >>> +     install: false,
> >>> + )
> >>> +
> >>> ++udev_rules_cmd = get_option('udev_rules_cmd')
> >>> + if install_udev_rules
> >>> +-    udev_rules = executable('fprint-list-udev-rules',
> >>> +-        'fprint-list-udev-rules.c',
> >>> +-        dependencies: libfprint_private_dep,
> >>> +-        link_with: libfprint_drivers,
> >>> +-        install: false)
> >>> ++    if udev_rules_cmd == ''
> >>> ++        udev_rules = executable('fprint-list-udev-rules',
> >>> ++            'fprint-list-udev-rules.c',
> >>> ++            dependencies: libfprint_private_dep,
> >>> ++            link_with: libfprint_drivers,
> >>> ++            install: false)
> >>> ++    else
> >>> ++        udev_rules = find_program(udev_rules_cmd)
> >>> ++    endif
> >>> +
> >>> +     custom_target('udev-rules',
> >>> +         output: '70-@0@.rules'.format(versioned_libname),
> >>> +diff --git a/meson_options.txt b/meson_options.txt
> >>> +index f9b801f..a6f0c4d 100644
> >>> +--- a/meson_options.txt
> >>> ++++ b/meson_options.txt
> >>> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
> >>> +        description: 'Installation path for udev rules',
> >>> +        type: 'string',
> >>> +        value: 'auto')
> >>> ++option('udev_rules_cmd',
> >>> ++       description : 'Optional path for native build of fprint-list-udev-rules',
> >>> ++       type : 'string',
> >>> ++       value : '')
> >>> + option('udev_hwdb',
> >>> +        description: 'Whether to create a udev hwdb for autosuspend (included in
> >>> systemd v248 and later)',
> >>> +        type: 'feature',
> >>> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
> >>> +        description: 'Installation path for udev hwdb',
> >>> +        type: 'string',
> >>> +        value: 'auto')
> >>> ++option('udev_hwdb_cmd',
> >>> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
> >>> ++       type : 'string',
> >>> ++       value : '')
> >>> + option('gtk-examples',
> >>> +        description: 'Whether to build GTK+ example applications',
> >>> +        type: 'boolean',
> >>> +--
> >>> +2.39.2
> >>> +
> >>> diff --git
> >>> a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >>> b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >>> new file mode 100644
> >>> index 000000000..c83ea95e1
> >>> --- /dev/null
> >>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >>> @@ -0,0 +1,47 @@
> >>> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
> >>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> >>> + <zboszor@gmail.com>
> >>> +Date: Thu, 30 Mar 2023 09:57:35 +0200
> >>> +Subject: [PATCH 2/2] Make building tests optional
> >>> +MIME-Version: 1.0
> >>> +Content-Type: text/plain; charset=UTF-8
> >>> +Content-Transfer-Encoding: 8bit
> >>> +
> >>> +Upstream-Status: Submitted
> >>> +
> >>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >>> +---
> >>> + meson.build       | 4 +++-
> >>> + meson_options.txt | 4 ++++
> >>> + 2 files changed, 7 insertions(+), 1 deletion(-)
> >>> +
> >>> +diff --git a/meson.build b/meson.build
> >>> +index 1badb16..05edb8d 100644
> >>> +--- a/meson.build
> >>> ++++ b/meson.build
> >>> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
> >>> + endif
> >>> +
> >>> + subdir('data')
> >>> +-subdir('tests')
> >>> ++if get_option('tests')
> >>> ++    subdir('tests')
> >>> ++endif
> >>> +
> >>> + pkgconfig = import('pkgconfig')
> >>> + pkgconfig.generate(
> >>> +diff --git a/meson_options.txt b/meson_options.txt
> >>> +index a6f0c4d..175710d 100644
> >>> +--- a/meson_options.txt
> >>> ++++ b/meson_options.txt
> >>> +@@ -38,3 +38,7 @@ option('doc',
> >>> +        description: 'Whether to build the API documentation',
> >>> +        type: 'boolean',
> >>> +        value: true)
> >>> ++option('tests',
> >>> ++       description: 'Whether to build the tests',
> >>> ++       type: 'boolean',
> >>> ++       value: true)
> >>> +--
> >>> +2.39.2
> >>> +
> >>> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >>> b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >>> new file mode 100644
> >>> index 000000000..b0133409a
> >>> --- /dev/null
> >>> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >>> @@ -0,0 +1,45 @@
> >>> +SUMMARY = "Library for fingerprint readers"
> >>> +DESCRIPTION = "libfprint is an open source software library \
> >>> +designed to make it easy for application developers to add \
> >>> +support for consumer fingerprint readers to their software."
> >>> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
> >>> +
> >>> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
> >>> +
> >>> +DEPENDS:append:class-target = " libfprint-native "
> >>> +
> >>> +LICENSE = "LGPL-2.1-only"
> >>> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
> >>> +
> >>> +#PR = "r1"
> >>> +
> >>> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
> >>> +
> >>> +SRC_URI = " \
> >>> +
> >>> git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
> >>> +       file://0001-Optionally-use-native-generators.patch \
> >>> +       file://0002-Make-building-tests-optional.patch \
> >>> +"
> >>> +
> >>> +S = "${WORKDIR}/git"
> >>> +
> >>> +inherit meson pkgconfig useradd python3native gobject-introspection
> >>> +
> >>> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
> >>> +
> >>> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
> >>> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
> >>> + -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
> >>> + -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
> >>> +"
> >>> +
> >>> +do_install:append:class-native () {
> >>> +       install -d ${D}${bindir}
> >>> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb
> >>> ${D}${bindir}/fprint-list-udev-hwdb
> >>> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules
> >>> ${D}${bindir}/fprint-list-udev-rules
> >>> +}
> >>> +
> >>> +BBCLASSEXTEND = "native"
> >>> +
> >>> +USERADD_PACKAGES = "${PN}"
> >>> +GROUPADD_PARAM:${PN} = "fprint"
> >>> --
> >>> 2.39.2
> >>>
> >>>
> >>>
> >>>
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#101840): https://lists.openembedded.org/g/openembedded-devel/message/101840
> > Mute This Topic: https://lists.openembedded.org/mt/97950767/3617728
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [zboszor@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 15:40       ` Alexander Kanavin
@ 2023-03-30 17:20         ` Böszörményi Zoltán
  2023-03-30 17:37           ` Alexander Kanavin
  0 siblings, 1 reply; 14+ messages in thread
From: Böszörményi Zoltán @ 2023-03-30 17:20 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-devel

2023. 03. 30. 17:40 keltezéssel, Alexander Kanavin írta:
> How do libfprint's meson rules for producing the executable and then
> running it look like?

Here are the two generators:
https://gitlab.freedesktop.org/libfprint/libfprint/-/blob/master/libfprint/meson.build#L310
https://gitlab.freedesktop.org/libfprint/libfprint/-/blob/master/libfprint/meson.build#L325

> Any meson based recipe has a similar entry in ${WORKDIR}/meson.cross:
>
> exe_wrapper = '/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/glib-2.0/1_2.74.6-r0/meson-qemuwrapper'

Yes, and it's created for libfprint, it's just not used.
Otherwise running the executable would have succeeded.

> And the use of the exe_wrapper is documented here:
> https://mesonbuild.com/Cross-compilation.html
>
> Alex
>
> On Thu, 30 Mar 2023 at 17:24, Böszörményi Zoltán <zboszor@gmail.com> wrote:
>> 2023. 03. 30. 15:50 keltezéssel, Alexander Kanavin írta:
>>> Meson is specifically configured in yocto to user qemu usermode as the
>>> wrapper to run cross binaries, so can libfprint build configuration be
>>> tweaked to use that? This would avoid all the nasty -native extensions
>>> and modifications.
>> How would I do that? This is the error if I not use the
>> externally built executables:
>>
>> | [122/124]
>> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real
>> --internal exe --capture libfprint/70-libfprint-2.rules --
>> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
>> | FAILED: libfprint/70-libfprint-2.rules
>> |
>> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real
>> --internal exe --capture libfprint/70-libfprint-2.rules --
>> /home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules
>> | Traceback (most recent call last):
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/bin/meson.real",
>> line 8, in <module>
>> |     sys.exit(main())
>> |              ^^^^^^
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
>> line 287, in main
>> |     return run(sys.argv[1:], launcher)
>> |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
>> line 275, in run
>> |     return run_script_command(args[1], args[2:])
>> |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/mesonmain.py",
>> line 223, in run_script_command
>> |     return module.run(script_args)
>> |            ^^^^^^^^^^^^^^^^^^^^^^^
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py",
>> line 121, in run
>> |     return run_exe(exe)
>> |            ^^^^^^^^^^^^
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/mesonbuild/scripts/meson_exe.py",
>> line 66, in run_exe
>> |     p = subprocess.Popen(cmd_args, env=child_env, cwd=exe.workdir,
>> |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
>> line 1024, in __init__
>> |     self._execute_child(args, executable, preexec_fn, close_fds,
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
>> line 1789, in _execute_child
>> |     self._posix_spawn(args, executable, env, restore_signals,
>> |   File
>> "/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/recipe-sysroot-native/usr/lib/python3.11/subprocess.py",
>> line 1733, in _posix_spawn
>> |     self.pid = os.posix_spawn(executable, args, env, **kwargs)
>> |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> | FileNotFoundError: [Errno 2] No such file or directory:
>> '/home/zozo/dtd-yocto-4.2/tmp-sicom-glibc/work/corei7-64-oe-linux/libfprint/1.94.5-r0/build/libfprint/fprint-list-udev-rules'
>>
>> The executable is built, it is there, and it's using the target system's
>> runtime linker path.
>>
>> Obviously, meson doesn't run it through the exe_wrapper.
>>
>>> Alex
>>>
>>> On Thu, 30 Mar 2023 at 15:43, Zoltan Boszormenyi <zboszor@gmail.com> wrote:
>>>> libfprint is the library used by fprintd.
>>>>
>>>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>>>> ---
>>>>    ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
>>>>    .../0002-Make-building-tests-optional.patch   |  47 ++++++++
>>>>    .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
>>>>    3 files changed, 203 insertions(+)
>>>>    create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>>>    create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>>>    create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>>>
>>>> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>>> new file mode 100644
>>>> index 000000000..779d78c28
>>>> --- /dev/null
>>>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>>> @@ -0,0 +1,111 @@
>>>> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
>>>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>>>> + <zboszor@gmail.com>
>>>> +Date: Thu, 30 Mar 2023 09:45:31 +0200
>>>> +Subject: [PATCH 1/2] Optionally use native generators
>>>> +MIME-Version: 1.0
>>>> +Content-Type: text/plain; charset=UTF-8
>>>> +Content-Transfer-Encoding: 8bit
>>>> +
>>>> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
>>>> +during the build to generate autosuspend.hwdb and 70-*.rules,
>>>> +respectively.
>>>> +
>>>> +Since they are not marked as "native: true", a cross-compiled
>>>> +version is not possible.
>>>> +
>>>> +Since these binaries are linked with the libfprint_drivers target,
>>>> +marking them as native binaries would also need libfprint_drivers
>>>> +to be duplicated as a native version and possibly other library
>>>> +targets, too.
>>>> +
>>>> +Instead, make it the responsibility of the cross-compiler
>>>> +framework to build the native variant separately and allow
>>>> +the external binaries to be passed in.
>>>> +
>>>> +Upstream-Status: Submitted
>>>> +
>>>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>>>> +---
>>>> + libfprint/meson.build | 30 ++++++++++++++++++++----------
>>>> + meson_options.txt     |  8 ++++++++
>>>> + 2 files changed, 28 insertions(+), 10 deletions(-)
>>>> +
>>>> +diff --git a/libfprint/meson.build b/libfprint/meson.build
>>>> +index d3c8b03..2a4de67 100644
>>>> +--- a/libfprint/meson.build
>>>> ++++ b/libfprint/meson.build
>>>> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
>>>> +     ]
>>>> + )
>>>> +
>>>> +-udev_hwdb = executable('fprint-list-udev-hwdb',
>>>> +-    'fprint-list-udev-hwdb.c',
>>>> +-    dependencies: libfprint_private_dep,
>>>> +-    link_with: libfprint_drivers,
>>>> +-    install: false)
>>>> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
>>>> ++if udev_hwdb_cmd == ''
>>>> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
>>>> ++        'fprint-list-udev-hwdb.c',
>>>> ++        dependencies: libfprint_private_dep,
>>>> ++        link_with: libfprint_drivers,
>>>> ++        install: false)
>>>> ++else
>>>> ++    udev_hwdb = find_program(udev_hwdb_cmd)
>>>> ++endif
>>>> +
>>>> + udev_hwdb_generator = custom_target('udev-hwdb',
>>>> +     output: 'autosuspend.hwdb',
>>>> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
>>>> +     install: false,
>>>> + )
>>>> +
>>>> ++udev_rules_cmd = get_option('udev_rules_cmd')
>>>> + if install_udev_rules
>>>> +-    udev_rules = executable('fprint-list-udev-rules',
>>>> +-        'fprint-list-udev-rules.c',
>>>> +-        dependencies: libfprint_private_dep,
>>>> +-        link_with: libfprint_drivers,
>>>> +-        install: false)
>>>> ++    if udev_rules_cmd == ''
>>>> ++        udev_rules = executable('fprint-list-udev-rules',
>>>> ++            'fprint-list-udev-rules.c',
>>>> ++            dependencies: libfprint_private_dep,
>>>> ++            link_with: libfprint_drivers,
>>>> ++            install: false)
>>>> ++    else
>>>> ++        udev_rules = find_program(udev_rules_cmd)
>>>> ++    endif
>>>> +
>>>> +     custom_target('udev-rules',
>>>> +         output: '70-@0@.rules'.format(versioned_libname),
>>>> +diff --git a/meson_options.txt b/meson_options.txt
>>>> +index f9b801f..a6f0c4d 100644
>>>> +--- a/meson_options.txt
>>>> ++++ b/meson_options.txt
>>>> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
>>>> +        description: 'Installation path for udev rules',
>>>> +        type: 'string',
>>>> +        value: 'auto')
>>>> ++option('udev_rules_cmd',
>>>> ++       description : 'Optional path for native build of fprint-list-udev-rules',
>>>> ++       type : 'string',
>>>> ++       value : '')
>>>> + option('udev_hwdb',
>>>> +        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
>>>> +        type: 'feature',
>>>> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
>>>> +        description: 'Installation path for udev hwdb',
>>>> +        type: 'string',
>>>> +        value: 'auto')
>>>> ++option('udev_hwdb_cmd',
>>>> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
>>>> ++       type : 'string',
>>>> ++       value : '')
>>>> + option('gtk-examples',
>>>> +        description: 'Whether to build GTK+ example applications',
>>>> +        type: 'boolean',
>>>> +--
>>>> +2.39.2
>>>> +
>>>> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>>> new file mode 100644
>>>> index 000000000..c83ea95e1
>>>> --- /dev/null
>>>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>>> @@ -0,0 +1,47 @@
>>>> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
>>>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>>>> + <zboszor@gmail.com>
>>>> +Date: Thu, 30 Mar 2023 09:57:35 +0200
>>>> +Subject: [PATCH 2/2] Make building tests optional
>>>> +MIME-Version: 1.0
>>>> +Content-Type: text/plain; charset=UTF-8
>>>> +Content-Transfer-Encoding: 8bit
>>>> +
>>>> +Upstream-Status: Submitted
>>>> +
>>>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>>>> +---
>>>> + meson.build       | 4 +++-
>>>> + meson_options.txt | 4 ++++
>>>> + 2 files changed, 7 insertions(+), 1 deletion(-)
>>>> +
>>>> +diff --git a/meson.build b/meson.build
>>>> +index 1badb16..05edb8d 100644
>>>> +--- a/meson.build
>>>> ++++ b/meson.build
>>>> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
>>>> + endif
>>>> +
>>>> + subdir('data')
>>>> +-subdir('tests')
>>>> ++if get_option('tests')
>>>> ++    subdir('tests')
>>>> ++endif
>>>> +
>>>> + pkgconfig = import('pkgconfig')
>>>> + pkgconfig.generate(
>>>> +diff --git a/meson_options.txt b/meson_options.txt
>>>> +index a6f0c4d..175710d 100644
>>>> +--- a/meson_options.txt
>>>> ++++ b/meson_options.txt
>>>> +@@ -38,3 +38,7 @@ option('doc',
>>>> +        description: 'Whether to build the API documentation',
>>>> +        type: 'boolean',
>>>> +        value: true)
>>>> ++option('tests',
>>>> ++       description: 'Whether to build the tests',
>>>> ++       type: 'boolean',
>>>> ++       value: true)
>>>> +--
>>>> +2.39.2
>>>> +
>>>> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>>> new file mode 100644
>>>> index 000000000..b0133409a
>>>> --- /dev/null
>>>> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>>> @@ -0,0 +1,45 @@
>>>> +SUMMARY = "Library for fingerprint readers"
>>>> +DESCRIPTION = "libfprint is an open source software library \
>>>> +designed to make it easy for application developers to add \
>>>> +support for consumer fingerprint readers to their software."
>>>> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
>>>> +
>>>> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
>>>> +
>>>> +DEPENDS:append:class-target = " libfprint-native "
>>>> +
>>>> +LICENSE = "LGPL-2.1-only"
>>>> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
>>>> +
>>>> +#PR = "r1"
>>>> +
>>>> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
>>>> +
>>>> +SRC_URI = " \
>>>> +       git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
>>>> +       file://0001-Optionally-use-native-generators.patch \
>>>> +       file://0002-Make-building-tests-optional.patch \
>>>> +"
>>>> +
>>>> +S = "${WORKDIR}/git"
>>>> +
>>>> +inherit meson pkgconfig useradd python3native gobject-introspection
>>>> +
>>>> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
>>>> +
>>>> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
>>>> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
>>>> +       -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
>>>> +       -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
>>>> +"
>>>> +
>>>> +do_install:append:class-native () {
>>>> +       install -d ${D}${bindir}
>>>> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
>>>> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
>>>> +}
>>>> +
>>>> +BBCLASSEXTEND = "native"
>>>> +
>>>> +USERADD_PACKAGES = "${PN}"
>>>> +GROUPADD_PARAM:${PN} = "fprint"
>>>> --
>>>> 2.39.2
>>>>
>>>>
>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>> Links: You receive all messages sent to this group.
>>>> View/Reply Online (#101836): https://lists.openembedded.org/g/openembedded-devel/message/101836
>>>> Mute This Topic: https://lists.openembedded.org/mt/97950767/1686489
>>>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [alex.kanavin@gmail.com]
>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 17:20         ` Böszörményi Zoltán
@ 2023-03-30 17:37           ` Alexander Kanavin
  0 siblings, 0 replies; 14+ messages in thread
From: Alexander Kanavin @ 2023-03-30 17:37 UTC (permalink / raw)
  To: Böszörményi Zoltán; +Cc: openembedded-devel

On Thu, 30 Mar 2023 at 19:20, Böszörményi Zoltán <zboszor@gmail.com> wrote:
>
> 2023. 03. 30. 17:40 keltezéssel, Alexander Kanavin írta:
> > How do libfprint's meson rules for producing the executable and then
> > running it look like?
>
> Here are the two generators:
> https://gitlab.freedesktop.org/libfprint/libfprint/-/blob/master/libfprint/meson.build#L310
> https://gitlab.freedesktop.org/libfprint/libfprint/-/blob/master/libfprint/meson.build#L325

Right. Welcome to:
https://github.com/mesonbuild/meson/issues/11029

I'm not sure what rules in meson do use the exe_wrapper setting, if
you can investigate that and see if one of them can be used in this
case, would be great. Or those two generators can be patched to prefix
the wrapper.

Alex


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-30 13:43 ` [meta-oe][PATCH 2/3] libfprint: New recipe Zoltán Böszörményi
  2023-03-30 13:50   ` [oe] " Alexander Kanavin
@ 2023-03-31 17:41   ` Khem Raj
  2023-04-01  6:01     ` Böszörményi Zoltán
  1 sibling, 1 reply; 14+ messages in thread
From: Khem Raj @ 2023-03-31 17:41 UTC (permalink / raw)
  To: Zoltan Boszormenyi; +Cc: openembedded-devel

It needs to address native deps on udev-native I am seeing

ERROR: Nothing PROVIDES 'udev-native' (but
virtual:native:/mnt/b/yoe/master/sources/meta-openembedded/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
DEPENDS on or otherwise requires it).

On Thu, Mar 30, 2023 at 6:43 AM Zoltan Boszormenyi <zboszor@gmail.com> wrote:
>
> libfprint is the library used by fprintd.
>
> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> ---
>  ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
>  .../0002-Make-building-tests-optional.patch   |  47 ++++++++
>  .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
>  3 files changed, 203 insertions(+)
>  create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>  create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>  create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>
> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> new file mode 100644
> index 000000000..779d78c28
> --- /dev/null
> +++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> @@ -0,0 +1,111 @@
> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> + <zboszor@gmail.com>
> +Date: Thu, 30 Mar 2023 09:45:31 +0200
> +Subject: [PATCH 1/2] Optionally use native generators
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
> +during the build to generate autosuspend.hwdb and 70-*.rules,
> +respectively.
> +
> +Since they are not marked as "native: true", a cross-compiled
> +version is not possible.
> +
> +Since these binaries are linked with the libfprint_drivers target,
> +marking them as native binaries would also need libfprint_drivers
> +to be duplicated as a native version and possibly other library
> +targets, too.
> +
> +Instead, make it the responsibility of the cross-compiler
> +framework to build the native variant separately and allow
> +the external binaries to be passed in.
> +
> +Upstream-Status: Submitted
> +
> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> +---
> + libfprint/meson.build | 30 ++++++++++++++++++++----------
> + meson_options.txt     |  8 ++++++++
> + 2 files changed, 28 insertions(+), 10 deletions(-)
> +
> +diff --git a/libfprint/meson.build b/libfprint/meson.build
> +index d3c8b03..2a4de67 100644
> +--- a/libfprint/meson.build
> ++++ b/libfprint/meson.build
> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
> +     ]
> + )
> +
> +-udev_hwdb = executable('fprint-list-udev-hwdb',
> +-    'fprint-list-udev-hwdb.c',
> +-    dependencies: libfprint_private_dep,
> +-    link_with: libfprint_drivers,
> +-    install: false)
> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
> ++if udev_hwdb_cmd == ''
> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
> ++        'fprint-list-udev-hwdb.c',
> ++        dependencies: libfprint_private_dep,
> ++        link_with: libfprint_drivers,
> ++        install: false)
> ++else
> ++    udev_hwdb = find_program(udev_hwdb_cmd)
> ++endif
> +
> + udev_hwdb_generator = custom_target('udev-hwdb',
> +     output: 'autosuspend.hwdb',
> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
> +     install: false,
> + )
> +
> ++udev_rules_cmd = get_option('udev_rules_cmd')
> + if install_udev_rules
> +-    udev_rules = executable('fprint-list-udev-rules',
> +-        'fprint-list-udev-rules.c',
> +-        dependencies: libfprint_private_dep,
> +-        link_with: libfprint_drivers,
> +-        install: false)
> ++    if udev_rules_cmd == ''
> ++        udev_rules = executable('fprint-list-udev-rules',
> ++            'fprint-list-udev-rules.c',
> ++            dependencies: libfprint_private_dep,
> ++            link_with: libfprint_drivers,
> ++            install: false)
> ++    else
> ++        udev_rules = find_program(udev_rules_cmd)
> ++    endif
> +
> +     custom_target('udev-rules',
> +         output: '70-@0@.rules'.format(versioned_libname),
> +diff --git a/meson_options.txt b/meson_options.txt
> +index f9b801f..a6f0c4d 100644
> +--- a/meson_options.txt
> ++++ b/meson_options.txt
> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
> +        description: 'Installation path for udev rules',
> +        type: 'string',
> +        value: 'auto')
> ++option('udev_rules_cmd',
> ++       description : 'Optional path for native build of fprint-list-udev-rules',
> ++       type : 'string',
> ++       value : '')
> + option('udev_hwdb',
> +        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
> +        type: 'feature',
> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
> +        description: 'Installation path for udev hwdb',
> +        type: 'string',
> +        value: 'auto')
> ++option('udev_hwdb_cmd',
> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
> ++       type : 'string',
> ++       value : '')
> + option('gtk-examples',
> +        description: 'Whether to build GTK+ example applications',
> +        type: 'boolean',
> +--
> +2.39.2
> +
> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> new file mode 100644
> index 000000000..c83ea95e1
> --- /dev/null
> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> @@ -0,0 +1,47 @@
> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> + <zboszor@gmail.com>
> +Date: Thu, 30 Mar 2023 09:57:35 +0200
> +Subject: [PATCH 2/2] Make building tests optional
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Upstream-Status: Submitted
> +
> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> +---
> + meson.build       | 4 +++-
> + meson_options.txt | 4 ++++
> + 2 files changed, 7 insertions(+), 1 deletion(-)
> +
> +diff --git a/meson.build b/meson.build
> +index 1badb16..05edb8d 100644
> +--- a/meson.build
> ++++ b/meson.build
> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
> + endif
> +
> + subdir('data')
> +-subdir('tests')
> ++if get_option('tests')
> ++    subdir('tests')
> ++endif
> +
> + pkgconfig = import('pkgconfig')
> + pkgconfig.generate(
> +diff --git a/meson_options.txt b/meson_options.txt
> +index a6f0c4d..175710d 100644
> +--- a/meson_options.txt
> ++++ b/meson_options.txt
> +@@ -38,3 +38,7 @@ option('doc',
> +        description: 'Whether to build the API documentation',
> +        type: 'boolean',
> +        value: true)
> ++option('tests',
> ++       description: 'Whether to build the tests',
> ++       type: 'boolean',
> ++       value: true)
> +--
> +2.39.2
> +
> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> new file mode 100644
> index 000000000..b0133409a
> --- /dev/null
> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> @@ -0,0 +1,45 @@
> +SUMMARY = "Library for fingerprint readers"
> +DESCRIPTION = "libfprint is an open source software library \
> +designed to make it easy for application developers to add \
> +support for consumer fingerprint readers to their software."
> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
> +
> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
> +
> +DEPENDS:append:class-target = " libfprint-native "
> +
> +LICENSE = "LGPL-2.1-only"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
> +
> +#PR = "r1"
> +
> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
> +
> +SRC_URI = " \
> +       git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
> +       file://0001-Optionally-use-native-generators.patch \
> +       file://0002-Make-building-tests-optional.patch \
> +"
> +
> +S = "${WORKDIR}/git"
> +
> +inherit meson pkgconfig useradd python3native gobject-introspection
> +
> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
> +
> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
> +       -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
> +       -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
> +"
> +
> +do_install:append:class-native () {
> +       install -d ${D}${bindir}
> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
> +}
> +
> +BBCLASSEXTEND = "native"
> +
> +USERADD_PACKAGES = "${PN}"
> +GROUPADD_PARAM:${PN} = "fprint"
> --
> 2.39.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#101836): https://lists.openembedded.org/g/openembedded-devel/message/101836
> Mute This Topic: https://lists.openembedded.org/mt/97950767/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-03-31 17:41   ` Khem Raj
@ 2023-04-01  6:01     ` Böszörményi Zoltán
  2023-04-01 12:55       ` Khem Raj
  0 siblings, 1 reply; 14+ messages in thread
From: Böszörményi Zoltán @ 2023-04-01  6:01 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-devel

2023. 03. 31. 19:41 keltezéssel, Khem Raj írta:
> It needs to address native deps on udev-native I am seeing
>
> ERROR: Nothing PROVIDES 'udev-native' (but
> virtual:native:/mnt/b/yoe/master/sources/meta-openembedded/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> DEPENDS on or otherwise requires it).

This is a problem with using two different mailing lists
and separate layers. Interconnected changes are often
overlooked without taking the changed in the other layer.

This particular problem is addressed by the systemd change
with BBCLASSEXTEND = "native" and other tweaks which
was sent to the openembedded-core ML and is being debated there.

FWIW, this meson bug prevents libfprint to use the exe_wrapper,
which would make the systemd-native recipe unnecessary:
https://github.com/mesonbuild/meson/issues/11029

> On Thu, Mar 30, 2023 at 6:43 AM Zoltan Boszormenyi <zboszor@gmail.com> wrote:
>> libfprint is the library used by fprintd.
>>
>> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> ---
>>   ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
>>   .../0002-Make-building-tests-optional.patch   |  47 ++++++++
>>   .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
>>   3 files changed, 203 insertions(+)
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>>
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>> new file mode 100644
>> index 000000000..779d78c28
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
>> @@ -0,0 +1,111 @@
>> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>> + <zboszor@gmail.com>
>> +Date: Thu, 30 Mar 2023 09:45:31 +0200
>> +Subject: [PATCH 1/2] Optionally use native generators
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
>> +during the build to generate autosuspend.hwdb and 70-*.rules,
>> +respectively.
>> +
>> +Since they are not marked as "native: true", a cross-compiled
>> +version is not possible.
>> +
>> +Since these binaries are linked with the libfprint_drivers target,
>> +marking them as native binaries would also need libfprint_drivers
>> +to be duplicated as a native version and possibly other library
>> +targets, too.
>> +
>> +Instead, make it the responsibility of the cross-compiler
>> +framework to build the native variant separately and allow
>> +the external binaries to be passed in.
>> +
>> +Upstream-Status: Submitted
>> +
>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> +---
>> + libfprint/meson.build | 30 ++++++++++++++++++++----------
>> + meson_options.txt     |  8 ++++++++
>> + 2 files changed, 28 insertions(+), 10 deletions(-)
>> +
>> +diff --git a/libfprint/meson.build b/libfprint/meson.build
>> +index d3c8b03..2a4de67 100644
>> +--- a/libfprint/meson.build
>> ++++ b/libfprint/meson.build
>> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
>> +     ]
>> + )
>> +
>> +-udev_hwdb = executable('fprint-list-udev-hwdb',
>> +-    'fprint-list-udev-hwdb.c',
>> +-    dependencies: libfprint_private_dep,
>> +-    link_with: libfprint_drivers,
>> +-    install: false)
>> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
>> ++if udev_hwdb_cmd == ''
>> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
>> ++        'fprint-list-udev-hwdb.c',
>> ++        dependencies: libfprint_private_dep,
>> ++        link_with: libfprint_drivers,
>> ++        install: false)
>> ++else
>> ++    udev_hwdb = find_program(udev_hwdb_cmd)
>> ++endif
>> +
>> + udev_hwdb_generator = custom_target('udev-hwdb',
>> +     output: 'autosuspend.hwdb',
>> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
>> +     install: false,
>> + )
>> +
>> ++udev_rules_cmd = get_option('udev_rules_cmd')
>> + if install_udev_rules
>> +-    udev_rules = executable('fprint-list-udev-rules',
>> +-        'fprint-list-udev-rules.c',
>> +-        dependencies: libfprint_private_dep,
>> +-        link_with: libfprint_drivers,
>> +-        install: false)
>> ++    if udev_rules_cmd == ''
>> ++        udev_rules = executable('fprint-list-udev-rules',
>> ++            'fprint-list-udev-rules.c',
>> ++            dependencies: libfprint_private_dep,
>> ++            link_with: libfprint_drivers,
>> ++            install: false)
>> ++    else
>> ++        udev_rules = find_program(udev_rules_cmd)
>> ++    endif
>> +
>> +     custom_target('udev-rules',
>> +         output: '70-@0@.rules'.format(versioned_libname),
>> +diff --git a/meson_options.txt b/meson_options.txt
>> +index f9b801f..a6f0c4d 100644
>> +--- a/meson_options.txt
>> ++++ b/meson_options.txt
>> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
>> +        description: 'Installation path for udev rules',
>> +        type: 'string',
>> +        value: 'auto')
>> ++option('udev_rules_cmd',
>> ++       description : 'Optional path for native build of fprint-list-udev-rules',
>> ++       type : 'string',
>> ++       value : '')
>> + option('udev_hwdb',
>> +        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
>> +        type: 'feature',
>> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
>> +        description: 'Installation path for udev hwdb',
>> +        type: 'string',
>> +        value: 'auto')
>> ++option('udev_hwdb_cmd',
>> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
>> ++       type : 'string',
>> ++       value : '')
>> + option('gtk-examples',
>> +        description: 'Whether to build GTK+ example applications',
>> +        type: 'boolean',
>> +--
>> +2.39.2
>> +
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>> new file mode 100644
>> index 000000000..c83ea95e1
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
>> @@ -0,0 +1,47 @@
>> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
>> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
>> + <zboszor@gmail.com>
>> +Date: Thu, 30 Mar 2023 09:57:35 +0200
>> +Subject: [PATCH 2/2] Make building tests optional
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +Upstream-Status: Submitted
>> +
>> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
>> +---
>> + meson.build       | 4 +++-
>> + meson_options.txt | 4 ++++
>> + 2 files changed, 7 insertions(+), 1 deletion(-)
>> +
>> +diff --git a/meson.build b/meson.build
>> +index 1badb16..05edb8d 100644
>> +--- a/meson.build
>> ++++ b/meson.build
>> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
>> + endif
>> +
>> + subdir('data')
>> +-subdir('tests')
>> ++if get_option('tests')
>> ++    subdir('tests')
>> ++endif
>> +
>> + pkgconfig = import('pkgconfig')
>> + pkgconfig.generate(
>> +diff --git a/meson_options.txt b/meson_options.txt
>> +index a6f0c4d..175710d 100644
>> +--- a/meson_options.txt
>> ++++ b/meson_options.txt
>> +@@ -38,3 +38,7 @@ option('doc',
>> +        description: 'Whether to build the API documentation',
>> +        type: 'boolean',
>> +        value: true)
>> ++option('tests',
>> ++       description: 'Whether to build the tests',
>> ++       type: 'boolean',
>> ++       value: true)
>> +--
>> +2.39.2
>> +
>> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>> new file mode 100644
>> index 000000000..b0133409a
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
>> @@ -0,0 +1,45 @@
>> +SUMMARY = "Library for fingerprint readers"
>> +DESCRIPTION = "libfprint is an open source software library \
>> +designed to make it easy for application developers to add \
>> +support for consumer fingerprint readers to their software."
>> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
>> +
>> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
>> +
>> +DEPENDS:append:class-target = " libfprint-native "
>> +
>> +LICENSE = "LGPL-2.1-only"
>> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
>> +
>> +#PR = "r1"
>> +
>> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
>> +
>> +SRC_URI = " \
>> +       git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
>> +       file://0001-Optionally-use-native-generators.patch \
>> +       file://0002-Make-building-tests-optional.patch \
>> +"
>> +
>> +S = "${WORKDIR}/git"
>> +
>> +inherit meson pkgconfig useradd python3native gobject-introspection
>> +
>> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
>> +
>> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
>> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
>> +       -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
>> +       -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
>> +"
>> +
>> +do_install:append:class-native () {
>> +       install -d ${D}${bindir}
>> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
>> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
>> +}
>> +
>> +BBCLASSEXTEND = "native"
>> +
>> +USERADD_PACKAGES = "${PN}"
>> +GROUPADD_PARAM:${PN} = "fprint"
>> --
>> 2.39.2
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#101836): https://lists.openembedded.org/g/openembedded-devel/message/101836
>> Mute This Topic: https://lists.openembedded.org/mt/97950767/1997914
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [oe] [meta-oe][PATCH 2/3] libfprint: New recipe
  2023-04-01  6:01     ` Böszörményi Zoltán
@ 2023-04-01 12:55       ` Khem Raj
  0 siblings, 0 replies; 14+ messages in thread
From: Khem Raj @ 2023-04-01 12:55 UTC (permalink / raw)
  To: Böszörményi Zoltán; +Cc: openembedded-devel

i am also seeing this on AB

ERROR: Nothing PROVIDES 'polkit' (but
/home/pokybuild/yocto-worker/meta-oe/build/meta-openembedded/meta-oe/recipes-support/fprintd/fprintd_git.bb
DEPENDS on or otherwise requires it)
polkit was skipped: missing required distro feature 'polkit' (not in
DISTRO_FEATURES)
polkit was skipped: missing required distro feature 'polkit' (not in
DISTRO_FEATURES)
ERROR: Required build target 'meta-world-pkgdata' has no buildable providers.
Missing or unbuildable dependency chain was: ['meta-world-pkgdata',
'fprintd', 'polkit']

On Fri, Mar 31, 2023 at 11:01 PM Böszörményi Zoltán <zboszor@gmail.com> wrote:
>
> 2023. 03. 31. 19:41 keltezéssel, Khem Raj írta:
> > It needs to address native deps on udev-native I am seeing
> >
> > ERROR: Nothing PROVIDES 'udev-native' (but
> > virtual:native:/mnt/b/yoe/master/sources/meta-openembedded/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> > DEPENDS on or otherwise requires it).
>
> This is a problem with using two different mailing lists
> and separate layers. Interconnected changes are often
> overlooked without taking the changed in the other layer.
>
> This particular problem is addressed by the systemd change
> with BBCLASSEXTEND = "native" and other tweaks which
> was sent to the openembedded-core ML and is being debated there.
>
> FWIW, this meson bug prevents libfprint to use the exe_wrapper,
> which would make the systemd-native recipe unnecessary:
> https://github.com/mesonbuild/meson/issues/11029
>
> > On Thu, Mar 30, 2023 at 6:43 AM Zoltan Boszormenyi <zboszor@gmail.com> wrote:
> >> libfprint is the library used by fprintd.
> >>
> >> Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >> ---
> >>   ...001-Optionally-use-native-generators.patch | 111 ++++++++++++++++++
> >>   .../0002-Make-building-tests-optional.patch   |  47 ++++++++
> >>   .../libfprint/libfprint_1.94.5.bb             |  45 +++++++
> >>   3 files changed, 203 insertions(+)
> >>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >>   create mode 100644 meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >>
> >> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >> new file mode 100644
> >> index 000000000..779d78c28
> >> --- /dev/null
> >> +++ b/meta-oe/recipes-support/libfprint/libfprint/0001-Optionally-use-native-generators.patch
> >> @@ -0,0 +1,111 @@
> >> +From 4f0f84448dbc46c18d2700ddb45acdee67687574 Mon Sep 17 00:00:00 2001
> >> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> >> + <zboszor@gmail.com>
> >> +Date: Thu, 30 Mar 2023 09:45:31 +0200
> >> +Subject: [PATCH 1/2] Optionally use native generators
> >> +MIME-Version: 1.0
> >> +Content-Type: text/plain; charset=UTF-8
> >> +Content-Transfer-Encoding: 8bit
> >> +
> >> +fprint-list-udev-hwdb and fprint-list-udev-rules are run
> >> +during the build to generate autosuspend.hwdb and 70-*.rules,
> >> +respectively.
> >> +
> >> +Since they are not marked as "native: true", a cross-compiled
> >> +version is not possible.
> >> +
> >> +Since these binaries are linked with the libfprint_drivers target,
> >> +marking them as native binaries would also need libfprint_drivers
> >> +to be duplicated as a native version and possibly other library
> >> +targets, too.
> >> +
> >> +Instead, make it the responsibility of the cross-compiler
> >> +framework to build the native variant separately and allow
> >> +the external binaries to be passed in.
> >> +
> >> +Upstream-Status: Submitted
> >> +
> >> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >> +---
> >> + libfprint/meson.build | 30 ++++++++++++++++++++----------
> >> + meson_options.txt     |  8 ++++++++
> >> + 2 files changed, 28 insertions(+), 10 deletions(-)
> >> +
> >> +diff --git a/libfprint/meson.build b/libfprint/meson.build
> >> +index d3c8b03..2a4de67 100644
> >> +--- a/libfprint/meson.build
> >> ++++ b/libfprint/meson.build
> >> +@@ -301,11 +301,16 @@ libfprint_private_dep = declare_dependency(
> >> +     ]
> >> + )
> >> +
> >> +-udev_hwdb = executable('fprint-list-udev-hwdb',
> >> +-    'fprint-list-udev-hwdb.c',
> >> +-    dependencies: libfprint_private_dep,
> >> +-    link_with: libfprint_drivers,
> >> +-    install: false)
> >> ++udev_hwdb_cmd = get_option('udev_hwdb_cmd')
> >> ++if udev_hwdb_cmd == ''
> >> ++    udev_hwdb = executable('fprint-list-udev-hwdb',
> >> ++        'fprint-list-udev-hwdb.c',
> >> ++        dependencies: libfprint_private_dep,
> >> ++        link_with: libfprint_drivers,
> >> ++        install: false)
> >> ++else
> >> ++    udev_hwdb = find_program(udev_hwdb_cmd)
> >> ++endif
> >> +
> >> + udev_hwdb_generator = custom_target('udev-hwdb',
> >> +     output: 'autosuspend.hwdb',
> >> +@@ -315,12 +320,17 @@ udev_hwdb_generator = custom_target('udev-hwdb',
> >> +     install: false,
> >> + )
> >> +
> >> ++udev_rules_cmd = get_option('udev_rules_cmd')
> >> + if install_udev_rules
> >> +-    udev_rules = executable('fprint-list-udev-rules',
> >> +-        'fprint-list-udev-rules.c',
> >> +-        dependencies: libfprint_private_dep,
> >> +-        link_with: libfprint_drivers,
> >> +-        install: false)
> >> ++    if udev_rules_cmd == ''
> >> ++        udev_rules = executable('fprint-list-udev-rules',
> >> ++            'fprint-list-udev-rules.c',
> >> ++            dependencies: libfprint_private_dep,
> >> ++            link_with: libfprint_drivers,
> >> ++            install: false)
> >> ++    else
> >> ++        udev_rules = find_program(udev_rules_cmd)
> >> ++    endif
> >> +
> >> +     custom_target('udev-rules',
> >> +         output: '70-@0@.rules'.format(versioned_libname),
> >> +diff --git a/meson_options.txt b/meson_options.txt
> >> +index f9b801f..a6f0c4d 100644
> >> +--- a/meson_options.txt
> >> ++++ b/meson_options.txt
> >> +@@ -14,6 +14,10 @@ option('udev_rules_dir',
> >> +        description: 'Installation path for udev rules',
> >> +        type: 'string',
> >> +        value: 'auto')
> >> ++option('udev_rules_cmd',
> >> ++       description : 'Optional path for native build of fprint-list-udev-rules',
> >> ++       type : 'string',
> >> ++       value : '')
> >> + option('udev_hwdb',
> >> +        description: 'Whether to create a udev hwdb for autosuspend (included in systemd v248 and later)',
> >> +        type: 'feature',
> >> +@@ -22,6 +26,10 @@ option('udev_hwdb_dir',
> >> +        description: 'Installation path for udev hwdb',
> >> +        type: 'string',
> >> +        value: 'auto')
> >> ++option('udev_hwdb_cmd',
> >> ++       description : 'Optional path for native build of fprint-list-udev-hwdb',
> >> ++       type : 'string',
> >> ++       value : '')
> >> + option('gtk-examples',
> >> +        description: 'Whether to build GTK+ example applications',
> >> +        type: 'boolean',
> >> +--
> >> +2.39.2
> >> +
> >> diff --git a/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >> new file mode 100644
> >> index 000000000..c83ea95e1
> >> --- /dev/null
> >> +++ b/meta-oe/recipes-support/libfprint/libfprint/0002-Make-building-tests-optional.patch
> >> @@ -0,0 +1,47 @@
> >> +From 8e27d45a7747c9aaf8e619f2de3ad3eae9659da8 Mon Sep 17 00:00:00 2001
> >> +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
> >> + <zboszor@gmail.com>
> >> +Date: Thu, 30 Mar 2023 09:57:35 +0200
> >> +Subject: [PATCH 2/2] Make building tests optional
> >> +MIME-Version: 1.0
> >> +Content-Type: text/plain; charset=UTF-8
> >> +Content-Transfer-Encoding: 8bit
> >> +
> >> +Upstream-Status: Submitted
> >> +
> >> +Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
> >> +---
> >> + meson.build       | 4 +++-
> >> + meson_options.txt | 4 ++++
> >> + 2 files changed, 7 insertions(+), 1 deletion(-)
> >> +
> >> +diff --git a/meson.build b/meson.build
> >> +index 1badb16..05edb8d 100644
> >> +--- a/meson.build
> >> ++++ b/meson.build
> >> +@@ -309,7 +309,9 @@ if get_option('gtk-examples')
> >> + endif
> >> +
> >> + subdir('data')
> >> +-subdir('tests')
> >> ++if get_option('tests')
> >> ++    subdir('tests')
> >> ++endif
> >> +
> >> + pkgconfig = import('pkgconfig')
> >> + pkgconfig.generate(
> >> +diff --git a/meson_options.txt b/meson_options.txt
> >> +index a6f0c4d..175710d 100644
> >> +--- a/meson_options.txt
> >> ++++ b/meson_options.txt
> >> +@@ -38,3 +38,7 @@ option('doc',
> >> +        description: 'Whether to build the API documentation',
> >> +        type: 'boolean',
> >> +        value: true)
> >> ++option('tests',
> >> ++       description: 'Whether to build the tests',
> >> ++       type: 'boolean',
> >> ++       value: true)
> >> +--
> >> +2.39.2
> >> +
> >> diff --git a/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >> new file mode 100644
> >> index 000000000..b0133409a
> >> --- /dev/null
> >> +++ b/meta-oe/recipes-support/libfprint/libfprint_1.94.5.bb
> >> @@ -0,0 +1,45 @@
> >> +SUMMARY = "Library for fingerprint readers"
> >> +DESCRIPTION = "libfprint is an open source software library \
> >> +designed to make it easy for application developers to add \
> >> +support for consumer fingerprint readers to their software."
> >> +HOMEPAGE = "https://www.freedesktop.org/wiki/Software/fprint/libfprint/"
> >> +
> >> +DEPENDS = "glib-2.0 libgusb udev libgudev nspr nss pixman cairo"
> >> +
> >> +DEPENDS:append:class-target = " libfprint-native "
> >> +
> >> +LICENSE = "LGPL-2.1-only"
> >> +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
> >> +
> >> +#PR = "r1"
> >> +
> >> +SRCREV = "86961a9429d589c387da37351fd6b4ff3caf67ea"
> >> +
> >> +SRC_URI = " \
> >> +       git://anongit.freedesktop.org/git/libfprint/libfprint.git;branch=master;protocol=https \
> >> +       file://0001-Optionally-use-native-generators.patch \
> >> +       file://0002-Make-building-tests-optional.patch \
> >> +"
> >> +
> >> +S = "${WORKDIR}/git"
> >> +
> >> +inherit meson pkgconfig useradd python3native gobject-introspection
> >> +
> >> +EXTRA_OEMESON:class-native = "-Ddoc=false -Dtests=false -Dintrospection=false"
> >> +
> >> +EXTRA_OEMESON:class-target = "-Ddoc=false -Dtests=false \
> >> +       -Dudev_hwdb=enabled -Dudev_hwdb_dir=${sysconfdir}/udev/hwdb.d \
> >> +       -Dudev_hwdb_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-hwdb \
> >> +       -Dudev_rules_cmd=${STAGING_BINDIR_NATIVE}/fprint-list-udev-rules \
> >> +"
> >> +
> >> +do_install:append:class-native () {
> >> +       install -d ${D}${bindir}
> >> +       install -m0755 ${B}/libfprint/fprint-list-udev-hwdb ${D}${bindir}/fprint-list-udev-hwdb
> >> +       install -m0755 ${B}/libfprint/fprint-list-udev-rules ${D}${bindir}/fprint-list-udev-rules
> >> +}
> >> +
> >> +BBCLASSEXTEND = "native"
> >> +
> >> +USERADD_PACKAGES = "${PN}"
> >> +GROUPADD_PARAM:${PN} = "fprint"
> >> --
> >> 2.39.2
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#101836): https://lists.openembedded.org/g/openembedded-devel/message/101836
> >> Mute This Topic: https://lists.openembedded.org/mt/97950767/1997914
> >> Group Owner: openembedded-devel+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-04-01 12:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 13:43 [meta-oe][PATCH 1/3] libgusb: Allow building in native mode Zoltán Böszörményi
2023-03-30 13:43 ` [meta-oe][PATCH 2/3] libfprint: New recipe Zoltán Böszörményi
2023-03-30 13:50   ` [oe] " Alexander Kanavin
2023-03-30 14:22     ` Böszörményi Zoltán
2023-03-30 15:24     ` Böszörményi Zoltán
2023-03-30 15:40       ` Alexander Kanavin
2023-03-30 17:20         ` Böszörményi Zoltán
2023-03-30 17:37           ` Alexander Kanavin
     [not found]     ` <17513BCD51B17AEE.27612@lists.openembedded.org>
2023-03-30 15:52       ` Böszörményi Zoltán
2023-03-30 16:44         ` Alexander Kanavin
2023-03-31 17:41   ` Khem Raj
2023-04-01  6:01     ` Böszörményi Zoltán
2023-04-01 12:55       ` Khem Raj
2023-03-30 13:43 ` [meta-oe][PATCH 3/3] fprintd: " Zoltán Böszörményi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.