@@ -1,34 +1,22 @@
1−{ stdenv, fetchurl, buildPackages, ncurses }:
1+{ stdenv, fetchFromGitHub, buildPackages, ncurses }:
22
33let dialect = with stdenv.lib; last (splitString "-" stdenv.hostPlatform.system); in
44
55stdenv.mkDerivation rec {
6− name = "lsof-${version}";
7− version = "4.91";
6+ pname = "lsof";
7+ version = "4.93.2";
88
99 depsBuildBuild = [ buildPackages.stdenv.cc ];
1010 buildInputs = [ ncurses ];
1111
12− src = fetchurl {
13− urls = ["https://fossies.org/linux/misc/lsof_${version}.tar.bz2"] ++ # Mirrors seem to be down...
14− ["ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${version}.tar.bz2"]
15− ++ map (
16− # the tarball is moved after new version is released
17− isOld: "ftp://sunsite.ualberta.ca/pub/Mirror/lsof/"
18− + "${stdenv.lib.optionalString isOld "OLD/"}lsof_${version}.tar.bz2"
19− ) [ false true ]
20− ++ map (
21− # the tarball is moved after new version is released
22− isOld: "http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/"
23− + "${stdenv.lib.optionalString isOld "OLD/"}lsof_${version}.tar.bz2"
24− ) [ false true ]
25− ;
26− sha256 = "18sh4hbl9jw2szkf0gvgan8g13f3g4c6s2q9h3zq5gsza9m99nn9";
12+ src = fetchFromGitHub {
13+ owner = "lsof-org";
14+ repo = "lsof";
15+ rev = "${version}";
16+ sha256 = "1gd6r0nv8xz76pmvk52dgmfl0xjvkxl0s51b4jk4a0lphw3393yv";
2717 };
2818
29− unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); ";
30−
31− patches = [ ./no-build-info.patch ] ++ stdenv.lib.optional stdenv.isDarwin ./darwin-dfile.patch;
19+ patches = [ ./no-build-info.patch ];
3220
3321 postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
3422 substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1
@@ -47,12 +35,12 @@ stdenv.mkDerivation rec {
4735
4836 installPhase = ''
4937 mkdir -p $out/bin $out/man/man8
50− cp lsof.8 $out/man/man8/
38+ cp Lsof.8 $out/man/man8/lsof.8
5139 cp lsof $out/bin
5240 '';
5341
5442 meta = with stdenv.lib; {
55− homepage = https://people.freebsd.org/~abe/;
43+ homepage = "https://github.com/lsof-org/lsof";
5644 description = "A tool to list open files";
5745 longDescription = ''
5846 List open files. Can show what process has opened some file,