todoist: unofficial 1.24.0 -> official 0.2.4
This commit is contained in:
parent
5e260c3c5c
commit
483114e761
|
@ -1,65 +1,51 @@
|
||||||
{ stdenv, lib, fetchurl, makeDesktopItem, dpkg, atk, at-spi2-atk, glib, pango, gdk-pixbuf
|
{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron, libsecret }:
|
||||||
, gtk3, cairo, freetype, fontconfig, dbus, xorg, nss, nspr, alsaLib, cups, expat
|
|
||||||
, udev, libpulseaudio, util-linux, makeWrapper }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "todoist-electron";
|
pname = "todoist-electron";
|
||||||
version = "1.24.0";
|
version = "0.2.4";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/KryDos/todoist-linux/releases/download/${version}/Todoist_${version}_amd64.deb";
|
url = "https://electron-dl.todoist.com/linux/Todoist-${version}.AppImage";
|
||||||
sha256 = "0g35518z6nf6pnfyx4ax75rq8b8br72mi6wv6jzgac9ric1q4h2s";
|
sha256 = "1xrf2qjhq116z18qx7n1zd7mhvkb2dccaq7az4w6fs216l8q5zf2";
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
appimageContents = appimageTools.extractType2 {
|
||||||
name = "Todoist";
|
name = "${pname}-${version}";
|
||||||
exec = "todoist %U";
|
inherit src;
|
||||||
icon = "todoist";
|
|
||||||
comment = "Todoist for Linux";
|
|
||||||
desktopName = "Todoist";
|
|
||||||
categories = "Utility";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper dpkg ];
|
dontUnpack = true;
|
||||||
unpackPhase = ''
|
dontConfigure = true;
|
||||||
mkdir pkg
|
dontBuild = true;
|
||||||
dpkg-deb -x $src pkg
|
|
||||||
sourceRoot=pkg
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/bin $out/share/${pname} $out/share/applications $out/share/icons/hicolor/512x512
|
||||||
|
|
||||||
|
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
|
||||||
'';
|
'';
|
||||||
installPhase = let
|
|
||||||
libPath = lib.makeLibraryPath ([
|
|
||||||
stdenv.cc.cc gtk3 atk at-spi2-atk glib pango gdk-pixbuf cairo freetype fontconfig dbus
|
|
||||||
nss nspr alsaLib libpulseaudio cups expat udev util-linux
|
|
||||||
] ++ (with xorg; [
|
|
||||||
libXi libXcursor libXdamage libXrandr libXcomposite libXext libXfixes libxcb
|
|
||||||
libXrender libX11 libXtst libXScrnSaver
|
|
||||||
]));
|
|
||||||
in ''
|
|
||||||
mkdir -p "$out/bin"
|
|
||||||
mv opt "$out/"
|
|
||||||
mv usr/share "$out/share"
|
|
||||||
|
|
||||||
# Patch binary
|
postFixup = ''
|
||||||
patchelf \
|
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
|
||||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
--add-flags $out/share/${pname}/resources/app.asar \
|
||||||
--set-rpath "${libPath}:\$ORIGIN" \
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc libsecret ]}"
|
||||||
$out/opt/Todoist/todoist
|
|
||||||
|
|
||||||
# Hacky workaround for RPATH problems
|
|
||||||
makeWrapper $out/opt/Todoist/todoist $out/bin/todoist \
|
|
||||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpulseaudio udev ]}
|
|
||||||
|
|
||||||
# Desktop item
|
|
||||||
mkdir -p "$out/share"
|
|
||||||
rm -r "$out/share/applications"
|
|
||||||
cp -r "${desktopItem}/share/applications" "$out/share/applications"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/KryDos/todoist-linux";
|
homepage = "https://todoist.com";
|
||||||
description = "The Linux wrapper for Todoist web version";
|
description = "The official Todoist electron app";
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [ "x86_64-linux" ];
|
||||||
license = licenses.mit;
|
license = licenses.unfree;
|
||||||
maintainers = with maintainers; [ i077 ];
|
maintainers = with maintainers; [ i077 kylesferrazza ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue