Merge pull request #617 from lovek323/vim_configurable

Get vim_configurable compiling on darwin
This commit is contained in:
Michael Raskin 2013-06-13 05:41:12 -07:00
commit c7536d2fa6
7 changed files with 56 additions and 33 deletions

View File

@ -4,7 +4,12 @@ args@{source ? "latest", ...}: with args;
let inherit (args.composableDerivation) composableDerivation edf; in
composableDerivation {} (fix: {
composableDerivation {
# use gccApple to compile on darwin
mkDerivation = ( if stdenv.isDarwin
then stdenvAdapters.overrideGCC stdenv gccApple
else stdenv ).mkDerivation;
} (fix: {
name = "vim_configurable-7.3";
@ -37,9 +42,9 @@ composableDerivation {} (fix: {
configureFlags = ["--enable-gui=auto" "--with-features=${args.features}"];
nativeBuildInputs = [ncurses pkgconfig]
++ [ gtk libX11 libXext libSM libXpm libXt libXaw libXau libXmu glib
libICE ];
nativeBuildInputs
= [ ncurses pkgconfig gtk 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 = {
@ -71,14 +76,18 @@ composableDerivation {} (fix: {
cfg = {
pythonSupport = config.vim.python or true;
darwinSupport = config.vim.darwin or false;
nlsSupport = config.vim.nls or false;
tclSupport = config.vim.tcl or false;
multibyteSupport = config.vim.multibyte or false;
cscopeSupport = config.vim.cscope or false;
netbeansSupport = config.netbeans or true; # eg envim is using it
# by default, compile with darwin support if we're compiling on darwin, but
# allow this to be disabled by setting config.vim.darwin to false
darwinSupport = stdenv.isDarwin && (config.vim.darwin or true);
# add .nix filetype detection and minimal syntax highlighting support
ftNixSupport = config.vim.ftNix or true;
netbeansSupport = config.netbeans or true; # eg envim is using it
};
#--enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon
@ -93,22 +102,23 @@ composableDerivation {} (fix: {
// edf "gtktest" "gtktest" { } #Do not try to compile and run a test GTK program
*/
postInstall = "
rpath=`patchelf --print-rpath \$out/bin/vim`;
for i in \$nativeBuildInputs; do
echo adding \$i/lib
rpath=\$rpath:\$i/lib
postInstall = if stdenv.isLinux then ''
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}
";
dontStrip =1;
echo $nativeBuildInputs
echo $rpath
patchelf --set-rpath $rpath $out/bin/{vim,gvim}
'' else "";
dontStrip = 1;
meta = {
description = "The most popular clone of the VI editor";
homepage = "www.vim.org";
homepage = "www.vim.org";
platforms = lib.platforms.unix;
};
})

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, perl, glib }:
{ stdenv, fetchurl, pkgconfig, perl, glib, libintlOrEmpty }:
stdenv.mkDerivation rec {
name = "atk-2.6.0";
@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
sha256 = "eff663f90847620bb68c9c2cbaaf7f45e2ff44163b9ab3f10d15be763680491f";
};
buildInputs = libintlOrEmpty;
nativeBuildInputs = [ pkgconfig perl ];
propagatedBuildInputs = [ glib ];

View File

@ -33,6 +33,8 @@ stdenv.mkDerivation rec {
stdenv.lib.optional postscriptSupport zlib ++
stdenv.lib.optional pngSupport libpng;
NIX_CFLAGS_COMPILE = "-I${pixman}/include/pixman-1";
configureFlags =
[ "--enable-tee" ]
++ stdenv.lib.optional xcbSupport "--enable-xcb"

View File

@ -1,4 +1,5 @@
{ stdenv, fetchurl, pkgconfig, glib, libtiff, libjpeg, libpng, libX11, xz, jasper }:
{ stdenv, fetchurl, pkgconfig, glib, libtiff, libjpeg, libpng, libX11, xz
, jasper, libintlOrEmpty }:
stdenv.mkDerivation rec {
name = "gdk-pixbuf-2.26.1";
@ -9,7 +10,7 @@ stdenv.mkDerivation rec {
};
# !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
buildInputs = [ libX11 ];
buildInputs = [ libX11 libintlOrEmpty ];
nativeBuildInputs = [ pkgconfig ];

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, glib, atk, pango, cairo, perl, xlibs
, gdk_pixbuf, xz
, gdk_pixbuf, xz, libintlOrEmpty
, xineramaSupport ? true
, cupsSupport ? true, cups ? null
}:
@ -17,12 +17,14 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
NIX_CFLAGS_COMPILE = "-I${cairo}/include/cairo";
nativeBuildInputs = [ perl pkgconfig ];
propagatedBuildInputs =
[ xlibs.xlibs glib atk pango gdk_pixbuf cairo
xlibs.libXrandr xlibs.libXrender xlibs.libXcomposite xlibs.libXi
]
xlibs.libXrandr xlibs.libXrender xlibs.libXcomposite xlibs.libXi ]
++ libintlOrEmpty
++ stdenv.lib.optional xineramaSupport xlibs.libXinerama
++ stdenv.lib.optionals cupsSupport [ cups ];

View File

@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
sha256 = "3a8c061e143c272ddcd5467b3567e970cfbb64d1d1600a8f8e62435556220cbe";
};
NIX_CFLAGS_COMPILE = "-I${cairo}/include/cairo";
buildInputs = stdenv.lib.optionals stdenv.isDarwin [ gettext fontconfig ];
nativeBuildInputs = [ pkgconfig ];

View File

@ -4089,7 +4089,9 @@ let
gdk_pixbuf = callPackage ../development/libraries/gdk-pixbuf/2.26.x.nix { };
gtk2 = callPackage ../development/libraries/gtk+/2.24.x.nix { };
gtk2 = callPackage ../development/libraries/gtk+/2.24.x.nix {
cupsSupport = config.gtk2.cups or true;
};
gtk3 = lowPrio (callPackage ../development/libraries/gtk+/3.2.x.nix { });
gtk = pkgs.gtk2;
@ -8234,18 +8236,20 @@ let
vimHugeX = vim_configurable;
vim_configurable = callPackage (import ../applications/editors/vim/configurable.nix) {
inherit (pkgs) fetchurl stdenv ncurses pkgconfig gettext composableDerivation lib config;
inherit (pkgs.xlibs) libX11 libXext libSM libXpm libXt libXaw libXau libXmu libICE;
inherit (pkgs) glib gtk;
vim_configurable = callPackage ../applications/editors/vim/configurable.nix {
inherit (pkgs) fetchurl stdenv ncurses pkgconfig gettext
composableDerivation lib config glib gtk python perl tcl ruby;
inherit (pkgs.xlibs) libX11 libXext libSM libXpm libXt libXaw libXau libXmu
libICE;
features = "huge"; # one of tiny, small, normal, big or huge
# optional features by passing
# python
# TODO mzschemeinterp perlinterp
inherit (pkgs) python perl tcl ruby /*x11*/;
lua = pkgs.lua5;
# optional features by flags
flags = [ "python" "X11" ]; # only flag "X11" by now
# so that we can use gccApple if we're building on darwin
inherit stdenvAdapters gccApple;
};
vimLatest = vim_configurable.override { source = "latest"; };
vimNox = vim_configurable.override { source = "vim-nox"; };