summaryrefslogtreecommitdiffstats
path: root/meta-gnome/recipes-support
diff options
context:
space:
mode:
authorAndreas Müller <schnitzeltony@gmail.com>2019-12-09 09:36:12 +0100
committerKhem Raj <raj.khem@gmail.com>2019-12-10 16:21:08 -0800
commit079137f59b1c16c6c0462e67e68e798eb87bcd35 (patch)
tree927acbe31c04b2f6138fec622a2d1f60e8192e22 /meta-gnome/recipes-support
parent4ce1faf54de6a77d549ef478f0b7e6387d590731 (diff)
downloadmeta-openembedded-079137f59b1c16c6c0462e67e68e798eb87bcd35.tar.gz
accountsservice: Hack musl build fix
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-gnome/recipes-support')
-rw-r--r--meta-gnome/recipes-support/accountsservice/accountsservice/0001-musl-Hack-to-fix-build.patch36
-rw-r--r--meta-gnome/recipes-support/accountsservice/accountsservice/0002-musl-add-missing-fgetspent_r.patch46
-rw-r--r--meta-gnome/recipes-support/accountsservice/accountsservice_0.6.55.bb4
3 files changed, 86 insertions, 0 deletions
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 000000000..c2310fe46
--- /dev/null
+++ b/meta-gnome/recipes-support/accountsservice/accountsservice/0001-musl-Hack-to-fix-build.patch
@@ -0,0 +1,36 @@
1From 2a1c7103839c20df5ca9ce2fa863535d802f8f3a Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Sun, 8 Dec 2019 23:42:00 +0100
4Subject: [PATCH] musl: Hack to fix configure
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9---
10 meson.build | 10 ++++++++--
11 1 file changed, 8 insertions(+), 2 deletions(-)
12
13diff --git a/meson.build b/meson.build
14index 4465a26..726c9fe 100644
15--- a/meson.build
16+++ b/meson.build
17@@ -82,8 +82,14 @@ if cc.has_header_symbol('utmpx.h', 'WTMPX_FILENAME', prefix: '#define _GNU_SOURC
18 elif cc.has_header_symbol('paths.h', '_PATH_WTMPX')
19 config_h.set('PATH_WTMP', '_PATH_WTMPX')
20 else
21- assert(run_command('test', '-e', '/var/log/utx.log').returncode() == 0, 'Do not know which filename to watch for wtmp changes')
22- config_h.set_quoted('PATH_WTMP', '/var/log/utx.log')
23+ # musl: This is just a build fix hack.
24+ # As usual they know better, consider all other projects crap and offer zero
25+ # alternatives: So wtmp is a dead stub only [1] (= /dev/null/wtmp - taken
26+ # from musl sources).
27+ # Maybe a hero comes along and adds utmps [2] to make accountsservice useful for musl
28+ # [1] https://wiki.musl-libc.org/faq.html#Q:-Why-is-the-utmp/wtmp-functionality-only-implemented-as-stubs?
29+ # [2] https://github.com/skarnet/utmps
30+ config_h.set_quoted('PATH_WTMP', '/dev/null/wtmp')
31 endif
32
33 # compiler flags
34--
352.21.0
36
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 000000000..14161804e
--- /dev/null
+++ b/meta-gnome/recipes-support/accountsservice/accountsservice/0002-musl-add-missing-fgetspent_r.patch
@@ -0,0 +1,46 @@
1From 820249ea8e38c568e6a36fbd9c852718c7665b56 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Mon, 9 Dec 2019 00:12:08 +0100
4Subject: [PATCH] musl: add missing fgetspent_r
5
6Stolen from void-linux
7
8Upstream-Status: Inappropriate [musl-specific]
9---
10 src/daemon.c | 20 ++++++++++++++++++++
11 1 file changed, 20 insertions(+)
12
13diff --git a/src/daemon.c b/src/daemon.c
14index c52bda3..a7676fe 100644
15--- a/src/daemon.c
16+++ b/src/daemon.c
17@@ -164,6 +164,26 @@ remove_cache_files (const gchar *user_name)
18 g_remove (icon_filename);
19 }
20
21+/* Musl libc does not support fgetspent_r(), write own
22+ * wrapper
23+ */
24+static int fgetspent_r(FILE *fp, struct spwd *spbuf, char *buf, size_t buflen, struct spwd **spbufp) {
25+ struct spwd *shadow_entry = fgetspent(fp);
26+ if(!shadow_entry)
27+ return -1;
28+ size_t namplen = strlen(shadow_entry->sp_namp);
29+ size_t pwdplen = strlen(shadow_entry->sp_pwdp);
30+
31+ if(namplen + pwdplen + 2 > buflen)
32+ return -1;
33+
34+ *spbufp = memcpy(spbuf, shadow_entry, sizeof(struct spwd));
35+ spbuf->sp_namp = strncpy(buf, shadow_entry->sp_namp, namplen + 1);
36+ spbuf->sp_pwdp = strncpy(buf + namplen + 1, shadow_entry->sp_pwdp, pwdplen + 1);
37+
38+ return 0;
39+}
40+
41 static struct passwd *
42 entry_generator_fgetpwent (Daemon *daemon,
43 GHashTable *users,
44--
452.21.0
46
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 bf603b3bc..36fecfe11 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
13REQUIRED_DISTRO_FEATURES = "polkit" 13REQUIRED_DISTRO_FEATURES = "polkit"
14 14
15SRC_URI = "https://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz" 15SRC_URI = "https://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz"
16SRC_URI_append_libc-musl = " \
17 file://0001-musl-Hack-to-fix-build.patch \
18 file://0002-musl-add-missing-fgetspent_r.patch \
19"
16SRC_URI[md5sum] = "6e4c6fbd490260cfe17de2e76f5d803a" 20SRC_URI[md5sum] = "6e4c6fbd490260cfe17de2e76f5d803a"
17SRC_URI[sha256sum] = "ff2b2419a7e06bd9cb335ffe391c7409b49a0f0130b890bd54692a3986699c9b" 21SRC_URI[sha256sum] = "ff2b2419a7e06bd9cb335ffe391c7409b49a0f0130b890bd54692a3986699c9b"
18 22