1 { stdenv, lib, fetchurl, dpkg, patchelf, qt5, libXtst, libXext, libX11, mkDerivation, libXScrnSaver, writeScript, common-updater-scripts, curl, pup }:
6 if stdenv.hostPlatform.system == "i686-linux" then fetchurl {
7 name = "rescuetime-installer.deb";
8 url = "https://www.rescuetime.com/installers/rescuetime_${version}_i386.deb";
9 sha256 = "1xrvyy0higc1fbc8ascpaszvg2bl6x0a35bzmdq6dkay48hnrd8b";
11 name = "rescuetime-installer.deb";
12 url = "https://www.rescuetime.com/installers/rescuetime_${version}_amd64.deb";
13 sha256 = "09ng0yal66d533vzfv27k9l2va03rqbqmsni43qi3hgx7w9wx5ii";
16 # https://www.rescuetime.com/updates/linux_release_notes.html
20 nativeBuildInputs = [ dpkg ];
21 # avoid https://github.com/NixOS/patchelf/issues/99
30 cp usr/bin/rescuetime $out/bin
32 ${patchelf}/bin/patchelf \
33 --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
34 --set-rpath "${lib.makeLibraryPath [ qt5.qtbase libXtst libXext libX11 libXScrnSaver ]}" \
38 passthru.updateScript = writeScript "${pname}-updater" ''
41 PATH=${lib.makeBinPath [curl pup common-updater-scripts]}:$PATH
42 latestVersion="$(curl -sS https://www.rescuetime.com/release-notes/linux | pup '.release:first-of-type h2 strong text{}' | tr -d '\n')"
44 for platform in ${lib.concatStringsSep " " meta.platforms}; do
45 update-source-version ${pname} "$latestVersion" --system=$platform --ignore-same-version
50 description = "Helps you understand your daily habits so you can focus and be more productive";
51 homepage = "https://www.rescuetime.com";
53 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
54 license = licenses.unfree;
55 platforms = [ "i686-linux" "x86_64-linux" ];