Merge pull request #42436 from mredaelli/epsonv500

epkowa: added Perfection V500 support
This commit is contained in:
Matthew Bauer 2018-06-28 22:08:16 -04:00 committed by GitHub
commit 10be4fab85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 3 deletions

View file

@ -6,7 +6,7 @@ libxslt,
libusb,
sane-backends,
rpm, cpio,
eject,
getopt,
patchelf, gcc
}:
@ -25,6 +25,38 @@ 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";
};
meta = common_meta // { description = "iscan esci x770 plugin for "+passthru.hw; };
};
f720 = stdenv.mkDerivation rec {
name = "iscan-gt-f720-bundle";
version = "1.0.1";
@ -124,7 +156,7 @@ stdenv.mkDerivation rec {
'';
postFixup = ''
# iscan-registry is a shell script requiring getopt
wrapProgram $out/bin/iscan-registry --prefix PATH : ${eject}/bin
wrapProgram $out/bin/iscan-registry --prefix PATH : ${getopt}/bin
registry=$out/bin/iscan-registry;
'' +
stdenv.lib.concatStrings (stdenv.lib.mapAttrsToList (name: value: ''

View file

@ -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);