From b7dda2027ec8166eaa12764a07a50099875601d7 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 14 Nov 2024 07:03:53 +0000 Subject: [PATCH] wget: use nuke-refs to avoid runtime depeneds That way we still preserve the compilation flags but don't retain development headers in final closure. (cherry picked from commit 0d59db6c85d9a142aacbe16816ecc611f7e41a14) --- pkgs/by-name/wg/wget/package.nix | 14 ++++++++------ .../remove-runtime-dep-on-openssl-headers.patch | 17 ----------------- 2 files changed, 8 insertions(+), 23 deletions(-) delete mode 100644 pkgs/by-name/wg/wget/remove-runtime-dep-on-openssl-headers.patch diff --git a/pkgs/by-name/wg/wget/package.nix b/pkgs/by-name/wg/wget/package.nix index 6b625571dc12..e96bcd22fd8b 100644 --- a/pkgs/by-name/wg/wget/package.nix +++ b/pkgs/by-name/wg/wget/package.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, gettext, pkg-config, perlPackages , libidn2, zlib, pcre, libuuid, libiconv, libintl -, python3, lzip, darwin +, nukeReferences, python3, lzip, darwin , withLibpsl ? false, libpsl , withOpenssl ? true, openssl }: @@ -14,15 +14,11 @@ stdenv.mkDerivation rec { hash = "sha256-GSJcx1awoIj8gRSNxqQKDI8ymvf9hIPxx7L+UPTgih8="; }; - patches = [ - ./remove-runtime-dep-on-openssl-headers.patch - ]; - preConfigure = '' patchShebangs doc ''; - nativeBuildInputs = [ gettext pkg-config perlPackages.perl lzip libiconv libintl ]; + nativeBuildInputs = [ gettext pkg-config perlPackages.perl lzip libiconv libintl nukeReferences ]; buildInputs = [ libidn2 zlib pcre libuuid ] ++ lib.optional withOpenssl openssl ++ lib.optional withLibpsl libpsl @@ -35,6 +31,12 @@ stdenv.mkDerivation rec { "--without-included-regex" ]; + preBuild = '' + # avoid runtime references to build-only depends + make -C src version.c + nuke-refs src/version.c + ''; + enableParallelBuilding = true; __darwinAllowLocalNetworking = true; diff --git a/pkgs/by-name/wg/wget/remove-runtime-dep-on-openssl-headers.patch b/pkgs/by-name/wg/wget/remove-runtime-dep-on-openssl-headers.patch deleted file mode 100644 index a6a1fcfcb37b..000000000000 --- a/pkgs/by-name/wg/wget/remove-runtime-dep-on-openssl-headers.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/src/Makefile.in b/src/Makefile.in -index 1a36a9b..e279c84 100644 ---- a/src/Makefile.in -+++ b/src/Makefile.in -@@ -2211,10 +2211,9 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a - echo '' >> $@ - echo '#include "version.h"' >> $@ - echo 'const char *version_string = "@VERSION@";' >> $@ -- echo 'const char *compilation_string = "'$(COMPILE)'";' \ -+ echo 'const char *compilation_string = 0;' \ - | $(ESCAPEQUOTE) >> $@ -- echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \ -- $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \ -+ echo 'const char *link_string = 0;' \ - | $(ESCAPEQUOTE) >> $@ - - css.c: $(srcdir)/css.l