diff mbox series

[oe-ore,PATCHv2] libsecret: add pam support depending on DISTRO_FEATURES

Message ID 20241129144556.2259-1-f_l_k@t-online.de
State New
Headers show
Series [oe-ore,PATCHv2] libsecret: add pam support depending on DISTRO_FEATURES | expand

Commit Message

Markus Volk Nov. 29, 2024, 2:45 p.m. UTC
pam module has been ported from gnome-keyring to libsecret
[https://gitlab.gnome.org/GNOME/libsecret/-/commit/9a37dc839a9be1670afeb647d9f82b6ef1cd0893]

Add a PACKAGECONFIG for pam and enable it if pam is in DISTRO_FEATURES

Add a recipe for pam_wrapper, needed to build the tests

[https://gitlab.com/cwrap/pam_wrapper]

Import cmocka recipe from meta-oe
[https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-test/cmocka/cmocka_1.1.7.bb]

(From OE-Core rev: 3ef7f9650df0d99cd3a25ad470ac67aed1351d11)

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meta/conf/distro/include/maintainers.inc      |  2 +
 meta/recipes-devtools/cmocka/cmocka_1.1.7.bb  | 43 ++++++++++++++++
 ...or-previous-declaration-of-uintptr_t.patch | 43 ++++++++++++++++
 meta/recipes-devtools/cmocka/files/run-ptest  | 10 ++++
 ...rapper-add-pc_sysrootdir-to-pc-files.patch | 49 +++++++++++++++++++
 .../pam-wrapper/pam-wrapper_1.1.7.bb          | 23 +++++++++
 .../libsecret/libsecret_0.21.4.bb             |  5 +-
 7 files changed, 173 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/cmocka/cmocka_1.1.7.bb
 create mode 100644 meta/recipes-devtools/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch
 create mode 100644 meta/recipes-devtools/cmocka/files/run-ptest
 create mode 100644 meta/recipes-devtools/pam-wrapper/pam-wrapper/0001-pamwrapper-add-pc_sysrootdir-to-pc-files.patch
 create mode 100644 meta/recipes-devtools/pam-wrapper/pam-wrapper_1.1.7.bb

Comments

patchtest@automation.yoctoproject.org Nov. 29, 2024, 3:02 p.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/oe-ore-PATCHv2-libsecret-add-pam-support-depending-on-DISTRO_FEATURES.patch

FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
FAIL: test summary presence: SUMMARY is missing in newly added recipe (test_metadata.TestMetadata.test_summary_presence)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test lic files chksum presence (test_metadata.TestMetadata.test_lic_files_chksum_presence)
PASS: test license presence (test_metadata.TestMetadata.test_license_presence)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index d61b88f7de..e6675fce36 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -98,6 +98,7 @@  RECIPE_MAINTAINER:pn-cdrtools-native = "Yi Zhao <yi.zhao@windriver.com>"
 RECIPE_MAINTAINER:pn-chrpath = "Yi Zhao <yi.zhao@windriver.com>"
 RECIPE_MAINTAINER:pn-cmake = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-cmake-native = "Unassigned <unassigned@yoctoproject.org>"
+RECIPE_MAINTAINER:pn-cmocka = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-connman = "Changhyeok Bae <changhyeok.bae@gmail.com>"
 RECIPE_MAINTAINER:pn-connman-conf = "Ross Burton <ross.burton@arm.com>"
 RECIPE_MAINTAINER:pn-connman-gnome = "Ross Burton <ross.burton@arm.com>"
@@ -569,6 +570,7 @@  RECIPE_MAINTAINER:pn-ovmf = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-ovmf-shell-image = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-p11-kit = "Alexander Kanavin <alex.kanavin@gmail.com>"
 RECIPE_MAINTAINER:pn-package-index = "Ross Burton <ross.burton@arm.com>"
+RECIPE_MAINTAINER:pn-pam-wrapper = "Markus Volk <f_l_k@t-online.de>"
 RECIPE_MAINTAINER:pn-pango = "Ross Burton <ross.burton@arm.com>"
 RECIPE_MAINTAINER:pn-parted = "Hongxu Jia <hongxu.jia@windriver.com>"
 RECIPE_MAINTAINER:pn-patch = "Hongxu Jia <hongxu.jia@windriver.com>"
diff --git a/meta/recipes-devtools/cmocka/cmocka_1.1.7.bb b/meta/recipes-devtools/cmocka/cmocka_1.1.7.bb
new file mode 100644
index 0000000000..6c94e9e275
--- /dev/null
+++ b/meta/recipes-devtools/cmocka/cmocka_1.1.7.bb
@@ -0,0 +1,43 @@ 
+DESCRIPTION = "cmocka is an elegant unit testing framework for C with support for mock \
+objects. It only requires the standard C library, works on a range of computing \
+platforms (including embedded) and with different compilers."
+HOMEPAGE = "https://cmocka.org/"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313"
+PV .= "+git"
+SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=stable-1.1 \
+           file://0001-include-Check-for-previous-declaration-of-uintptr_t.patch \
+           file://run-ptest \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit cmake ptest
+
+EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON', '', d)}"
+# Use -Wl,wrap linker flag, which does not work with LTO
+LTO = ""
+
+do_install:append () {
+    install -d ${D}${libdir}/${BPN}/example
+    install -d ${D}${libdir}/${BPN}/example/mock/chef_wrap
+    install -d ${D}${libdir}/${BPN}/example/mock/uptime
+
+    install -m 0755 ${B}/example/*_test ${D}/${libdir}/${BPN}/example
+    install -m 0755 ${B}/example/mock/chef_wrap/waiter_test_wrap ${D}/${libdir}/${BPN}/example/mock/chef_wrap
+    install -m 0755 ${B}/example/mock/uptime/uptime ${D}/${libdir}/${BPN}/example/mock/uptime
+    install -m 0755 ${B}/example/mock/uptime/test_uptime ${D}/${libdir}/${BPN}/example/mock/uptime
+    install -m 0644 ${B}/example/mock/uptime/libproc_uptime.so ${D}/${libdir}/${BPN}/example/mock/libproc_uptime.so
+}
+
+do_install_ptest () {
+    install -d ${D}${PTEST_PATH}/tests
+    install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests
+}
+
+PACKAGE_BEFORE_PN += "${PN}-examples"
+
+FILES:${PN}-examples = "${libdir}/${BPN}/example"
diff --git a/meta/recipes-devtools/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch b/meta/recipes-devtools/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch
new file mode 100644
index 0000000000..65d30ea993
--- /dev/null
+++ b/meta/recipes-devtools/cmocka/files/0001-include-Check-for-previous-declaration-of-uintptr_t.patch
@@ -0,0 +1,43 @@ 
+From a54e035f802e79e3292d8ad39a14bd7c060eb7b1 Mon Sep 17 00:00:00 2001
+From: Breno Leitao <breno.leitao@gmail.com>
+Date: Tue, 21 Mar 2023 21:58:28 -0700
+Subject: [PATCH] include: Check for previous declaration of uintptr_t
+
+Adding a extra check before declaring uintptr_t. Currently musl uses
+macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking
+this macro before defining it, and, defining it when uintptr_t is
+defined.
+
+Taken from Alpine
+
+Upstream-Status: Pending
+Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/cmocka.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/include/cmocka.h b/include/cmocka.h
+index a21d965..f540793 100644
+--- a/include/cmocka.h
++++ b/include/cmocka.h
+@@ -121,7 +121,7 @@ typedef uintmax_t LargestIntegralType;
+     ((LargestIntegralType)(value))
+ 
+ /* Smallest integral type capable of holding a pointer. */
+-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T)
++#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T) && !defined(__DEFINED_uintptr_t)
+ # if defined(_WIN32)
+     /* WIN32 is an ILP32 platform */
+     typedef unsigned int uintptr_t;
+@@ -147,6 +147,7 @@ typedef uintmax_t LargestIntegralType;
+ 
+ # define _UINTPTR_T
+ # define _UINTPTR_T_DEFINED
++# define __DEFINED_uintptr_t
+ #endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
+ 
+ /* Perform an unsigned cast to uintptr_t. */
+-- 
+2.40.0
+
diff --git a/meta/recipes-devtools/cmocka/files/run-ptest b/meta/recipes-devtools/cmocka/files/run-ptest
new file mode 100644
index 0000000000..48b9cd9fc5
--- /dev/null
+++ b/meta/recipes-devtools/cmocka/files/run-ptest
@@ -0,0 +1,10 @@ 
+#!/bin/sh
+
+cd tests
+for i in `ls *`; do
+   if [ ./$i ] ; then
+       echo "PASS: $i"
+   else
+       echo "FAIL: $i"
+   fi
+done
diff --git a/meta/recipes-devtools/pam-wrapper/pam-wrapper/0001-pamwrapper-add-pc_sysrootdir-to-pc-files.patch b/meta/recipes-devtools/pam-wrapper/pam-wrapper/0001-pamwrapper-add-pc_sysrootdir-to-pc-files.patch
new file mode 100644
index 0000000000..03c4141aa2
--- /dev/null
+++ b/meta/recipes-devtools/pam-wrapper/pam-wrapper/0001-pamwrapper-add-pc_sysrootdir-to-pc-files.patch
@@ -0,0 +1,49 @@ 
+From 15733e45935dbef71b6c4547cd3a905014793aed Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Fri, 29 Nov 2024 13:49:16 +0100
+Subject: [PATCH] pamwrapper: add ${pc_sysrootdir} to pc files
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+
+Upstream-Status: Inappropriate [oe-specific]
+---
+ libpamtest.pc.cmake         | 2 +-
+ pam_wrapper-config.cmake.in | 4 ++--
+ pam_wrapper.pc.cmake        | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/libpamtest.pc.cmake b/libpamtest.pc.cmake
+index 6726d76..9cee8bf 100644
+--- a/libpamtest.pc.cmake
++++ b/libpamtest.pc.cmake
+@@ -1,4 +1,4 @@
+ Name: libpamtest
+ Description: A helper library for PAM testing
+ Version: @APPLICATION_VERSION@
+-Libs: @CMAKE_INSTALL_FULL_LIBDIR@/libpamtest.so
++Libs: ${pc_sysrootdir}@CMAKE_INSTALL_FULL_LIBDIR@/libpamtest.so
+diff --git a/pam_wrapper-config.cmake.in b/pam_wrapper-config.cmake.in
+index d89e9a4..6ff00d7 100644
+--- a/pam_wrapper-config.cmake.in
++++ b/pam_wrapper-config.cmake.in
+@@ -1,2 +1,2 @@
+-set(PAM_WRAPPER_LIBRARY @CMAKE_INSTALL_FULL_LIBDIR@/@PAM_WRAPPER_LIB@)
+-set(PAM_WRAPPER_MODULE_DIR @CMAKE_INSTALL_FULL_LIBDIR@/@PROJECT_NAME@)
++set(PAM_WRAPPER_LIBRARY ${pc_sysrootdir}@CMAKE_INSTALL_FULL_LIBDIR@/@PAM_WRAPPER_LIB@)
++set(PAM_WRAPPER_MODULE_DIR ${pc_sysrootdir}@CMAKE_INSTALL_FULL_LIBDIR@/@PROJECT_NAME@)
+diff --git a/pam_wrapper.pc.cmake b/pam_wrapper.pc.cmake
+index 7ebe607..f722781 100644
+--- a/pam_wrapper.pc.cmake
++++ b/pam_wrapper.pc.cmake
+@@ -1,6 +1,6 @@
+-modules=@CMAKE_INSTALL_FULL_LIBDIR@/pam_wrapper
++modules=${pc_sysrootdir}@CMAKE_INSTALL_FULL_LIBDIR@/pam_wrapper
+ 
+ Name: @PROJECT_NAME@
+ Description: The pam_wrapper library
+ Version: @PROJECT_VERSION@
+-Libs: @CMAKE_INSTALL_FULL_LIBDIR@/@PAM_WRAPPER_LIB@
++Libs: ${pc_sysrootdir}@CMAKE_INSTALL_FULL_LIBDIR@/@PAM_WRAPPER_LIB@
+-- 
+2.47.0
+
diff --git a/meta/recipes-devtools/pam-wrapper/pam-wrapper_1.1.7.bb b/meta/recipes-devtools/pam-wrapper/pam-wrapper_1.1.7.bb
new file mode 100644
index 0000000000..8df3295eb6
--- /dev/null
+++ b/meta/recipes-devtools/pam-wrapper/pam-wrapper_1.1.7.bb
@@ -0,0 +1,23 @@ 
+SUMMARY = "A tool to test PAM applications and PAM modules"
+HOMEPAGE = "https://gitlab.com/cwrap/pam_wrapper"
+LICENSE = "GPL-3.0-only"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504"
+
+SRCREV = "f140952e99bb0682bc6da7858f6ca25b70fab86c"
+SRC_URI = " \
+	git://gitlab.com/cwrap/pam_wrapper.git;protocol=https;branch=master \
+	file://0001-pamwrapper-add-pc_sysrootdir-to-pc-files.patch \
+"
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig python3targetconfig
+
+EXTRA_OECMAKE += "-DPAM_LIBRARY=${libdir}/libpam.so.0"
+
+DEPENDS += "cmocka libpam"
+
+FILES:${PN} += "${libdir}"
+
+RDEPENDS:${PN} += "python3-core libpython3"
+
diff --git a/meta/recipes-gnome/libsecret/libsecret_0.21.4.bb b/meta/recipes-gnome/libsecret/libsecret_0.21.4.bb
index 88c3c73510..fd3f7a38c3 100644
--- a/meta/recipes-gnome/libsecret/libsecret_0.21.4.bb
+++ b/meta/recipes-gnome/libsecret/libsecret_0.21.4.bb
@@ -8,16 +8,17 @@  HOMEPAGE = "https://github.com/GNOME/libsecret"
 BUGTRACKER = "https://gitlab.gnome.org/GNOME/libsecret/issues"
 LIC_FILES_CHKSUM = "file://COPYING;md5=23c2a5e0106b99d75238986559bb5fc6"
 
-
 inherit gnomebase gi-docgen vala gobject-introspection manpages
 
-DEPENDS += "glib-2.0 libgcrypt gettext-native"
+DEPENDS += "glib-2.0 libgcrypt gettext-native pam-wrapper"
 
 SRC_URI[archive.sha256sum] = "163d08d783be6d4ab9a979ceb5a4fecbc1d9660d3c34168c581301cd53912b20"
 
 GTKDOC_MESON_OPTION = 'gtk_doc'
 
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG[manpages] = "-Dmanpage=true,-Dmanpage=false,libxslt-native xmlto-native"
+PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam"
 
 # http://errors.yoctoproject.org/Errors/Details/20228/
 ARM_INSTRUCTION_SET:armv4 = "arm"