summary refs log tree commit diff
path: root/pkgs/applications/editors/vim
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-08-28 21:14:22 +0200
committerGitHub <noreply@github.com>2018-08-28 21:14:22 +0200
commitc66c46943380a2f09df07c913098f5feeae5c6cf (patch)
tree6d23658da0e0536be541699e542a8aed0309d557 /pkgs/applications/editors/vim
parent776cb2f7b5bedccd8f0def789b6bc9adbd3835bb (diff)
parentcfc3d7c9181f543ddb2cf4aa61112957f58e4a4a (diff)
downloadnixpkgs-c66c46943380a2f09df07c913098f5feeae5c6cf.tar
nixpkgs-c66c46943380a2f09df07c913098f5feeae5c6cf.tar.gz
nixpkgs-c66c46943380a2f09df07c913098f5feeae5c6cf.tar.bz2
nixpkgs-c66c46943380a2f09df07c913098f5feeae5c6cf.tar.lz
nixpkgs-c66c46943380a2f09df07c913098f5feeae5c6cf.tar.xz
nixpkgs-c66c46943380a2f09df07c913098f5feeae5c6cf.tar.zst
nixpkgs-c66c46943380a2f09df07c913098f5feeae5c6cf.zip
Merge pull request #45352 from LnL7/darwin-vim-x11
vim_configurable: fix darwin build with guiSupport
Diffstat (limited to 'pkgs/applications/editors/vim')
-rw-r--r--pkgs/applications/editors/vim/configurable.nix25
1 files changed, 12 insertions, 13 deletions
diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix
index 2f2c787ffac..7ee28adfa47 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -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@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, gettext
-, writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby
+{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, gettext
+, writeText, config, glib, gtk2, gtk3, lua, python, perl, tcl, ruby
 , libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu
 , libICE
 , vimPlugins
@@ -13,7 +13,7 @@ args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, ge
 
 , features          ? "huge" # One of tiny, small, normal, big or huge
 , wrapPythonDrv     ? false
-, guiSupport        ? config.vim.gui or "auto"
+, guiSupport        ? config.vim.gui or "gtk3"
 , luaSupport        ? config.vim.lua or true
 , perlSupport       ? config.vim.perl or false      # Perl interpreter
 , pythonSupport     ? config.vim.python or true     # Python interpreter
@@ -24,11 +24,10 @@ args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, ge
 , cscopeSupport     ? config.vim.cscope or true     # Enable cscope interface
 , netbeansSupport   ? config.netbeans or true       # Enable NetBeans integration support.
 , ximSupport        ? config.vim.xim or true        # less than 15KB, needed for deadkeys
-# 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) # Enable Darwin support
+, darwinSupport     ? config.vim.darwin or false    # Enable Darwin support
 , ftNixSupport      ? config.vim.ftNix or true      # Add .nix filetype detection and minimal syntax highlighting support
-, ... }: with args;
+, ...
+}:
 
 
 let
@@ -99,8 +98,10 @@ in stdenv.mkDerivation rec {
     "--disable-carbon_check"
     "--disable-gtktest"
   ]
+  ++ stdenv.lib.optional stdenv.isDarwin
+     (if darwinSupport then "--enable-darwin" else "--disable-darwin")
   ++ stdenv.lib.optionals luaSupport [
-    "--with-lua-prefix=${args.lua}"
+    "--with-lua-prefix=${lua}"
     "--enable-luainterp"
   ]
   ++ stdenv.lib.optionals pythonSupport [
@@ -128,7 +129,8 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [ ncurses libX11 libXext libSM libXpm libXt libXaw libXau
     libXmu glib libICE ]
-    ++ (if guiSupport == "gtk3" then [gtk3] else [gtk2])
+    ++ stdenv.lib.optional (guiSupport == "gtk2") gtk2
+    ++ stdenv.lib.optional (guiSupport == "gtk3") gtk3
     ++ stdenv.lib.optionals darwinSupport [ CoreServices CoreData Cocoa Foundation libobjc cf-private ]
     ++ stdenv.lib.optional luaSupport lua
     ++ stdenv.lib.optional pythonSupport python
@@ -142,13 +144,10 @@ in stdenv.mkDerivation rec {
       cp ${vimPlugins.vim-nix.src}/syntax/nix.vim runtime/syntax/nix.vim
     '';
 
-  NIX_LDFLAGS = stdenv.lib.optionalString (darwinSupport && stdenv.isDarwin)
-    "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation";
-
   postInstall = ''
   '' + stdenv.lib.optionalString stdenv.isLinux ''
     patchelf --set-rpath \
-      "$(patchelf --print-rpath $out/bin/vim):${lib.makeLibraryPath buildInputs}" \
+      "$(patchelf --print-rpath $out/bin/vim):${stdenv.lib.makeLibraryPath buildInputs}" \
       "$out"/bin/{vim,gvim}
 
     ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc