[oe-commits] [meta-openembedded] 26/52: accountsservice: Hack musl build fix

git at git.openembedded.org git at git.openembedded.org
Thu Dec 12 00:23:23 UTC 2019


This is an automated email from the git hooks/post-receive script.

khem pushed a commit to branch master-next
in repository meta-openembedded.

commit 079137f59b1c16c6c0462e67e68e798eb87bcd35
Author: Andreas Müller <schnitzeltony at gmail.com>
AuthorDate: Mon Dec 9 09:36:12 2019 +0100

    accountsservice: Hack musl build fix
    
    Signed-off-by: Andreas Müller <schnitzeltony at gmail.com>
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 .../0001-musl-Hack-to-fix-build.patch              | 36 +++++++++++++++++
 .../0002-musl-add-missing-fgetspent_r.patch        | 46 ++++++++++++++++++++++
 .../accountsservice/accountsservice_0.6.55.bb      |  4 ++
 3 files changed, 86 insertions(+)

diff --git a/meta-gnome/recipes-support/accountsservice/accountsservice/0001-musl-Hack-to-fix-build.patch b/meta-gnome/recipes-support/accountsservice/accountsservice/0001-musl-Hack-to-fix-build.patch
new file mode 100644
index 0000000..c2310fe
--- /dev/null
+++ b/meta-gnome/recipes-support/accountsservice/accountsservice/0001-musl-Hack-to-fix-build.patch
@@ -0,0 +1,36 @@
+From 2a1c7103839c20df5ca9ce2fa863535d802f8f3a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at gmail.com>
+Date: Sun, 8 Dec 2019 23:42:00 +0100
+Subject: [PATCH] musl: Hack to fix configure
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+---
+ meson.build | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 4465a26..726c9fe 100644
+--- a/meson.build
++++ b/meson.build
+@@ -82,8 +82,14 @@ 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')
++  # musl: This is just a build fix hack.
++  # As usual they know better, consider all other projects crap and offer zero
++  # alternatives: So wtmp is a dead stub only [1] (= /dev/null/wtmp - taken
++  # from musl sources).
++  # Maybe a hero comes along and adds utmps [2] to make accountsservice useful for musl
++  # [1] https://wiki.musl-libc.org/faq.html#Q:-Why-is-the-utmp/wtmp-functionality-only-implemented-as-stubs?
++  # [2] https://github.com/skarnet/utmps
++  config_h.set_quoted('PATH_WTMP', '/dev/null/wtmp')
+ endif
+ 
+ # compiler flags
+-- 
+2.21.0
+
diff --git a/meta-gnome/recipes-support/accountsservice/accountsservice/0002-musl-add-missing-fgetspent_r.patch b/meta-gnome/recipes-support/accountsservice/accountsservice/0002-musl-add-missing-fgetspent_r.patch
new file mode 100644
index 0000000..1416180
--- /dev/null
+++ b/meta-gnome/recipes-support/accountsservice/accountsservice/0002-musl-add-missing-fgetspent_r.patch
@@ -0,0 +1,46 @@
+From 820249ea8e38c568e6a36fbd9c852718c7665b56 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at gmail.com>
+Date: Mon, 9 Dec 2019 00:12:08 +0100
+Subject: [PATCH] musl: add missing fgetspent_r
+
+Stolen from void-linux
+
+Upstream-Status: Inappropriate [musl-specific]
+---
+ src/daemon.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/src/daemon.c b/src/daemon.c
+index c52bda3..a7676fe 100644
+--- a/src/daemon.c
++++ b/src/daemon.c
+@@ -164,6 +164,26 @@ remove_cache_files (const gchar *user_name)
+         g_remove (icon_filename);
+ }
+ 
++/* 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(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;
++}
++
+ static struct passwd *
+ entry_generator_fgetpwent (Daemon       *daemon,
+                            GHashTable   *users,
+-- 
+2.21.0
+
diff --git a/meta-gnome/recipes-support/accountsservice/accountsservice_0.6.55.bb b/meta-gnome/recipes-support/accountsservice/accountsservice_0.6.55.bb
index bf603b3..36fecfe 100644
--- a/meta-gnome/recipes-support/accountsservice/accountsservice_0.6.55.bb
+++ b/meta-gnome/recipes-support/accountsservice/accountsservice_0.6.55.bb
@@ -13,6 +13,10 @@ inherit meson gobject-introspection gtk-doc features_check systemd
 REQUIRED_DISTRO_FEATURES = "polkit"
 
 SRC_URI = "https://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz"
+SRC_URI_append_libc-musl = " \
+    file://0001-musl-Hack-to-fix-build.patch \
+    file://0002-musl-add-missing-fgetspent_r.patch \
+"
 SRC_URI[md5sum] = "6e4c6fbd490260cfe17de2e76f5d803a"
 SRC_URI[sha256sum] = "ff2b2419a7e06bd9cb335ffe391c7409b49a0f0130b890bd54692a3986699c9b"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list