anchor.diff:      # 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 \
  
positive.code:       [ -r .rev ] && cat .rev || true
      fi
    '';
  in stdenv.mkDerivation rec {
    pname = "utsushi";
    version = "unstable-2021-01-01";
  
    src = fetchFromGitLab {
      owner = pname;
      repo = pname;
      rev = "1646d7d301f3d2aeb24930696688853fed5f0d43";
      sha256 = "1g9m00qljhlw56h3hgfq67ywf4r92nl37m7x5mxa7ygaxc0dyb14";
    };
  
    nativeBuildInputs = [
      autoreconfHook
  
negative.code: { lib, stdenv, writeScriptBin, fetchpatch, fetchFromGitLab, autoreconfHook, pkg-config
  , autoconf-archive, libxslt, boost, gtkmm2, imagemagick, sane-backends
  , tesseract4, udev, libusb1
  , withNetworkScan ? false, utsushi-networkscan
  }:
  
  
  let
  