-
-
Save i077/7c7f486f26acfe85d21bb378a0b58f25 to your computer and use it in GitHub Desktop.
todoist-linux derivation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, lib, fetchurl, makeDesktopItem, dpkg, atk, at_spi2_atk, glib, pango, gdk-pixbuf | |
, gtk3, cairo, freetype, fontconfig, dbus, xorg, nss, nspr, alsaLib, cups, expat | |
, udev, libpulseaudio, utillinux }: | |
stdenv.mkDerivation rec { | |
pname = "todoist-electron"; | |
version = "1.19"; | |
src = fetchurl { | |
url = "https://github.com/KryDos/todoist-linux/releases/download/${version}/Todoist_${version}.0_amd64.deb"; | |
sha256 = "1w0l7k7wmbhwzv71cffsir0q7zg9m0617fmyvd4a01b6flpxrpfx"; | |
}; | |
desktopItem = makeDesktopItem { | |
name = "Todoist"; | |
exec = "Todoist"; | |
desktopName = "Todoist"; | |
categories = "Utility;Productivity"; | |
}; | |
buildInputs = [ dpkg ]; | |
unpackPhase = '' | |
mkdir pkg | |
dpkg-deb -x $src pkg | |
sourceRoot=pkg | |
''; | |
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 utillinux | |
] ++ (with xorg; [ | |
libXi libXcursor libXdamage libXrandr libXcomposite libXext libXfixes libxcb | |
libXrender libX11 libXtst libXScrnSaver | |
])); | |
in '' | |
mkdir -p "$out/bin" | |
mv opt "$out/" | |
ln -s "$out/opt/Todoist/todoist" "$out/bin/todoist" | |
# Patch binary | |
patchelf \ | |
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ | |
--set-rpath "${libPath}:\$ORIGIN" \ | |
$out/opt/Todoist/todoist | |
# Patch shared libs | |
patchelf \ | |
--set-rpath "${libPath}:\$ORIGIN" \ | |
$out/opt/Todoist/libffmpeg.so | |
patchelf \ | |
--set-rpath "${libPath}:\$ORIGIN" \ | |
$out/opt/Todoist/libGLESv2.so | |
mv usr/* "$out/" | |
''; | |
meta = with lib; { | |
homepage = "https://github.com/KryDos/todoist-linux"; | |
description = "The Linux wrapper for Todoist web version"; | |
platforms = [ "x86_64-linux" ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment