diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-11-07 15:45:48 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-11-07 18:55:21 +0100 |
commit | 51feecbe88742dd4496c96981d1a87a12c1022e7 (patch) | |
tree | a66ca974693fecf5604247b84300f92bcbf9bf6c /pkgs/applications/editors/vim/configurable.nix | |
parent | 1667046505070067884668e0f2b96aab4c193165 (diff) | |
download | nixlib-51feecbe88742dd4496c96981d1a87a12c1022e7.tar nixlib-51feecbe88742dd4496c96981d1a87a12c1022e7.tar.gz nixlib-51feecbe88742dd4496c96981d1a87a12c1022e7.tar.bz2 nixlib-51feecbe88742dd4496c96981d1a87a12c1022e7.tar.lz nixlib-51feecbe88742dd4496c96981d1a87a12c1022e7.tar.xz nixlib-51feecbe88742dd4496c96981d1a87a12c1022e7.tar.zst nixlib-51feecbe88742dd4496c96981d1a87a12c1022e7.zip |
vim_configurable: misc improvements
- fix wrongly used *native* build inputs; - remove confusing `prePatch = "cd src";` ; - adapt RPATH handling to multiple-output changes; - don't list full compiler flags in vim --version, as that would keep references to -dev paths. Together, the closure of the default feature-set drops almost by 100 MB. The lean vim attribute would *not* lose any references due to patching --version, so we only apply it for vim_configurable.
Diffstat (limited to 'pkgs/applications/editors/vim/configurable.nix')
-rw-r--r-- | pkgs/applications/editors/vim/configurable.nix | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index dc7fa3fa3984..793f554970f3 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -61,31 +61,27 @@ composableDerivation { }.src; }; - prePatch = "cd src"; + patches = [ ./cflags-prune.diff ]; configureFlags = [ "--enable-gui=${args.gui}" "--with-features=${args.features}" ]; - nativeBuildInputs - = [ ncurses pkgconfig gtk2 libX11 libXext libSM libXpm libXt libXaw libXau + nativeBuildInputs = [ pkgconfig ]; + + buildInputs + = [ ncurses gtk2 libX11 libXext libSM libXpm libXt libXaw libXau libXmu glib libICE ]; # most interpreters aren't tested yet.. (see python for example how to do it) flags = { ftNix = { - # because we cd to src in the main patch phase, we can't just add this - # patch to the list, we have to apply it manually - postPatch = '' - cd ../runtime - patch -p2 < ${./ft-nix-support.patch} - cd .. - ''; + patches = [ ./ft-nix-support.patch ]; }; } // edf { name = "darwin"; enable = { - nativeBuildInputs = [ CoreServices CoreData Cocoa Foundation libobjc cf-private ]; + buildInputs = [ CoreServices CoreData Cocoa Foundation libobjc cf-private ]; NIX_LDFLAGS = stdenv.lib.optional stdenv.isDarwin "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"; }; @@ -99,7 +95,7 @@ composableDerivation { name = "python"; feat = "python${if python ? isPy3 then "3" else ""}interp"; enable = { - nativeBuildInputs = [ python ]; + buildInputs = [ python ]; } // lib.optionalAttrs stdenv.isDarwin { configureFlags = [ "--enable-python${if python ? isPy3 then "3" else ""}interp=yes" @@ -108,13 +104,13 @@ composableDerivation { }; } - // edf { name = "tcl"; feat = "tclinterp"; enable = { nativeBuildInputs = [tcl]; }; } #Include Tcl interpreter. - // edf { name = "ruby"; feat = "rubyinterp"; enable = { nativeBuildInputs = [ruby]; };} #Include Ruby interpreter. + // edf { name = "tcl"; feat = "tclinterp"; enable = { buildInputs = [tcl]; }; } #Include Tcl interpreter. + // edf { name = "ruby"; feat = "rubyinterp"; enable = { buildInputs = [ruby]; };} #Include Ruby interpreter. // edf { name = "lua"; feat = "luainterp"; enable = { - nativeBuildInputs = [lua]; + buildInputs = [lua]; configureFlags = [ "--with-lua-prefix=${args.lua}" "--enable-luainterp" @@ -166,16 +162,11 @@ composableDerivation { */ postInstall = stdenv.lib.optionalString stdenv.isLinux '' - rpath=`patchelf --print-rpath $out/bin/vim`; - for i in $nativeBuildInputs; do - echo adding $i/lib - rpath=$rpath:$i/lib - done - echo $nativeBuildInputs - echo $rpath - patchelf --set-rpath $rpath $out/bin/{vim,gvim} - - ln -sfn ${nixosRuntimepath} $out/share/vim/vimrc + patchelf --set-rpath \ + "$(patchelf --print-rpath $out/bin/vim):${lib.makeLibraryPath buildInputs}" \ + "$out"/bin/{vim,gvim} + + ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc ''; dontStrip = 1; |