make depend &&
diff --git a/devel/perl/DEPENDS b/devel/perl/DEPENDS
index c23fc18..d15193f 100755
--- a/devel/perl/DEPENDS
+++ b/devel/perl/DEPENDS
@@ -1 +1,3 @@
+depends zlib &&
+depends bzip2 &&
optional_depends gdbm "" "" "for database support"
diff --git a/devel/perl/HISTORY b/devel/perl/HISTORY
index 47de62f..761b74f 100644
--- a/devel/perl/HISTORY
+++ b/devel/perl/HISTORY
@@ -1,4 +1,9 @@
-2019-04-20 Florian Franzmann < siflfran AT hawo.stw.uni-erlangen.de>
+2019-05-17 Ismael Luceno <ismael AT sourcemage.org>
+ * DEPENDS, BUILD: added dependencies on zlib and bzip2
+ * BUILD: Added -Dusethreads
+ * PRE_BUILD: Fixed gcc version check
+
+2019-04-20 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
* DETAILS: version 5.28.2
2018-12-03 Pavel Vinogradov <public AT sourcemage.org>
diff --git a/devel/perl/PRE_BUILD b/devel/perl/PRE_BUILD
new file mode 100755
index 0000000..4090b47
--- /dev/null
+++ b/devel/perl/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+sedit 's@gccversion" in@& [1-3][!.]*|[4-9]*|\\@' Configure
diff --git a/doc/man/HISTORY b/doc/man/HISTORY
index 5c1eb85..6ef4cde 100644
--- a/doc/man/HISTORY
+++ b/doc/man/HISTORY
@@ -1,3 +1,6 @@
+2019-05-16 Ismael Luceno <ismael AT sourcemage.org>
+ * PRE_BUILD, missing-includes.patch: Fixed build against musl
+
2018-04-09 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
* PROVIDES: provide MAN
diff --git a/doc/man/PRE_BUILD b/doc/man/PRE_BUILD
index 16c5448..3009454 100755
--- a/doc/man/PRE_BUILD
+++ b/doc/man/PRE_BUILD
@@ -1,4 +1,5 @@
default_pre_build &&
cd "$SOURCE_DIRECTORY" &&
+patch -fp1 -i "$SPELL_DIRECTORY/missing-includes.patch" &&
patch -p0 < "$SPELL_DIRECTORY/man.conf.patch"
diff --git a/doc/man/missing-includes.patch b/doc/man/missing-includes.patch
new file mode 100644
index 0000000..afa2a1a
--- /dev/null
+++ b/doc/man/missing-includes.patch
@@ -0,0 +1,14 @@
+Missing includes; required at least for compiling against musl.
+
+diff --git a/gencat/gencat.c.orig b/gencat/gencat.c
+index d1a7c31..99be7fa 100644
+--- a/gencat/gencat.c.orig
++++ b/gencat/gencat.c
+@@ -55,6 +55,7 @@ up-to-date. Many thanks.
+ #endif
+ #include <sys/file.h>
+ #include <sys/stat.h>
++#include <fcntl.h>
+ #include "gencat.h"
+
+ #ifndef L_SET
diff --git a/libs/gettext-tiny/BUILD b/libs/gettext-tiny/BUILD
new file mode 100755
index 0000000..8b64698
--- /dev/null
+++ b/libs/gettext-tiny/BUILD
@@ -0,0 +1,6 @@
+libintl=
+case "$HOST" in
+*-musl) libintl=MUSL;;
+*-gnu) libintl=NONE;;
+esac
+make LIBINTL="$libintl" CFLAGS="$CFLAGS" CC="$CC"
diff --git a/libs/gettext-tiny/CONFLICTS b/libs/gettext-tiny/CONFLICTS
new file mode 100755
index 0000000..7caaab1
--- /dev/null
+++ b/libs/gettext-tiny/CONFLICTS
@@ -0,0 +1 @@
+conflicts gettext
diff --git a/libs/gettext-tiny/DETAILS b/libs/gettext-tiny/DETAILS
new file mode 100755
index 0000000..eef85a4
--- /dev/null
+++ b/libs/gettext-tiny/DETAILS
@@ -0,0 +1,40 @@
+ SPELL=gettext-tiny
+ VERSION=0.3.1
+ SOURCE="${SPELL}-${VERSION}.tar.xz"
+ SOURCE_URL[0]=http://ftp.barfooze.de/pub/sabotage/tarballs/${SOURCE}
+
SOURCE_HASH=sha512:a2d88d3d0989a2f775d7940c28470f4cb80e41f190b69c65f61890764c73f96810006320e9daaf717e9fccd93eb541ca0c818bd58b2180713e030ad788263060
+SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
+ WEB_SITE="https://github.com/sabotage-linux/gettext-tiny"
+ LICENSE[0]="MIT"
+ ENTERED=20190417
+ KEYWORDS=""
+ SHORT="Lightweight replacement for the GNU gettext suite"
+cat << EOF
+gettext-tiny provides lightweight replacements for tools typically
+used from the GNU gettext suite, which is incredibly bloated and takes
+a lot of time to build (in the order of an hour on slow devices). the
+most notable component is msgfmt which is used to create binary
+translation files in the .mo format out of textual input files in .po
+format. this is the most important tool for building software from
+source, because it is used from the build processes of many software
+packages.
+
+our msgfmt implementation was initially a fake implementation that
+would just output the english input string as the translation, which
+is sufficient to get software to work, but it has since grown into a
+complete implementation. unlike the GNU implementation, it can even
+expand input strings containing so-called sysdep strings into a
+constant translation table. sysdep strings were glued as an
+after-thought onto the GNU implementation to deal with system-specific
+format strings, and in the GNU implementation those are created at
+runtime, which requires mapping the entire .mo file into read/write
+memory locations, thereby wasting precious RAM for read-only data that
+could otherwise be shared among processes.
+
+other parts of gettext-tiny such as xgettext and msgmerge are still
+stubs, but they are sufficient to build many packages.
+
+since musl libc, our preferred target, didn't provide a libintl in the
+past, (and it's also part of GNU gettext) we also ship a no-op libintl
+providing a header and a library.
+EOF
diff --git a/libs/gettext-tiny/HISTORY b/libs/gettext-tiny/HISTORY
new file mode 100644
index 0000000..2b1ba11
--- /dev/null
+++ b/libs/gettext-tiny/HISTORY
@@ -0,0 +1,2 @@
+2019-05-16 Ismael Luceno <ismael AT sourcemage.org>
+ * BUILD, CONFLICTS, DETAILS, INSTALL, PROVIDES: spell created
diff --git a/libs/gettext-tiny/INSTALL b/libs/gettext-tiny/INSTALL
new file mode 100755
index 0000000..04bdeaa
--- /dev/null
+++ b/libs/gettext-tiny/INSTALL
@@ -0,0 +1 @@
+make prefix="$INSTALL_ROOT/usr" install
diff --git a/libs/gettext-tiny/PROVIDES b/libs/gettext-tiny/PROVIDES
new file mode 100755
index 0000000..1a48646
--- /dev/null
+++ b/libs/gettext-tiny/PROVIDES
@@ -0,0 +1 @@
+GETTEXT
diff --git a/libs/gettext/HISTORY b/libs/gettext/HISTORY
index 33911f9..073c730 100644
--- a/libs/gettext/HISTORY
+++ b/libs/gettext/HISTORY
@@ -1,3 +1,6 @@
+2019-05-16 Ismael Luceno <ismael AT sourcemage.org>
+ * PROVIDES: provides GETTEXT
+
2019-05-12 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 0.20.1