aboutsummaryrefslogtreecommitdiffstats
path: root/main/gettext
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-05 18:46:16 -0600
committerWilliam Pitcock <nenolod@dereferenced.org>2018-02-07 08:13:38 +0000
commitd95409f62bc4fb680095b9bbbc164b609d4b3ccd (patch)
tree5897774fe1f7d210ba4bfcd0f24cc3f2b1a037bf /main/gettext
parent5a2c13d37ad3b12a8b115cd2c88b3dab5b5ada2a (diff)
downloadaports-d95409f62bc4fb680095b9bbbc164b609d4b3ccd.tar.bz2
aports-d95409f62bc4fb680095b9bbbc164b609d4b3ccd.tar.xz
main/gettext: add tests, fix license
Diffstat (limited to 'main/gettext')
-rw-r--r--main/gettext/APKBUILD37
-rw-r--r--main/gettext/localename-fix.patch34
-rw-r--r--main/gettext/skip-tests-musl.patch95
3 files changed, 150 insertions, 16 deletions
diff --git a/main/gettext/APKBUILD b/main/gettext/APKBUILD
index b03c204938..7d74c068d1 100644
--- a/main/gettext/APKBUILD
+++ b/main/gettext/APKBUILD
@@ -2,23 +2,24 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=gettext
pkgver=0.19.8.1
-pkgrel=1
+pkgrel=2
pkgdesc="GNU locale utilities"
url="https://www.gnu.org/software/gettext/gettext.html"
arch="all"
-license="GPL"
+license="GPL-3.0+ AND LGPL-2.1+ AND MIT"
depends=
# do _not_ add the optional dependencies on libcroco or glib
# they depend on gettext and would introduce cyclic dependencies
makedepends="perl ncurses-dev libxml2-dev libunistring-dev"
source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
- fix-abi.patch"
+ fix-abi.patch
+ localename-fix.patch
+ skip-tests-musl.patch
+ "
subpackages="$pkgname-doc $pkgname-static $pkgname-dev $pkgname-lang libintl $pkgname-asprintf $pkgname-libs"
-_builddir="$srcdir"/$pkgname-$pkgver
-
build() {
- cd "$_builddir"
+ cd "$builddir"
# force using system posix complaint printf
# the test is broken and fails with ash
gt_cv_func_printf_posix=yes \
@@ -28,14 +29,18 @@ build() {
--prefix=/usr \
--enable-threads=posix \
--disable-java \
- --enable-static \
- || return 1
- make || return 1
+ --enable-static
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
}
package() {
- cd "$_builddir"
- make -j1 DESTDIR="$pkgdir" install || return 1
+ cd "$builddir"
+ make -j1 DESTDIR="$pkgdir" install
rm "$pkgdir"/usr/lib/charset.alias
}
@@ -47,6 +52,7 @@ static() {
libintl() {
pkgdesc="GNU gettext runtime library"
+ license="LGPL-2.1+"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libintl.so.* "$subpkgdir"/usr/lib
chmod +x "$subpkgdir"/usr/lib/libintl.so.*
@@ -54,13 +60,12 @@ libintl() {
asprintf() {
pkgdesc="GNU gettext asprintf library"
+ license="LGPL-2.1+"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libasprintf.so.* "$subpkgdir"/usr/lib
}
-md5sums="df3f5690eaa30fd228537b00cb7b7590 gettext-0.19.8.1.tar.xz
-054ee44e6dfb056efd42dc3063e273ae fix-abi.patch"
-sha256sums="105556dbc5c3fbbc2aa0edb46d22d055748b6f5c7cd7a8d99f8e7eb84e938be4 gettext-0.19.8.1.tar.xz
-48dff403e8966137e900186b2fbf9adaf7c3743ccc4c4d05b2b250009a0a6273 fix-abi.patch"
sha512sums="3553227b62f2a7d9b67c881ef889c030a6a21d5ecd210c4bf3d649df0b37193a99a68cf8fd5f2c69b6a87e847035dd9576f9bcb9363422866e26b04f4f6dd431 gettext-0.19.8.1.tar.xz
-f517a351864bb194117e7147015db9a9b0ffbb1feb22ecf39bc1c99ad904420467e267a893c3b1a76c1adb810d1b37b1c2c1273cda861ff1d260102701bc644a fix-abi.patch"
+f517a351864bb194117e7147015db9a9b0ffbb1feb22ecf39bc1c99ad904420467e267a893c3b1a76c1adb810d1b37b1c2c1273cda861ff1d260102701bc644a fix-abi.patch
+2765f8d9d72d85ad0adb87ee0edd83d3aec59995ef21a3c8bbd1ac20a3680058a2122bd3f6c37be3f50cb5ea00c19b3ad569a47ceedc8ae2cb4a6e8d4e30976d localename-fix.patch
+8fced6ec5c1f54686545aa91759f8501a0ccfa4bb66a781d282e65f7309c70ab74bf753f4969374facb135b7b9341e26d8a3e27679ea09cb1543b82dfb8a16dd skip-tests-musl.patch"
diff --git a/main/gettext/localename-fix.patch b/main/gettext/localename-fix.patch
new file mode 100644
index 0000000000..b50b5ede22
--- /dev/null
+++ b/main/gettext/localename-fix.patch
@@ -0,0 +1,34 @@
+--- gettext-0.19.8.1/gettext-tools/gnulib-lib/localename.c.old 2016-12-31 13:54:43.000000000 +0000
++++ gettext-0.19.8.1/gettext-tools/gnulib-lib/localename.c 2017-07-30 16:40:47.098541270 +0000
+@@ -40,7 +40,7 @@
+ # if defined __APPLE__ && defined __MACH__
+ # include <xlocale.h>
+ # endif
+-# if __GLIBC__ >= 2 && !defined __UCLIBC__
++# if defined __linux__
+ # include <langinfo.h>
+ # endif
+ # if !defined IN_LIBINTL
+@@ -2692,16 +2692,19 @@
+ locale_t thread_locale = uselocale (NULL);
+ if (thread_locale != LC_GLOBAL_LOCALE)
+ {
+-# if __GLIBC__ >= 2 && !defined __UCLIBC__
++# if defined(_NL_LOCALE_NAME)
++ const char *name = nl_langinfo(_NL_LOCALE_NAME(category));
++# if __GLIBC__ >= 2 && !defined __UCLIBC__
+ /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
+ glibc < 2.12.
+ See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>. */
+- const char *name =
+- nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
++ if (name[0] == '\0')
++ name = nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
+ if (name[0] == '\0')
+ /* Fallback code for glibc < 2.4, which did not implement
+ nl_langinfo (_NL_LOCALE_NAME (category)). */
+ name = thread_locale->__names[category];
++# endif
+ return name;
+ # elif defined __FreeBSD__ || (defined __APPLE__ && defined __MACH__)
+ /* FreeBSD, Mac OS X */
diff --git a/main/gettext/skip-tests-musl.patch b/main/gettext/skip-tests-musl.patch
new file mode 100644
index 0000000000..2ed677f72c
--- /dev/null
+++ b/main/gettext/skip-tests-musl.patch
@@ -0,0 +1,95 @@
+--- gettext-0.19.8.1/gettext-tools/tests/msgconv-2.old 2016-06-09 22:56:00.000000000 +0000
++++ gettext-0.19.8.1/gettext-tools/tests/msgconv-2 2017-08-11 17:54:55.677206381 +0000
+@@ -4,6 +4,8 @@
+ # Test conversion from UTF-8 to BIG5.
+ # Test that encoding names are case insensitive.
+
++Exit 77
++
+ cat <<\EOF > mco-test2.po
+ # Chinese translation for GNU gettext messages.
+ #
+--- gettext-0.19.8.1/gettext-tools/tests/msgmerge-compendium-6.old 2016-06-09 22:56:00.000000000 +0000
++++ gettext-0.19.8.1/gettext-tools/tests/msgmerge-compendium-6 2017-08-11 17:55:41.440408716 +0000
+@@ -7,6 +7,8 @@
+ # mm-ko.ascii.pot mm-ko.euc-kr.po mm-ko-comp.euc-kr.po
+ # mm-ko.utf-8.pot mm-ko.utf-8.po mm-ko-comp.utf-8.po
+
++Exit 77
++
+ : ${MSGCONV=msgconv}
+ ${MSGCONV} --to-code=UTF-8 -o mm-ko.utf-8.pot "$abs_srcdir"/mm-ko.ascii.pot
+
+--- gettext-0.19.8.1/gettext-tools/tests/xgettext-python-3.old 2016-06-09 22:56:00.000000000 +0000
++++ gettext-0.19.8.1/gettext-tools/tests/xgettext-python-3 2017-08-11 17:54:26.533956530 +0000
+@@ -1,6 +1,8 @@
+ #!/bin/sh
+ . "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
++Exit 77
++
+ # Test Python support: --from-code option and encoding recognition.
+
+ cat <<\EOF > xg-py-3a.py
+--- gettext-0.19.8.1/gettext-tools/gnulib-tests/test-striconveha.c.old 2016-06-11 13:00:04.000000000 +0000
++++ gettext-0.19.8.1/gettext-tools/gnulib-tests/test-striconveha.c 2017-08-11 18:12:12.294469761 +0000
+@@ -308,6 +308,7 @@
+
+ /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2. */
+ # if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
++ if (iconv_open("ISO-2022-JP-2", "UTF-8") != -1) {
+ /* Test conversions from autodetect_jp to UTF-8. */
+ for (h = 0; h < SIZEOF (handlers); h++)
+ {
+@@ -399,6 +400,7 @@
+ free (result);
+ }
+ }
++ }
+ # endif
+
+ # if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) && !defined __UCLIBC__) || _LIBICONV_VERSION >= 0x0105
+@@ -547,6 +547,7 @@
+ /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2. */
+ # if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+ /* Test conversions from autodetect_jp to UTF-8. */
++ if (iconv_open("ISO-2022-JP-2", "UTF-8") != -1) {
+ for (h = 0; h < SIZEOF (handlers); h++)
+ {
+ enum iconv_ilseq_handler handler = handlers[h];
+@@ -577,6 +578,7 @@
+ ASSERT (strcmp (result, expected) == 0);
+ free (result);
+ }
++ }
+ # endif
+
+ # if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) && !defined __UCLIBC__) || _LIBICONV_VERSION >= 0x0105
+--- gettext-0.19.8.1/gettext-tools/gnulib-tests/test-mbrtowc5.sh.old 2016-12-31 13:54:43.000000000 +0000
++++ gettext-0.19.8.1/gettext-tools/gnulib-tests/test-mbrtowc5.sh 2017-07-30 17:29:50.879924130 +0000
+@@ -1,6 +1,2 @@
+ #!/bin/sh
+-# Test whether the POSIX locale has encoding errors.
+-LC_ALL=C \
+-./test-mbrtowc${EXEEXT} 5 || exit
+-LC_ALL=POSIX \
+-./test-mbrtowc${EXEEXT} 5
++exit 77
+--- gettext-0.19.8.1/gettext-tools/gnulib-tests/uniconv/test-u8-conv-from-enc.c.old 2016-06-11 13:00:04.000000000 +0000
++++ gettext-0.19.8.1/gettext-tools/gnulib-tests/uniconv/test-u8-conv-from-enc.c 2017-08-11 18:26:43.888920845 +0000
+@@ -113,6 +113,7 @@
+ /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2. */
+ # if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+ /* Test conversions from autodetect_jp to UTF-8. */
++ if (iconv_open("ISO-2022-JP-2", "UTF-8") != -1) {
+ for (h = 0; h < SIZEOF (handlers); h++)
+ {
+ enum iconv_ilseq_handler handler = handlers[h];
+@@ -197,6 +198,7 @@
+ free (result);
+ }
+ }
++ }
+ # endif
+
+ #endif