void-packages/srcpkgs/gettext/patches/musl-unsupported-iconv-enco...

45 lines
1.4 KiB
Diff
Raw Normal View History

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-04 22:31:38 +01:00
As upstream notes:
# Note: This test fails on Linux with musl libc versions that don't support
# the BIG5 encoding in 'iconv'.
diff --git a/gettext-tools/tests/msgconv-2 b/gettext-tools/tests/msgconv-2
index d286cda..d96c487 100755
--- a/gettext-tools/tests/msgconv-2
+++ b/gettext-tools/tests/msgconv-2
@@ -7,6 +7,8 @@
# Note: This test fails on Linux with musl libc versions that don't support
# the BIG5 encoding in 'iconv'.
+Exit 77
+
cat <<\EOF > mco-test2.po
# Chinese translation for GNU gettext messages.
#
diff --git a/gettext-tools/tests/msgmerge-compendium-6 b/gettext-tools/tests/msgmerge-compendium-6
index 0afbe1e..1b2fe6b 100755
--- a/gettext-tools/tests/msgmerge-compendium-6
+++ b/gettext-tools/tests/msgmerge-compendium-6
@@ -10,6 +10,8 @@
# Note: This test fails on Linux with musl libc versions that don't support
# the EUC-KR encoding in 'iconv'.
+Exit 77
+
: ${MSGCONV=msgconv}
${MSGCONV} --to-code=UTF-8 -o mm-ko.utf-8.pot "$wabs_srcdir"/mm-ko.ascii.pot
diff --git a/gettext-tools/tests/xgettext-python-3 b/gettext-tools/tests/xgettext-python-3
index ca0926d..2c49fd7 100755
--- a/gettext-tools/tests/xgettext-python-3
+++ b/gettext-tools/tests/xgettext-python-3
@@ -6,6 +6,8 @@
# Note: This test fails on Linux with musl libc versions that don't support
# the EUC-JP encoding in 'iconv'.
+Exit 77
+
cat <<\EOF > xg-py-3a.py
#!/usr/bin/env python
# TRANSLATORS: Fran<61><6E><EFBFBD>ois Pinard is a hero.