2021-11-01 20:16:52 +00:00
|
|
|
{ lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper, electron
|
|
|
|
, alsa-lib, glibc, gtk3, libxshmfence, mesa, nss }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "threema-desktop";
|
2023-03-02 15:32:28 +00:00
|
|
|
version = "1.2.27";
|
2021-11-01 20:16:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
# As Threema only offers a Latest Release url, the plan is to upload each
|
|
|
|
# new release url to web.archive.org until their Github releases page gets populated.
|
2023-03-02 15:32:28 +00:00
|
|
|
url = "https://web.archive.org/web/20230302151220/https://releases.threema.ch/web-electron/v1/release/Threema-Latest.deb";
|
|
|
|
sha256 = "0jx271zwqja7i7qdvhiyq5m6g19a12falfvxbkxrw7ab3ycds2px";
|
2021-11-01 20:16:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
dpkg
|
|
|
|
autoPatchelfHook
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ alsa-lib glibc gtk3 libxshmfence mesa nss ];
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
# Can't unpack with the common dpkg-deb -x method
|
|
|
|
dpkg --fsys-tarfile $src | tar --extract
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
# This will cause confusion, not needed
|
|
|
|
rm -r usr/bin
|
|
|
|
mv usr $out
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
mv $out/share/applications/threema.desktop $out/share/applications/threema-desktop.desktop
|
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/threema \
|
|
|
|
--add-flags $out/lib/threema/resources/app.asar
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Desktop client for Threema, a privacy-focused end-to-end encrypted mobile messenger";
|
|
|
|
homepage = "https://threema.ch";
|
2022-06-04 22:19:25 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-11-01 20:16:52 +00:00
|
|
|
license = licenses.agpl3Only;
|
|
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|