epsonscan: minor refactoring

- Removes a `pname` interpolation.
- Updates the `longDescription` so it uses syntax-highlighting code blocks instead of <literal>.
- Uses `lib.getExe` instead of hardcoding a `/bin/` path.
- Uses the new `lib.systems` standard for declaring platforms.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
This commit is contained in:
Fernando Rodrigues 2025-01-20 20:45:54 -03:00
parent 50c1a48d08
commit 432c7e10d7
No known key found for this signature in database
GPG Key ID: CC3AE2EA00000000

View File

@ -70,7 +70,7 @@ stdenv.mkDerivation {
postPatch = '' postPatch = ''
substituteInPlace src/Controller/Src/Scanner/Engine.cpp \ 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 \ substituteInPlace src/Controller/Src/Filter/GetOrientation.cpp \
--replace-fail '@OCR_ENGINE_GETROTATE@' $out/libexec/epsonscan2-ocr/ocr-engine-getrotate --replace-fail '@OCR_ENGINE_GETROTATE@' $out/libexec/epsonscan2-ocr/ocr-engine-getrotate
@ -137,7 +137,7 @@ stdenv.mkDerivation {
desktopItems = lib.optionals withGui [ desktopItems = lib.optionals withGui [
(makeDesktopItem { (makeDesktopItem {
name = pname; name = "epsonscan2";
exec = "epsonscan2"; exec = "epsonscan2";
icon = "epsonscan2"; icon = "epsonscan2";
desktopName = "Epson Scan 2"; desktopName = "Epson Scan 2";
@ -154,22 +154,27 @@ stdenv.mkDerivation {
inherit description; inherit description;
mainProgram = "epsonscan2"; mainProgram = "epsonscan2";
longDescription = '' longDescription = ''
Epson Scan 2 scanner driver including optional non-free plugins such as OCR and network The Epson Scan 2 scanner driver, including optional non-free plugins such
scanning. as OCR and network scanning.
To use the SANE backend: To use the SANE backend:
<literal> ```nix
hardware.sane.extraBackends = [ pkgs.epsonscan2 ]; {
</literal> hardware.sane.extraBackends = [ pkgs.epsonscan2 ];
}
```
Overrides can be used to customise this package. For example, to enable non-free plugins and Overrides can be used to customise this package. For example, to enable
disable the Epson GUI: non-free plugins and disable the Epson GUI:
<literal> ```nix
pkgs.epsonscan2.override { withNonFreePlugins = true; withGui = false; } pkgs.epsonscan2.override {
</literal> withNonFreePlugins = true;
withGui = false;
}
```
''; '';
homepage = "https://support.epson.net/linux/en/epsonscan2.php"; 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 = sourceProvenance =
with lib.sourceTypes; with lib.sourceTypes;
[ fromSource ] ++ lib.optionals withNonFreePlugins [ binaryNativeCode ]; [ fromSource ] ++ lib.optionals withNonFreePlugins [ binaryNativeCode ];