1#!/usr/bin/env nix-shell
2#!nix-shell -i python3 -p nix-update nix-prefetch-github python3Packages.requests
3
4from nix_prefetch_github import *
5import json
6import requests
7import subprocess
8
9REPOS = [
10 "libime",
11 "xcb-imdkit",
12
13 "fcitx5",
14 "fcitx5-chewing",
15 "fcitx5-chinese-addons",
16 "fcitx5-configtool",
17 "fcitx5-gtk",
18 "fcitx5-hangul",
19 "fcitx5-lua",
20 "fcitx5-m17n",
21 "fcitx5-qt",
22 "fcitx5-rime",
23 "fcitx5-table-extra",
24 "fcitx5-table-other",
25 "fcitx5-unikey"
26 ]
27
28OWNER = "fcitx"
29
30def get_latest_tag(repo, owner=OWNER):
31 r = requests.get('https://api.github.com/repos/{}/{}/tags'.format(owner,repo))
32 return r.json()[0].get("name")
33
34def main():
35 sources = dict()
36 for repo in REPOS:
37 rev = get_latest_tag(repo)
38 if repo == "fcitx5-qt":
39 subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)])
40 else:
41 subprocess.run(["nix-update", "--commit", "--version", rev, repo])
42
43if __name__ == "__main__":
44 main ()