From 56670875815ac885f39b3cf246f2287587bd58a7 Mon Sep 17 00:00:00 2001 From: Massimo Redaelli Date: Sat, 23 Jun 2018 17:04:21 +0200 Subject: [PATCH] epkowa: added Perfection V500 support --- pkgs/misc/drivers/epkowa/default.nix | 31 +++++++++++++++++++ .../drivers/epkowa/firmware_location.patch | 3 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/drivers/epkowa/default.nix b/pkgs/misc/drivers/epkowa/default.nix index 1c79be712b06..e01967019943 100644 --- a/pkgs/misc/drivers/epkowa/default.nix +++ b/pkgs/misc/drivers/epkowa/default.nix @@ -25,6 +25,37 @@ in # adding a plugin for another printer shouldn't be too difficult, but you need the firmware to test... let plugins = { + x770 = stdenv.mkDerivation rec { + name = "iscan-gt-x770-bundle"; + version = "1.0.1"; + pluginVersion = "2.1.2-1"; + + buildInputs = [ patchelf rpm ]; + src = fetchurl { + url = "https://download2.ebz.epson.net/iscan/plugin/gt-x770/rpm/x64/iscan-gt-x770-bundle-${version}.x64.rpm.tar.gz"; + sha256 = "0m9c60rszzdvq1pqfzygzzrjycm1giy465lj29108j7hsnfcv56r"; + }; + installPhase = '' + cd plugins + ${rpm}/bin/rpm2cpio iscan-plugin-gt-x770-${pluginVersion}.x86_64.rpm | ${cpio}/bin/cpio -idmv + mkdir $out + cp -r usr/share $out + cp -r usr/lib64 $out/lib + mv $out/share/iscan $out/share/esci + mv $out/lib/iscan $out/lib/esci + ''; + preFixup = '' + lib=$out/lib/esci/libesint7C.so + rpath=${gcc.cc.lib}/lib/ + patchelf --set-rpath $rpath $lib + ''; + passthru = { + registrationCommand = '' + $registry --add interpreter usb 0x04b8 0x0130 "$plugin/lib/esci/libesint7C $plugin/share/esci/esfw7C.bin" + ''; + hw = "Perfection V500 Photo"; + }; + }; f720 = stdenv.mkDerivation rec { name = "iscan-gt-f720-bundle"; version = "1.0.1"; diff --git a/pkgs/misc/drivers/epkowa/firmware_location.patch b/pkgs/misc/drivers/epkowa/firmware_location.patch index 7f67d9cf4579..58ea849d8f9d 100644 --- a/pkgs/misc/drivers/epkowa/firmware_location.patch +++ b/pkgs/misc/drivers/epkowa/firmware_location.patch @@ -8,11 +8,12 @@ set this environment variable. Instead, we patch iscan to set this variable before loading libesci-interpreter-gt-f720.so. --- backend/channel-usb.c.orig 2017-08-14 11:24:27.669582456 +0200 +++ backend/channel-usb.c 2017-08-14 11:31:40.509010897 +0200 -@@ -169,6 +169,8 @@ +@@ -169,6 +169,9 @@ { SANE_Status s; + setenv("ESCI_FIRMWARE_DIR", NIX_ESCI_PREFIX, 1); ++ setenv("ISCAN_FW_DIR", NIX_ESCI_PREFIX, 1); + s = sanei_usb_open (self->name, &self->fd);