diff --git a/pkgs/by-name/ca/caprine/001-disable-auto-update.patch b/pkgs/by-name/ca/caprine/001-disable-auto-update.patch new file mode 100644 index 000000000000..f26fc35690c0 --- /dev/null +++ b/pkgs/by-name/ca/caprine/001-disable-auto-update.patch @@ -0,0 +1,39 @@ +From 5da393e32336534222c77659ff138a4e512e6a1f Mon Sep 17 00:00:00 2001 +From: Austin Horstman +Date: Wed, 4 Dec 2024 13:23:15 -0600 +Subject: [PATCH] Disable autoUpdate + +--- + source/index.ts | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/source/index.ts b/source/index.ts +index b8511949a..205c513fe 100644 +--- a/source/index.ts ++++ b/source/index.ts +@@ -14,7 +14,6 @@ import { + nativeTheme, + } from 'electron'; + import {ipcMain as ipc} from 'electron-better-ipc'; +-import {autoUpdater} from 'electron-updater'; + import electronDl from 'electron-dl'; + import electronContextMenu from 'electron-context-menu'; + import electronLocalshortcut from 'electron-localshortcut'; +@@ -65,17 +64,6 @@ if (!config.get('hardwareAcceleration')) { + app.disableHardwareAcceleration(); + } + +-if (!is.development && config.get('autoUpdate')) { +- (async () => { +- const FOUR_HOURS = 1000 * 60 * 60 * 4; +- setInterval(async () => { +- await autoUpdater.checkForUpdatesAndNotify(); +- }, FOUR_HOURS); +- +- await autoUpdater.checkForUpdatesAndNotify(); +- })(); +-} +- + let mainWindow: BrowserWindow; + let isQuitting = false; + let previousMessageCount = 0; diff --git a/pkgs/by-name/ca/caprine/package.nix b/pkgs/by-name/ca/caprine/package.nix index 9d89f45435ee..17d78ba28d9b 100644 --- a/pkgs/by-name/ca/caprine/package.nix +++ b/pkgs/by-name/ca/caprine/package.nix @@ -6,22 +6,23 @@ makeDesktopItem, copyDesktopItems, electron, + nix-update-script, }: buildNpmPackage rec { pname = "caprine"; - version = "2.60.1"; + version = "2.60.3"; src = fetchFromGitHub { owner = "sindresorhus"; repo = "caprine"; rev = "v${version}"; - hash = "sha256-y4W295i7FhgJC3SlwSr801fLOGJY1WF136bbkkBUvyw="; + hash = "sha256-yfCilJ62m7nKe8B+4puwAbNgr2g1P7HaKIhFINdv0/k="; }; ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; - npmDepsHash = "sha256-JHaUc2p+wHsqWtls8xquHK9qnypuCrR0AQMGxcrTsC0="; + npmDepsHash = "sha256-hNOAplCSXrO4NZqDTkmhf0oZVeGRUHr2Y/Qdx2RIV9c="; nativeBuildInputs = [ copyDesktopItems ]; @@ -37,6 +38,8 @@ buildNpmPackage rec { -c.electronVersion=${electron.version} ''; + patches = [ ./001-disable-auto-update.patch ]; + installPhase = '' runHook preInstall @@ -79,6 +82,8 @@ buildNpmPackage rec { }) ]; + passthru.updateScript = nix-update-script { }; + meta = { changelog = "https://github.com/sindresorhus/caprine/releases/tag/${src.rev}"; description = "Elegant Facebook Messenger desktop app";