Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 28 additions & 21 deletions pkgs/by-name/ep/epsonscan2/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
autoPatchelfHook,
boost,
boost186,
cmake,
copyDesktopItems,
imagemagick,
Expand All @@ -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";
SigmaSquadron marked this conversation as resolved.
Show resolved Hide resolved

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 =
{
Expand Down Expand Up @@ -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
Expand All @@ -88,7 +90,7 @@ stdenv.mkDerivation {

buildInputs =
[
boost
boost186 # uses Boost.Optional but epsonscan2 is pre-C++11.
libjpeg
libpng
libtiff
Expand Down Expand Up @@ -135,7 +137,7 @@ stdenv.mkDerivation {

desktopItems = lib.optionals withGui [
(makeDesktopItem {
name = pname;
name = "epsonscan2";
exec = "epsonscan2";
icon = "epsonscan2";
desktopName = "Epson Scan 2";
Expand All @@ -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>

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>
```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:
```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 ];
Expand Down