about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/tensor
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2017-04-14 19:04:55 +0800
committerPeter Hoeg <peter@hoeg.com>2017-04-14 19:05:01 +0800
commit862fc1b46592d974e020979ef03e569c82aece13 (patch)
tree37ba00adbaab4c18d42858cf52da1bec7eebe29f /pkgs/applications/networking/instant-messengers/tensor
parent48b5b77bb7a74d631a6ac699564f85de532bdb33 (diff)
tensor: init at (post) 0.3
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/tensor')
-rw-r--r--pkgs/applications/networking/instant-messengers/tensor/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/applications/networking/instant-messengers/tensor/default.nix b/pkgs/applications/networking/instant-messengers/tensor/default.nix
new file mode 100644
index 0000000000000..ed78274c799d9
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/tensor/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchgit, qtbase, qtquickcontrols, qmakeHook, makeQtWrapper, makeDesktopItem }:
+
+let
+  rev = "f3f3056d770d7fb4a21c610cee7936ee900569f5";
+
+in stdenv.mkDerivation rec {
+  name = "tensor-git-${stdenv.lib.strings.substring 0 8 rev}";
+
+  src = fetchgit {
+    url = "https://github.com/davidar/tensor.git";
+    fetchSubmodules = true;
+    inherit rev;
+    sha256 = "19in8c7a2hxsx2c4lj540w5c3pn1882645m21l91mcriynqr67k9";
+  };
+
+  parallelBuilding = true;
+
+  buildInputs = [ qtbase qtquickcontrols ];
+  nativeBuildInputs = [ qmakeHook makeQtWrapper ];
+
+  desktopItem = makeDesktopItem {
+    name = "tensor";
+    exec = "@bin@";
+    icon = "tensor.png";
+    comment = meta.description;
+    desktopName = "Tensor Matrix Client";
+    genericName = meta.description;
+    categories = "Chat;Utility";
+    mimeType = "text/xml";
+  };
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 tensor $out/bin/tensor
+    install -Dm644 client/logo.png \
+                   $out/share/icons/hicolor/512x512/apps/tensor.png
+    install -Dm644 ${desktopItem}/share/applications/tensor.desktop \
+                   $out/share/applications/tensor.desktop
+
+    wrapQtProgram $out/bin/tensor
+
+    substituteInPlace $out/share/applications/tensor.desktop \
+      --subst-var-by bin $out/bin/tensor
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://matrix.org/docs/projects/client/tensor.html;
+    description = "Cross-platform Qt5/QML-based Matrix client";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ peterhoeg ];
+  };
+}