nixpkgs/pkgs/applications/networking/instant-messengers/tensor/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
1.7 KiB
Nix
Raw Normal View History

{ mkDerivation
, lib
, stdenv
2022-03-15 10:27:46 +00:00
, fetchFromGitHub
, qtbase
, qtquickcontrols
, qmake
, makeDesktopItem
}:
2017-04-14 11:04:55 +00:00
# we now have libqmatrixclient so a future version of tensor that supports it
# should use that
2020-04-07 20:34:28 +00:00
mkDerivation rec {
pname = "tensor";
version = "unstable-2017-02-21";
2017-04-14 11:04:55 +00:00
2022-03-15 10:27:46 +00:00
src = fetchFromGitHub {
owner = "davidar";
repo = "tensor";
rev = "f3f3056d770d7fb4a21c610cee7936ee900569f5";
2022-03-15 10:27:46 +00:00
sha256 = "sha256-aR6TsfUxsxoSDaIWYgRCwd7BCgekSEqY6LpDoQ5DNqY=";
2017-04-14 11:04:55 +00:00
fetchSubmodules = true;
};
buildInputs = [ qtbase qtquickcontrols ];
2017-05-17 19:26:11 +00:00
nativeBuildInputs = [ qmake ];
2017-04-14 11:04:55 +00:00
desktopItem = makeDesktopItem {
name = "tensor";
exec = "@bin@";
icon = "tensor.png";
comment = meta.description;
2017-04-14 11:04:55 +00:00
desktopName = "Tensor Matrix Client";
genericName = meta.description;
categories = [ "Chat" "Utility" ];
mimeTypes = [ "application/x-chat" ];
2017-04-14 11:04:55 +00:00
};
2021-05-18 17:33:46 +00:00
installPhase = if stdenv.isDarwin then ''
runHook preInstall
mkdir -p $out/Applications
cp -r tensor.app $out/Applications/tensor.app
runHook postInstall
'' else ''
2017-04-14 11:04:55 +00:00
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
substituteInPlace $out/share/applications/tensor.desktop \
--subst-var-by bin $out/bin/tensor
runHook postInstall
'';
meta = with lib; {
2023-10-06 19:28:26 +00:00
homepage = "https://github.com/davidar/tensor";
2017-04-14 11:04:55 +00:00
description = "Cross-platform Qt5/QML-based Matrix client";
mainProgram = "tensor";
2017-04-14 11:04:55 +00:00
license = licenses.gpl3;
maintainers = with maintainers; [ peterhoeg ];
inherit (qtbase.meta) platforms;
2017-04-14 11:04:55 +00:00
};
}