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.
This commit is contained in:
parent
31eea73f99
commit
c47fcbf293
@ -2,6 +2,7 @@
|
|||||||
, fetchurl, pkgconfig, ncurses, gzip
|
, fetchurl, pkgconfig, ncurses, gzip
|
||||||
, sslSupport ? true, openssl ? null
|
, sslSupport ? true, openssl ? null
|
||||||
, buildPlatform, hostPlatform
|
, buildPlatform, hostPlatform
|
||||||
|
, nukeReferences
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert sslSupport -> openssl != null;
|
assert sslSupport -> openssl != null;
|
||||||
@ -18,10 +19,18 @@ stdenv.mkDerivation rec {
|
|||||||
configureFlags = [ "--enable-widec" ] ++ stdenv.lib.optional sslSupport "--with-ssl";
|
configureFlags = [ "--enable-widec" ] ++ stdenv.lib.optional sslSupport "--with-ssl";
|
||||||
|
|
||||||
nativeBuildInputs = stdenv.lib.optional sslSupport pkgconfig
|
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;
|
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; {
|
meta = with stdenv.lib; {
|
||||||
homepage = http://lynx.isc.org/;
|
homepage = http://lynx.isc.org/;
|
||||||
description = "A text-mode web browser";
|
description = "A text-mode web browser";
|
||||||
|
Loading…
Reference in New Issue
Block a user