From c47fcbf2938d113cfe903ebda5c6927f681027b4 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Thu, 17 Aug 2017 18:37:28 +0200 Subject: [PATCH] lynx: remove unwanted references to build-time only inputs The binary embeds a listing of build-time dependencies derived from config.cache. Fix by nuking references in the derived header prior to building. Reduces size from ~102MB to ~51MB. --- .../applications/networking/browsers/lynx/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/lynx/default.nix b/pkgs/applications/networking/browsers/lynx/default.nix index bbf034a1342..aca0c735f0f 100644 --- a/pkgs/applications/networking/browsers/lynx/default.nix +++ b/pkgs/applications/networking/browsers/lynx/default.nix @@ -2,6 +2,7 @@ , fetchurl, pkgconfig, ncurses, gzip , sslSupport ? true, openssl ? null , buildPlatform, hostPlatform +, nukeReferences }: assert sslSupport -> openssl != null; @@ -18,10 +19,18 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-widec" ] ++ stdenv.lib.optional sslSupport "--with-ssl"; nativeBuildInputs = stdenv.lib.optional sslSupport pkgconfig - ++ stdenv.lib.optional (hostPlatform != buildPlatform) buildPackages.stdenv.cc; + ++ stdenv.lib.optional (hostPlatform != buildPlatform) buildPackages.stdenv.cc + ++ [ nukeReferences ]; buildInputs = [ ncurses gzip ] ++ stdenv.lib.optional sslSupport openssl.dev; + # cfg_defs.h captures lots of references to build-only dependencies, derived + # from config.cache. + postConfigure = '' + make cfg_defs.h + nuke-refs cfg_defs.h + ''; + meta = with stdenv.lib; { homepage = http://lynx.isc.org/; description = "A text-mode web browser";