epkowa: init at 2.30.3-1

+163
+142
pkgs/misc/drivers/epkowa/default.nix
··· 1 + {stdenv, fetchurl, fetchpatch, makeWrapper, symlinkJoin, 2 + pkgconfig, libtool, 3 + gtk2, 4 + libxml2, 5 + libxslt, 6 + libusb, 7 + sane-backends, 8 + rpm, cpio, 9 + eject, 10 + patchelf, gcc 11 + }: 12 + 13 + let common_meta = { 14 + homepage = "http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX"; 15 + license = with stdenv.lib.licenses; epson; 16 + platforms = with stdenv.lib.platforms; linux; 17 + }; 18 + in 19 + ############################ 20 + # 21 + # PLUGINS 22 + # 23 + ############################ 24 + 25 + # adding a plugin for another printer shouldn't be too difficult, but you need the firmware to test... 26 + 27 + let plugins = { 28 + f720 = stdenv.mkDerivation rec { 29 + name = "iscan-gt-f720-bundle"; 30 + version = "1.0.1"; 31 + pluginVersion = "0.1.1-2"; 32 + 33 + buildInputs = [ patchelf ]; 34 + src = fetchurl { 35 + url = "https://download2.ebz.epson.net/iscan/plugin/gt-f720/rpm/x64/iscan-gt-f720-bundle-${version}.x64.rpm.tar.gz"; 36 + sha256 = "0dvikq5ad6wid3lxw1amar8lsbr50g39g6zlmcjxdcsg0wb1qspp"; 37 + }; 38 + installPhase = '' 39 + cd plugins 40 + ${rpm}/bin/rpm2cpio esci-interpreter-gt-f720-${pluginVersion}.x86_64.rpm | ${cpio}/bin/cpio -idmv 41 + mkdir $out 42 + cp -r usr/share $out 43 + cp -r usr/lib64 $out/lib 44 + ''; 45 + preFixup = '' 46 + lib=$out/lib/esci/libesci-interpreter-gt-f720.so 47 + rpath=${gcc.cc.lib}/lib/ 48 + patchelf --set-rpath $rpath $lib 49 + ''; 50 + passthru = { 51 + registrationCommand = '' 52 + $registry --add interpreter usb 0x04b8 0x0131 "$plugin/lib/esci/libesci-interpreter-gt-f720 $plugin/share/esci/esfw8b.bin" 53 + ''; 54 + hw = "GT-F720, GT-S620, Perfection V30, Perfection V300 Photo"; 55 + }; 56 + 57 + meta = common_meta // { description = "iscan esci f720 plugin for "+passthru.hw; }; 58 + }; 59 + }; 60 + in 61 + 62 + 63 + 64 + let fwdir = symlinkJoin { 65 + name = "esci-firmware-dir"; 66 + paths = stdenv.lib.mapAttrsToList (name: value: value + /share/esci) plugins; 67 + }; 68 + in 69 + let iscan-data = stdenv.mkDerivation rec { 70 + name = "iscan-data-${version}"; 71 + version = "1.39.0-1"; 72 + 73 + src = fetchurl { 74 + url = "http://support.epson.net/linux/src/scanner/iscan/iscan-data_${version}.tar.gz"; 75 + sha256 = "0pvm67gqyvzhnv5qyfbaz802l4sbgvaf0zb8wz60k1wcasb99vv1"; 76 + }; 77 + 78 + buildInputs = [ 79 + libxslt 80 + ]; 81 + 82 + meta = common_meta; 83 + }; 84 + in 85 + stdenv.mkDerivation rec { 86 + name = "iscan-${version}"; 87 + version = "2.30.3-1"; 88 + 89 + src = fetchurl { 90 + url = "http://support.epson.net/linux/src/scanner/iscan/iscan_${version}.tar.gz"; 91 + sha256 = "0ryy946h7ddmxh866hfszqfyff1qy4svpsk7w3739v75f4awr9li"; 92 + }; 93 + 94 + buildInputs = [ 95 + pkgconfig 96 + gtk2 97 + libxml2 98 + libtool 99 + libusb 100 + sane-backends 101 + makeWrapper 102 + ]; 103 + 104 + patches = [ 105 + (fetchpatch { 106 + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-2.28.1.3+libpng-1.5.patch"; 107 + sha256 = "04y70qjd220dpyh771fiq50lha16pms98mfigwjczdfmx6kpj1jd"; 108 + }) 109 + ./firmware_location.patch 110 + ]; 111 + patchFlags = "-p0"; 112 + 113 + configureFlags = [ "--disable-static" "--enable-dependency-reduction" "--disable-frontend"]; 114 + 115 + postConfigure = '' 116 + echo '#define NIX_ESCI_PREFIX "'${fwdir}'"' >> config.h 117 + ''; 118 + 119 + postInstall = '' 120 + mkdir -p $out/etc/sane.d 121 + cp backend/epkowa.conf $out/etc/sane.d 122 + echo "epkowa" > $out/etc/sane.d/dll.conf 123 + ln -s ${iscan-data}/share/iscan-data $out/share/iscan-data 124 + ''; 125 + postFixup = '' 126 + # iscan-registry is a shell script requiring getopt 127 + wrapProgram $out/bin/iscan-registry --prefix PATH : ${eject}/bin 128 + registry=$out/bin/iscan-registry; 129 + '' + 130 + stdenv.lib.concatStrings (stdenv.lib.mapAttrsToList (name: value: '' 131 + plugin=${value}; 132 + ${value.passthru.registrationCommand} 133 + '') plugins); 134 + meta = common_meta // { 135 + description = "sane-epkowa backend for some epson scanners."; 136 + longDescription = '' 137 + Includes gui-less iscan (aka. Image Scan! for Linux). 138 + Supported hardware: at least : 139 + '' + 140 + stdenv.lib.concatStringsSep ", " (stdenv.lib.mapAttrsToList (name: value: value.passthru.hw) plugins); 141 + }; 142 + }
+19
pkgs/misc/drivers/epkowa/firmware_location.patch
··· 1 + Explanation: 2 + in libesci-interpreter-gt-f720.so in 3 + libesci_interpreter_gt_f720_342::libesci_interpreter_gt_f720_348 at 0xdf74: the 4 + binary blob esfw8b.bin is searched either in /usr/share/esci/ or in 5 + $ESCI_FIRMWARE_DIR. But since this library is to be used wia libsane.so in 6 + every binary in the system, we can't wrapProgram the relevant executables to 7 + set this environment variable. Instead, we patch iscan to set this variable 8 + before loading libesci-interpreter-gt-f720.so. 9 + --- backend/channel-usb.c.orig 2017-08-14 11:24:27.669582456 +0200 10 + +++ backend/channel-usb.c 2017-08-14 11:31:40.509010897 +0200 11 + @@ -169,6 +169,8 @@ 12 + { 13 + SANE_Status s; 14 + 15 + + setenv("ESCI_FIRMWARE_DIR", NIX_ESCI_PREFIX, 1); 16 + + 17 + s = sanei_usb_open (self->name, &self->fd); 18 + 19 + if (SANE_STATUS_GOOD == s)
+2
pkgs/top-level/all-packages.nix
··· 18605 18605 hplip_3_15_9 = callPackage ../misc/drivers/hplip/3.15.9.nix { }; 18606 18606 18607 18607 hplipWithPlugin_3_15_9 = hplip_3_15_9.override { withPlugin = true; }; 18608 + 18609 + epkowa = callPackage ../misc/drivers/epkowa { }; 18608 18610 18609 18611 illum = callPackage ../tools/system/illum { }; 18610 18612