Merge pull request #19222 from jhhuh/jh

lsof: fixed for darwin
This commit is contained in:
Daiderd Jordan 2016-10-06 20:38:07 +02:00 committed by GitHub
commit 4589a8d750
2 changed files with 29 additions and 4 deletions

View File

@ -1,9 +1,11 @@
{ stdenv, fetchurl }:
{ stdenv, fetchurl, ncurses }:
stdenv.mkDerivation rec {
name = "lsof-${version}";
version = "4.89";
buildInputs = [ ncurses ];
src = fetchurl {
urls =
["ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${version}.tar.bz2"]
@ -22,14 +24,19 @@ stdenv.mkDerivation rec {
};
unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); ";
preBuild = "sed -i Makefile -e 's/^CFGF=/& -DHASIPv6=1/;';";
patches = [ ./dfile.patch ];
configurePhase = ''
# Stop build scripts from searching global include paths
export LSOF_INCLUDE=/$(md5sum <(echo $name) | awk '{print $1}')
export LSOF_INCLUDE=${stdenv.cc.libc}/include
./Configure -n ${if stdenv.isDarwin then "darwin" else "linux"}
'';
preBuild = ''
sed -i Makefile -e 's/^CFGF=/& -DHASIPv6=1/;' -e 's/-lcurses/-lncurses/'
'';
installPhase = ''
mkdir -p $out/bin $out/man/man8

View File

@ -0,0 +1,18 @@
--- lsof_4.89_src/dialects/darwin/libproc/dfile.c 2014-10-30 12:39:46.000000000 +0100
+++ lsof_4.89_src/dialects/darwin/libproc/dfile_new.c 2016-10-04 13:44:58.000000000 +0200
@@ -286,13 +286,13 @@
#if defined(PROC_FP_GUARDED)
if (extra > 1)
- putchar(`,');
+ putchar(',');
if (lf->guardflags) {
struct pff_tab *tp;
long gf;
(void) printf("guard=");
- tp = Pgf_tab;
+ tp = Pff_tab;
gf = lf->guardflags;
while (gf && !FsvFlagX) {
while (tp->nm) {