Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/lightdm/files/, x11-misc/lightdm/
Date: Thu, 01 Sep 2022 02:11:51
Message-Id: 1661998150.0326445b2ff09d42d0fa399840e3314e56dd1644.sam@gentoo
1 commit: 0326445b2ff09d42d0fa399840e3314e56dd1644
2 Author: brahmajit das <listout <AT> protonmail <DOT> com>
3 AuthorDate: Thu Jul 21 13:53:18 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 1 02:09:10 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0326445b
7
8 x11-misc/lightdm: Fix LC_IDENTIFICATION and updwtmpx on musl
9
10 This commit fixes two issues with lightdm on musl
11
12 - LC_IDENTIFICATION not being defined, and
13 - updwtmpx giving conflicting types
14
15 Patches are documented to the best of my abilities.
16
17 Closes: https://bugs.gentoo.org/766866
18
19 Signed-off-by: brahmajit das <listout <AT> protonmail.com>
20 Closes: https://github.com/gentoo/gentoo/pull/26469
21 Signed-off-by: Sam James <sam <AT> gentoo.org>
22
23 .../lightdm/files/lightdm-1.30.0-musl-locale.patch | 42 ++++++++++++++++++++++
24 .../files/lightdm-1.30.0-musl-updwtmpx.patch | 26 ++++++++++++++
25 x11-misc/lightdm/lightdm-1.30.0-r3.ebuild | 5 +++
26 3 files changed, 73 insertions(+)
27
28 diff --git a/x11-misc/lightdm/files/lightdm-1.30.0-musl-locale.patch b/x11-misc/lightdm/files/lightdm-1.30.0-musl-locale.patch
29 new file mode 100644
30 index 000000000000..46c65d79f764
31 --- /dev/null
32 +++ b/x11-misc/lightdm/files/lightdm-1.30.0-musl-locale.patch
33 @@ -0,0 +1,42 @@
34 +https://github.com/canonical/lightdm/pull/261
35 +
36 +# Fix LC_IDENTIFICATION undeclared on musl or other libc that doesn't have it defined
37 +# Patch is taken from Alpine linux [1]
38 +# [1]: https://git.alpinelinux.org/aports/tree/community/lightdm/musl-language.patch
39 +# Closes: https://bugs.gentoo.org/766866
40 +diff --git a/liblightdm-gobject/language.c b/liblightdm-gobject/language.c
41 +index 3d4fa96..e38f5ce 100644
42 +--- a/liblightdm-gobject/language.c
43 ++++ b/liblightdm-gobject/language.c
44 +@@ -210,6 +210,7 @@ lightdm_language_get_name (LightDMLanguage *language)
45 +
46 + if (!priv->name)
47 + {
48 ++#if HAVE_LC_IDENTIFICATION
49 + g_autofree gchar *locale = get_locale_name (priv->code);
50 + if (locale)
51 + {
52 +@@ -223,6 +224,7 @@ lightdm_language_get_name (LightDMLanguage *language)
53 +
54 + setlocale (LC_ALL, current);
55 + }
56 ++#endif
57 + if (!priv->name)
58 + {
59 + g_auto(GStrv) tokens = g_strsplit_set (priv->code, "_.@", 2);
60 +@@ -250,6 +252,7 @@ lightdm_language_get_territory (LightDMLanguage *language)
61 +
62 + if (!priv->territory && strchr (priv->code, '_'))
63 + {
64 ++#if HAVE_LC_IDENTIFICATION
65 + g_autofree gchar *locale = get_locale_name (priv->code);
66 + if (locale)
67 + {
68 +@@ -263,6 +266,7 @@ lightdm_language_get_territory (LightDMLanguage *language)
69 +
70 + setlocale (LC_ALL, current);
71 + }
72 ++#endif
73 + if (!priv->territory)
74 + {
75 + g_auto(GStrv) tokens = g_strsplit_set (priv->code, "_.@", 3);
76
77 diff --git a/x11-misc/lightdm/files/lightdm-1.30.0-musl-updwtmpx.patch b/x11-misc/lightdm/files/lightdm-1.30.0-musl-updwtmpx.patch
78 new file mode 100644
79 index 000000000000..0df9bd4f051e
80 --- /dev/null
81 +++ b/x11-misc/lightdm/files/lightdm-1.30.0-musl-updwtmpx.patch
82 @@ -0,0 +1,26 @@
83 +https://github.com/canonical/lightdm/pull/261
84 +
85 +# A little bit modified version of Alpine linux patch [1]. On musl the default
86 +# implementation of updwtmpx will give conflicting types error and build will
87 +# fail. This patch should fix that. This issue is noticed together with bug
88 +# 766866 [2].
89 +# [1]: https://git.alpinelinux.org/aports/tree/community/lightdm/musl-updwtmpx.patch
90 +# [2]: https://bugs.gentoo.org/766866
91 +diff --git a/src/session-child.c b/src/session-child.c
92 +index eef51e4..0052904 100644
93 +--- a/src/session-child.c
94 ++++ b/src/session-child.c
95 +@@ -193,8 +193,13 @@ read_xauth (void)
96 + }
97 +
98 + /* GNU provides this but we can't rely on that so let's make our own version */
99 ++#if defined(__GLIBC__)
100 + static void
101 + updwtmpx (const gchar *wtmp_file, struct utmpx *ut)
102 ++#else // use this version in libc's other than glibc
103 ++void
104 ++updwtmpx (const char *wtmp_file, const struct utmpx *ut)
105 ++#endif
106 + {
107 + struct utmp u;
108 + memset (&u, 0, sizeof (u));
109
110 diff --git a/x11-misc/lightdm/lightdm-1.30.0-r3.ebuild b/x11-misc/lightdm/lightdm-1.30.0-r3.ebuild
111 index 2c0883c92e03..5f23bb293fae 100644
112 --- a/x11-misc/lightdm/lightdm-1.30.0-r3.ebuild
113 +++ b/x11-misc/lightdm/lightdm-1.30.0-r3.ebuild
114 @@ -51,6 +51,11 @@ DOCS=( NEWS )
115 RESTRICT="test"
116 REQUIRED_USE="vala? ( introspection )"
117
118 +PATCHES=(
119 + "${FILESDIR}"/${PN}-1.30.0-musl-locale.patch
120 + "${FILESDIR}"/${PN}-1.30.0-musl-updwtmpx.patch
121 +)
122 +
123 pkg_setup() {
124 export LIGHTDM_USER=${LIGHTDM_USER:-lightdm}
125 }