net-analyzer/nagios-plugins-linux-madrisan: fix build with musl
authorLouis Sautier <sbraz@gentoo.org>
Mon, 20 Apr 2020 14:59:33 +0000 (16:59 +0200)
committerLouis Sautier <sbraz@gentoo.org>
Mon, 20 Apr 2020 15:01:45 +0000 (17:01 +0200)
Closes: https://bugs.gentoo.org/717038
Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Louis Sautier <sbraz@gentoo.org>
net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-25-fix-musl-build.patch [new file with mode: 0644]
net-analyzer/nagios-plugins-linux-madrisan/nagios-plugins-linux-madrisan-25-r1.ebuild

diff --git a/net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-25-fix-musl-build.patch b/net-analyzer/nagios-plugins-linux-madrisan/files/nagios-plugins-linux-madrisan-25-fix-musl-build.patch
new file mode 100644 (file)
index 0000000..3220be2
--- /dev/null
@@ -0,0 +1,35 @@
+commit 72547f774641d3ed881cc957a6d6c20d5e3370ec
+Author: Louis Sautier <sautier.louis@gmail.com>
+Date:   Mon Apr 20 16:40:08 2020 +0200
+
+    Fix build with musl by including limits.h when PATH_MAX is used
+    
+    Otherwise, the build fails with:
+    error: PATH_MAX undeclared (first use in this function)
+    
+    Bug: https://bugs.gentoo.org/717038
+
+diff --git a/lib/processes.c b/lib/processes.c
+index cb006ca..e65992d 100644
+--- a/lib/processes.c
++++ b/lib/processes.c
+@@ -26,6 +26,7 @@
+ #include <ctype.h>
+ #include <dirent.h>
+ #include <errno.h>
++#include <limits.h>
+ #include <pwd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+diff --git a/plugins/check_fc.c b/plugins/check_fc.c
+index b798377..cfaafa5 100644
+--- a/plugins/check_fc.c
++++ b/plugins/check_fc.c
+@@ -22,6 +22,7 @@
+ #include <dirent.h>
+ #include <errno.h>
+ #include <getopt.h>
++#include <limits.h>
+ #include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
index 284d0d9d1a834745374e481c2f18ba26db1a0a91..e56c277678f3d0ffb8be1fb43d0f8d69f583662b 100644 (file)
@@ -22,7 +22,11 @@ RDEPEND="${DEPEND}"
 
 # https://github.com/madrisan/nagios-plugins-linux/issues/48
 # Will be in the next release
-PATCHES=( "${FILESDIR}/${P}-fix-fno-common.patch" )
+# https://github.com/madrisan/nagios-plugins-linux/pull/52
+PATCHES=(
+       "${FILESDIR}/${P}-fix-fno-common.patch"
+       "${FILESDIR}/${P}-fix-musl-build.patch"
+)
 
 S="${WORKDIR}/${MY_P}"