diff options
author | Nikolay Amiantov <ab@fmap.me> | 2021-12-22 14:14:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-22 14:14:38 +0300 |
commit | f92057a1956b660ea5950885592001c42fb1f3f2 (patch) | |
tree | 45b569d8104cf6fbcb1432dd3541cb5d504d16a0 /pkgs/misc | |
parent | b8e515e5cc9d69a4cddd5a8c41e5e7311932f356 (diff) | |
parent | 526238b288baafd99bb4fb6a69ead3f9db0c7f0a (diff) |
Merge pull request #150776 from abbradar/utsushi
utsushi: unstable-2021-01-01 -> 3.65.0, rename, add imagescan plugin
Diffstat (limited to 'pkgs/misc')
-rw-r--r-- | pkgs/misc/drivers/utsushi/default.nix | 36 | ||||
-rw-r--r-- | pkgs/misc/drivers/utsushi/networkscan.nix | 31 |
2 files changed, 58 insertions, 9 deletions
diff --git a/pkgs/misc/drivers/utsushi/default.nix b/pkgs/misc/drivers/utsushi/default.nix index 46a72fdd0dad9..dcb04f5ce5784 100644 --- a/pkgs/misc/drivers/utsushi/default.nix +++ b/pkgs/misc/drivers/utsushi/default.nix @@ -1,6 +1,8 @@ -{ lib, stdenv, writeScriptBin, fetchFromGitLab, autoreconfHook, pkg-config -, autoconf-archive, libxslt, boost , gtkmm2 , imagemagick, sane-backends -, tesseract4, udev, libusb1 }: +{ lib, stdenv, writeScriptBin, fetchpatch, fetchFromGitLab, autoreconfHook, pkg-config +, autoconf-archive, libxslt, boost, gtkmm2, imagemagick, sane-backends +, tesseract4, udev, libusb1 +, withNetworkScan ? false, utsushi-networkscan +}: let @@ -10,17 +12,29 @@ let [ -r .rev ] && cat .rev || true fi ''; + in stdenv.mkDerivation rec { - pname = "utsushi"; - version = "unstable-2021-01-01"; + pname = "imagescan"; + version = "3.65.0"; src = fetchFromGitLab { - owner = pname; + owner = "utsushi"; repo = pname; - rev = "1646d7d301f3d2aeb24930696688853fed5f0d43"; - sha256 = "1g9m00qljhlw56h3hgfq67ywf4r92nl37m7x5mxa7ygaxc0dyb14"; + rev = version; + sha256 = "sha256-CrN9F/WJKmlDN7eozEHtKgGUQBWVwTqwjnrfiATk7lI="; }; + patches = [ + (fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-3.63.0-autoconf-2.70.patch?id=4fe8a9e6c60f9163cadad830ba4935c069c67b10"; + sha256 = "sha256-2V4cextjcEQrywe4tvvD5KaVYdXnwdNhTiY/aSNx3mM="; + }) + (fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-3.61.0-imagemagick-7.patch?id=985c92af4730d864e86fa87746185b0246e9db93"; + sha256 = "sha256-dfdVMp3ZfclYeRxYjMIvl+ZdlLn9S+IwQ+OmlHW8318="; + }) + ]; + nativeBuildInputs = [ autoreconfHook pkg-config @@ -49,8 +63,8 @@ in stdenv.mkDerivation rec { # create fake udev and sane config mkdir -p $out/etc/{sane.d,udev/rules.d} touch $out/etc/sane.d/dll.conf + # absolute paths to convert & tesseract - sed -i '/\[AC_DEFINE(\[HAVE_IMAGE_MAGICK\], \[1\])/a \ MAGICK_CONVERT="${imagemagick}/bin/convert"' configure.ac substituteInPlace filters/magick.cpp \ --replace 'convert ' '${imagemagick}/bin/convert ' substituteInPlace filters/reorient.cpp \ @@ -77,6 +91,10 @@ in stdenv.mkDerivation rec { doInstallCheck = false; + postInstall = lib.optionalString withNetworkScan '' + ln -s ${utsushi-networkscan}/libexec/utsushi/networkscan $out/libexec/utsushi + ''; + meta = with lib; { description = "SANE utsushi backend for some Epson scanners"; longDescription = '' diff --git a/pkgs/misc/drivers/utsushi/networkscan.nix b/pkgs/misc/drivers/utsushi/networkscan.nix new file mode 100644 index 0000000000000..09230b16cb44b --- /dev/null +++ b/pkgs/misc/drivers/utsushi/networkscan.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, rpmextract }: + +stdenv.mkDerivation rec { + pname = "imagescan-plugin-networkscan"; + imagescanVersion = "3.65.0"; + version = "1.1.4"; + + src = fetchurl { + url = "https://download2.ebz.epson.net/imagescanv3/fedora/latest1/rpm/x64/imagescan-bundle-fedora-32-${imagescanVersion}.x64.rpm.tar.gz"; + sha256 = "sha256-fxi63sV+YJOlv1aVTfCPIXOPfNAo+R7zNPvA11sFmMk="; + }; + + nativeBuildInputs = [ rpmextract ]; + + installPhase = '' + rpmextract plugins/imagescan-plugin-networkscan-${version}-*.x86_64.rpm + install -Dm755 usr/libexec/utsushi/networkscan $out/libexec/utsushi/networkscan + patchelf \ + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ + --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc ]} \ + $out/libexec/utsushi/networkscan + ''; + + meta = with lib; { + homepage = "https://support.epson.net/linux/en/imagescanv3.php"; + description = "Network scan plugin for ImageScan v3"; + license = licenses.unfree; + maintainers = with maintainers; [ abbradar ]; + platforms = [ "x86_64-linux" ]; + }; +} |