From a50807e1b8b02919a18d0d0d182fe7dd0201059d Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 19 Aug 2018 21:39:10 +0200 Subject: [PATCH 1/4] vim_configurable: fix lua reference --- pkgs/applications/editors/vim/configurable.nix | 11 ++++++----- pkgs/top-level/all-packages.nix | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 3711b3cdcee..6c20ac8bd08 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 @@ -28,7 +28,8 @@ args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, ge # allow this to be disabled by setting config.vim.darwin to false , darwinSupport ? stdenv.isDarwin && (config.vim.darwin or true) # Enable Darwin support , ftNixSupport ? config.vim.ftNix or true # Add .nix filetype detection and minimal syntax highlighting support -, ... }: with args; +, ... +}: let @@ -100,7 +101,7 @@ in stdenv.mkDerivation rec { "--disable-gtktest" ] ++ stdenv.lib.optionals luaSupport [ - "--with-lua-prefix=${args.lua}" + "--with-lua-prefix=${lua}" "--enable-luainterp" ] ++ stdenv.lib.optionals pythonSupport [ @@ -148,7 +149,7 @@ in stdenv.mkDerivation rec { 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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 37bbf0ed0c8..99e2fb9cf97 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18836,7 +18836,6 @@ with pkgs; vim_configurable = vimUtils.makeCustomizable (callPackage ../applications/editors/vim/configurable.nix { inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData; inherit (darwin) libobjc cf-private; - inherit lua; gtk2 = if stdenv.isDarwin then gtk2-x11 else gtk2; guiSupport = if stdenv.isDarwin then "gtk2" else "gtk3"; }); From 8a6064a526c98cf6daf51f8c02e961098f6b792e Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 19 Aug 2018 21:41:15 +0200 Subject: [PATCH 2/4] vim_configurable: make gtk optional Using vim_configurable.override { guiSupport = "no"; } would still pull in gtk2 as a dependency. --- pkgs/applications/editors/vim/configurable.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 6c20ac8bd08..d0d0089dbcc 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -129,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 From e2ef32765246fa226e88f5ba22d281ee4396e1af Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 19 Aug 2018 21:52:51 +0200 Subject: [PATCH 3/4] vim_configurable: disable darwinSupport by default Using gtk + darwin support seems broken at the moment, we probably want guiSupport = "carbon" instead but that doesn't work and something like macvim is probably better for that. This fixes the build while keeping guiSupport enabled which might be desirable for eg. +clientserver. Fixes #45025 --- pkgs/applications/editors/vim/configurable.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index d0d0089dbcc..73db70880f1 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -24,9 +24,7 @@ , 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 , ... }: @@ -100,6 +98,8 @@ 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=${lua}" "--enable-luainterp" @@ -144,9 +144,6 @@ 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 \ From cfc3d7c9181f543ddb2cf4aa61112957f58e4a4a Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 19 Aug 2018 22:43:52 +0200 Subject: [PATCH 4/4] vim_configurable: use gtk3 on darwin --- pkgs/applications/editors/vim/configurable.nix | 2 +- pkgs/top-level/all-packages.nix | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 73db70880f1..0945b4e4570 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -13,7 +13,7 @@ , 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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 99e2fb9cf97..59c4ed9d6ba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9682,6 +9682,11 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; }; + # On darwin gtk uses cocoa by default instead of x11. + gtk3-x11 = gtk3.override { + x11Support = true; + }; + gtkmm2 = callPackage ../development/libraries/gtkmm/2.x.nix { }; gtkmm3 = callPackage ../development/libraries/gtkmm/3.x.nix { }; @@ -18837,7 +18842,7 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData; inherit (darwin) libobjc cf-private; gtk2 = if stdenv.isDarwin then gtk2-x11 else gtk2; - guiSupport = if stdenv.isDarwin then "gtk2" else "gtk3"; + gtk3 = if stdenv.isDarwin then gtk3-x11 else gtk3; }); qpdfview = libsForQt5.callPackage ../applications/misc/qpdfview {};