add Darwin's flavor of lsof

This commit is contained in:
Jude Taylor 2015-07-29 10:29:36 -07:00
parent 6310a9a3be
commit 7024b4dc62
4 changed files with 33 additions and 1 deletions

View File

@ -27,6 +27,8 @@ stdenv.mkDerivation rec {
cp lsof $out/bin
'';
isBroken = stdenv.isDarwin;
meta = {
homepage = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/;
description = "A tool to list open files";

View File

@ -78,6 +78,7 @@ let
Libsystem = applePackage "Libsystem" "1197.1.1" "1yfj2qdrf9vrzs7p9m4wlb7zzxcrim1gw43x4lvz4qydpp5kg2rh" {};
libutil = applePackage "libutil" "38" "12gsvmj342n5d81kqwba68bmz3zf2757442g1sz2y5xmcapa3g5f" {};
libunwind = applePackage "libunwind" "35.3" "0miffaa41cv0lzf8az5k1j1ng8jvqvxcr4qrlkf3xyj479arbk1b" {};
lsof = applePackage "lsof" "53" "0ylzds2rhq5v8rddh0dgpcndsp9n3slfp30wsbl5fmsch7a5356j" {};
mDNSResponder = applePackage "mDNSResponder" "522.92.1" "1cp87qda1s7brriv413i71yggm8yqfwv64vknrnqv24fcb8hzbmy" {};
objc4 = applePackage "objc4" "551.1" "1jrdb6yyb5jwwj27c1r0nr2y2ihqjln8ynj61mpkvp144c1cm5bg" {};
objc4_pure = applePackage "objc4/pure.nix" "551.1" "1jrdb6yyb5jwwj27c1r0nr2y2ihqjln8ynj61mpkvp144c1cm5bg" {};

View File

@ -0,0 +1,27 @@
{ stdenv, appleDerivation, ncurses }:
appleDerivation {
buildInputs = [ ncurses ];
postUnpack = ''
sourceRoot="$sourceRoot/lsof"
'';
prePatch = ''
mv Configure configure
substituteInPlace configure \
--replace '`which make`' "$(type -P make)" \
--replace /usr/include "${stdenv.libc}/include" \
--replace -lcurses -lncurses
'';
dontAddPrefix = true;
configureFlags = [ "-n" "darwin" ];
installPhase = ''
mkdir -p $out/bin $out/man/man8
cp lsof.8 $out/man/man8/
cp lsof $out/bin
'';
}

View File

@ -5607,7 +5607,9 @@ let
libtool_2 = callPackage ../development/tools/misc/libtool/libtool2.nix { };
lsof = callPackage ../development/tools/misc/lsof { };
lsof = if stdenv.isDarwin
then darwin.lsof
else callPackage ../development/tools/misc/lsof { };
ltrace = callPackage ../development/tools/misc/ltrace { };