google-chrome: add update-script
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, patchelf, makeWrapper, fetchurl
|
{ lib, stdenv, patchelf, makeWrapper, fetchurl, writeScript
|
||||||
|
|
||||||
# Linked dynamic libraries.
|
# Linked dynamic libraries.
|
||||||
, glib, fontconfig, freetype, pango, cairo, libX11, libXi, atk, nss, nspr
|
, glib, fontconfig, freetype, pango, cairo, libX11, libXi, atk, nss, nspr
|
||||||
@@ -142,6 +142,17 @@ in stdenv.mkDerivation (finalAttrs: {
|
|||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
updateScript = writeScript "update-google-chrome.sh" ''
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p curl jq common-updater-scripts
|
||||||
|
url="https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions/all/releases"
|
||||||
|
response=$(curl --silent $url)
|
||||||
|
version=$(jq ".releases[0].version" --raw-output <<< "$response")
|
||||||
|
update-source-version ${finalAttrs.pname} "$version" --ignore-same-hash
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A freeware web browser developed by Google";
|
description = "A freeware web browser developed by Google";
|
||||||
homepage = "https://www.google.com/chrome/browser/";
|
homepage = "https://www.google.com/chrome/browser/";
|
||||||
|
|||||||
Reference in New Issue
Block a user