aboutsummaryrefslogtreecommitdiffstats
path: root/community/gettext-tiny
diff options
context:
space:
mode:
Diffstat (limited to 'community/gettext-tiny')
-rw-r--r--community/gettext-tiny/APKBUILD31
-rw-r--r--community/gettext-tiny/flip-macro-logic.patch20
-rw-r--r--community/gettext-tiny/line-length.patch15
-rw-r--r--community/gettext-tiny/respect-cflags.patch11
4 files changed, 77 insertions, 0 deletions
diff --git a/community/gettext-tiny/APKBUILD b/community/gettext-tiny/APKBUILD
new file mode 100644
index 0000000000..946e31b35e
--- /dev/null
+++ b/community/gettext-tiny/APKBUILD
@@ -0,0 +1,31 @@
+# Contributor: TBK <alpine@jjtc.eu>
+# Maintainer: TBK <alpine@jjtc.eu>
+pkgname=gettext-tiny
+pkgver=0.3.2
+pkgrel=0
+pkgdesc="Tiny Internationalized Message Handling Library and tools"
+url="https://github.com/sabotage-linux/gettext-tiny"
+arch="all"
+license="MIT"
+options="!check" # No test suite
+provides="gettext"
+depends_dev="musl-libintl"
+subpackages="$pkgname-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/sabotage-linux/gettext-tiny/archive/v$pkgver.tar.gz
+ line-length.patch
+ respect-cflags.patch
+ flip-macro-logic.patch
+ "
+
+build() {
+ make LIBINTL=MUSL prefix=/usr
+}
+
+package() {
+ make LIBINTL=MUSL prefix=/usr DESTDIR="$pkgdir" install
+}
+
+sha512sums="0ed85599c8dc4114764b8eeed1e35cde97f11185c3f689e377d020758cc010ba4402febb84dba4cdc78e94fa2cd65614dafade8708ea078db5b2921925c36e78 gettext-tiny-0.3.2.tar.gz
+0a26a8481bffe2ce8c73f7f500963aea9db8379fb87849142d8efabf1656604b22f6ad345483256f14c388466f2f44e5924b9f65d88f26867a753a96d1529270 line-length.patch
+b4e7db4e415f6bc31f2214f2044506ad18ea0bd3cae4200d93bbd34aa493c7478a7f953d0a7e08f29f0fd5a5d7b7cbfa2bcfd5692c37e423706a1c193239bf1d respect-cflags.patch
+cd4cfc8cc6ea998f1e33ef666e3b9c3de3f3253994bccc942b177773c94f785e3892cb7d5f34bec1102dc7558236c07c5eac90e15d755e12ee06836336373526 flip-macro-logic.patch"
diff --git a/community/gettext-tiny/flip-macro-logic.patch b/community/gettext-tiny/flip-macro-logic.patch
new file mode 100644
index 0000000000..277bc7ae76
--- /dev/null
+++ b/community/gettext-tiny/flip-macro-logic.patch
@@ -0,0 +1,20 @@
+--- gettext-tiny-0.2.0/include/libintl.h.old 2017-08-02 06:14:20.000000000 -0500
++++ gettext-tiny-0.2.0/include/libintl.h 2018-06-15 02:31:14.241446687 -0500
+@@ -34,14 +34,14 @@
+ #undef gettext_noop
+ #define gettext_noop(X) X
+
+-#ifndef LIBINTL_NO_MACROS
++#ifdef LIBINTL_MACROS
+ /* if these macros are defined, configure checks will detect libintl as
+ * built into the libc because test programs will work without -lintl.
+ * for example:
+ * checking for ngettext in libc ... yes
+ * the consequence is that -lintl will not be added to the LDFLAGS.
+- * so if for some reason you want that libintl.a gets linked,
+- * add -DLIBINTL_NO_MACROS=1 to your CPPFLAGS. */
++ * so if for some reason you dont want that libintl.a gets linked,
++ * add -DLIBINTL_MACROS=1 to your CPPFLAGS. */
+
+ #define gettext(X) ((char*) (X))
+ #define dgettext(dom, X) ((void)(dom), (char*) (X))
diff --git a/community/gettext-tiny/line-length.patch b/community/gettext-tiny/line-length.patch
new file mode 100644
index 0000000000..0ba9781977
--- /dev/null
+++ b/community/gettext-tiny/line-length.patch
@@ -0,0 +1,15 @@
+https://github.com/sabotage-linux/gettext-tiny/issues/50
+
+We're losing the battle of the bulge; someone really should make this use malloc.
+
+--- gettext-tiny-0.3.1_git20191130/src/msgfmt.c.old 2020-01-14 08:03:11.000000000 +0000
++++ gettext-tiny-0.3.1_git20191130/src/msgfmt.c 2020-01-21 18:58:28.257709860 +0000
+@@ -160,7 +160,7 @@
+
+ int process(FILE *in, FILE *out, bool strict) {
+ struct mo_hdr mohdr = def_hdr;
+- char line[8192]; char *lp;
++ char line[12288]; char *lp;
+ size_t off, i;
+ enum po_error t;
+ char convbuf[32768];
diff --git a/community/gettext-tiny/respect-cflags.patch b/community/gettext-tiny/respect-cflags.patch
new file mode 100644
index 0000000000..dd1cf3fe2c
--- /dev/null
+++ b/community/gettext-tiny/respect-cflags.patch
@@ -0,0 +1,11 @@
+--- gettext-tiny-0.2.0/Makefile.old 2017-08-02 06:14:20.000000000 -0500
++++ gettext-tiny-0.2.0/Makefile 2018-06-16 21:21:57.148735892 -0500
+@@ -32,7 +32,7 @@
+ ALL_M4S=$(sort $(wildcard m4/*.m4))
+ ALL_DATA=$(sort $(wildcard data/*))
+
+-CFLAGS=-O0 -fPIC
++CFLAGS ?= -O0 -fPIC
+
+ AR ?= $(CROSS_COMPILE)ar
+ RANLIB ?= $(CROSS_COMPILE)ranlib