2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, boost, glog, leveldb, marisa, opencc,
|
2023-02-02 18:25:31 +00:00
|
|
|
yaml-cpp, gtest, capnproto, pkg-config, plugins ? [ ] }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
let
|
|
|
|
copySinglePlugin = plug: "cp -r ${plug} plugins/${plug.name}";
|
|
|
|
copyPlugins = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
mkdir -p plugins
|
2021-12-24 04:21:11 +00:00
|
|
|
${lib.concatMapStringsSep "\n" copySinglePlugin plugins}
|
|
|
|
chmod +w -R plugins/*
|
|
|
|
'';
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "librime";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.11.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rime";
|
2021-06-06 07:54:09 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-QHuzpitxSYQ4EcBPY1f0R5zl4UFtefu0bFXA76Iv+j0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
buildInputs = [ boost glog leveldb marisa opencc yaml-cpp gtest capnproto ]
|
2021-12-24 04:21:11 +00:00
|
|
|
++ plugins; # for propagated build inputs
|
|
|
|
|
|
|
|
preConfigure = copyPlugins;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://rime.im/";
|
|
|
|
description = "Rime Input Method Engine, the core library";
|
|
|
|
license = licenses.bsd3;
|
2021-12-24 04:21:11 +00:00
|
|
|
maintainers = with maintainers; [ vonfry ];
|
2023-11-16 04:20:00 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|