From a7a6528c611351fc38bb3e42a25550ce4943b106 Mon Sep 17 00:00:00 2001 From: Averell Dalton Date: Thu, 29 Aug 2019 00:17:25 +0200 Subject: [PATCH] lsof: 4.91 -> 4.93.2 --- .../tools/misc/lsof/darwin-dfile.patch | 12 ------- pkgs/development/tools/misc/lsof/default.nix | 34 ++++++------------- 2 files changed, 11 insertions(+), 35 deletions(-) delete mode 100644 pkgs/development/tools/misc/lsof/darwin-dfile.patch diff --git a/pkgs/development/tools/misc/lsof/darwin-dfile.patch b/pkgs/development/tools/misc/lsof/darwin-dfile.patch deleted file mode 100644 index 9952228e613a..000000000000 --- a/pkgs/development/tools/misc/lsof/darwin-dfile.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur a/dialects/darwin/libproc/dfile.c b/dialects/darwin/libproc/dfile.c ---- a/dialects/darwin/libproc/dfile.c 2018-02-14 09:28:06.000000000 -0500 -+++ b/dialects/darwin/libproc/dfile.c 2018-04-16 18:52:40.828715293 -0400 -@@ -43,7 +43,7 @@ - #include "lsof.h" - - #if defined(PROC_FP_GUARDED) --#extern struct pff_tab Pgf_tab[]; -+extern struct pff_tab Pgf_tab[]; - #endif /* defined(PROC_FP_GUARDED) */ - - diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix index 63003f338eb9..98acccb252a3 100644 --- a/pkgs/development/tools/misc/lsof/default.nix +++ b/pkgs/development/tools/misc/lsof/default.nix @@ -1,34 +1,22 @@ -{ stdenv, fetchurl, buildPackages, ncurses }: +{ stdenv, fetchFromGitHub, buildPackages, ncurses }: let dialect = with stdenv.lib; last (splitString "-" stdenv.hostPlatform.system); in stdenv.mkDerivation rec { - name = "lsof-${version}"; - version = "4.91"; + pname = "lsof"; + version = "4.93.2"; depsBuildBuild = [ buildPackages.stdenv.cc ]; buildInputs = [ ncurses ]; - src = fetchurl { - urls = ["https://fossies.org/linux/misc/lsof_${version}.tar.bz2"] ++ # Mirrors seem to be down... - ["ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${version}.tar.bz2"] - ++ map ( - # the tarball is moved after new version is released - isOld: "ftp://sunsite.ualberta.ca/pub/Mirror/lsof/" - + "${stdenv.lib.optionalString isOld "OLD/"}lsof_${version}.tar.bz2" - ) [ false true ] - ++ map ( - # the tarball is moved after new version is released - isOld: "http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/" - + "${stdenv.lib.optionalString isOld "OLD/"}lsof_${version}.tar.bz2" - ) [ false true ] - ; - sha256 = "18sh4hbl9jw2szkf0gvgan8g13f3g4c6s2q9h3zq5gsza9m99nn9"; + src = fetchFromGitHub { + owner = "lsof-org"; + repo = "lsof"; + rev = "${version}"; + sha256 = "1gd6r0nv8xz76pmvk52dgmfl0xjvkxl0s51b4jk4a0lphw3393yv"; }; - unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); "; - - patches = [ ./no-build-info.patch ] ++ stdenv.lib.optional stdenv.isDarwin ./darwin-dfile.patch; + patches = [ ./no-build-info.patch ]; postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1 @@ -47,12 +35,12 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin $out/man/man8 - cp lsof.8 $out/man/man8/ + cp Lsof.8 $out/man/man8/lsof.8 cp lsof $out/bin ''; meta = with stdenv.lib; { - homepage = https://people.freebsd.org/~abe/; + homepage = "https://github.com/lsof-org/lsof"; description = "A tool to list open files"; longDescription = '' List open files. Can show what process has opened some file,