git.iko.soy/typeable/nixpkgs
on master help sign in
Fixing lsof-4.89 for Darwin
commitf02f1a490be0f0d462020ac1517b68a507a9e9e7 authorJi-Haeng Huh <jhhuh.note@gmail.com> dateTue 4 Oct 2016, 15:37 (10 years ago) parent94e87bd
2 files changed+26−3
pkgs/development/tools/misc/lsof/default.nix+8−3 pkgs/development/tools/misc/lsof/dfile.patch+18
pkgs/development/tools/misc/lsof/default.nix+8−3
@@ -1,9 +1,12 @@
11{ stdenv, fetchurl }:
2−
2+let pkgs = import <nixpkgs> {};
3+in
34stdenv.mkDerivation rec {
45 name = "lsof-${version}";
56 version = "4.89";
67
8+ buildInputs = [ pkgs.ncurses ];
9+
710 src = fetchurl {
811 urls =
912 ["ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${version}.tar.bz2"]
@@ -22,12 +25,14 @@ stdenv.mkDerivation rec {
2225 };
2326
2427 unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); ";
28+
29+ patches = [ ./dfile.patch ];
2530
26− preBuild = "sed -i Makefile -e 's/^CFGF=/& -DHASIPv6=1/;';";
31+ preBuild = "sed -i Makefile -e 's/^CFGF=/& -DHASIPv6=1/;' -e s/-lcurses/-lncurses/ ;";
2732
2833 configurePhase = ''
2934 # Stop build scripts from searching global include paths
30− export LSOF_INCLUDE=/$(md5sum <(echo $name) | awk '{print $1}')
35+ # export LSOF_INCLUDE=/$(md5sum <(echo $name) | awk '{print $1}')
3136 ./Configure -n ${if stdenv.isDarwin then "darwin" else "linux"}
3237 '';
3338
pkgs/development/tools/misc/lsof/dfile.patchnew file+18
@@ -0,0 +1,18 @@
1+--- lsof_4.89_src/dialects/darwin/libproc/dfile.c 2014-10-30 12:39:46.000000000 +0100
2++++ lsof_4.89_src/dialects/darwin/libproc/dfile_new.c 2016-10-04 13:44:58.000000000 +0200
3+@@ -286,13 +286,13 @@
4+
5+ #if defined(PROC_FP_GUARDED)
6+ if (extra > 1)
7+- putchar(`,');
8++ putchar(',');
9+ if (lf->guardflags) {
10+ struct pff_tab *tp;
11+ long gf;
12+
13+ (void) printf("guard=");
14+- tp = Pgf_tab;
15++ tp = Pff_tab;
16+ gf = lf->guardflags;
17+ while (gf && !FsvFlagX) {
18+ while (tp->nm) {