summary refs log blame commit diff
path: root/pkgs/applications/networking/instant-messengers/quaternion/default.nix
blob: ec6a497bde92d6ed99fd3e79680e4eab9a590c43 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                   
                                                            
                      
           
  
 
   
                                                            

                         
 





                                    
 
                                                                                       
 
                                          
 







                                                                    
 

                                                                               
                                                                              




                                                    
    

        

                                                                                                                         
                              
 
{ mkDerivation, stdenv, lib, fetchFromGitHub, cmake
, qtbase, qtquickcontrols, qtkeychain, qtmultimedia, qttools
, libqmatrixclient_0_5
, libsecret
}:

let
  generic = version: sha256: prefix: library: mkDerivation {
    pname = "quaternion";
    inherit version;

    src = fetchFromGitHub {
      owner = "QMatrixClient";
      repo  = "Quaternion";
      rev   = "${prefix}${version}";
      inherit sha256;
    };

    buildInputs = [ qtbase qtmultimedia qtquickcontrols qtkeychain library libsecret ];

    nativeBuildInputs = [ cmake qttools ];

    postInstall = if stdenv.isDarwin then ''
      mkdir -p $out/Applications
      mv $out/bin/quaternion.app $out/Applications
      rmdir $out/bin || :
    '' else ''
      substituteInPlace $out/share/applications/quaternion.desktop \
        --replace 'Exec=quaternion' "Exec=$out/bin/quaternion"
    '';

    meta = with lib; {
      description = "Cross-platform desktop IM client for the Matrix protocol";
      homepage    = "https://matrix.org/docs/projects/client/quaternion.html";
      license     = licenses.gpl3;
      maintainers = with maintainers; [ peterhoeg ];
      inherit (qtbase.meta) platforms;
      inherit version;
    };
  };

in rec {
  quaternion     = generic "0.0.9.4c"     "12mkwiqqbi4774kwl7gha72jyf0jf547acy6rw8ry249zl4lja54" "" libqmatrixclient_0_5;

  quaternion-git = quaternion;
}