1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-28 00:22:13 +00:00

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:
Joachim Fasting 2017-08-17 18:37:28 +02:00
parent 31eea73f99
commit c47fcbf293
No known key found for this signature in database
GPG key ID: 66EAB6B14F6B6E0D

View file

@ -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";