commit:     1509130765cbb849b2186954e0b24944eca843ee
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 27 06:31:44 2023 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Jul 27 06:31:44 2023 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=15091307

sys-apps/accountsservice: sync with gx86

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 sys-apps/accountsservice/Manifest                  |  1 +
 .../accountsservice/accountsservice-23.13.9.ebuild | 96 ++++++++++++++++++++++
 .../accountsservice-23.13.9-check-for-wtmp.patch   | 41 +++++++++
 .../accountsservice-23.13.9-fgetspent_r-musl.patch | 53 ++++++++++++
 .../accountsservice-23.13.9-generate-version.patch | 30 +++++++
 5 files changed, 221 insertions(+)

diff --git a/sys-apps/accountsservice/Manifest 
b/sys-apps/accountsservice/Manifest
index 0e7fae0f..e71030a3 100644
--- a/sys-apps/accountsservice/Manifest
+++ b/sys-apps/accountsservice/Manifest
@@ -1 +1,2 @@
 DIST accountsservice-22.08.8.tar.xz 102672 BLAKE2B 
7c9436d3845fc1883772b434c4f9e2fba934d17e6d4452a6be65e1d790a23b331eaaa64b0e6eff6fefe79587a40cf1749a0f3de09f323b10740046bd9d145c9d
 SHA512 
2ca3ceb1b44338d9924b86788256d4eef7ec10e0c2197bfb8cc6c31ae224fab3051f03cb406a526f90057684965bef4ba0f2cc01b26198ec1fc6baec36ad3ff8
+DIST accountsservice-23.13.9.tar.xz 636064 BLAKE2B 
74dbbe816937e626ba0f6524b4293466ac2905f474396f5d23633e966d46e013de110671abcbfe2911fffa1e98872e2525b61594a967f917975ebf18d39b8547
 SHA512 
c6eb543ce2e07b61bbdfa454e388949bc688517be0536b14f30c66383ed105b15d3fab8b6c62b1eaa08f67d9bdc29b928729d9f7c704f47de4decf0de8e12f89

diff --git a/sys-apps/accountsservice/accountsservice-23.13.9.ebuild 
b/sys-apps/accountsservice/accountsservice-23.13.9.ebuild
new file mode 100644
index 00000000..eaa12c4c
--- /dev/null
+++ b/sys-apps/accountsservice/accountsservice-23.13.9.ebuild
@@ -0,0 +1,96 @@
+# Copyright 2011-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{9..11} )
+inherit meson python-any-r1 systemd
+
+DESCRIPTION="D-Bus interfaces for querying and manipulating user account 
information"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/AccountsService/";
+SRC_URI="https://www.freedesktop.org/software/${PN}/${P}.tar.xz";
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~loong ppc ppc64 ~riscv ~sparc x86"
+
+IUSE="doc elogind gtk-doc +introspection selinux systemd test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="^^ ( elogind systemd )"
+
+CDEPEND="
+       >=dev-libs/glib-2.63.5:2
+       sys-auth/polkit
+       virtual/libcrypt:=
+       elogind? ( >=sys-auth/elogind-229.4 )
+       introspection? ( >=dev-libs/gobject-introspection-0.9.12:= )
+       systemd? ( >=sys-apps/systemd-186:0= )
+"
+DEPEND="${CDEPEND}"
+BDEPEND="
+       dev-libs/libxslt
+       dev-util/gdbus-codegen
+       dev-util/glib-utils
+       sys-devel/gettext
+       virtual/pkgconfig
+       doc? (
+               app-text/docbook-xml-dtd:4.1.2
+               app-text/xmlto
+       )
+       gtk-doc? (
+               dev-util/gtk-doc
+               app-text/docbook-xml-dtd:4.3
+       )
+       test? (
+               $(python_gen_any_dep '
+                       dev-python/python-dbusmock[${PYTHON_USEDEP}]
+               ')
+       )
+"
+RDEPEND="${CDEPEND}
+       selinux? ( sec-policy/selinux-accountsd )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-22.04.62-gentoo-system-users.patch
+       "${FILESDIR}"/${PN}-23.13.9-generate-version.patch #905770
+       "${FILESDIR}"/${PN}-23.13.9-check-for-wtmp.patch
+       "${FILESDIR}"/${PN}-23.13.9-fgetspent_r-musl.patch
+)
+
+python_check_deps() {
+       if use test; then
+               python_has_version 
"dev-python/python-dbusmock[${PYTHON_USEDEP}]"
+       fi
+}
+
+src_configure() {
+       # No option to disable tests
+       if ! use test; then
+               sed -e "/subdir('tests')/d" -i meson.build || die
+       fi
+
+       local emesonargs=(
+               --localstatedir="${EPREFIX}/var"
+               -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
+               -Dadmin_group="wheel"
+               -Dcheck_wtmp="$(usex !elibc_musl true false)"
+               $(meson_use elogind)
+               $(meson_use introspection)
+               $(meson_use doc docbook)
+               $(meson_use gtk-doc gtk_doc)
+               -Dvapi=false
+       )
+       meson_src_configure
+}
+
+src_install() {
+       meson_src_install
+
+       # 
https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/90
+       if use doc; then
+               mv "${ED}/usr/share/doc/${PN}" "${ED}/usr/share/doc/${PF}" || 
die
+       fi
+
+       # This directories are created at runtime when needed
+       rm -r "${ED}"/var/lib || die
+}

