-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
default.nix
51 lines (45 loc) · 1.1 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
source,
lib,
stdenv,
rustPlatform,
pkg-config,
makeWrapper,
librime,
rime-data,
symlinkJoin,
rimeDataPkgs ? [ rime-data ],
}:
let
rimeDataDrv = symlinkJoin {
name = "rime_ls-rime-data";
paths = rimeDataPkgs;
};
librime' = librime.overrideAttrs (old: {
postInstall = ''
cp -r "${rimeDataDrv}/share/rime-data/." $out/share/rime-data
'';
});
in
rustPlatform.buildRustPackage {
inherit (source) pname src version;
cargoLock = source.cargoLock."Cargo.lock";
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
makeWrapper
];
buildInputs = [ librime' ];
# Set RIME_DATA_DIR to work around test_get_candidates during checkPhase
env.RIME_DATA_DIR = lib.optionalString stdenv.isLinux "${librime'}/share/rime-data";
postInstall = ''
wrapProgram $out/bin/rime_ls \
--set RIME_DATA_DIR ${librime'}/share/rime-data
'';
meta = with lib; {
description = "A language server for Rime input method engine";
homepage = "https://github.com/wlh320/rime-ls";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
};
}