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

51 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, fetchpatch, qtbase, qtquickcontrols, cmake, libqmatrixclient }:
2017-11-26 15:32:18 +00:00
stdenv.mkDerivation rec {
name = "quaternion-${version}";
2018-07-12 18:33:13 +01:00
version = "0.0.9.2";
2017-11-26 15:32:18 +00:00
src = fetchFromGitHub {
owner = "QMatrixClient";
repo = "Quaternion";
rev = "v${version}";
2018-07-12 18:33:13 +01:00
sha256 = "0zrr4khbbdf5ziq65gi0cb1yb1d0y5rv18wld22w1x96f7fkmrib";
2017-04-16 09:52:51 +01:00
};
buildInputs = [ qtbase qtquickcontrols ];
2017-11-26 15:32:18 +00:00
2017-05-17 20:26:11 +01:00
nativeBuildInputs = [ cmake ];
2017-04-16 09:52:51 +01:00
patches = [
# https://github.com/QMatrixClient/Quaternion/pull/400
(fetchpatch {
url = "https://github.com/QMatrixClient/Quaternion/commit/6cb29834efc343dc2bcf1db62cfad2dc4c121c54.patch";
sha256 = "0n7mgzzrvx9sa657rfb99i0mjh1k0sn5br344mknqy3wgqdr7s3x";
})
];
2018-04-30 10:22:20 +01:00
# libqmatrixclient is now compiled as a dynamic library but quarternion cannot use it yet
# https://github.com/QMatrixClient/Quaternion/issues/239
2017-11-26 15:32:18 +00:00
postPatch = ''
rm -rf lib
ln -s ${libqmatrixclient.src} lib
'';
2017-04-16 09:52:51 +01:00
postInstall = if stdenv.isDarwin then ''
mkdir -p $out/Applications
mv $out/bin/quaternion.app $out/Applications
rmdir $out/bin || :
'' else ''
2017-04-16 09:52:51 +01:00
substituteInPlace $out/share/applications/quaternion.desktop \
--replace 'Exec=quaternion' "Exec=$out/bin/quaternion"
'';
2017-05-17 20:26:11 +01:00
meta = with lib; {
2017-04-16 09:52:51 +01:00
description = "Cross-platform desktop IM client for the Matrix protocol";
2017-07-12 16:50:04 +01:00
homepage = https://matrix.org/docs/projects/client/quaternion.html;
license = licenses.gpl3;
2017-04-16 09:52:51 +01:00
maintainers = with maintainers; [ peterhoeg ];
inherit (qtbase.meta) platforms;
inherit version;
};
}