summary refs log tree commit diff
path: root/pkgs/tools/inputmethods/fcitx5
diff options
context:
space:
mode:
authorPoscat <poscat@mail.poscat.moe>2021-01-16 11:13:51 +0800
committerPoscat <poscat@mail.poscat.moe>2021-01-16 12:02:43 +0800
commit13f5c8013f62c1f4dc24221ca4b0dad7c105641a (patch)
tree31151215c4c1ee9ab274cf2f2f42ba274e1b7121 /pkgs/tools/inputmethods/fcitx5
parentc7ebdc8123d4765d3543a9345cb448ada81eac6d (diff)
downloadnixpkgs-13f5c8013f62c1f4dc24221ca4b0dad7c105641a.tar
nixpkgs-13f5c8013f62c1f4dc24221ca4b0dad7c105641a.tar.gz
nixpkgs-13f5c8013f62c1f4dc24221ca4b0dad7c105641a.tar.bz2
nixpkgs-13f5c8013f62c1f4dc24221ca4b0dad7c105641a.tar.lz
nixpkgs-13f5c8013f62c1f4dc24221ca4b0dad7c105641a.tar.xz
nixpkgs-13f5c8013f62c1f4dc24221ca4b0dad7c105641a.tar.zst
nixpkgs-13f5c8013f62c1f4dc24221ca4b0dad7c105641a.zip
Add an update script for fcitx packages
Diffstat (limited to 'pkgs/tools/inputmethods/fcitx5')
-rw-r--r--pkgs/tools/inputmethods/fcitx5/default.nix2
-rwxr-xr-xpkgs/tools/inputmethods/fcitx5/update.py29
2 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/tools/inputmethods/fcitx5/default.nix b/pkgs/tools/inputmethods/fcitx5/default.nix
index b3dd2260d1c..cce48914e69 100644
--- a/pkgs/tools/inputmethods/fcitx5/default.nix
+++ b/pkgs/tools/inputmethods/fcitx5/default.nix
@@ -90,6 +90,8 @@ stdenv.mkDerivation rec {
     libxkbfile
   ];
 
+  passthru.updateScript = ./update.py;
+
   meta = with lib; {
     description = "Next generation of fcitx";
     homepage = "https://github.com/fcitx/fcitx5";
diff --git a/pkgs/tools/inputmethods/fcitx5/update.py b/pkgs/tools/inputmethods/fcitx5/update.py
new file mode 100755
index 00000000000..e3513c747fc
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx5/update.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i python3 -p nix-prefetch-github python3Packages.requests
+
+from nix_prefetch_github import *
+import json
+import requests
+import subprocess
+
+REPOS = [ "libime", "xcb-imdkit", "fcitx5", "fcitx5-gtk", "fcitx5-qt", "fcitx5-configtool", "fcitx5-lua",
+          "fcitx5-rime", "fcitx5-chinese-addons", "fcitx5-table-extra", "fcitx5-table-other" ]
+
+OWNER = "fcitx"
+
+def get_latest_tag(repo, owner=OWNER):
+    r = requests.get( 'https://api.github.com/repos/{}/{}/tags'.format(owner,repo)
+                    , auth=('poscat', 'db5e6fd16d0eb8c36385d3d944e058a1178b4265'))
+    return r.json()[0].get("name")
+
+def main():
+    sources = dict()
+    for repo in REPOS:
+        rev = get_latest_tag(repo)
+        if repo == "fcitx5-qt":
+            subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)])
+        else:
+            subprocess.run(["nix-update", "--commit", "--version", rev, repo])
+
+if __name__ == "__main__":
+    main ()