summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrahmajit das <listout@protonmail.com>2022-08-27 01:23:14 +0530
committerSam James <sam@gentoo.org>2022-09-01 03:06:00 +0100
commitd12d15fee1604f729ea93a3401cbb25ee41c9897 (patch)
tree47bffedf9bf3f2bc3a34f5a57f45890f62c78e7a /app-shells
parentnet-libs/libbtbb: Fix unknown type u_char on musl (diff)
downloadgentoo-d12d15fee1604f729ea93a3401cbb25ee41c9897.tar.gz
gentoo-d12d15fee1604f729ea93a3401cbb25ee41c9897.tar.bz2
gentoo-d12d15fee1604f729ea93a3401cbb25ee41c9897.zip
app-shells/zsh: Fix failing tests on musl
On musl the tests A03quoting.ztst, B03print.ztst, V09datetime.ztst, and E02xtrace.ztst were failing. This commit fixes all four (E02xtrace is removed for musl) of them. Closes: https://bugs.gentoo.org/833981 Signed-off-by: brahmajit das <listout@protonmail.com> Signed-off-by: brahmajit das <listout@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/27019 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/zsh/files/zsh-5.9-musl-V09datetime-test-fix.patch15
-rw-r--r--app-shells/zsh/zsh-5.9.ebuild23
2 files changed, 35 insertions, 3 deletions
diff --git a/app-shells/zsh/files/zsh-5.9-musl-V09datetime-test-fix.patch b/app-shells/zsh/files/zsh-5.9-musl-V09datetime-test-fix.patch
new file mode 100644
index 000000000000..6f9fa4458a29
--- /dev/null
+++ b/app-shells/zsh/files/zsh-5.9-musl-V09datetime-test-fix.patch
@@ -0,0 +1,15 @@
+# On musl strftime '%@' returns new line, so we include to check for that too
+# Closes: https://bugs.gentoo.org/833981
+--- a/Test/V09datetime.ztst
++++ b/Test/V09datetime.ztst
+@@ -79,8 +79,8 @@
+ >1973^@03^@03
+
+ # We assume '%@' is not a valid format on any OSs.
+-# The result can be '%@' (Linux), '@' (BSDs) or an error (Cygwin).
+- [[ $(strftime '%@' 0 2> /dev/null) == (%|)@ || $? != 0 ]]
++# The result can be '%@' (Linux), '\n' (Linux with musl libc) '@', (BSDs) or an error (Cygwin).
++ [[ $(strftime '%@' 0 2> /dev/null) == (%|)@ || $? != 0 || $'\n' ]]
+ 0:bad format specifier
+
+ # This test may fail at 23:59:59.xxx on New Year's Eve :/
diff --git a/app-shells/zsh/zsh-5.9.ebuild b/app-shells/zsh/zsh-5.9.ebuild
index a2940a5c435e..9cfcc3a75650 100644
--- a/app-shells/zsh/zsh-5.9.ebuild
+++ b/app-shells/zsh/zsh-5.9.ebuild
@@ -50,6 +50,13 @@ if [[ ${PV} == *9999 ]] ; then
)"
fi
+PATCHES=(
+ # add openrc specific options for init.d completion
+ "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff
+ # Please refer gentoo bug 833981
+ "${FILESDIR}"/${PN}-5.9-musl-V09datetime-test-fix.patch
+)
+
src_prepare() {
if [[ ${PV} != *9999 ]]; then
# fix zshall problem with soelim
@@ -58,9 +65,6 @@ src_prepare() {
soelim Doc/zshall.1.soelim > Doc/zshall.1 || die
fi
- # add openrc specific options for init.d completion
- eapply "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff
-
default
hprefixify configure.ac
@@ -132,6 +136,19 @@ src_compile() {
}
src_test() {
+ # Fixes tests A03quoting.ztst B03print.ztst on musl
+ # Please refer:
+ # https://www.zsh.org/mla/workers/2021/msg00805.html
+ # Test E02xtrace fails on musl, so we are removing it.
+ # Closes: https://bugs.gentoo.org/833981
+ if use elibc_musl ; then
+ unset LC_ALL
+ unset LC_COLLATE
+ unset LC_NUMERIC
+ unset LC_MESSAGES
+ unset LANG
+ rm "${S}"/Test/E02xtrace.ztst || die
+ fi
addpredict /dev/ptmx
local i
for i in C02cond.ztst V08zpty.ztst X02zlevi.ztst Y01completion.ztst Y02compmatch.ztst Y03arguments.ztst ; do