--- /dev/null
+From 5e1c429eec977cd365f490137ca9dede0caef662 Mon Sep 17 00:00:00 2001
+From: Rob Landley <rob@landley.net>
+Date: Fri, 5 Feb 2016 15:13:24 -0600
+Subject: [PATCH] Debian unstable is even more pedantic than previous debian.
+
+---
+ scripts/mktags.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/scripts/mktags.c b/scripts/mktags.c
+index 3604260..9c23cf1 100644
+--- a/scripts/mktags.c
++++ b/scripts/mktags.c
+@@ -3,6 +3,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <ctype.h>
+
+ int main(int argc, char *argv[])
+ {
+--
+2.6.2
+
--- /dev/null
+fix from upstream for flaky parallel builds
+
+From e17fbf19c4b48d763041761052e98c2b4ee95487 Mon Sep 17 00:00:00 2001
+From: Rob Landley <rob@landley.net>
+Date: Fri, 26 Feb 2016 00:22:15 -0600
+Subject: [PATCH] Switch to $! for make.sh process enumeration.
+
+---
+ scripts/make.sh | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/scripts/make.sh b/scripts/make.sh
+index 84dda34..c73a03d 100755
+--- a/scripts/make.sh
++++ b/scripts/make.sh
+@@ -264,17 +264,17 @@ do
+ LFILES="$LFILES $OUT"
+ [ "$OUT" -nt "$i" ] && continue
+ do_loudly $BUILD -c $i -o $OUT &
++ PENDING="$PENDING $!"
+
+ # ratelimit to $CPUS many parallel jobs, detecting errors
+
+ while true
+ do
+- PENDING="$(echo $PENDING $(jobs -rp) | tr ' ' '\n' | sort -u)"
+- [ $(echo -n "$PENDING" | wc -l) -lt "$CPUS" ] && break;
++ [ $(echo "$PENDING" | wc -w) -lt "$CPUS" ] && break;
+
+- wait $(echo "$PENDING" | head -n 1)
++ wait $(echo "$PENDING" | awk '{print $1}')
+ DONE=$(($DONE+$?))
+- PENDING="$(echo "$PENDING" | tail -n +2)"
++ PENDING="$(echo "$PENDING" | sed 's/^ *[0-9]*//')"
+ done
+ [ $DONE -ne 0 ] && break
+ done
+--
+2.6.2
+
--- /dev/null
+From 99e5c17b5fe5a93066e81cc6fcc7ebf386cb6183 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 29 Feb 2016 13:35:05 -0500
+Subject: [PATCH] include sys/sysmacros.h
+
+The major/minor macros are defined in sys/sysmacros.h. This has
+historically been pulled in implicitly by sys/types.h, but C libs
+are moving away from that as they aren't in POSIX. Use the header
+directly as defined by BSD systems.
+---
+ toys.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/toys.h b/toys.h
+index 8a29730..5e640a1 100644
+--- a/toys.h
++++ b/toys.h
+@@ -34,6 +34,7 @@
+ #include <sys/resource.h>
+ #include <sys/stat.h>
+ #include <sys/statvfs.h>
++#include <sys/sysmacros.h>
+ #include <sys/time.h>
+ #include <sys/times.h>
+ #include <sys/utsname.h>
+--
+2.6.2
+
IUSE=""
src_prepare() {
+ epatch "${FILESDIR}"/${P}-parallel-build.patch
+ epatch "${FILESDIR}"/${P}-includes.patch
+ epatch "${FILESDIR}"/${P}-sysmacros.patch
epatch_user
restore_config .config
}