diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix index 2faefedd6656..9153a2dea198 100644 --- a/pkgs/development/tools/misc/lsof/default.nix +++ b/pkgs/development/tools/misc/lsof/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, buildPackages, perl, which, ncurses }: +{ lib, stdenv, fetchFromGitHub, buildPackages, perl, which, ncurses, nukeReferences }: let dialect = with lib; last (splitString "-" stdenv.hostPlatform.system); @@ -6,27 +6,29 @@ in stdenv.mkDerivation rec { pname = "lsof"; - version = "4.98.0"; + version = "4.99.3"; src = fetchFromGitHub { owner = "lsof-org"; repo = "lsof"; rev = version; - sha256 = "sha256-DQLY0a0sOCZFEJA4Y4b18OcWZw47RyqKZ0mVG0CDVTI="; + hash = "sha256-XW3l+E9D8hgI9jGJGKkIAKa8O9m0JHgZhEASqg4gYuw="; }; - patches = [ - ./no-build-info.patch - ]; - - postPatch = lib.optionalString stdenv.hostPlatform.isMusl '' + postPatch = '' + patchShebangs --build lib/dialects/*/Mksrc + # Do not re-build version.h in every 'make' to allow nuke-refs below. + # We remove phony 'FRC' target that forces rebuilds: + # 'version.h: FRC ...' is translated to 'version.h: ...'. + sed -i lib/dialects/*/Makefile -e 's/version.h:\s*FRC/version.h:/' + '' + lib.optionalString stdenv.hostPlatform.isMusl '' substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1 '' + lib.optionalString stdenv.isDarwin '' sed -i 's|lcurses|lncurses|g' Configure ''; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ perl which ]; + nativeBuildInputs = [ nukeReferences perl which ]; buildInputs = [ ncurses ]; # Stop build scripts from searching global include paths @@ -37,6 +39,10 @@ stdenv.mkDerivation rec { for filepath in $(find dialects/${dialect} -type f); do sed -i "s,/usr/include,$LSOF_INCLUDE,g" $filepath done + + # Wipe out development-only flags from CFLAGS embedding + make version.h + nuke-refs version.h ''; installPhase = '' diff --git a/pkgs/development/tools/misc/lsof/no-build-info.patch b/pkgs/development/tools/misc/lsof/no-build-info.patch deleted file mode 100644 index 3c518896b045..000000000000 --- a/pkgs/development/tools/misc/lsof/no-build-info.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/usage.c -+++ b/usage.c -@@ -931,24 +931,6 @@ usage(err, fh, version) - (void) fprintf(stderr, " configuration info: %s\n", cp); - #endif /* defined(LSOF_CINFO) */ - -- cp = isnullstr(LSOF_HOST); -- if (!(cp1 = isnullstr(LSOF_LOGNAME))) -- cp1 = isnullstr(LSOF_USER); -- if (cp || cp1) { -- if (cp && cp1) -- cp2 = "by and on"; -- else if (cp) -- cp2 = "on"; -- else -- cp2 = "by"; -- (void) fprintf(stderr, " constructed %s: %s%s%s\n", -- cp2, -- cp1 ? cp1 : "", -- (cp && cp1) ? "@" : "", -- cp ? cp : "" -- ); -- } -- - #if defined(LSOF_BLDCMT) - if ((cp = isnullstr(LSOF_BLDCMT))) - (void) fprintf(stderr, " builder's comment: %s\n", cp); -@@ -958,12 +940,6 @@ usage(err, fh, version) - (void) fprintf(stderr, " compiler: %s\n", cp); - if ((cp = isnullstr(LSOF_CCV))) - (void) fprintf(stderr, " compiler version: %s\n", cp); -- if ((cp = isnullstr(LSOF_CCFLAGS))) -- (void) fprintf(stderr, " compiler flags: %s\n", cp); -- if ((cp = isnullstr(LSOF_LDFLAGS))) -- (void) fprintf(stderr, " loader flags: %s\n", cp); -- if ((cp = isnullstr(LSOF_SYSINFO))) -- (void) fprintf(stderr, " system info: %s\n", cp); - // display configurations that might affect output - char *features[] = { - #if defined(HASEFFNLINK)