depot/third_party/nixpkgs/pkgs/development/libraries/librime/default.nix
Default email 4bac34ead1 Project import generated by Copybara.
GitOrigin-RevId: 724bfc0892363087709bd3a5a1666296759154b1
2023-02-09 12:40:11 +01:00

36 lines
1,004 B
Nix

{ lib, stdenv, fetchFromGitHub, cmake, boost, glog, leveldb, marisa, opencc,
yaml-cpp, gtest, capnproto, pkg-config, plugins ? [ ] }:
let
copySinglePlugin = plug: "cp -r ${plug} plugins/${plug.name}";
copyPlugins = ''
${lib.concatMapStringsSep "\n" copySinglePlugin plugins}
chmod +w -R plugins/*
'';
in
stdenv.mkDerivation rec {
pname = "librime";
version = "1.8.5";
src = fetchFromGitHub {
owner = "rime";
repo = pname;
rev = version;
sha256 = "sha256-FkkZIxSuqlFFOjABBpnE5ax2Vdo9tzP0prM7ATDIIdk=";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ boost glog leveldb marisa opencc yaml-cpp gtest capnproto ]
++ plugins; # for propagated build inputs
preConfigure = copyPlugins;
meta = with lib; {
homepage = "https://rime.im/";
description = "Rime Input Method Engine, the core library";
license = licenses.bsd3;
maintainers = with maintainers; [ vonfry ];
platforms = platforms.linux;
};
}