forked from mirrors/nixpkgs
Merge vim fixes, all backports, mainly from #20237
The only difference from master now is that I kept on the 7.4 branch. (And I didn't touch plugins here, too.)
This commit is contained in:
commit
c859ea0821
15
pkgs/applications/editors/vim/cflags-prune.diff
Normal file
15
pkgs/applications/editors/vim/cflags-prune.diff
Normal file
|
@ -0,0 +1,15 @@
|
|||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 864f54b..fd85f76 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -2806,8 +2806,8 @@ auto/pathdef.c: Makefile auto/config.mk
|
||||
-@echo '#include "vim.h"' >> $@
|
||||
-@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' | $(QUOTESED) >> $@
|
||||
-@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' | $(QUOTESED) >> $@
|
||||
- -@echo 'char_u *all_cflags = (char_u *)"$(CC) -c -I$(srcdir) $(ALL_CFLAGS)";' | $(QUOTESED) >> $@
|
||||
- -@echo 'char_u *all_lflags = (char_u *)"$(CC) $(ALL_LIB_DIRS) $(LDFLAGS) -o $(VIMTARGET) $(ALL_LIBS) ";' | $(QUOTESED) >> $@
|
||||
+ -@echo 'char_u *all_cflags = (char_u *)"see nix-store --read-log $(out)";' | $(QUOTESED) >> $@
|
||||
+ -@echo 'char_u *all_lflags = (char_u *)"see nix-store --read-log $(out)";' | $(QUOTESED) >> $@
|
||||
-@echo 'char_u *compiled_user = (char_u *)"' | tr -d $(NL) >> $@
|
||||
-@if test -n "$(COMPILEDBY)"; then \
|
||||
echo "$(COMPILEDBY)" | tr -d $(NL) >> $@; \
|
30
pkgs/applications/editors/vim/common.nix
Normal file
30
pkgs/applications/editors/vim/common.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ lib, fetchFromGitHub }:
|
||||
rec {
|
||||
version = "7.4.2367";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vim";
|
||||
repo = "vim";
|
||||
rev = "v${version}";
|
||||
sha256 = "1r3a3sh1v4q2mc98j2izz9c5qc1a97vy49nv6644la0z2m92vyik";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
hardeningDisable = [ "fortify" ];
|
||||
|
||||
postPatch =
|
||||
# Use man from $PATH; escape sequences are still problematic.
|
||||
''
|
||||
substituteInPlace runtime/ftplugin/man.vim \
|
||||
--replace "/usr/bin/man " "man "
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "The most popular clone of the VI editor";
|
||||
homepage = http://www.vim.org;
|
||||
license = licenses.vim;
|
||||
maintainers = with maintainers; [ lovek323 ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
# TODO tidy up eg The patchelf code is patching gvim even if you don't build it..
|
||||
# but I have gvim with python support now :) - Marc
|
||||
args@{pkgs, source ? "default", fetchurl, fetchFromGitHub, stdenv, ncurses, pkgconfig, gettext
|
||||
, composableDerivation, lib, config, glib, gtk, python, perl, tcl, ruby
|
||||
args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, gettext
|
||||
, composableDerivation, writeText, lib, config, glib, gtk2, python, perl, tcl, ruby
|
||||
, libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu
|
||||
, libICE
|
||||
|
||||
|
@ -11,8 +11,9 @@ args@{pkgs, source ? "default", fetchurl, fetchFromGitHub, stdenv, ncurses, pkgc
|
|||
, ... }: with args;
|
||||
|
||||
|
||||
let inherit (args.composableDerivation) composableDerivation edf;
|
||||
nixosRuntimepath = pkgs.writeText "nixos-vimrc" ''
|
||||
let
|
||||
inherit (args.composableDerivation) composableDerivation edf;
|
||||
nixosRuntimepath = writeText "nixos-vimrc" ''
|
||||
set nocompatible
|
||||
syntax on
|
||||
|
||||
|
@ -37,25 +38,18 @@ let inherit (args.composableDerivation) composableDerivation edf;
|
|||
source /etc/vim/vimrc
|
||||
endif
|
||||
'';
|
||||
|
||||
common = callPackage ./common.nix {};
|
||||
in
|
||||
composableDerivation {
|
||||
} (fix: rec {
|
||||
|
||||
name = "vim_configurable-${version}";
|
||||
version = "7.4.826";
|
||||
|
||||
enableParallelBuilding = true; # test this
|
||||
inherit (common) version postPatch hardeningDisable enableParallelBuilding meta;
|
||||
|
||||
src =
|
||||
builtins.getAttr source {
|
||||
"default" =
|
||||
# latest release
|
||||
args.fetchFromGitHub {
|
||||
owner = "vim";
|
||||
repo = "vim";
|
||||
rev = "v${version}";
|
||||
sha256 = "04hp2gqbbj9h872bgj1g9xcaj5qlg9q45v6by2ch9n105dng9aj3";
|
||||
};
|
||||
src = builtins.getAttr source {
|
||||
"default" = common.src; # latest release
|
||||
|
||||
"vim-nox" =
|
||||
{
|
||||
|
@ -67,37 +61,27 @@ composableDerivation {
|
|||
}.src;
|
||||
};
|
||||
|
||||
prePatch = "cd src";
|
||||
|
||||
# if darwin support is enabled, we want to make sure we're not building with
|
||||
# OS-installed python framework
|
||||
patches = stdenv.lib.optionals
|
||||
(stdenv.isDarwin && (config.vim.darwin or true))
|
||||
[ ./python_framework.patch ];
|
||||
patches = [ ./cflags-prune.diff ];
|
||||
|
||||
configureFlags
|
||||
= [ "--enable-gui=${args.gui}" "--with-features=${args.features}" ];
|
||||
|
||||
nativeBuildInputs
|
||||
= [ ncurses pkgconfig gtk 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";
|
||||
};
|
||||
|
@ -111,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"
|
||||
|
@ -120,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"
|
||||
|
@ -178,28 +162,13 @@ 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}
|
||||
patchelf --set-rpath \
|
||||
"$(patchelf --print-rpath $out/bin/vim):${lib.makeLibraryPath buildInputs}" \
|
||||
"$out"/bin/{vim,gvim}
|
||||
|
||||
ln -sfn ${nixosRuntimepath} $out/share/vim/vimrc
|
||||
ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc
|
||||
'';
|
||||
|
||||
dontStrip = 1;
|
||||
|
||||
hardeningDisable = [ "fortify" ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "The most popular clone of the VI editor";
|
||||
homepage = http://www.vim.org;
|
||||
license = licenses.vim;
|
||||
maintainers = with maintainers; [ lovek323 ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
})
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, fetchFromGitHub, fetchurl, ncurses, gettext, pkgconfig
|
||||
{ stdenv, fetchurl, callPackage, ncurses, gettext, pkgconfig
|
||||
# default vimrc
|
||||
, vimrc ? fetchurl {
|
||||
name = "default-vimrc";
|
||||
|
@ -8,18 +8,13 @@
|
|||
# apple frameworks
|
||||
, Carbon, Cocoa }:
|
||||
|
||||
let
|
||||
common = callPackage ./common.nix {};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "vim-${version}";
|
||||
version = "7.4.1585";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vim";
|
||||
repo = "vim";
|
||||
rev = "v${version}";
|
||||
sha256 = "1kjdwpka269i4cyl0rmnmzg23dl26g65k26h32w8ayzfm3kbj123";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
inherit (common) version src postPatch hardeningDisable enableParallelBuilding meta;
|
||||
|
||||
buildInputs = [ ncurses pkgconfig ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ Carbon Cocoa ];
|
||||
|
@ -30,8 +25,6 @@ stdenv.mkDerivation rec {
|
|||
"--enable-nls"
|
||||
];
|
||||
|
||||
hardeningDisable = [ "fortify" ];
|
||||
|
||||
postInstall = ''
|
||||
ln -s $out/bin/vim $out/bin/vi
|
||||
mkdir -p $out/share/vim
|
||||
|
@ -62,12 +55,4 @@ stdenv.mkDerivation rec {
|
|||
# patchPhase = ''
|
||||
# sed -i -e 's/as_fn_error.*int32.*/:/' src/auto/configure
|
||||
# '';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "The most popular clone of the VI editor";
|
||||
homepage = http://www.vim.org;
|
||||
license = licenses.vim;
|
||||
maintainers = with maintainers; [ lovek323 ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
--- a/auto/configure
|
||||
+++ b/auto/configure
|
||||
@@ -5895,13 +5895,6 @@
|
||||
eof
|
||||
eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
|
||||
rm -f -- "${tmp_mkf}"
|
||||
- if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
|
||||
- "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
|
||||
- vi_cv_path_python_plibs="-framework Python"
|
||||
- if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
|
||||
- vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
|
||||
- fi
|
||||
- else
|
||||
if test "${vi_cv_var_python_version}" = "1.4"; then
|
||||
vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
|
||||
else
|
||||
@@ -5921,7 +5914,6 @@
|
||||
vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
|
||||
vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
|
||||
|
||||
-fi
|
||||
|
||||
if ${vi_cv_dll_name_python+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
Loading…
Reference in a new issue