lsof: Fix build on darwin.

This commit is contained in:
Shea Levy 2018-04-16 18:58:07 -04:00
parent 9330ef4df8
commit 85422c0f51
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,12 @@
diff -Naur a/dialects/darwin/libproc/dfile.c b/dialects/darwin/libproc/dfile.c
--- a/dialects/darwin/libproc/dfile.c 2018-02-14 09:28:06.000000000 -0500
+++ b/dialects/darwin/libproc/dfile.c 2018-04-16 18:52:40.828715293 -0400
@@ -43,7 +43,7 @@
#include "lsof.h"
#if defined(PROC_FP_GUARDED)
-#extern struct pff_tab Pgf_tab[];
+extern struct pff_tab Pgf_tab[];
#endif /* defined(PROC_FP_GUARDED) */

View File

@ -28,8 +28,12 @@ stdenv.mkDerivation rec {
unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); ";
patches = stdenv.lib.optional stdenv.isDarwin ./darwin-dfile.patch;
postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1
'' + stdenv.lib.optionalString stdenv.isDarwin ''
sed -i 's|lcurses|lncurses|g' Configure
'';
# Stop build scripts from searching global include paths