Skip to content

Commit

Permalink
epsonscan: minor refactoring
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
SigmaSquadron committed Jan 26, 2025
1 parent 50c1a48 commit 432c7e1
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions pkgs/by-name/ep/epsonscan2/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ stdenv.mkDerivation {

postPatch = ''
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 Down Expand Up @@ -137,7 +137,7 @@ stdenv.mkDerivation {

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

0 comments on commit 432c7e1

Please sign in to comment.