]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add telegramircd
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 1 Mar 2019 22:59:59 +0000 (23:59 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 1 Mar 2019 23:51:06 +0000 (00:51 +0100)
default.nix
fetched/telegramircd.json [new file with mode: 0644]

index 674a72f89f64ed8f5c1b8c52ce0bb9d7d010af76..4bae440c3b65b4625be5dd499602b489c2b04783 100644 (file)
@@ -496,6 +496,43 @@ let
       '';
   };
 
+  mypkgs.telegramircd = with python3Packages; let
+    telethon = buildPythonPackage rec {
+      pname = "Telethon-sync";
+      version = "1.1.1";
+
+      src = fetchPypi {
+        inherit pname version;
+        sha256 =
+          "01z8fzqn0qs5pxhvzq891r3mwffq1ga3f8xvm7qdn6kvmxjni9fy";
+      };
+
+      propagatedBuildInputs = with self; [
+        rsa pyaes async_generator
+      ];
+      doCheck = false;
+
+      meta = with lib; {
+        homepage = https://github.com/LonamiWebs/Telethon;
+        description = "Full-featured Telegram client library for Python 3";
+        license = licenses.mit;
+      };
+    };
+  in
+    buildPythonApplication rec {
+      format = "other";
+      pname = "telegramircd";
+      version = "master";
+      propagatedBuildInputs = [ telethon aiohttp ConfigArgParse openssl ];
+      src = (fetchedGithub ./fetched/telegramircd.json).src;
+      LD_LIBRARY_PATH = "${openssl.out}/lib";
+      installPhase = ''
+        install -D $src/telegramircd.py $out/bin/telegramircd
+        wrapProgram "$out/bin/telegramircd" \
+          --prefix LD_LIBRARY_PATH : "${openssl.out}/lib"
+        install -Dm644 "$src/config" -t "$out/etc/telegramircd/"
+        '';
+    };
 # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh
 # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks
 in
diff --git a/fetched/telegramircd.json b/fetched/telegramircd.json
new file mode 100644 (file)
index 0000000..3d219f8
--- /dev/null
@@ -0,0 +1,15 @@
+{
+  "tag": "40a0c7c-master",
+  "meta": {
+    "name": "telegramircd",
+    "url": "https://github.com/MaskRay/telegramircd",
+    "branch": "master"
+  },
+  "github": {
+    "owner": "MaskRay",
+    "repo": "telegramircd",
+    "rev": "40a0c7cf60492bde3f44d43f06f62e3792480139",
+    "sha256": "123fjhgxq2fzn0ar8274jv7jjbxnlpidrj5333kbch7rpcipks0y",
+    "fetchSubmodules": true
+  }
+}