diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index ec3e7c9a6253..d9abd14e2e51 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -14,6 +14,8 @@ url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/68f6d131750aa778807119e03eed70286a17b1cb/trunk/archlinux.vim"; sha256 = "18ifhv5q9prd175q3vxbqf6qyvkk6bc7d2lhqdk0q78i68kv9y0c"; }, + # TODO: Clean up on `staging` + llvmPackages, }: let @@ -37,6 +39,10 @@ stdenv.mkDerivation { nativeBuildInputs = [ gettext pkg-config + ] + # TODO: Clean up on `staging`. + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.lld ]; buildInputs = [ ncurses @@ -44,6 +50,13 @@ stdenv.mkDerivation { gawk ]; + # workaround for ld64 hardening issue + # + # TODO: Clean up on `staging` + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_CFLAGS_COMPILE = "-fuse-ld=lld"; + }; + strictDeps = true; configureFlags = [ diff --git a/pkgs/applications/editors/vim/full.nix b/pkgs/applications/editors/vim/full.nix index a2a105e3182c..f07960cf950c 100644 --- a/pkgs/applications/editors/vim/full.nix +++ b/pkgs/applications/editors/vim/full.nix @@ -48,6 +48,9 @@ darwinSupport ? config.vim.darwin or false, # Enable Darwin support ftNixSupport ? config.vim.ftNix or true, # Add nix indentation support from vim-nix (not needed for basic syntax highlighting) sodiumSupport ? config.vim.sodium or true, # Enable sodium based encryption + + # TODO: Clean up on `staging` + llvmPackages, }: let @@ -169,7 +172,9 @@ stdenv.mkDerivation { ++ lib.optional nlsSupport gettext ++ lib.optional perlSupport perl ++ lib.optional (guiSupport == "gtk3") wrapGAppsHook3 - ++ lib.optional waylandSupport wayland-scanner; + ++ lib.optional waylandSupport wayland-scanner + # TODO: Clean up on `staging` + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.lld; buildInputs = [ ncurses @@ -196,7 +201,10 @@ stdenv.mkDerivation { ++ lib.optional sodiumSupport libsodium; # error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-fdeclspec"; + # workaround for ld64 hardening issue + # + # TODO: Clean up on `staging` + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-fdeclspec -fuse-ld=lld"; preConfigure = lib.optionalString ftNixSupport '' cp ${vimPlugins.vim-nix.src}/ftplugin/nix.vim runtime/ftplugin/nix.vim diff --git a/pkgs/applications/editors/vim/macvim.nix b/pkgs/applications/editors/vim/macvim.nix index 36e22ddc2b0a..9e48750c0b0a 100644 --- a/pkgs/applications/editors/vim/macvim.nix +++ b/pkgs/applications/editors/vim/macvim.nix @@ -17,6 +17,8 @@ # This can be set to one of the `darwin.xcode_*` packages as well. # If set, this should be a path to Xcode.app, e.g. `"/Applications/Xcode.app"`. withXcodePath ? null, + # TODO: Clean up on `staging` + llvmPackages, }: # Try to match MacVim's documented script interface compatibility @@ -48,6 +50,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config + # TODO: Clean up on `staging` + llvmPackages.lld ]; buildInputs = [ # MacVim references up to MAC_OS_VERSION_14_0 in its source @@ -188,7 +192,8 @@ stdenv.mkDerivation (finalAttrs: { # macvim obj-c log macro triggers -Wformat-security (seems like a bug? it's a string literal!) hardeningDisable = common.hardeningDisable ++ [ "format" ]; # os_log also enables -Werror,-Wformat by default - env.NIX_CFLAGS_COMPILE = "-DOS_LOG_FORMAT_WARNINGS"; + # TODO: Clean up on `staging` + env.NIX_CFLAGS_COMPILE = "-DOS_LOG_FORMAT_WARNINGS -fuse-ld=lld"; # We rely on the user's Xcode install to build. It may be located in an arbitrary place, and # it's not clear what system-level components it may require, so for now we'll just allow full