From f8d40e2677177ea9375fce4f6282daa5c36dbe04 Mon Sep 17 00:00:00 2001 From: definfo Date: Sun, 27 Oct 2024 02:48:57 +0800 Subject: [PATCH] rime-ls: init at 0.4.0 NOTE: Currently rime-data is only used to pass checkPhase. Users may need to set RIME_DATA_DIR and configure editors themselves. --- pkgs/by-name/ri/rime-ls/package.nix | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pkgs/by-name/ri/rime-ls/package.nix diff --git a/pkgs/by-name/ri/rime-ls/package.nix b/pkgs/by-name/ri/rime-ls/package.nix new file mode 100644 index 0000000000000..1381760ed452b --- /dev/null +++ b/pkgs/by-name/ri/rime-ls/package.nix @@ -0,0 +1,37 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + librime, + rime-data, +}: +rustPlatform.buildRustPackage rec { + pname = "rime-ls"; + version = "0.4.0"; + + src = fetchFromGitHub { + owner = "wlh320"; + repo = "rime-ls"; + rev = "v${version}"; + hash = "sha256-ZqoRFIF3ehfEeTN+ZU+/PAzA4JyS1403+sqZdzwJHA8="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-mbkxOYlOCpNzxVWwG8n4vD8klHGVjvMA8XSsBbifjoM="; + + nativeBuildInputs = [ rustPlatform.bindgenHook ]; + + buildInputs = [ librime ]; + + # Set RIME_DATA_DIR to work around test_get_candidates during checkPhase + env.RIME_DATA_DIR = "${rime-data}/share/rime-data"; + + meta = { + description = "Language server for Rime input method engine"; + homepage = "https://github.com/wlh320/rime-ls"; + license = lib.licenses.bsd3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ definfo ]; + mainProgram = "rime_ls"; + }; +}