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