diff options
author | Andreas Müller <schnitzeltony@gmail.com> | 2019-12-09 09:36:12 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-12-10 16:21:08 -0800 |
commit | 079137f59b1c16c6c0462e67e68e798eb87bcd35 (patch) | |
tree | 927acbe31c04b2f6138fec622a2d1f60e8192e22 /meta-gnome | |
parent | 4ce1faf54de6a77d549ef478f0b7e6387d590731 (diff) | |
download | meta-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')
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 @@ | |||
1 | From 2a1c7103839c20df5ca9ce2fa863535d802f8f3a Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com> | ||
3 | Date: Sun, 8 Dec 2019 23:42:00 +0100 | ||
4 | Subject: [PATCH] musl: Hack to fix configure | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | --- | ||
10 | meson.build | 10 ++++++++-- | ||
11 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/meson.build b/meson.build | ||
14 | index 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 | -- | ||
35 | 2.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 @@ | |||
1 | From 820249ea8e38c568e6a36fbd9c852718c7665b56 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com> | ||
3 | Date: Mon, 9 Dec 2019 00:12:08 +0100 | ||
4 | Subject: [PATCH] musl: add missing fgetspent_r | ||
5 | |||
6 | Stolen from void-linux | ||
7 | |||
8 | Upstream-Status: Inappropriate [musl-specific] | ||
9 | --- | ||
10 | src/daemon.c | 20 ++++++++++++++++++++ | ||
11 | 1 file changed, 20 insertions(+) | ||
12 | |||
13 | diff --git a/src/daemon.c b/src/daemon.c | ||
14 | index 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 | -- | ||
45 | 2.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 | |||
13 | REQUIRED_DISTRO_FEATURES = "polkit" | 13 | REQUIRED_DISTRO_FEATURES = "polkit" |
14 | 14 | ||
15 | SRC_URI = "https://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz" | 15 | SRC_URI = "https://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz" |
16 | SRC_URI_append_libc-musl = " \ | ||
17 | file://0001-musl-Hack-to-fix-build.patch \ | ||
18 | file://0002-musl-add-missing-fgetspent_r.patch \ | ||
19 | " | ||
16 | SRC_URI[md5sum] = "6e4c6fbd490260cfe17de2e76f5d803a" | 20 | SRC_URI[md5sum] = "6e4c6fbd490260cfe17de2e76f5d803a" |
17 | SRC_URI[sha256sum] = "ff2b2419a7e06bd9cb335ffe391c7409b49a0f0130b890bd54692a3986699c9b" | 21 | SRC_URI[sha256sum] = "ff2b2419a7e06bd9cb335ffe391c7409b49a0f0130b890bd54692a3986699c9b" |
18 | 22 | ||