diff options
author | Ji-Haeng Huh <jhhuh.note@gmail.com> | 2016-10-04 15:37:35 +0200 |
---|---|---|
committer | Ji-Haeng Huh <jhhuh.note@gmail.com> | 2016-10-04 15:37:35 +0200 |
commit | f02f1a490be0f0d462020ac1517b68a507a9e9e7 (patch) | |
tree | 70437338582e5745c0d9c5cc449aa11cea34b07e /pkgs/development | |
parent | 94e87bd79bd04bc54efef21b93c8bbf5ffec40e8 (diff) | |
download | nixlib-f02f1a490be0f0d462020ac1517b68a507a9e9e7.tar nixlib-f02f1a490be0f0d462020ac1517b68a507a9e9e7.tar.gz nixlib-f02f1a490be0f0d462020ac1517b68a507a9e9e7.tar.bz2 nixlib-f02f1a490be0f0d462020ac1517b68a507a9e9e7.tar.lz nixlib-f02f1a490be0f0d462020ac1517b68a507a9e9e7.tar.xz nixlib-f02f1a490be0f0d462020ac1517b68a507a9e9e7.tar.zst nixlib-f02f1a490be0f0d462020ac1517b68a507a9e9e7.zip |
Fixing lsof-4.89 for Darwin
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/tools/misc/lsof/default.nix | 11 | ||||
-rw-r--r-- | pkgs/development/tools/misc/lsof/dfile.patch | 18 |
2 files changed, 26 insertions, 3 deletions
diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix index da5da2e5ab9a..0095f85c3c7a 100644 --- a/pkgs/development/tools/misc/lsof/default.nix +++ b/pkgs/development/tools/misc/lsof/default.nix @@ -1,9 +1,12 @@ { stdenv, fetchurl }: - +let pkgs = import <nixpkgs> {}; +in stdenv.mkDerivation rec { name = "lsof-${version}"; version = "4.89"; + buildInputs = [ pkgs.ncurses ]; + src = fetchurl { urls = ["ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${version}.tar.bz2"] @@ -22,12 +25,14 @@ stdenv.mkDerivation rec { }; unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); "; + + patches = [ ./dfile.patch ]; - preBuild = "sed -i Makefile -e 's/^CFGF=/& -DHASIPv6=1/;';"; + preBuild = "sed -i Makefile -e 's/^CFGF=/& -DHASIPv6=1/;' -e s/-lcurses/-lncurses/ ;"; configurePhase = '' # Stop build scripts from searching global include paths - export LSOF_INCLUDE=/$(md5sum <(echo $name) | awk '{print $1}') + # export LSOF_INCLUDE=/$(md5sum <(echo $name) | awk '{print $1}') ./Configure -n ${if stdenv.isDarwin then "darwin" else "linux"} ''; diff --git a/pkgs/development/tools/misc/lsof/dfile.patch b/pkgs/development/tools/misc/lsof/dfile.patch new file mode 100644 index 000000000000..47202d5ebeab --- /dev/null +++ b/pkgs/development/tools/misc/lsof/dfile.patch @@ -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) { |