forked from mirrors/nixpkgs
vim_configurable example added. broken see comment.
svn path=/nixpkgs/trunk/; revision=9923
This commit is contained in:
parent
054d0e3076
commit
9a4e9e7a3b
66
pkgs/applications/editors/vim_configurable.nix
Normal file
66
pkgs/applications/editors/vim_configurable.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
rgs:
|
||||
let edf = args.lib.enableDisableFeature; in
|
||||
( args.mkDerivationByConfiguration {
|
||||
# most interpreters aren't tested yet.. (see python for example how to do it)
|
||||
flagConfig = {
|
||||
mandatory = { cfgOption = "--enable-gui=auto --with-features=${args.features}";
|
||||
buildInputs = ["ncurses" "pkgconfig"];
|
||||
};
|
||||
# x11 = { buildInputs = "x11"; };
|
||||
# using this flag does result in cannot find libXmu..
|
||||
X11 = { buildInputs = [ "x11" "libX11" "libXext" "libSM" "libXpm" "libXt" "libXaw" "libXau" "libXmu" ]; };
|
||||
|
||||
} // edf "darwin" "darwin" { } #Disable Darwin (Mac OS X) support.
|
||||
// edf "xsmp" "xsmp" { } #Disable XSMP session management
|
||||
// edf "xsmp_interact" "xsmp_interact" { } #Disable XSMP interaction
|
||||
// edf "mzscheme" "mzschemeinterp" { } #Include MzScheme interpreter.
|
||||
// edf "perl" "perlinterp" { } #Include Perl interpreter.
|
||||
// edf "python" "pythoninterp" { pass = "python"; } #Include Python interpreter.
|
||||
// edf "tcl" "tclinterp" { } #Include Tcl interpreter.
|
||||
// edf "ruby" "rubyinterp" { } #Include Ruby interpreter.
|
||||
// edf "cscope" "cscope" { } #Include cscope interface.
|
||||
// edf "workshop" "workshop" { } #Include Sun Visual Workshop support.
|
||||
// edf "netbeans" "netbeans" { } #Disable NetBeans integration support.
|
||||
// edf "sniff" "sniff" { } #Include Sniff interface.
|
||||
// edf "multibyte" "multibyte" { } #Include multibyte editing support.
|
||||
// edf "hangulinput" "hangulinput" { } #Include Hangul input support.
|
||||
// edf "xim" "xim" { pass = "xim"; } #Include XIM input support.
|
||||
// edf "fontset" "fontset" { } #Include X fontset output support.
|
||||
|
||||
#--enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon
|
||||
/*
|
||||
// edf "gtk_check" "gtk_check" { } #If auto-select GUI, check for GTK default=yes
|
||||
// edf "gtk2_check" "gtk2_check" { } #If GTK GUI, check for GTK+ 2 default=yes
|
||||
// edf "gnome_check" "gnome_check" { } #If GTK GUI, check for GNOME default=no
|
||||
// edf "motif_check" "motif_check" { } #If auto-select GUI, check for Motif default=yes
|
||||
// edf "athena_check" "athena_check" { } #If auto-select GUI, check for Athena default=yes
|
||||
// edf "nextaw_check" "nextaw_check" { } #If auto-select GUI, check for neXtaw default=yes
|
||||
// edf "carbon_check" "carbon_check" { } #If auto-select GUI, check for Carbon default=yes
|
||||
// edf "gtktest" "gtktest" { } #Do not try to compile and run a test GTK program
|
||||
*/
|
||||
// edf "acl" "acl" { } #Don't check for ACL support.
|
||||
// edf "gpm" "gpm" { } #Don't use gpm (Linux mouse daemon).
|
||||
// edf "nls" "nls" { } #Don't support NLS (gettext()).
|
||||
;
|
||||
|
||||
optionals = ["python"];
|
||||
|
||||
extraAttrs = co : {
|
||||
name = "vim_configurable-7.1.0";
|
||||
|
||||
|
||||
#configurePhase = "
|
||||
#set | grep python | grep flag
|
||||
#fail
|
||||
#";
|
||||
src = args.fetchurl {
|
||||
url = ftp://ftp.nluug.nl/pub/editors/vim/unix/vim-7.1.tar.bz2;
|
||||
sha256 = "0w6gy49gdbw7hby5rjkjpa7cdvc0z5iajsm4j1h8108rvfam22kz";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "The most popular clone of the VI editor";
|
||||
homepage = "www.vim.org";
|
||||
};
|
||||
};
|
||||
} ) args
|
|
@ -309,6 +309,9 @@ rec {
|
|||
collectAttrs = attr : catAttrs attr flatOptions;
|
||||
optsConcatStrs = delimiter : attrs : concatStrings
|
||||
( intersperse delimiter (flatten ( collectAttrs attrs ) ) );
|
||||
|
||||
ifStringGetArg = x : if (__isAttrs x) then x # ( TODO implement __isString ?)
|
||||
else avs x (__getAttr x args);
|
||||
|
||||
in assert ( all id ( mapRecordFlatten ( attr : r : if ( all id ( flatten (getAttr ["assertion"] [] r ) ) )
|
||||
then true else throw "assertion failed flag ${attr}" )
|
||||
|
@ -322,13 +325,15 @@ rec {
|
|||
|
||||
buildInputs = map ( attr: if (! hasAttr attr args) then throw "argument ${attr} is missing!" else (builtins.getAttr attr args) )
|
||||
(flatten (catAttrs "buildInputs" flatOptions));
|
||||
propagatedBuildInputs = map ( attr: if (! hasAttr attr args) then throw "argument ${attr} is missing!" else (builtins.getAttr attr args) )
|
||||
(flatten (catAttrs "propagatedBuildInputs" flatOptions));
|
||||
|
||||
configureFlags = optsConcatStrs " " "cfgOption";
|
||||
|
||||
#flags = listToAttrs (map ( flag: av flag (hasAttr flag options) ) (attrNames flagConfig) );
|
||||
flags_prefixed = listToAttrs (map ( flag: av ("flag_set_"+flag) (hasAttr flag options) ) (attrNames flagConfig) );
|
||||
|
||||
pass = mergeAttrs (flatten (collectAttrs "pass") );
|
||||
pass = mergeAttrs ( map ifStringGetArg ( flatten (collectAttrs "pass") ) );
|
||||
} # now add additional phase actions (see examples)
|
||||
// listToAttrs ( map ( x : av x (optsConcatStrs "\n" x) ) collectExtraPhaseActions ) );
|
||||
}
|
||||
|
@ -362,7 +367,8 @@ rec {
|
|||
# features:
|
||||
# * configure options are passed automatically
|
||||
# * buildInputs are collected (they are special, see the setup script)
|
||||
# * they can be passed by additional name as well using pass =
|
||||
# * they can be passed by additional name as well using pass = { inherit (args) python }
|
||||
# ( or short (value not attrs) : pass = "python" )
|
||||
# * an attribute named the same way as the flag is added indicating
|
||||
# true/ false (flag has been set/ not set)
|
||||
# * extra phase dependend commands can be added
|
||||
|
|
|
@ -4443,6 +4443,24 @@ rec {
|
|||
flags = ["hugeFeatures" "gtkGUI" "x11Support"];
|
||||
};
|
||||
|
||||
# gvim: error while loading shared libraries: libXmu.so.6: cannot open shared object file: No such file or directory
|
||||
# What's causing this?
|
||||
vim_configurable = import ../applications/editors/vim_configurable.nix {
|
||||
inherit fetchurl stdenv ncurses pkgconfig mkDerivationByConfiguration;
|
||||
inherit (xlibs) libX11 libXext libSM libXpm
|
||||
libXt libXaw libXau libXmu;
|
||||
inherit (gtkLibs) glib gtk;
|
||||
lib = lib_unstable;
|
||||
features = "huge"; # one of tiny, small, normal, big or huge
|
||||
# optional features by passing
|
||||
# python
|
||||
# TODO mzschemeinterp perlinterp
|
||||
inherit python /*x11*/;
|
||||
|
||||
# optional features by flags
|
||||
flags = [ "X11" ]; # only flag "X11" by now
|
||||
};
|
||||
|
||||
vlc = import ../applications/video/vlc {
|
||||
inherit fetchurl stdenv perl x11 wxGTK
|
||||
zlib mpeg2dec a52dec libmad ffmpeg
|
||||
|
|
Loading…
Reference in a new issue