aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Hughes <davidhughes205@gmail.com>2021-04-18 22:27:00 -0400
committerDave Hughes <davidhughes205@gmail.com>2021-04-18 22:27:14 -0400
commitd849cff19a57717c42e61331afec0d1bbcae7df8 (patch)
tree7ecae0b227b1c3aaf557dc069b79722e9301e8fc /sys-apps
parentdev-util/valgrind: add musl patch + suppressions (diff)
downloadmusl-d849cff19a57717c42e61331afec0d1bbcae7df8.tar.gz
musl-d849cff19a57717c42e61331afec0d1bbcae7df8.tar.bz2
musl-d849cff19a57717c42e61331afec0d1bbcae7df8.zip
sys-apps/accountsservice: sync with ::gentoo
Bug: https://bugs.gentoo.org/762442 Closes: https://bugs.gentoo.org/762442 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Dave Hughes <davidhughes205@gmail.com>
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/accountsservice/Manifest2
-rw-r--r--sys-apps/accountsservice/accountsservice-0.6.50-r1.ebuild67
-rw-r--r--sys-apps/accountsservice/accountsservice-0.6.55.ebuild82
-rw-r--r--sys-apps/accountsservice/files/musl-fgetspent_r.patch61
-rw-r--r--sys-apps/accountsservice/files/musl-wtmp.patch14
5 files changed, 128 insertions, 98 deletions
diff --git a/sys-apps/accountsservice/Manifest b/sys-apps/accountsservice/Manifest
index a3e3d72..d02ee74 100644
--- a/sys-apps/accountsservice/Manifest
+++ b/sys-apps/accountsservice/Manifest
@@ -1 +1 @@
-DIST accountsservice-0.6.50.tar.xz 384484 BLAKE2B 52c06ba85498f292204834f967211d8f0940786dc2ea3070124d3aecccd551375bfbc8fc31f23a2c3c86e23359294307656c3b927c4e819fc102d8626ae0dd82 SHA512 6e07cd318452b1cbedeacd729f0ebb200525caf1b09981abb2bac16fd90756a790ebec08aca0a0cea016f14ab27c159a68fe1332ef4bc636c5863b8c61040f64
+DIST accountsservice-0.6.55.tar.xz 97972 BLAKE2B aba3adfeb53e64455ce8e672b9db754bae4af6b4de0823cc021d0311a381ec40af04371e78f7c84eab7fb72356b26e22db78aad0343d57f65ea71a7742b51fc7 SHA512 c12e6a8e80f9b087f97238da4734d2d3a14a7c5cbd870a32a04b00116f176c818c39fb886f6dc72c3e93c136b0c2074ddf8f77e20431fa3bd54f138bea9d262d
diff --git a/sys-apps/accountsservice/accountsservice-0.6.50-r1.ebuild b/sys-apps/accountsservice/accountsservice-0.6.50-r1.ebuild
deleted file mode 100644
index f98bb6d..0000000
--- a/sys-apps/accountsservice/accountsservice-0.6.50-r1.ebuild
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-GNOME2_EAUTORECONF="yes"
-
-inherit gnome2 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="amd64 arm arm64 ppc ppc64 x86"
-
-IUSE="doc elogind +introspection selinux systemd"
-REQUIRED_USE="^^ ( elogind systemd )"
-
-CDEPEND="
- >=dev-libs/glib-2.44:2
- sys-auth/polkit
- elogind? ( >=sys-auth/elogind-229.4 )
- introspection? ( >=dev-libs/gobject-introspection-0.9.12:= )
- systemd? ( >=sys-apps/systemd-186:0= )
-"
-DEPEND="${CDEPEND}
- dev-libs/libxslt
- dev-util/gdbus-codegen
- >=dev-util/gtk-doc-am-1.15
- >=dev-util/intltool-0.40
- sys-devel/gettext
- virtual/pkgconfig
- doc? (
- app-text/docbook-xml-dtd:4.1.2
- app-text/xmlto )
-"
-RDEPEND="${CDEPEND}
- selinux? ( sec-policy/selinux-accountsd )
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-0.6.35-gentoo-system-users.patch
-
- # lib: don't set loaded state until seat is fetched (from 'master')
- "${FILESDIR}"/${P}-loaded-state.patch
- "${FILESDIR}"/musl-fgetspent_r.patch
-)
-
-src_prepare() {
- default
- sed -i configure -e "s;utx\.log;wtmp;g"
- export ac_cv_file__var_log_utx_log=yes
-}
-
-src_configure() {
- gnome2_src_configure \
- --disable-static \
- --disable-more-warnings \
- --localstatedir="${EPREFIX}"/var \
- --enable-admin-group="wheel" \
- --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
- $(use_enable doc docbook-docs) \
- $(use_enable elogind) \
- $(use_enable introspection) \
- $(use_enable systemd)
-}
diff --git a/sys-apps/accountsservice/accountsservice-0.6.55.ebuild b/sys-apps/accountsservice/accountsservice-0.6.55.ebuild
new file mode 100644
index 0000000..7ba6e42
--- /dev/null
+++ b/sys-apps/accountsservice/accountsservice-0.6.55.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit meson 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 ppc ppc64 ~sparc x86"
+
+IUSE="doc elogind gtk-doc +introspection selinux systemd"
+REQUIRED_USE="^^ ( elogind systemd )"
+
+CDEPEND="
+ >=dev-libs/glib-2.44:2
+ sys-auth/polkit
+ 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
+ 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 )
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-accountsd )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.6.35-gentoo-system-users.patch
+)
+
+src_prepare() {
+ default
+
+ if use elibc_musl ; then
+ eapply "${FILESDIR}/musl-fgetspent_r.patch"
+ eapply "${FILESDIR}/musl-wtmp.patch"
+ fi
+
+ eapply_user
+}
+
+src_configure() {
+ local emesonargs=(
+ --localstatedir="${EPREFIX}/var"
+ -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)"
+ -Dadmin_group="wheel"
+ $(meson_use systemd)
+ $(meson_use elogind)
+ $(meson_use introspection)
+ $(meson_use doc docbook)
+ $(meson_use gtk-doc gtk_doc)
+ )
+ 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/musl-fgetspent_r.patch b/sys-apps/accountsservice/files/musl-fgetspent_r.patch
index c365065..3b5cc80 100644
--- a/sys-apps/accountsservice/files/musl-fgetspent_r.patch
+++ b/sys-apps/accountsservice/files/musl-fgetspent_r.patch
@@ -1,34 +1,35 @@
-Musl libc does not support fgetspent_r(), so fall back
-to using the non-thread-safe fgetspent() function.
+From: https://git.alpinelinux.org/aports/tree/community/accountsservice
---- a/src/daemon.c 2016-09-06 21:48:50.000000000 +0200
-+++ b/src/daemon.c 2016-11-25 10:41:01.614534302 +0100
-@@ -174,7 +174,7 @@
- int ret = 0;
+diff --git a/src/daemon.c b/src/daemon.c
+index 312394a..e7b3c58 100644
+--- a/src/daemon.c
++++ b/src/daemon.c
+@@ -140,6 +140,28 @@ error_get_type (void)
+ #define MAX_LOCAL_USERS 50
+ #endif
- shadow_entry_buffers = g_malloc0 (sizeof (*shadow_entry_buffers));
--
-+#if defined(__GLIBC__)
- ret = fgetspent_r (fp, &shadow_entry_buffers->spbuf, shadow_entry_buffers->buf, sizeof (shadow_entry_buffers->buf), &shadow_entry);
- if (ret == 0) {
- g_hash_table_insert (shadow_users, g_strdup (shadow_entry->sp_namp), shadow_entry_buffers);
-@@ -185,6 +185,19 @@
- break;
- }
- }
-+#else
-+ /* Musl libc does not support fgetspent_r(), so fall back
-+ * to using the non-thread-safe fgetspent() function.
-+ */
-+ shadow_entry = fgetspent(fp);
-+ if (shadow_entry == NULL) {
-+ g_free (shadow_entry_buffers);
++#ifndef __GLIBC__
++ /* Musl libc does not support fgetspent_r(), write own
++ * wrapper
++ */
++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 (errno != EINTR) {
-+ break;
-+ }
-+ }
++ 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
- } while (shadow_entry != NULL);
-
- fclose (fp);
++
+ static struct passwd *
+ entry_generator_fgetpwent (Daemon *daemon,
+ GHashTable *users,
diff --git a/sys-apps/accountsservice/files/musl-wtmp.patch b/sys-apps/accountsservice/files/musl-wtmp.patch
new file mode 100644
index 0000000..c4d364b
--- /dev/null
+++ b/sys-apps/accountsservice/files/musl-wtmp.patch
@@ -0,0 +1,14 @@
+From: https://git.alpinelinux.org/aports/tree/community/accountsservice
+
+--- a/meson.build
++++ b/meson.build
+@@ -82,8 +82,7 @@ if cc.has_header_symbol('utmpx.h', 'WTMPX_FILENAME', prefix: '#define _GNU_SOURC
+ elif cc.has_header_symbol('paths.h', '_PATH_WTMPX')
+ config_h.set('PATH_WTMP', '_PATH_WTMPX')
+ else
+- assert(run_command('test', '-e', '/var/log/utx.log').returncode() == 0, 'Do not know which filename to watch for wtmp changes')
+- config_h.set_quoted('PATH_WTMP', '/var/log/utx.log')
++ config_h.set_quoted('PATH_WTMP', '/var/log/wtmp')
+ endif
+
+ # compiler flags