2021-03-13 00:58:40 +01:00
|
|
|
{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron_11, libsecret }:
|
2020-02-04 01:08:59 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "todoist-electron";
|
2021-02-18 04:46:22 +01:00
|
|
|
version = "0.2.4";
|
2020-02-04 01:08:59 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-18 04:46:22 +01:00
|
|
|
url = "https://electron-dl.todoist.com/linux/Todoist-${version}.AppImage";
|
|
|
|
sha256 = "1xrf2qjhq116z18qx7n1zd7mhvkb2dccaq7az4w6fs216l8q5zf2";
|
2020-02-04 01:08:59 +01:00
|
|
|
};
|
|
|
|
|
2021-02-18 04:46:22 +01:00
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
inherit src;
|
2020-02-04 01:08:59 +01:00
|
|
|
};
|
|
|
|
|
2021-02-18 04:46:22 +01:00
|
|
|
dontUnpack = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2020-02-04 01:08:59 +01:00
|
|
|
|
2021-02-18 04:46:22 +01:00
|
|
|
mkdir -p $out/bin $out/share/${pname} $out/share/applications $out/share/icons/hicolor/512x512
|
2020-02-04 01:08:59 +01:00
|
|
|
|
2021-02-18 04:46:22 +01:00
|
|
|
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
|
|
|
|
cp -a ${appimageContents}/todoist.desktop $out/share/applications/${pname}.desktop
|
|
|
|
cp -a ${appimageContents}/usr/share/icons/hicolor/0x0/apps $out/share/icons/hicolor/512x512
|
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-02-04 01:08:59 +01:00
|
|
|
|
2021-02-18 04:46:22 +01:00
|
|
|
postFixup = ''
|
2021-03-13 00:58:40 +01:00
|
|
|
makeWrapper ${electron_11}/bin/electron $out/bin/${pname} \
|
2021-02-18 04:46:22 +01:00
|
|
|
--add-flags $out/share/${pname}/resources/app.asar \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc libsecret ]}"
|
2020-02-04 01:08:59 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-02-18 04:46:22 +01:00
|
|
|
homepage = "https://todoist.com";
|
|
|
|
description = "The official Todoist electron app";
|
2020-02-04 01:08:59 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-02-18 04:46:22 +01:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ i077 kylesferrazza ];
|
2020-02-04 01:08:59 +01:00
|
|
|
};
|
|
|
|
}
|