epsonscan2: 6.7.70.0 -> 6.7.70.0-01-2025, pin boost, minor refactor (#375409)

This commit is contained in:
Arne Keller
2025-01-26 01:31:14 +01:00
committed by GitHub
+27 -20
View File
@@ -2,7 +2,7 @@
lib,
stdenv,
autoPatchelfHook,
boost,
boost186,
cmake,
copyDesktopItems,
imagemagick,
@@ -25,13 +25,17 @@
let
pname = "epsonscan2";
description = "Epson Scan 2 scanner driver for many modern Epson scanners and multifunction printers";
version = "6.7.70.0";
# Epson updates projects without changing their version numbers.
# There can be multiple different packages identified by the same
#version, so we also tag them with the month and year shown in
# the Epson download page.
version = "6.7.70.0-01-2025";
system = stdenv.hostPlatform.system;
src = fetchzip {
url = "https://download3.ebz.epson.net/dsc/f/03/00/16/14/37/7577ee65efdad48ee2d2f38d9eda75418e490552/epsonscan2-6.7.70.0-1.src.tar.gz";
hash = "sha256-y7XGxrOpVou/ZSfUffV3qv+SsFFpTiU7pWvtfsiLZWc=";
url = "https://download3.ebz.epson.net/dsc/f/03/00/16/60/70/c7fc14e41ec84255008c6125b63bcac40f55e11c/epsonscan2-6.7.70.0-1.src.tar.gz";
hash = "sha256-WvNBy5hAxNJfwgjBR5VGaXuyTCK2YEiD3i7SMDl3U/U=";
};
bundle =
{
@@ -65,10 +69,8 @@ stdenv.mkDerivation {
];
postPatch = ''
rm CMakeCache.txt
substituteInPlace src/Controller/Src/Scanner/Engine.cpp \
--replace-fail '@KILLALL@' ${killall}/bin/killall
--replace-fail '@KILLALL@' ${lib.getExe killall}
substituteInPlace src/Controller/Src/Filter/GetOrientation.cpp \
--replace-fail '@OCR_ENGINE_GETROTATE@' $out/libexec/epsonscan2-ocr/ocr-engine-getrotate
@@ -88,7 +90,7 @@ stdenv.mkDerivation {
buildInputs =
[
boost
boost186 # uses Boost.Optional but epsonscan2 is pre-C++11.
libjpeg
libpng
libtiff
@@ -135,7 +137,7 @@ stdenv.mkDerivation {
desktopItems = lib.optionals withGui [
(makeDesktopItem {
name = pname;
name = "epsonscan2";
exec = "epsonscan2";
icon = "epsonscan2";
desktopName = "Epson Scan 2";
@@ -152,22 +154,27 @@ stdenv.mkDerivation {
inherit description;
mainProgram = "epsonscan2";
longDescription = ''
Epson Scan 2 scanner driver including optional non-free plugins such as OCR and network
scanning.
The Epson Scan 2 scanner driver, including optional non-free plugins such
as OCR and network scanning.
To use the SANE backend:
<literal>
hardware.sane.extraBackends = [ pkgs.epsonscan2 ];
</literal>
```nix
{
hardware.sane.extraBackends = [ pkgs.epsonscan2 ];
}
```
Overrides can be used to customise this package. For example, to enable non-free plugins and
disable the Epson GUI:
<literal>
pkgs.epsonscan2.override { withNonFreePlugins = true; withGui = false; }
</literal>
Overrides can be used to customise this package. For example, to enable
non-free plugins and disable the Epson GUI:
```nix
pkgs.epsonscan2.override {
withNonFreePlugins = true;
withGui = false;
}
```
'';
homepage = "https://support.epson.net/linux/en/epsonscan2.php";
platforms = [ "x86_64-linux" ];
platforms = lib.systems.inspect.patternLogicalAnd lib.systems.inspect.patterns.isLinux lib.systems.inspect.patterns.isx86_64;
sourceProvenance =
with lib.sourceTypes;
[ fromSource ] ++ lib.optionals withNonFreePlugins [ binaryNativeCode ];