void-packages/srcpkgs/gettext/patches/musl-realpath.patch
Érico Rolim e1091a5c5b gettext: reorganize so gettext-libs only ships versioned libintl.so.
Move unrelated libraries to gettext package, since they are only used by
it and by gtranslator, which will for the most part be installed
alongside gtranslator already.

The main purpose with this PR is to stop shipping unversioned libintl.so
in gettext-libs. What happens in this case is that packages built
natively for musl with localization support will have gettext in
hostmakedepends, which will lead to gettext-libs being in the host, and,
consequently, /usr/lib/libintl.so being available.

Due to CMake's FindIntl being bad, CMake projects will assume they
should use libintl.so instead of the gettext support from libc, and link
against it unnecessarily (and sometimes innefectively: CMake points the
compiler at /usr/include/libintl.h instead of our
/usr/include/gettext/libintl.h, which means the musl header will be used
instead, and unless the main executable is linked against libintl, the
library's functions won't even be used). Leaving only the essential
libraries in gettext-libs (versioned libintl.so files) and guaranteeing
gettext doesn't pull in the unversioned one means many packages won't
depend on libintl unnecessarily any more. As a matter of fact, this is a
case where our cross builds were more "correct" than native ones, since
libintl.so in the host won't be found for the target.

Furthermore, some packages require autopoint(1) in order to run
autoreconf; to avoid depending on gettext-devel for it, and ending up
linking in libintl into the final binary, we split it into the
gettext-devel-tools subpackage as well.

Also pull in Alpine patches fixing test failures.
2021-03-24 00:51:08 -03:00

41 lines
1.6 KiB
Diff

https://gitlab.alpinelinux.org/alpine/aports/-/issues/12295
This patch is necessary only with musl after 1.2.2
----
test-canonicalize.c:339: assertion 'strcmp (result1, "/") == 0' failed
Aborted (core dumped)
FAIL test-canonicalize (exit status: 134)
----
diff --git a/gettext-tools/gnulib-tests/test-canonicalize-lgpl.c b/gettext-tools/gnulib-tests/test-canonicalize-lgpl.c
index ff82981..17842e8 100644
--- a/gettext-tools/gnulib-tests/test-canonicalize-lgpl.c
+++ b/gettext-tools/gnulib-tests/test-canonicalize-lgpl.c
@@ -208,8 +208,8 @@ main (void)
#ifndef __MVS__
if (SAME_INODE (st1, st2))
{
- ASSERT (strcmp (result1, "/") == 0);
- ASSERT (strcmp (result2, "/") == 0);
+ ASSERT (strcmp (result1, "/") == 0 || strcmp (result1, "//") == 0);
+ ASSERT (strcmp (result2, "/") == 0 || strcmp (result2, "//") == 0);
}
else
#endif
--- a/gettext-tools/gnulib-tests/test-canonicalize.c
+++ b/gettext-tools/gnulib-tests/test-canonicalize.c
@@ -336,10 +336,10 @@
ASSERT (stat ("//", &st2) == 0);
if (SAME_INODE (st1, st2))
{
- ASSERT (strcmp (result1, "/") == 0);
- ASSERT (strcmp (result2, "/") == 0);
- ASSERT (strcmp (result3, "/") == 0);
- ASSERT (strcmp (result4, "/") == 0);
+ ASSERT (strcmp (result1, "/") == 0 || strcmp (result1, "//") == 0);
+ ASSERT (strcmp (result2, "/") == 0 || strcmp (result2, "//") == 0);
+ ASSERT (strcmp (result3, "/") == 0 || strcmp (result3, "//") == 0);
+ ASSERT (strcmp (result4, "/") == 0 || strcmp (result4, "//") == 0);
}
else
{