Skip to content

Commit

Permalink
Merge pull request #49315 from andrew-d/andrew/vlc-shrink-closure
Browse files Browse the repository at this point in the history
vlc: shrink runtime closure size by removing CONFIGURE_LINE
  • Loading branch information
joachifm authored Oct 28, 2018
2 parents a5b8de5 + 0cf647f commit aa4005f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkgs/applications/video/vlc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
, withQt5 ? true, qtbase ? null, qtsvg ? null, qtx11extras ? null
, jackSupport ? false
, fetchpatch
, removeReferencesTo
}:

with stdenv.lib;
Expand Down Expand Up @@ -42,7 +43,7 @@ stdenv.mkDerivation rec {
] ++ optionals withQt5 [ qtbase qtsvg qtx11extras ]
++ optional jackSupport libjack2;

nativeBuildInputs = [ autoreconfHook perl pkgconfig ];
nativeBuildInputs = [ autoreconfHook perl pkgconfig removeReferencesTo ];

enableParallelBuilding = true;

Expand All @@ -60,10 +61,14 @@ stdenv.mkDerivation rec {
/usr/share/fonts/truetype/freefont ${freefont_ttf}/share/fonts/truetype
'';

# https://github.com/NixOS/nixpkgs/pull/35124#issuecomment-370552830
# - Touch plugins (plugins cache keyed off mtime and file size:
# https://github.com/NixOS/nixpkgs/pull/35124#issuecomment-370552830
# - Remove references to the Qt development headers (used in error messages)
postFixup = ''
find $out/lib/vlc/plugins -exec touch -d @1 '{}' ';'
$out/lib/vlc/vlc-cache-gen $out/vlc/plugins
remove-references-to -t "${qtbase.dev}" $out/lib/vlc/plugins/gui/libqt_plugin.so
'';

# Most of the libraries are auto-detected so we don't need to set a bunch of
Expand All @@ -72,6 +77,11 @@ stdenv.mkDerivation rec {
"--with-kde-solid=$out/share/apps/solid/actions"
] ++ optional onlyLibVLC "--disable-vlc";

# Remove runtime dependencies on libraries
postConfigure = ''
sed -i 's|^#define CONFIGURE_LINE.*$|#define CONFIGURE_LINE "<removed>"|g' config.h
'';

meta = with stdenv.lib; {
description = "Cross-platform media player and streaming server";
homepage = http://www.videolan.org/vlc/;
Expand Down

0 comments on commit aa4005f

Please sign in to comment.