--- /dev/null
+commit f52c40680f0aad44b9ae16648803453ec00cbb2c
+Author: Paul Crawford <psc@sat.dundee.ac.uk>
+Date: Fri Dec 30 15:55:45 2016 +0000
+
+ Compile with musl when nfs is disabled
+
+ musl does by default not ship with rpc headers. The watchdog should
+ not require rpc headers when nfs support is disabled.
+
+ Patch by Felix Janda <fjanda@users.sf.net>
+
+diff --git a/include/sundries.h b/include/sundries.h
+index 4379982..98c489a 100644
+--- a/include/sundries.h
++++ b/include/sundries.h
+@@ -9,9 +9,11 @@
+ #include <signal.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
++#if HAVE_NFS
+ #if !defined(bool_t) && !defined(__GLIBC__)
+ #include <rpc/types.h>
+ #endif
++#endif
+
+ extern int mount_mount_quiet;
+ extern int mount_verbose;
--- /dev/null
+commit c5cb4e1a0339844ae3f55ff1dc4a716c28012f05
+Author: Paul Crawford <psc@sat.dundee.ac.uk>
+Date: Tue Jun 28 18:08:48 2016 +0100
+
+ Include linux/param.h for EXEC_PAGESIZE definition
+
+ Musl does not include linux/param.h whereas glibc does, so it fails
+ to build on musl. Patch supplied by Khem Raj <raj.khem@gmail.com>
+
+diff --git a/src/watchdog.c b/src/watchdog.c
+index acf6450..486384a 100644
+--- a/src/watchdog.c
++++ b/src/watchdog.c
+@@ -26,6 +26,9 @@
+ #include <sys/param.h> /* For EXEC_PAGESIZE */
+ #include <linux/oom.h>
+ #include <linux/watchdog.h>
++#ifdef __linux__
++#include <linux/param.h>
++#endif
+ #include <string.h>
+
+ #include <libgen.h>
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=6
inherit toolchain-funcs flag-o-matic systemd
DEPEND="nfs? ( net-libs/libtirpc )"
RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}"/${P}-musl.patch
+ "${FILESDIR}"/${P}-musl-nfs.patch
+)
+
src_configure() {
if use nfs ; then
tc-export PKG_CONFIG