epson-escpr2: 1.2.35 -> 1.2.36, add update script (#462985)

This commit is contained in:
Aleksana
2025-12-06 14:37:05 +00:00
committed by GitHub
2 changed files with 27 additions and 3 deletions
+6 -3
View File
@@ -8,14 +8,15 @@
stdenv.mkDerivation {
pname = "epson-inkjet-printer-escpr2";
version = "1.2.35";
version = "1.2.36";
src = fetchurl {
# To find the most recent version go to
# https://support.epson.net/linux/Printer/LSB_distribution_pages/en/escpr2.php
# and retrieve the download link for source package for arm CPU for the tar.gz (the x86 link targets to rpm source files)
url = "https://download3.ebz.epson.net/dsc/f/03/00/17/28/09/4e8dc40219d4b52e414b608de92552af4fd46eca/epson-inkjet-printer-escpr2-1.2.35-1.tar.gz";
hash = "sha256-aYEuEION/C32/SnngreX/nqK/6Yzkuxf0k0HpferTYM=";
url = "https://download-center.epson.com/f/module/bb48b7e6-662f-4152-a86f-c1a78fc74b1f/epson-inkjet-printer-escpr2-1.2.36-1.tar.gz";
hash = "sha256-0R4dFhT1XhjXMOeRxCbTIT1K83bkwiAhpu/W10DSlxM=";
};
buildInputs = [ cups ];
@@ -37,6 +38,8 @@ stdenv.mkDerivation {
"--with-cupsppddir=${placeholder "out"}/share/cups/model"
];
passthru.updateScript = ./update.sh;
meta = {
homepage = "http://download.ebz.epson.net/dsc/search/01/search/";
description = "ESC/P-R 2 Driver (generic driver)";
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash curl jq common-updater-scripts
set -eou pipefail
result=$(curl -sSL 'https://download-center.epson.com/api/v1/modules/?device_id=XP-970%20Series&os=DEBARM32&region=US&language=en' | jq -r '.items[] | select(.module_name == "Epson Inkjet Printer Driver 2 (ESC/P-R) for Linux" and .cti_category == "Sources")')
latestVersion=$(jq '.version' <<< "$result" | tr -d '"')
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; (lib.getVersion epson-escpr2)" | tr -d '"')
echo "latest version: $latestVersion"
echo "current version: $currentVersion"
if [[ "$latestVersion" == "$currentVersion" ]]; then
echo "package is up-to-date"
exit 0
fi
url=$(jq '.url' <<< "$result" | tr -d '"')
hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $(nix-prefetch-url $url))
update-source-version epson-escpr2 $latestVersion $hash $url --ignore-same-version