1 { lib, stdenv, fetchurl, callPackage, ncurses, bash, gawk, gettext, pkg-config
4 name = "default-vimrc";
5 url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/68f6d131750aa778807119e03eed70286a17b1cb/trunk/archlinux.vim";
6 sha256 = "18ifhv5q9prd175q3vxbqf6qyvkk6bc7d2lhqdk0q78i68kv9y0c";
13 common = callPackage ./common.nix {};
18 inherit (common) version outputs src postPatch hardeningDisable enableParallelBuilding enableParallelInstalling postFixup meta;
20 nativeBuildInputs = [ gettext pkg-config ];
21 buildInputs = [ ncurses bash gawk ]
22 ++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa ];
29 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([
30 "vim_cv_toupper_broken=no"
33 "vim_cv_tgetent=zero" # it does on native anyway
34 "vim_cv_tty_group=tty"
35 "vim_cv_tty_mode=0660"
36 "vim_cv_getcwd_broken=no"
37 "vim_cv_stat_ignores_slash=yes"
38 "vim_cv_memmove_handles_overlap=yes"
39 ] ++ lib.optionals stdenv.hostPlatform.isFreeBSD [
40 "vim_cv_timer_create=no"
41 "vim_cv_timer_create_with_lrt=yes"
42 ] ++ lib.optionals (!stdenv.hostPlatform.isFreeBSD) [
43 "vim_cv_timer_create=yes"
46 # which.sh is used to for vim's own shebang patching, so make it find
47 # binaries for the host platform.
50 substituteInPlace src/which.sh --replace '$PATH' '$HOST_PATH'
54 ln -s $out/bin/vim $out/bin/vi
55 mkdir -p $out/share/vim
56 cp "${vimrc}" $out/share/vim/vimrc
58 # Prevent bugs in the upstream makefile from silently failing and missing outputs.
59 # Some of those are build-time requirements for other packages.
60 for tool in ex xxd vi view vimdiff; do
61 if [ ! -e "$out/bin/$tool" ]; then
62 echo "ERROR: install phase did not install '$tool'."
68 __impureHostDeps = [ "/dev/ptmx" ];