diff --git 
a/sys-apps/accountsservice/files/accountsservice-23.13.9-check-for-wtmp.patch 
b/sys-apps/accountsservice/files/accountsservice-23.13.9-check-for-wtmp.patch
new file mode 100644
index 00000000..34a60b0b
--- /dev/null
+++ 
b/sys-apps/accountsservice/files/accountsservice-23.13.9-check-for-wtmp.patch
@@ -0,0 +1,41 @@
+Adds a meson build option to check if wtmp path is valid.
+wtmp is not used on musl and is implemented with stubs because it is harmful 
software, and because of that, checking whether the path is valid or not does 
not matter.
+
+See: 
https://wiki.musl-libc.org/faq.html#Q:_Why_is_the_utmp/wtmp_functionality_only_implemented_as_stubs?
+https://bugs.gentoo.org/762442
+
+---
+ meson.build       | 4 +++-
+ meson_options.txt | 1 +
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 075776f..0801659 100644
+--- a/meson.build
++++ b/meson.build
+@@ -102,7 +102,9 @@ elif cc.has_header_symbol('paths.h', '_PATH_WTMPX')
+   config_h.set('PATH_WTMP', '_PATH_WTMPX')
+ else
+   path_wtmp = '/var/log/utx.log'
+-  assert(run_command('test', '-e', path_wtmp, check: false).returncode() == 
0, 'Do not know which filename to watch for wtmp changes')
++  if get_option('check_wtmp')
++    assert(run_command('test', '-e', path_wtmp, check: false).returncode() == 
0, 'Do not know which filename to watch for wtmp changes')
++  endif
+   config_h.set_quoted('PATH_WTMP', path_wtmp)
+ endif
+ 
+diff --git a/meson_options.txt b/meson_options.txt
+index 93f384a..4fec12e 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -6,6 +6,7 @@ option('extra_admin_groups', type: 'array', value: [], 
description: 'Comma-separ
+ option('minimum_uid', type: 'integer', value: 1000, description: 'Set minimum 
uid for human users')
+ 
+ option('elogind', type: 'boolean', value: false, description: 'Use elogind')
++option('check_wtmp', type: 'boolean', value: true, description: 'Check if 
wtmp path is valid (musl workaround)')
+ 
+ option('introspection', type: 'boolean', value: true, description: 'Enable 
introspection for this build')
+ option('vapi', type: 'boolean', value: true, description : 'Enable Vala 
bindings for this build')
+-- 
+2.35.1
+

diff --git 
a/sys-apps/accountsservice/files/accountsservice-23.13.9-fgetspent_r-musl.patch 
b/sys-apps/accountsservice/files/accountsservice-23.13.9-fgetspent_r-musl.patch
new file mode 100644
index 00000000..8cdeb695
--- /dev/null
+++ 
b/sys-apps/accountsservice/files/accountsservice-23.13.9-fgetspent_r-musl.patch
@@ -0,0 +1,53 @@
+Define fgetspent_r if not already defined. (GNU extension, therefore not in 
musl).
+
+https://git.alpinelinux.org/aports/tree/community/accountsservice/musl-fgetspent_r.patch
 (copied the function from here).
+diff -u b/src/daemon.c b/src/daemon.c
+--- b/src/daemon.c
++++ b/src/daemon.c
+@@ -32,7 +32,7 @@
+ #include <pwd.h>
+ #ifdef HAVE_SHADOW_H
+ #include <shadow.h>
+-#endif
++#endif // HAVE_SHADOW_H
+ #include <unistd.h>
+ #include <errno.h>
+ #include <sys/types.h>
+@@ -51,6 +51,25 @@
+ #include "user.h"
+ #include "accounts-user-generated.h"
+ 
++#ifndef HAVE_FGETSPENT_R
++static int fgetspent_r(FILE *fp, struct spwd *spbuf, char *buf, size_t 
buflen, struct spwd **spbufp) {
++       struct spwd *shadow_entry = fgetspent(fp);
++       if(!shadow_entry)
++               return -1;
++       size_t namplen = strlen(shadow_entry->sp_namp);
++       size_t pwdplen = strlen(shadow_entry->sp_pwdp);
++
++       if(namplen + pwdplen + 2 > buflen)
++               return -1;
++
++       *spbufp = memcpy(spbuf, shadow_entry, sizeof(struct spwd));
++       spbuf->sp_namp = strncpy(buf, shadow_entry->sp_namp, namplen + 1);
++       spbuf->sp_pwdp = strncpy(buf + namplen + 1, shadow_entry->sp_pwdp, 
pwdplen + 1);
++
++       return 0;
++}
++#endif // HAVE_FGETSPENT_R
++
+ #define PATH_PASSWD "passwd"
+ #define PATH_SHADOW "shadow"
+ #define PATH_GROUP "/etc/group"
+only in patch2:
+unchanged:
+--- a/meson.build
++++ b/meson.build
+@@ -71,6 +71,7 @@ check_functions = [
+   'getusershell',
+   'setutxdb',
+   'fgetpwent',
++  'fgetspent_r'
+ ]
+ 
+ foreach func: check_functions

diff --git 
a/sys-apps/accountsservice/files/accountsservice-23.13.9-generate-version.patch 
b/sys-apps/accountsservice/files/accountsservice-23.13.9-generate-version.patch
new file mode 100644
index 00000000..162b914b
--- /dev/null
+++ 
b/sys-apps/accountsservice/files/accountsservice-23.13.9-generate-version.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/905770
+https://gitlab.freedesktop.org/accountsservice/accountsservice/-/merge_requests/136
+https://gitlab.freedesktop.org/accountsservice/accountsservice/-/commit/c9c16b3c47e13e90bb2213141f6f309e2d474396
+
+From c9c16b3c47e13e90bb2213141f6f309e2d474396 Mon Sep 17 00:00:00 2001
+From: orbea <or...@riseup.net>
+Date: Fri, 5 May 2023 07:43:48 -0700
+Subject: [PATCH] generate-version.sh: fix script inside of a tarball
+
+---
+ generate-version.sh | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/generate-version.sh b/generate-version.sh
+index 3f88bff..8375c86 100755
+--- a/generate-version.sh
++++ b/generate-version.sh
+@@ -4,11 +4,10 @@ exec 3>&2 2> /dev/null
+ SRCDIR=$(dirname "$0")
+ cd "$SRCDIR"
+ CWD=$(realpath "$PWD")
+-TOPLEVEL_WORKING_DIR=$(realpath "$(git rev-parse --show-toplevel)")
+ exec 2>&3
+ 
+ # If it's not from a git checkout, assume it's from a tarball
+-if [ "$TOPLEVEL_WORKING_DIR" != "$CWD" ]; then
++if ! git rev-parse --is-inside-git-dir > /dev/null 2>&1; then
+     VERSION_FROM_DIR_NAME=$(basename "$CWD" | sed -n 
's/^accountsservice-\([^-]*\)$/\1/p')
+ 
+     if [ -n "$VERSION_FROM_DIR_NAME" ]; then

Reply via email to