From 8807140c8352883363c6505aa4dcae38317c578e Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 7 Jun 2024 07:31:44 +0000 Subject: [PATCH] neovim: fix cross to armv7l --- hosts/common/programs/neovim.nix | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/hosts/common/programs/neovim.nix b/hosts/common/programs/neovim.nix index ad9bdc2d..a0fc4f5f 100644 --- a/hosts/common/programs/neovim.nix +++ b/hosts/common/programs/neovim.nix @@ -14,7 +14,8 @@ let # docs: https://github.com/nvim-treesitter/nvim-treesitter # config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix # this is required for tree-sitter to even highlight - plugin = nvim-treesitter.withPlugins (_: nvim-treesitter.allGrammars ++ [ + # XXX(2024/06/03): `unison` removed because it doesn't cross compile + plugin = nvim-treesitter.withPlugins (_: (lib.filter (p: p.pname != "unison-grammar") nvim-treesitter.allGrammars) ++ [ # XXX: this is apparently not enough to enable syntax highlighting! # nvim-treesitter ships its own queries which may be distinct from e.g. helix. # the queries aren't included when i ship the grammar in this manner @@ -167,9 +168,27 @@ in vim.mpack.decode = vim.mpack.unpack vim.lpeg = require 'lpeg' " - '' + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - substituteInPlace runtime/CMakeLists.txt --replace-fail \ - 'COMMAND $' 'COMMAND ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} $' + '' + # + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # # required for x86_64 -> aarch64 (and probably armv7l too) + # substituteInPlace runtime/CMakeLists.txt --replace-fail \ + # 'COMMAND $' 'COMMAND ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} $' + # '' + + '' + # disable translations and syntax highlighting of .vim files because they don't cross x86_64 -> armv7l + substituteInPlace src/nvim/CMakeLists.txt --replace-fail \ + 'add_subdirectory(po)' '# add_subdirectory(po)' + # substituteInPlace src/nvim/po/CMakeLists.txt --replace-fail \ + # 'add_dependencies(nvim nvim_translations)' '# add_dependencies(nvim nvim_translations)' + substituteInPlace runtime/CMakeLists.txt \ + --replace-fail ' ''${GENERATED_SYN_VIM}' ' # ''${GENERATED_SYN_VIM}' \ + --replace-fail ' ''${GENERATED_HELP_TAGS}' ' # ''${GENERATED_HELP_TAGS}' \ + --replace-fail 'FILES ''${GENERATED_HELP_TAGS} ''${BUILDDOCFILES}' 'FILES ''${CMAKE_CURRENT_SOURCE_DIR}/nvim.desktop' \ + --replace-fail 'FILES ''${GENERATED_SYN_VIM}' 'FILES ''${CMAKE_CURRENT_SOURCE_DIR}/nvim.desktop' \ + --replace-fail 'if(''${PACKNAME}_DOC_FILES)' 'if(false)' + # --replace-fail ' ''${GENERATED_PACKAGE_TAGS}' ' # ''${GENERATED_PACKAGE_TAGS}' \ + # --replace-fail 'list(APPEND BUILDDOCFILES' '# list(APPEND BUILDDOCFILES' + # --replace-fail ' FILES ''${GENERATED_HELP_TAGS} ' ' FILES ' \ ''; }); in pkgs.wrapNeovimUnstable