Merge pull request #45352 from LnL7/darwin-vim-x11

vim_configurable: fix darwin build with guiSupport

authored by Daiderd Jordan and committed by GitHub c66c4694 776cb2f7

+18 -15
+12 -13
pkgs/applications/editors/vim/configurable.nix
··· 1 # TODO tidy up eg The patchelf code is patching gvim even if you don't build it.. 2 # but I have gvim with python support now :) - Marc 3 - args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, gettext 4 - , writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby 5 , libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu 6 , libICE 7 , vimPlugins ··· 13 14 , features ? "huge" # One of tiny, small, normal, big or huge 15 , wrapPythonDrv ? false 16 - , guiSupport ? config.vim.gui or "auto" 17 , luaSupport ? config.vim.lua or true 18 , perlSupport ? config.vim.perl or false # Perl interpreter 19 , pythonSupport ? config.vim.python or true # Python interpreter ··· 24 , cscopeSupport ? config.vim.cscope or true # Enable cscope interface 25 , netbeansSupport ? config.netbeans or true # Enable NetBeans integration support. 26 , ximSupport ? config.vim.xim or true # less than 15KB, needed for deadkeys 27 - # By default, compile with darwin support if we're compiling on darwin, but 28 - # allow this to be disabled by setting config.vim.darwin to false 29 - , darwinSupport ? stdenv.isDarwin && (config.vim.darwin or true) # Enable Darwin support 30 , ftNixSupport ? config.vim.ftNix or true # Add .nix filetype detection and minimal syntax highlighting support 31 - , ... }: with args; 32 33 34 let ··· 99 "--disable-carbon_check" 100 "--disable-gtktest" 101 ] 102 ++ stdenv.lib.optionals luaSupport [ 103 - "--with-lua-prefix=${args.lua}" 104 "--enable-luainterp" 105 ] 106 ++ stdenv.lib.optionals pythonSupport [ ··· 128 129 buildInputs = [ ncurses libX11 libXext libSM libXpm libXt libXaw libXau 130 libXmu glib libICE ] 131 - ++ (if guiSupport == "gtk3" then [gtk3] else [gtk2]) 132 ++ stdenv.lib.optionals darwinSupport [ CoreServices CoreData Cocoa Foundation libobjc cf-private ] 133 ++ stdenv.lib.optional luaSupport lua 134 ++ stdenv.lib.optional pythonSupport python ··· 142 cp ${vimPlugins.vim-nix.src}/syntax/nix.vim runtime/syntax/nix.vim 143 ''; 144 145 - NIX_LDFLAGS = stdenv.lib.optionalString (darwinSupport && stdenv.isDarwin) 146 - "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"; 147 - 148 postInstall = '' 149 '' + stdenv.lib.optionalString stdenv.isLinux '' 150 patchelf --set-rpath \ 151 - "$(patchelf --print-rpath $out/bin/vim):${lib.makeLibraryPath buildInputs}" \ 152 "$out"/bin/{vim,gvim} 153 154 ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc
··· 1 # TODO tidy up eg The patchelf code is patching gvim even if you don't build it.. 2 # but I have gvim with python support now :) - Marc 3 + { source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, gettext 4 + , writeText, config, glib, gtk2, gtk3, lua, python, perl, tcl, ruby 5 , libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu 6 , libICE 7 , vimPlugins ··· 13 14 , features ? "huge" # One of tiny, small, normal, big or huge 15 , wrapPythonDrv ? false 16 + , guiSupport ? config.vim.gui or "gtk3" 17 , luaSupport ? config.vim.lua or true 18 , perlSupport ? config.vim.perl or false # Perl interpreter 19 , pythonSupport ? config.vim.python or true # Python interpreter ··· 24 , cscopeSupport ? config.vim.cscope or true # Enable cscope interface 25 , netbeansSupport ? config.netbeans or true # Enable NetBeans integration support. 26 , ximSupport ? config.vim.xim or true # less than 15KB, needed for deadkeys 27 + , darwinSupport ? config.vim.darwin or false # Enable Darwin support 28 , ftNixSupport ? config.vim.ftNix or true # Add .nix filetype detection and minimal syntax highlighting support 29 + , ... 30 + }: 31 32 33 let ··· 98 "--disable-carbon_check" 99 "--disable-gtktest" 100 ] 101 + ++ stdenv.lib.optional stdenv.isDarwin 102 + (if darwinSupport then "--enable-darwin" else "--disable-darwin") 103 ++ stdenv.lib.optionals luaSupport [ 104 + "--with-lua-prefix=${lua}" 105 "--enable-luainterp" 106 ] 107 ++ stdenv.lib.optionals pythonSupport [ ··· 129 130 buildInputs = [ ncurses libX11 libXext libSM libXpm libXt libXaw libXau 131 libXmu glib libICE ] 132 + ++ stdenv.lib.optional (guiSupport == "gtk2") gtk2 133 + ++ stdenv.lib.optional (guiSupport == "gtk3") gtk3 134 ++ stdenv.lib.optionals darwinSupport [ CoreServices CoreData Cocoa Foundation libobjc cf-private ] 135 ++ stdenv.lib.optional luaSupport lua 136 ++ stdenv.lib.optional pythonSupport python ··· 144 cp ${vimPlugins.vim-nix.src}/syntax/nix.vim runtime/syntax/nix.vim 145 ''; 146 147 postInstall = '' 148 '' + stdenv.lib.optionalString stdenv.isLinux '' 149 patchelf --set-rpath \ 150 + "$(patchelf --print-rpath $out/bin/vim):${stdenv.lib.makeLibraryPath buildInputs}" \ 151 "$out"/bin/{vim,gvim} 152 153 ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc
+6 -2
pkgs/top-level/all-packages.nix
··· 9767 inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; 9768 }; 9769 9770 gtkmm2 = callPackage ../development/libraries/gtkmm/2.x.nix { }; 9771 gtkmm3 = callPackage ../development/libraries/gtkmm/3.x.nix { }; 9772 ··· 18986 vim_configurable = vimUtils.makeCustomizable (callPackage ../applications/editors/vim/configurable.nix { 18987 inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData; 18988 inherit (darwin) libobjc cf-private; 18989 - inherit lua; 18990 gtk2 = if stdenv.isDarwin then gtk2-x11 else gtk2; 18991 - guiSupport = if stdenv.isDarwin then "gtk2" else "gtk3"; 18992 }); 18993 18994 qpdfview = libsForQt5.callPackage ../applications/misc/qpdfview {};
··· 9767 inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; 9768 }; 9769 9770 + # On darwin gtk uses cocoa by default instead of x11. 9771 + gtk3-x11 = gtk3.override { 9772 + x11Support = true; 9773 + }; 9774 + 9775 gtkmm2 = callPackage ../development/libraries/gtkmm/2.x.nix { }; 9776 gtkmm3 = callPackage ../development/libraries/gtkmm/3.x.nix { }; 9777 ··· 18991 vim_configurable = vimUtils.makeCustomizable (callPackage ../applications/editors/vim/configurable.nix { 18992 inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData; 18993 inherit (darwin) libobjc cf-private; 18994 gtk2 = if stdenv.isDarwin then gtk2-x11 else gtk2; 18995 + gtk3 = if stdenv.isDarwin then gtk3-x11 else gtk3; 18996 }); 18997 18998 qpdfview = libsForQt5.callPackage ../applications/misc/qpdfview {};