about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/librime
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/librime')
-rw-r--r--nixpkgs/pkgs/development/libraries/librime/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/librime/default.nix b/nixpkgs/pkgs/development/libraries/librime/default.nix
new file mode 100644
index 000000000000..3c0fb1fdff08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librime/default.nix
@@ -0,0 +1,37 @@
+{ 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 = ''
+    mkdir -p plugins
+    ${lib.concatMapStringsSep "\n" copySinglePlugin plugins}
+    chmod +w -R plugins/*
+  '';
+in
+stdenv.mkDerivation rec {
+  pname = "librime";
+  version = "1.9.0";
+
+  src = fetchFromGitHub {
+    owner = "rime";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-4gEdltdm9A3FxwyZqgSyUWgQ934glinfKwHF8S05f5I=";
+  };
+
+  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;
+  };
+}