vimPlugins.cord-nvim: 1.0.0 -> 2.2.3 (#394629)

authored by Gaétan Lepage and committed by GitHub 625d3cc6 3e0daa11

+36 -35
+36 -35
pkgs/applications/editors/vim/plugins/non-generated/cord-nvim/default.nix
··· 1 { 2 lib, 3 - stdenv, 4 fetchFromGitHub, 5 nix-update-script, 6 - rustPlatform, 7 vimUtils, 8 }: 9 let 10 - version = "1.0.0"; 11 src = fetchFromGitHub { 12 owner = "vyfor"; 13 repo = "cord.nvim"; 14 tag = "v${version}"; 15 - hash = "sha256-rA3R9SO3QRLGBVHlT5NZLtQw+EmkkmSDO/K6DdNtfBI="; 16 }; 17 - extension = if stdenv.hostPlatform.isDarwin then "dylib" else "so"; 18 - cord-nvim-rust = rustPlatform.buildRustPackage { 19 - pname = "cord.nvim-rust"; 20 - inherit version src; 21 22 useFetchCargoVendor = true; 23 - cargoHash = "sha256-UJdSQNaYaZxvmfuHwePzGhQ3Pv+Cm7YaRK1L0CJhtEc="; 24 25 - installPhase = 26 - let 27 - cargoTarget = stdenv.hostPlatform.rust.cargoShortTarget; 28 - in 29 - '' 30 - install -D target/${cargoTarget}/release/libcord.${extension} $out/lib/cord.${extension} 31 - ''; 32 }; 33 in 34 vimUtils.buildVimPlugin { 35 pname = "cord.nvim"; 36 inherit version src; 37 38 - nativeBuildInputs = [ 39 - cord-nvim-rust 40 - ]; 41 - 42 - buildPhase = '' 43 - runHook preBuild 44 - 45 - install -D ${cord-nvim-rust}/lib/cord.${extension} cord.${extension} 46 - 47 - runHook postBuild 48 - ''; 49 - 50 - installPhase = '' 51 - runHook preInstall 52 - 53 - install -D cord $out/lua/cord.${extension} 54 - 55 - runHook postInstall 56 ''; 57 58 passthru = { ··· 61 }; 62 63 # needed for the update script 64 - inherit cord-nvim-rust; 65 }; 66 67 meta = { 68 homepage = "https://github.com/vyfor/cord.nvim"; 69 license = lib.licenses.asl20; 70 }; 71 }
··· 1 { 2 lib, 3 fetchFromGitHub, 4 + rustPlatform, 5 + versionCheckHook, 6 nix-update-script, 7 vimUtils, 8 }: 9 let 10 + version = "2.2.3"; 11 src = fetchFromGitHub { 12 owner = "vyfor"; 13 repo = "cord.nvim"; 14 tag = "v${version}"; 15 + hash = "sha256-MhUjQxwATAGxIC8ACNDFDm249GzX4Npq3S+sHoUMuos="; 16 }; 17 + cord-server = rustPlatform.buildRustPackage { 18 + pname = "cord"; 19 + version = "2.2.3"; 20 + inherit src; 21 + 22 + # The version in .github/server-version.txt differs from the one in Cargo.toml 23 + postPatch = '' 24 + substituteInPlace .github/server-version.txt \ 25 + --replace-fail "2.0.0-beta.30" "${version}" 26 + ''; 27 28 useFetchCargoVendor = true; 29 + cargoHash = "sha256-hKt9d2u/tlD7bgo49O8oHDLljRvad9dEpGdFt+LH6Ec="; 30 31 + # cord depends on nightly features 32 + RUSTC_BOOTSTRAP = 1; 33 + 34 + nativeInstallCheckInputs = [ 35 + versionCheckHook 36 + ]; 37 + versionCheckProgramArg = "--version"; 38 + doInstallCheck = false; 39 + 40 + meta.mainProgram = "cord"; 41 }; 42 in 43 vimUtils.buildVimPlugin { 44 pname = "cord.nvim"; 45 inherit version src; 46 47 + # Patch the logic used to find the path to the cord server 48 + # This still lets the user set config.advanced.server.executable_path 49 + # https://github.com/vyfor/cord.nvim/blob/v2.2.3/lua/cord/server/fs/init.lua#L10-L15 50 + postPatch = '' 51 + substituteInPlace lua/cord/server/fs/init.lua \ 52 + --replace-fail \ 53 + "or M.get_data_path()" \ 54 + "'${cord-server}'" 55 ''; 56 57 passthru = { ··· 60 }; 61 62 # needed for the update script 63 + inherit cord-server; 64 }; 65 66 meta = { 67 homepage = "https://github.com/vyfor/cord.nvim"; 68 license = lib.licenses.asl20; 69 + changelog = "https://github.com/vyfor/cord.nvim/releases/tag/v${version}"; 70 + maintainers = with lib.maintainers; [ GaetanLepage ]; 71 }; 72 }