hubstaff: 1.5.2-bead991b -> 1.5.19-9e79d1da (#126855)

* hubstaff: 1.5.15 -> 1.5.19-9e79d1da

* hubstaff: use updateScript for automatic updates

* Apply suggestions from code review

* Delete revision.json

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Serhii Khoma 2021-06-18 14:59:10 +03:00 committed by GitHub
parent 9f0979714e
commit 3b6c3bee91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 28 deletions

View file

@ -1,13 +1,12 @@
{ lib, stdenv, fetchurl, unzip, makeWrapper, libX11, zlib, libSM, libICE
, libXext , freetype, libXrender, fontconfig, libXft, libXinerama
, libXfixes, libXScrnSaver, libnotify, glib , gtk3, libappindicator-gtk3
, curl }:
, curl, writeShellScript, common-updater-scripts }:
let
data = builtins.fromJSON (builtins.readFile ./revision.json);
inherit (data) version url sha256;
url = "https://hubstaff-production.s3.amazonaws.com/downloads/HubstaffClient/Builds/Release/1.5.19-9e79d1da/Hubstaff-1.5.19-9e79d1da.sh";
version = "1.5.19-9e79d1da";
sha256 = "1l4sq8cblpl1kclkx5pgy0ldfmqa3n8bvdl5qml0n78r0lpk382j";
rpath = lib.makeLibraryPath
[ libX11 zlib libSM libICE libXext freetype libXrender fontconfig libXft
@ -56,6 +55,18 @@ stdenv.mkDerivation {
ln -s $opt/data/resources $opt/x86_64/resources
'';
updateScript = writeShellScript "hubstaff-updater" ''
set -eu -o pipefail
installation_script_url=$(curl --fail --head --location --silent --output /dev/null --write-out %{url_effective} https://app.hubstaff.com/download/linux)
version=$(echo "$installation_script_url" | sed -r 's/^https:\/\/hubstaff\-production\.s3\.amazonaws\.com\/downloads\/HubstaffClient\/Builds\/Release\/([^\/]+)\/Hubstaff.+$/\1/')
sha256=$(nix-prefetch-url "$installation_script_url")
${common-updater-scripts}/bin/update-source-version hubstaff "$version" "$sha256" "$installation_script_url"
'';
meta = with lib; {
description = "Time tracking software";
homepage = "https://hubstaff.com/";

View file

@ -1,5 +0,0 @@
{
"url": "https://hubstaff-production.s3.amazonaws.com/downloads/HubstaffClient/Builds/Release/1.5.15-28673d1c/Hubstaff-1.5.15-28673d1c.sh",
"version": "1.5.15-28673d1c",
"sha256": "0ging41l3a3sdj6bggh913h71gqmb8l3rplp4civpgclnfzv7fg2"
}

View file

@ -1,18 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-prefetch-git curl
SCRIPT_DIR=$(dirname "$(readlink -f "$BASH_SOURCE")")
installation_script_url=$(curl --fail --head --location --silent --output /dev/null --write-out %{url_effective} https://app.hubstaff.com/download/linux)
version=$(echo "$installation_script_url" | sed -r 's/^https:\/\/hubstaff\-production\.s3\.amazonaws\.com\/downloads\/HubstaffClient\/Builds\/Release\/([^\/]+)\/Hubstaff.+$/\1/')
sha256=$(nix-prefetch-url "$installation_script_url")
cat <<EOT > $SCRIPT_DIR/revision.json
{
"url": "$installation_script_url",
"version": "$version",
"sha256": "$sha256"
}
EOT