Gentoo Archives: gentoo-commits

From: Piotr Karbowski <slashbeast@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/zsh/files/, app-shells/zsh/
Date: Sat, 26 Nov 2022 21:26:54
Message-Id: 1669498005.4ad14bbfc4f7c829df10ab89d1b8712c00dab896.slashbeast@gentoo
1 commit: 4ad14bbfc4f7c829df10ab89d1b8712c00dab896
2 Author: Piotr Karbowski <slashbeast <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 26 21:26:09 2022 +0000
4 Commit: Piotr Karbowski <slashbeast <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 26 21:26:45 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ad14bbf
7
8 app-shells/zsh: drop old.
9
10 Bug: https://bugs.gentoo.org/833252
11 Signed-off-by: Piotr Karbowski <slashbeast <AT> gentoo.org>
12
13 app-shells/zsh/Manifest | 2 -
14 ....8.1-non_interactive_shell_regression_fix.patch | 76 -------
15 .../zsh-5.8.1-performance_regression_fix.patch | 139 ------------
16 app-shells/zsh/zsh-5.8.1-r2.ebuild | 222 --------------------
17 app-shells/zsh/zsh-5.9.ebuild | 233 ---------------------
18 5 files changed, 672 deletions(-)
19
20 diff --git a/app-shells/zsh/Manifest b/app-shells/zsh/Manifest
21 index b5eba80c9a19..ebdcbff39663 100644
22 --- a/app-shells/zsh/Manifest
23 +++ b/app-shells/zsh/Manifest
24 @@ -1,4 +1,2 @@
25 -DIST zsh-5.8.1-doc.tar.xz 3088728 BLAKE2B c7f62f50a8fce483d2946ac550fa0996e5749a9040cf9424a61d591024292a2f1eb0fc2401824104c6ef0fff2a4b38e07269a0069cde1b0bff6e8a7b09daf160 SHA512 0d8ca4c54c10e8a471ba7d53f1371ee057f7df4b710fc01194833f29a61b5465133432b891b0b891b6cc5235a928a783bf99f39c67314e29e3d161ca5abf3219
26 -DIST zsh-5.8.1.tar.xz 3200540 BLAKE2B 19981d0cc208fb590af8e034bde66bda36a4a20abe76ff71ba9222d7150b7d53573e1f5b81ddb2cdd29f6aa0611071a35d8b48250e6bd4b196f0428b776c4af8 SHA512 f54a5a47ed15d134902613f6169c985680afc45a67538505e11b66b348fcb367145e9b8ae2d9eac185e07ef5f97254b85df01ba97294002a8c036fd02ed5e76d
27 DIST zsh-5.9-doc.tar.xz 3130444 BLAKE2B 96b635b438f8a90bc1f3c15c8a287ab392ba830e975e49b7f1c09d12de44c250dcf33d1d6dc93b58693839af2e57eb5c9d4e874ca08dd82fe876cb5ca26e6508 SHA512 5cc6abcdcfb4f5ad7bc4a31364ca49dfd87ae03e0082d89cc2ba1f00570f6757266ee60894ad31b562408de91494c22f177b414b03cb78c31d92328686be9860
28 DIST zsh-5.9.tar.xz 3332400 BLAKE2B 3ecd6d080ff47b78d228d9bf5c1bafd3dfc602beb681ec533ce1039041d0e93143ebd7e0e73a9aed0789e27ca42d58a55f3b6e2c7d89113ab3ee99112dec46d1 SHA512 d9138b7f379ad942a5f46819d2dd52d31f3a1129f2a0d1b53d4c5cd43c318b60396da6d37c57c477b8e958fb750209aca0ae93f8c9dd42ac958de006a0ff067e
29
30 diff --git a/app-shells/zsh/files/zsh-5.8.1-non_interactive_shell_regression_fix.patch b/app-shells/zsh/files/zsh-5.8.1-non_interactive_shell_regression_fix.patch
31 deleted file mode 100644
32 index 6e202fa2fb24..000000000000
33 --- a/app-shells/zsh/files/zsh-5.8.1-non_interactive_shell_regression_fix.patch
34 +++ /dev/null
35 @@ -1,76 +0,0 @@
36 -From da8be06c2062ea02795bcba25172369ec68848cf Mon Sep 17 00:00:00 2001
37 -From: Peter Stephenson <p.w.stephenson@××××××××.com>
38 -Date: Thu, 3 Mar 2022 19:19:35 +0000
39 -Subject: [PATCH] 49792: Non-interative shell input is line buffered.
40 -
41 ----
42 - ChangeLog | 5 +++++
43 - Src/input.c | 21 ++++++++++++++-------
44 - Test/A01grammar.ztst | 9 +++++++++
45 - 3 files changed, 28 insertions(+), 7 deletions(-)
46 -
47 -diff --git a/ChangeLog b/ChangeLog
48 -index 8a5ad4941..cae2fc4e3 100644
49 ---- a/ChangeLog
50 -+++ b/ChangeLog
51 -@@ -1,3 +1,8 @@
52 -+2022-03-03 Peter Stephenson <p.w.stephenson@××××××××.com>
53 -+
54 -+ * 49792: Src/input.c, Test/A01grammar.ztst: Use line buffering
55 -+ for non-interactive input.
56 -+
57 - 2022-02-12 dana <dana@××××.is>
58 -
59 - * unposted: Config/version.mk, Etc/FAQ.yo, README: Update
60 -diff --git a/Src/input.c b/Src/input.c
61 -index 18228b37d..caa8e23b0 100644
62 ---- a/Src/input.c
63 -+++ b/Src/input.c
64 -@@ -223,13 +223,20 @@ shingetchar(void)
65 - return STOUC(*shinbufptr++);
66 -
67 - shinbufreset();
68 -- do {
69 -- errno = 0;
70 -- nread = read(SHIN, shinbuffer, SHINBUFSIZE);
71 -- } while (nread < 0 && errno == EINTR);
72 -- if (nread <= 0)
73 -- return -1;
74 -- shinbufendptr = shinbuffer + nread;
75 -+ for (;;) {
76 -+ errno = 0;
77 -+ nread = read(SHIN, shinbufendptr, 1);
78 -+ if (nread > 0) {
79 -+ /* Use line buffering (POSIX requirement) */
80 -+ if (*shinbufendptr++ == '\n')
81 -+ break;
82 -+ if (shinbufendptr == shinbuffer + SHINBUFSIZE)
83 -+ break;
84 -+ } else if (nread == 0 || errno != EINTR)
85 -+ break;
86 -+ }
87 -+ if (shinbufendptr == shinbuffer)
88 -+ return -1;
89 - return STOUC(*shinbufptr++);
90 - }
91 -
92 -diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
93 -index 1e0e9a04e..adbf5f1d9 100644
94 ---- a/Test/A01grammar.ztst
95 -+++ b/Test/A01grammar.ztst
96 -@@ -932,3 +932,12 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci
97 - $ZTST_testdir/../Src/zsh -fc '{ ( ) } always { echo foo }'
98 - -f:exec last command optimization inhibited for try/always
99 - >foo
100 -+
101 -+ (
102 -+ export VALUE=first
103 -+ print -l 'echo Value is $VALUE' 'VALUE=second sh' 'echo Value is $VALUE' |
104 -+ $ZTST_testdir/../Src/zsh -f
105 -+ )
106 -+0:Non-interactive shell command input is line buffered
107 -+>Value is first
108 -+>Value is second
109 ---
110 -2.36.0.rc2
111 -
112
113 diff --git a/app-shells/zsh/files/zsh-5.8.1-performance_regression_fix.patch b/app-shells/zsh/files/zsh-5.8.1-performance_regression_fix.patch
114 deleted file mode 100644
115 index 14a3f38eb96d..000000000000
116 --- a/app-shells/zsh/files/zsh-5.8.1-performance_regression_fix.patch
117 +++ /dev/null
118 @@ -1,139 +0,0 @@
119 -From cbe8d2bcdc20682464217856aa48628804637f28 Mon Sep 17 00:00:00 2001
120 -From: Bart Schaefer <schaefer@×××.org>
121 -Date: Thu, 28 Apr 2022 21:06:51 -0700
122 -Subject: [PATCH] 50133: use read-ahead and lseek-rewind for efficient
123 - line-buffered input
124 -
125 ----
126 - ChangeLog | 6 ++++++
127 - Src/input.c | 24 ++++++++++++++++++++-
128 - configure.ac | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++
129 - 3 files changed, 88 insertions(+), 1 deletion(-)
130 -
131 -diff --git a/ChangeLog b/ChangeLog
132 -index cae2fc4e3..79c77741b 100644
133 ---- a/ChangeLog
134 -+++ b/ChangeLog
135 -@@ -1,3 +1,9 @@
136 -+2022-04-28 Bart Schaefer <schaefer@×××.org>
137 -+
138 -+ * 50133 (Bart, PWS, Jun-ichi): Src/input.c, configure.ac: when
139 -+ lseek(2) is available, use it to check for and rewind read-ahead
140 -+ for more efficient line-buffered input.
141 -+
142 - 2022-03-03 Peter Stephenson <p.w.stephenson@××××××××.com>
143 -
144 - * 49792: Src/input.c, Test/A01grammar.ztst: Use line buffering
145 -diff --git a/Src/input.c b/Src/input.c
146 -index caa8e23b0..6cc1b8a51 100644
147 ---- a/Src/input.c
148 -+++ b/Src/input.c
149 -@@ -217,12 +217,34 @@ shinbufrestore(void)
150 - static int
151 - shingetchar(void)
152 - {
153 -- int nread;
154 -+ int nread, rsize = isset(SHINSTDIN) ? 1 : SHINBUFSIZE;
155 -
156 - if (shinbufptr < shinbufendptr)
157 - return STOUC(*shinbufptr++);
158 -
159 - shinbufreset();
160 -+#ifdef USE_LSEEK
161 -+ if (rsize == 1 && lseek(SHIN, 0, SEEK_CUR) != (off_t)-1)
162 -+ rsize = SHINBUFSIZE;
163 -+ if (rsize > 1) {
164 -+ do {
165 -+ errno = 0;
166 -+ nread = read(SHIN, shinbuffer, rsize);
167 -+ } while (nread < 0 && errno == EINTR);
168 -+ if (nread <= 0)
169 -+ return -1;
170 -+ if (isset(SHINSTDIN) &&
171 -+ (shinbufendptr = memchr(shinbuffer, '\n', nread))) {
172 -+ shinbufendptr++;
173 -+ rsize = (shinbufendptr - shinbuffer);
174 -+ if (nread > rsize &&
175 -+ lseek(SHIN, -(nread - rsize), SEEK_CUR) < 0)
176 -+ zerr("lseek(%d, %d): %e", SHIN, -(nread - rsize), errno);
177 -+ } else
178 -+ shinbufendptr = shinbuffer + nread;
179 -+ return STOUC(*shinbufptr++);
180 -+ }
181 -+#endif
182 - for (;;) {
183 - errno = 0;
184 - nread = read(SHIN, shinbufendptr, 1);
185 -diff --git a/configure.ac b/configure.ac
186 -index af8c5bba8..42f2837cd 100644
187 ---- a/configure.ac
188 -+++ b/configure.ac
189 -@@ -2304,6 +2304,65 @@ if test x$zsh_cv_sys_fifo = xyes; then
190 - AC_DEFINE(HAVE_FIFOS)
191 - fi
192 -
193 -+dnl -----------
194 -+dnl check that lseek() correctly reports seekability.
195 -+dnl -----------
196 -+AC_CACHE_CHECK(if lseek() correctly reports seekability,
197 -+zsh_cv_sys_lseek,
198 -+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
199 -+#include <stdio.h>
200 -+#include <sys/types.h>
201 -+#include <fcntl.h>
202 -+#include <unistd.h>
203 -+#include <sys/socket.h>
204 -+#include <sys/stat.h>
205 -+int main() {
206 -+ int pipefd[2], fd;
207 -+ off_t ret;
208 -+ char* tmpfile = "seekfiletest.tmp";
209 -+ if ((fd = open(tmpfile, O_CREAT, S_IRUSR)) < 0) {
210 -+ fprintf(stderr, "creating file failed\n");
211 -+ return 1;
212 -+ }
213 -+ ret = lseek(fd, 0, SEEK_CUR);
214 -+ close(fd);
215 -+ unlink(tmpfile);
216 -+ if (ret == (off_t)-1) {
217 -+ fprintf(stderr, "lseek on regular file failed\n");
218 -+ return 1;
219 -+ }
220 -+ if (pipe(pipefd) < 0) {
221 -+ fprintf(stderr, "creating pipe failed\n");
222 -+ return 1;
223 -+ }
224 -+ write(pipefd[1], "abcdefgh", 8);
225 -+ ret = lseek(pipefd[0], 0, SEEK_CUR);
226 -+ close(pipefd[0]);
227 -+ close(pipefd[1]);
228 -+ if (ret != (off_t)-1) {
229 -+ fprintf(stderr, "lseek on pipe succeeded\n");
230 -+ return 1;
231 -+ }
232 -+ if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
233 -+ fprintf(stderr, "creating UNIX domain socket failed\n");
234 -+ return 1;
235 -+ }
236 -+ ret = lseek(fd, 0, SEEK_CUR);
237 -+ close(fd);
238 -+ if (ret != (off_t)-1) {
239 -+ fprintf(stderr, "lseek on UNIX domain socket succeeded\n");
240 -+ return 1;
241 -+ }
242 -+ return 0;
243 -+}
244 -+]])],[zsh_cv_sys_lseek=yes],[zsh_cv_sys_lseek=no],[zsh_cv_sys_lseek=yes])
245 -+])
246 -+AH_TEMPLATE([USE_LSEEK],
247 -+[Define to 1 if lseek() can be used for SHIN.])
248 -+if test x$zsh_cv_sys_lseek = xyes; then
249 -+ AC_DEFINE(USE_LSEEK)
250 -+fi
251 -+
252 - dnl -----------
253 - dnl test for whether link() works
254 - dnl for instance, BeOS R4.51 doesn't support hard links yet
255 ---
256 -2.36.0
257 -
258
259 diff --git a/app-shells/zsh/zsh-5.8.1-r2.ebuild b/app-shells/zsh/zsh-5.8.1-r2.ebuild
260 deleted file mode 100644
261 index 4aedba310b22..000000000000
262 --- a/app-shells/zsh/zsh-5.8.1-r2.ebuild
263 +++ /dev/null
264 @@ -1,222 +0,0 @@
265 -# Copyright 1999-2022 Gentoo Authors
266 -# Distributed under the terms of the GNU General Public License v2
267 -
268 -EAPI=8
269 -
270 -inherit autotools flag-o-matic prefix
271 -
272 -if [[ ${PV} == 9999* ]] ; then
273 - inherit git-r3
274 - EGIT_REPO_URI="https://git.code.sf.net/p/zsh/code"
275 -else
276 - KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
277 - SRC_URI="https://www.zsh.org/pub/${P}.tar.xz
278 - https://www.zsh.org/pub/old/${P}.tar.xz
279 - mirror://sourceforge/${PN}/${P}.tar.xz
280 - doc? (
281 - https://www.zsh.org/pub/${P}-doc.tar.xz
282 - mirror://sourceforge/${PN}/${P}-doc.tar.xz
283 - )"
284 -fi
285 -
286 -DESCRIPTION="UNIX Shell similar to the Korn shell"
287 -HOMEPAGE="https://www.zsh.org/"
288 -
289 -LICENSE="ZSH gdbm? ( GPL-2 )"
290 -SLOT="0"
291 -IUSE="caps debug doc examples gdbm maildir pcre static unicode"
292 -
293 -RDEPEND="
294 - >=sys-libs/ncurses-5.1:0=
295 - static? ( >=sys-libs/ncurses-5.7-r4:0=[static-libs] )
296 - caps? ( sys-libs/libcap )
297 - pcre? (
298 - >=dev-libs/libpcre-3.9
299 - static? ( >=dev-libs/libpcre-3.9[static-libs] )
300 - )
301 - gdbm? ( sys-libs/gdbm:= )
302 - !<sys-apps/baselayout-2.4.1
303 -"
304 -DEPEND="sys-apps/groff
305 - ${RDEPEND}"
306 -PDEPEND="
307 - examples? ( app-doc/zsh-lovers )
308 -"
309 -if [[ ${PV} == *9999 ]] ; then
310 - DEPEND+=" app-text/yodl
311 - doc? (
312 - sys-apps/texinfo
313 - app-text/texi2html
314 - virtual/latex-base
315 - )"
316 -fi
317 -
318 -PATCHES=(
319 - "${FILESDIR}/${P}-non_interactive_shell_regression_fix.patch"
320 - "${FILESDIR}/${P}-performance_regression_fix.patch" #839900
321 -)
322 -
323 -src_prepare() {
324 - if [[ ${PV} != *9999 ]]; then
325 - # fix zshall problem with soelim
326 - ln -s Doc man1 || die
327 - mv Doc/zshall.1 Doc/zshall.1.soelim || die
328 - soelim Doc/zshall.1.soelim > Doc/zshall.1 || die
329 - fi
330 -
331 - # add openrc specific options for init.d completion
332 - eapply "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff
333 -
334 - default
335 -
336 - hprefixify configure.ac
337 - if [[ ${PV} == *9999 ]] ; then
338 - sed -i "/^VERSION=/s@=.*@=${PV}@" Config/version.mk || die
339 - fi
340 - eautoreconf
341 -}
342 -
343 -src_configure() {
344 - local myconf=(
345 - --bindir="${EPREFIX}"/bin
346 - --libdir="${EPREFIX}"/usr/$(get_libdir)
347 - --enable-etcdir="${EPREFIX}"/etc/zsh
348 - --enable-runhelpdir="${EPREFIX}"/usr/share/zsh/${PV%_*}/help
349 - --enable-fndir="${EPREFIX}"/usr/share/zsh/${PV%_*}/functions
350 - --enable-site-fndir="${EPREFIX}"/usr/share/zsh/site-functions
351 - --enable-function-subdirs
352 - --with-tcsetpgrp
353 - --with-term-lib="$(usex unicode 'tinfow ncursesw' 'tinfo ncurses')"
354 - $(use_enable maildir maildir-support)
355 - $(use_enable pcre)
356 - $(use_enable caps cap)
357 - $(use_enable unicode multibyte)
358 - $(use_enable gdbm)
359 - )
360 -
361 - if use static ; then
362 - myconf+=( --disable-dynamic )
363 - append-ldflags -static
364 - fi
365 - if use debug ; then
366 - myconf+=(
367 - --enable-zsh-debug
368 - --enable-zsh-mem-debug
369 - --enable-zsh-mem-warning
370 - --enable-zsh-secure-free
371 - --enable-zsh-hash-debug
372 - )
373 - fi
374 -
375 - if [[ ${CHOST} == *-darwin* ]]; then
376 - myconf+=( --enable-libs=-liconv )
377 - append-ldflags -Wl,-x
378 - fi
379 -
380 - econf "${myconf[@]}"
381 -
382 - if use static ; then
383 - # compile all modules statically, see Bug #27392
384 - # removed cap and curses because linking failes
385 - sed -e "s,link=no,link=static,g" \
386 - -e "/^name=zsh\/cap/s,link=static,link=no," \
387 - -e "/^name=zsh\/curses/s,link=static,link=no," \
388 - -i "${S}"/config.modules || die
389 - if ! use gdbm ; then
390 - sed -i '/^name=zsh\/db\/gdbm/s,link=static,link=no,' \
391 - "${S}"/config.modules || die
392 - fi
393 - fi
394 -}
395 -
396 -src_compile() {
397 - default
398 -
399 - if [[ ${PV} == *9999 ]] && use doc ; then
400 - emake -C Doc everything
401 - fi
402 -}
403 -
404 -src_test() {
405 - addpredict /dev/ptmx
406 - local i
407 - for i in C02cond.ztst V08zpty.ztst X02zlevi.ztst Y01completion.ztst Y02compmatch.ztst Y03arguments.ztst ; do
408 - rm "${S}"/Test/${i} || die
409 - done
410 - emake check
411 -}
412 -
413 -src_install() {
414 - emake DESTDIR="${D}" install $(usex doc "install.info" "")
415 -
416 - insinto /etc/zsh
417 - export PREFIX_QUOTE_CHAR='"' PREFIX_EXTRA_REGEX="/EUID/s,0,${EUID},"
418 - newins "$(prefixify_ro "${FILESDIR}"/zprofile-4)" zprofile
419 -
420 - keepdir /usr/share/zsh/site-functions
421 - insinto /usr/share/zsh/${PV%_*}/functions/Prompts
422 - newins "${FILESDIR}"/prompt_gentoo_setup-1 prompt_gentoo_setup
423 -
424 - local i
425 -
426 - # install miscellaneous scripts (bug #54520)
427 - sed -e "s:/usr/local/bin/perl:${EPREFIX}/usr/bin/perl:g" \
428 - -e "s:/usr/local/bin/zsh:${EPREFIX}/bin/zsh:g" \
429 - -i {Util,Misc}/* || die
430 - for i in Util Misc ; do
431 - insinto /usr/share/zsh/${PV%_*}/${i}
432 - doins ${i}/*
433 - done
434 -
435 - # install header files (bug #538684)
436 - insinto /usr/include/zsh
437 - doins config.h Src/*.epro
438 - for i in Src/{zsh.mdh,*.h} ; do
439 - sed -e 's@\.\./config\.h@config.h@' \
440 - -e 's@#\(\s*\)include "\([^"]\+\)"@#\1include <zsh/\2>@' \
441 - -i "${i}"
442 - doins "${i}"
443 - done
444 -
445 - dodoc ChangeLog* META-FAQ NEWS README config.modules
446 -
447 - if use doc ; then
448 - pushd "${WORKDIR}/${PN}-${PV%_*}" >/dev/null
449 - dodoc Doc/zsh.{dvi,pdf}
450 - docinto html
451 - dodoc Doc/*.html
452 - popd >/dev/null
453 - fi
454 -
455 - docinto StartupFiles
456 - dodoc StartupFiles/z*
457 -}
458 -
459 -pkg_postinst() {
460 - if [[ -z ${REPLACING_VERSIONS} ]] ; then
461 - echo
462 - elog "If you want to enable Portage completions and Gentoo prompt,"
463 - elog "emerge app-shells/gentoo-zsh-completions and add"
464 - elog " autoload -U compinit promptinit"
465 - elog " compinit"
466 - elog " promptinit; prompt gentoo"
467 - elog "to your ~/.zshrc"
468 - echo
469 - elog "Also, if you want to enable cache for the completions, add"
470 - elog " zstyle ':completion::complete:*' use-cache 1"
471 - elog "to your ~/.zshrc"
472 - echo
473 - elog "Note that a system zprofile startup file is installed. This will override"
474 - elog "PATH and possibly other variables that a user may set in ~/.zshenv."
475 - elog "Custom PATH settings and similar overridden variables can be moved to ~/.zprofile"
476 - elog "or other user startup files that are sourced after the system zprofile."
477 - echo
478 - elog "If PATH must be set in ~/.zshenv to affect things like non-login ssh shells,"
479 - elog "one method is to use a separate path-setting file that is conditionally sourced"
480 - elog "in ~/.zshenv and also sourced from ~/.zprofile. For more information, see the"
481 - elog "zshenv example in ${EROOT}/usr/share/doc/${PF}/StartupFiles/."
482 - echo
483 - elog "See https://wiki.gentoo.org/wiki/Zsh/HOWTO for more introduction documentation."
484 - echo
485 - fi
486 -}
487
488 diff --git a/app-shells/zsh/zsh-5.9.ebuild b/app-shells/zsh/zsh-5.9.ebuild
489 deleted file mode 100644
490 index 9cfcc3a75650..000000000000
491 --- a/app-shells/zsh/zsh-5.9.ebuild
492 +++ /dev/null
493 @@ -1,233 +0,0 @@
494 -# Copyright 1999-2022 Gentoo Authors
495 -# Distributed under the terms of the GNU General Public License v2
496 -
497 -EAPI=8
498 -
499 -inherit autotools flag-o-matic prefix
500 -
501 -if [[ ${PV} == 9999* ]] ; then
502 - inherit git-r3
503 - EGIT_REPO_URI="https://git.code.sf.net/p/zsh/code"
504 -else
505 - KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
506 - SRC_URI="https://www.zsh.org/pub/${P}.tar.xz
507 - https://www.zsh.org/pub/old/${P}.tar.xz
508 - mirror://sourceforge/${PN}/${P}.tar.xz
509 - doc? (
510 - https://www.zsh.org/pub/${P}-doc.tar.xz
511 - mirror://sourceforge/${PN}/${P}-doc.tar.xz
512 - )"
513 -fi
514 -
515 -DESCRIPTION="UNIX Shell similar to the Korn shell"
516 -HOMEPAGE="https://www.zsh.org/"
517 -
518 -LICENSE="ZSH gdbm? ( GPL-2 )"
519 -SLOT="0"
520 -IUSE="caps debug doc examples gdbm maildir pcre static unicode"
521 -
522 -RDEPEND="
523 - >=sys-libs/ncurses-5.1:0=
524 - static? ( >=sys-libs/ncurses-5.7-r4:0=[static-libs] )
525 - caps? ( sys-libs/libcap )
526 - pcre? (
527 - >=dev-libs/libpcre-3.9
528 - static? ( >=dev-libs/libpcre-3.9[static-libs] )
529 - )
530 - gdbm? ( sys-libs/gdbm:= )
531 -"
532 -DEPEND="sys-apps/groff
533 - ${RDEPEND}"
534 -PDEPEND="
535 - examples? ( app-doc/zsh-lovers )
536 -"
537 -if [[ ${PV} == *9999 ]] ; then
538 - DEPEND+=" app-text/yodl
539 - doc? (
540 - sys-apps/texinfo
541 - app-text/texi2html
542 - virtual/latex-base
543 - )"
544 -fi
545 -
546 -PATCHES=(
547 - # add openrc specific options for init.d completion
548 - "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff
549 - # Please refer gentoo bug 833981
550 - "${FILESDIR}"/${PN}-5.9-musl-V09datetime-test-fix.patch
551 -)
552 -
553 -src_prepare() {
554 - if [[ ${PV} != *9999 ]]; then
555 - # fix zshall problem with soelim
556 - ln -s Doc man1 || die
557 - mv Doc/zshall.1 Doc/zshall.1.soelim || die
558 - soelim Doc/zshall.1.soelim > Doc/zshall.1 || die
559 - fi
560 -
561 - default
562 -
563 - hprefixify configure.ac
564 - if [[ ${PV} == *9999 ]] ; then
565 - sed -i "/^VERSION=/s@=.*@=${PV}@" Config/version.mk || die
566 - fi
567 - eautoreconf
568 -}
569 -
570 -src_configure() {
571 - local myconf=(
572 - --bindir="${EPREFIX}"/bin
573 - --libdir="${EPREFIX}"/usr/$(get_libdir)
574 - --enable-etcdir="${EPREFIX}"/etc/zsh
575 - --enable-runhelpdir="${EPREFIX}"/usr/share/zsh/${PV%_*}/help
576 - --enable-fndir="${EPREFIX}"/usr/share/zsh/${PV%_*}/functions
577 - --enable-site-fndir="${EPREFIX}"/usr/share/zsh/site-functions
578 - --enable-function-subdirs
579 - --with-tcsetpgrp
580 - --with-term-lib="$(usex unicode 'tinfow ncursesw' 'tinfo ncurses')"
581 - $(use_enable maildir maildir-support)
582 - $(use_enable pcre)
583 - $(use_enable caps cap)
584 - $(use_enable unicode multibyte)
585 - $(use_enable gdbm)
586 - )
587 -
588 - if use static ; then
589 - myconf+=( --disable-dynamic )
590 - append-ldflags -static
591 - fi
592 - if use debug ; then
593 - myconf+=(
594 - --enable-zsh-debug
595 - --enable-zsh-mem-debug
596 - --enable-zsh-mem-warning
597 - --enable-zsh-secure-free
598 - --enable-zsh-hash-debug
599 - )
600 - fi
601 -
602 - if [[ ${CHOST} == *-darwin* ]]; then
603 - myconf+=( --enable-libs=-liconv )
604 - append-ldflags -Wl,-x
605 - fi
606 -
607 - econf "${myconf[@]}"
608 -
609 - if use static ; then
610 - # compile all modules statically, see Bug #27392
611 - # removed cap and curses because linking failes
612 - sed -e "s,link=no,link=static,g" \
613 - -e "/^name=zsh\/cap/s,link=static,link=no," \
614 - -e "/^name=zsh\/curses/s,link=static,link=no," \
615 - -i "${S}"/config.modules || die
616 - if ! use gdbm ; then
617 - sed -i '/^name=zsh\/db\/gdbm/s,link=static,link=no,' \
618 - "${S}"/config.modules || die
619 - fi
620 - fi
621 -}
622 -
623 -src_compile() {
624 - default
625 -
626 - if [[ ${PV} == *9999 ]] && use doc ; then
627 - emake -C Doc everything
628 - fi
629 -}
630 -
631 -src_test() {
632 - # Fixes tests A03quoting.ztst B03print.ztst on musl
633 - # Please refer:
634 - # https://www.zsh.org/mla/workers/2021/msg00805.html
635 - # Test E02xtrace fails on musl, so we are removing it.
636 - # Closes: https://bugs.gentoo.org/833981
637 - if use elibc_musl ; then
638 - unset LC_ALL
639 - unset LC_COLLATE
640 - unset LC_NUMERIC
641 - unset LC_MESSAGES
642 - unset LANG
643 - rm "${S}"/Test/E02xtrace.ztst || die
644 - fi
645 - addpredict /dev/ptmx
646 - local i
647 - for i in C02cond.ztst V08zpty.ztst X02zlevi.ztst Y01completion.ztst Y02compmatch.ztst Y03arguments.ztst ; do
648 - rm "${S}"/Test/${i} || die
649 - done
650 - emake check
651 -}
652 -
653 -src_install() {
654 - emake DESTDIR="${D}" install $(usex doc "install.info" "")
655 -
656 - insinto /etc/zsh
657 - export PREFIX_QUOTE_CHAR='"' PREFIX_EXTRA_REGEX="/EUID/s,0,${EUID},"
658 - newins "$(prefixify_ro "${FILESDIR}"/zprofile-4)" zprofile
659 -
660 - keepdir /usr/share/zsh/site-functions
661 - insinto /usr/share/zsh/${PV%_*}/functions/Prompts
662 - newins "${FILESDIR}"/prompt_gentoo_setup-1 prompt_gentoo_setup
663 -
664 - local i
665 -
666 - # install miscellaneous scripts (bug #54520)
667 - sed -e "s:/usr/local/bin/perl:${EPREFIX}/usr/bin/perl:g" \
668 - -e "s:/usr/local/bin/zsh:${EPREFIX}/bin/zsh:g" \
669 - -i {Util,Misc}/* || die
670 - for i in Util Misc ; do
671 - insinto /usr/share/zsh/${PV%_*}/${i}
672 - doins ${i}/*
673 - done
674 -
675 - # install header files (bug #538684)
676 - insinto /usr/include/zsh
677 - doins config.h Src/*.epro
678 - for i in Src/{zsh.mdh,*.h} ; do
679 - sed -e 's@\.\./config\.h@config.h@' \
680 - -e 's@#\(\s*\)include "\([^"]\+\)"@#\1include <zsh/\2>@' \
681 - -i "${i}"
682 - doins "${i}"
683 - done
684 -
685 - dodoc ChangeLog* META-FAQ NEWS README config.modules
686 -
687 - if use doc ; then
688 - pushd "${WORKDIR}/${PN}-${PV%_*}" >/dev/null
689 - dodoc Doc/zsh.{dvi,pdf}
690 - docinto html
691 - dodoc Doc/*.html
692 - popd >/dev/null
693 - fi
694 -
695 - docinto StartupFiles
696 - dodoc StartupFiles/z*
697 -}
698 -
699 -pkg_postinst() {
700 - if [[ -z ${REPLACING_VERSIONS} ]] ; then
701 - echo
702 - elog "If you want to enable Portage completions and Gentoo prompt,"
703 - elog "emerge app-shells/gentoo-zsh-completions and add"
704 - elog " autoload -U compinit promptinit"
705 - elog " compinit"
706 - elog " promptinit; prompt gentoo"
707 - elog "to your ~/.zshrc"
708 - echo
709 - elog "Also, if you want to enable cache for the completions, add"
710 - elog " zstyle ':completion::complete:*' use-cache 1"
711 - elog "to your ~/.zshrc"
712 - echo
713 - elog "Note that a system zprofile startup file is installed. This will override"
714 - elog "PATH and possibly other variables that a user may set in ~/.zshenv."
715 - elog "Custom PATH settings and similar overridden variables can be moved to ~/.zprofile"
716 - elog "or other user startup files that are sourced after the system zprofile."
717 - echo
718 - elog "If PATH must be set in ~/.zshenv to affect things like non-login ssh shells,"
719 - elog "one method is to use a separate path-setting file that is conditionally sourced"
720 - elog "in ~/.zshenv and also sourced from ~/.zprofile. For more information, see the"
721 - elog "zshenv example in ${EROOT}/usr/share/doc/${PF}/StartupFiles/."
722 - echo
723 - elog "See https://wiki.gentoo.org/wiki/Zsh/HOWTO for more introduction documentation."
724 - echo
725 - fi
726 -}