1 |
commit: 332fe1cb7b2588d0fc0fb3086f7f44ac2386a2f0 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 14 17:22:43 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 14 17:22:43 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=332fe1cb |
7 |
|
8 |
x11-terms/st: backport locale crash fix |
9 |
|
10 |
Closes: https://bugs.gentoo.org/784071 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
.../st/files/st-0.8.4-locale-musl-segfault.patch | 16 +++++ |
14 |
x11-terms/st/st-0.8.4-r1.ebuild | 72 ++++++++++++++++++++++ |
15 |
2 files changed, 88 insertions(+) |
16 |
|
17 |
diff --git a/x11-terms/st/files/st-0.8.4-locale-musl-segfault.patch b/x11-terms/st/files/st-0.8.4-locale-musl-segfault.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..b70574025eb |
20 |
--- /dev/null |
21 |
+++ b/x11-terms/st/files/st-0.8.4-locale-musl-segfault.patch |
22 |
@@ -0,0 +1,16 @@ |
23 |
+https://bugs.gentoo.org/784071 |
24 |
+https://git.suckless.org/st/commit/2f6e597ed871cff91c627850d03152cae5f45779.html |
25 |
+--- a/x.c |
26 |
++++ b/x.c |
27 |
+@@ -1585,8 +1585,9 @@ xsettitle(char *p) |
28 |
+ XTextProperty prop; |
29 |
+ DEFAULT(p, opt_title); |
30 |
+ |
31 |
+- Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, |
32 |
+- &prop); |
33 |
++ if (Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, |
34 |
++ &prop) != Success) |
35 |
++ return; |
36 |
+ XSetWMName(xw.dpy, xw.win, &prop); |
37 |
+ XSetTextProperty(xw.dpy, xw.win, &prop, xw.netwmname); |
38 |
+ XFree(prop.value); |
39 |
|
40 |
diff --git a/x11-terms/st/st-0.8.4-r1.ebuild b/x11-terms/st/st-0.8.4-r1.ebuild |
41 |
new file mode 100644 |
42 |
index 00000000000..0b7788ee576 |
43 |
--- /dev/null |
44 |
+++ b/x11-terms/st/st-0.8.4-r1.ebuild |
45 |
@@ -0,0 +1,72 @@ |
46 |
+# Copyright 1999-2021 Gentoo Authors |
47 |
+# Distributed under the terms of the GNU General Public License v2 |
48 |
+ |
49 |
+EAPI=7 |
50 |
+inherit desktop multilib savedconfig toolchain-funcs |
51 |
+ |
52 |
+DESCRIPTION="simple terminal implementation for X" |
53 |
+HOMEPAGE="https://st.suckless.org/" |
54 |
+SRC_URI="https://dl.suckless.org/st/${P}.tar.gz" |
55 |
+ |
56 |
+LICENSE="MIT-with-advertising" |
57 |
+SLOT="0" |
58 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc64 ~riscv ~x86" |
59 |
+IUSE="savedconfig" |
60 |
+ |
61 |
+RDEPEND=" |
62 |
+ >=sys-libs/ncurses-6.0:0= |
63 |
+ media-libs/fontconfig |
64 |
+ x11-libs/libX11 |
65 |
+ x11-libs/libXft |
66 |
+" |
67 |
+DEPEND=" |
68 |
+ ${RDEPEND} |
69 |
+ virtual/pkgconfig |
70 |
+ x11-base/xorg-proto |
71 |
+" |
72 |
+ |
73 |
+PATCHES=( |
74 |
+ "${FILESDIR}"/${P}-locale-musl-segfault.patch |
75 |
+) |
76 |
+ |
77 |
+src_prepare() { |
78 |
+ default |
79 |
+ |
80 |
+ sed -i \ |
81 |
+ -e "/^X11LIB/{s:/usr/X11R6/lib:/usr/$(get_libdir)/X11:}" \ |
82 |
+ -e '/^STLDFLAGS/s|= .*|= $(LDFLAGS) $(LIBS)|g' \ |
83 |
+ -e '/^X11INC/{s:/usr/X11R6/include:/usr/include/X11:}' \ |
84 |
+ config.mk || die |
85 |
+ sed -i \ |
86 |
+ -e '/tic/d' \ |
87 |
+ Makefile || die |
88 |
+ |
89 |
+ restore_config config.h |
90 |
+} |
91 |
+ |
92 |
+src_configure() { |
93 |
+ sed -i \ |
94 |
+ -e "s|pkg-config|$(tc-getPKG_CONFIG)|g" \ |
95 |
+ config.mk || die |
96 |
+ |
97 |
+ tc-export CC |
98 |
+} |
99 |
+ |
100 |
+src_install() { |
101 |
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install |
102 |
+ |
103 |
+ dodoc TODO |
104 |
+ |
105 |
+ make_desktop_entry ${PN} simpleterm utilities-terminal 'System;TerminalEmulator;' '' |
106 |
+ |
107 |
+ save_config config.h |
108 |
+} |
109 |
+ |
110 |
+pkg_postinst() { |
111 |
+ if ! [[ "${REPLACING_VERSIONS}" ]]; then |
112 |
+ elog "Please ensure a usable font is installed, like" |
113 |
+ elog " media-fonts/corefonts" |
114 |
+ elog " media-fonts/dejavu" |
115 |
+ elog " media-fonts/urw-fonts" |
116 |
+ fi |
117 |
+} |