From 6324caac14e81bc5b14be134a70811baab5e7508 Mon Sep 17 00:00:00 2001 From: Serhii Khoma Date: Tue, 12 Feb 2019 21:56:49 +0200 Subject: [PATCH 1/2] =?UTF-8?q?hubstaff:=201.3.1=20=E2=86=92=201.4.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/applications/misc/hubstaff/default.nix | 9 ++++----- pkgs/applications/misc/hubstaff/revision.json | 5 +++++ pkgs/applications/misc/hubstaff/update.sh | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 pkgs/applications/misc/hubstaff/revision.json create mode 100755 pkgs/applications/misc/hubstaff/update.sh diff --git a/pkgs/applications/misc/hubstaff/default.nix b/pkgs/applications/misc/hubstaff/default.nix index 2b6e58a6ab36..46f50e2fd996 100644 --- a/pkgs/applications/misc/hubstaff/default.nix +++ b/pkgs/applications/misc/hubstaff/default.nix @@ -5,7 +5,9 @@ let - version = "1.3.1-ff75f26"; + data = builtins.fromJSON (builtins.readFile ./revision.json); + + inherit (data) version url sha256; rpath = stdenv.lib.makeLibraryPath [ libX11 zlib libSM libICE libXext freetype libXrender fontconfig libXft @@ -17,10 +19,7 @@ in stdenv.mkDerivation { name = "hubstaff-${version}"; - src = fetchurl { - url = "https://hubstaff-production.s3.amazonaws.com/downloads/HubstaffClient/Builds/Release/${version}/Hubstaff-${version}.sh"; - sha256 = "0jm5l34r6lkfkg8vsdfqbr0axngxznhagwcl9y184lnyji91fmdl"; - }; + src = fetchurl { inherit sha256 url; }; nativeBuildInputs = [ unzip makeWrapper ]; diff --git a/pkgs/applications/misc/hubstaff/revision.json b/pkgs/applications/misc/hubstaff/revision.json new file mode 100644 index 000000000000..9ef289c1b8ba --- /dev/null +++ b/pkgs/applications/misc/hubstaff/revision.json @@ -0,0 +1,5 @@ +{ + "url": "https://hubstaff-production.s3.amazonaws.com/downloads/HubstaffClient/Builds/Release/1.4.3-b4b3cb24/Hubstaff-1.4.3-b4b3cb24.sh", + "version": "1.4.3-b4b3cb24", + "sha256": "0wy8pn6m5pxiv1lgilni9z8hc62j72gfrrbj4yhmxph0jf1afrv9" +} diff --git a/pkgs/applications/misc/hubstaff/update.sh b/pkgs/applications/misc/hubstaff/update.sh new file mode 100755 index 000000000000..c4c1caf55db4 --- /dev/null +++ b/pkgs/applications/misc/hubstaff/update.sh @@ -0,0 +1,18 @@ +#!/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 < $SCRIPT_DIR/revision.json +{ + "url": "$installation_script_url", + "version": "$version", + "sha256": "$sha256" +} +EOT From aadfa893ab25d2410590faff1e3fbbdd4d89b2e3 Mon Sep 17 00:00:00 2001 From: Serhii Khoma Date: Wed, 8 May 2019 11:29:28 +0300 Subject: [PATCH 2/2] hubstaff: 1.4.3 -> 1.4.5 --- pkgs/applications/misc/hubstaff/revision.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/hubstaff/revision.json b/pkgs/applications/misc/hubstaff/revision.json index 9ef289c1b8ba..85126a496c65 100644 --- a/pkgs/applications/misc/hubstaff/revision.json +++ b/pkgs/applications/misc/hubstaff/revision.json @@ -1,5 +1,5 @@ { - "url": "https://hubstaff-production.s3.amazonaws.com/downloads/HubstaffClient/Builds/Release/1.4.3-b4b3cb24/Hubstaff-1.4.3-b4b3cb24.sh", - "version": "1.4.3-b4b3cb24", - "sha256": "0wy8pn6m5pxiv1lgilni9z8hc62j72gfrrbj4yhmxph0jf1afrv9" + "url": "https://hubstaff-production.s3.amazonaws.com/downloads/HubstaffClient/Builds/Release/1.4.5-c5b459ea/Hubstaff-1.4.5-c5b459ea.sh", + "version": "1.4.5-c5b459ea", + "sha256": "180qglbj175wln0kh8d5czhjvy7z503zxn4w6522hkz4ddz201nz" }