[meta-oe][PATCH 3/3] fprintd: New recipe


Zoltan Boszormenyi
 

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

Signed-off-by: Zoltán Böszörményi <zboszor@...>
---
.../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@...>
+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@...>
+---
+ 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