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