Fixing lsof-4.89 for Darwin

This commit is contained in:
Ji-Haeng Huh
2016-10-04 15:37:35 +02:00
parent 94e87bd79b
commit f02f1a490b
2 changed files with 26 additions and 3 deletions

View File

@@ -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"}
'';