Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utsushi: init at 3.57.0 #65223

Merged
merged 3 commits into from Aug 14, 2019
Merged

utsushi: init at 3.57.0 #65223

merged 3 commits into from Aug 14, 2019

Conversation

symphorien
Copy link
Member

Motivation for this change

#64985

Things done

Completely untested as I don't have access to the corresponding hardware.
@thedavidmeister can you test this and probably fix the problem you encounter ?

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

pkgs/misc/drivers/utsushi/default.nix Outdated Show resolved Hide resolved
pkgs/misc/drivers/utsushi/default.nix Outdated Show resolved Hide resolved
pkgs/misc/drivers/utsushi/default.nix Outdated Show resolved Hide resolved
@symphorien
Copy link
Member Author

Thanks for your review, @jtojnar. I will wait for @thedavidmeister feedback before applying your suggestions, though.

@symphorien
Copy link
Member Author

@thedavidmeister this version should not require imagemagick in $PATH. Can you test it ?

@thedavidmeister
Copy link
Contributor

@symphorien

latest is that utsushi mostly works (it complains about a config file on launch)

[thedavidmeister@nixos:~/nixpkgs]$ utsushi 

(utsushi-scan-gtkmm:16750): Gtk-WARNING **: 16:58:14.446: Unable to locate theme engine in module_path: "adwaita",

(utsushi-scan-gtkmm:16750): Gtk-WARNING **: 16:58:14.449: Unable to locate theme engine in module_path: "adwaita",
2019-Aug-06 16:58:14.452841[140027803146816]: duplicate key:26:combo007.udi = combo::?adf=esci:usb:04b8:0176&fb=esci:gt-s650:usb:04b8:013c
2019-Aug-06 16:58:14.453012[140027803146816]: duplicate key:30:combo007.udi = combo::?adf=esci:usb:04b8:016b&fb=esci:gt-s650:usb:04b8:013d
2019-Aug-06 16:58:14.453123[140027803146816]: duplicate key:31:combo007.udi = combo::?adf=esci:usb:04b8:0176&fb=esci:gt-s650:usb:04b8:013d
2019-Aug-06 16:58:14.453594[140027803146816]: no such file: /nix/store/4c3wc2ywgysci5l93nn6kwalsssqqkxw-imagescanv3-3.57.0/etc/utsushi/utsushi.conf
2019-Aug-06 16:58:14.617730[140027803146816]: falling back to device defaults
2019-Aug-06 16:58:14.623712[140027803146816]: disabling flip-side scan parameter support
2019-Aug-06 16:58:38.626148[140027626374912]: assuming top-to-bottom scan direction

and xsane does not work, still erroring on convert

[thedavidmeister@nixos:~/nixpkgs]$ xsane

(xsane:21488): Gtk-WARNING **: 17:23:03.112: Unable to locate theme engine in module_path: "adwaita",

(xsane:21488): Gtk-WARNING **: 17:23:03.115: Unable to locate theme engine in module_path: "adwaita",
sh: convert: command not found

@lukateras
Copy link
Member

lukateras commented Aug 6, 2019

$out/libexec/utsushi/get-text-orientation is likely to be causing this failure. While this doesn't fix the root cause of the issue (i.e. why first argument to get-text-orientation still assumes ImageMagick convert is on $PATH), this should help:

  postFixup = ''
    substituteInPlace $out/libexec/utsushi/get-text-orientation \
      --replace '$convert' ${imagemagick}/bin/convert
  '';

@symphorien
Copy link
Member Author

I won't have time to try other things this week, unfortunately. Try what @yegortimoshenko said, or attach a debugger on xsane, break on execve and or system and figure out what exactly is calling convert.
I checked quickly that no library in the dependency tree of libsane-utsushi.so contains the string convert except in human readable sentences or as an absolute path.

@symphorien
Copy link
Member Author

oh, by the way, after you rebuilt with the new version, did you reboot ?

@thedavidmeister
Copy link
Contributor

thedavidmeister commented Aug 10, 2019

@symphorien @yegortimoshenko i probably did not reboot, here is the latest

xsane

[thedavidmeister@nixos:~]$ xsane

(xsane:1903): Gtk-WARNING **: 14:22:33.899: Unable to locate theme engine in module_path: "adwaita",

(xsane:1903): Gtk-WARNING **: 14:22:33.903: Unable to locate theme engine in module_path: "adwaita",
2019-Aug-10 14:22:34.153609[140591011195520]: duplicate key:26:combo007.udi = combo::?adf=esci:usb:04b8:0176&fb=esci:gt-s650:usb:04b8:013c
2019-Aug-10 14:22:34.153885[140591011195520]: duplicate key:30:combo007.udi = combo::?adf=esci:usb:04b8:016b&fb=esci:gt-s650:usb:04b8:013d
2019-Aug-10 14:22:34.153967[140591011195520]: duplicate key:31:combo007.udi = combo::?adf=esci:usb:04b8:0176&fb=esci:gt-s650:usb:04b8:013d
2019-Aug-10 14:22:34.154945[140591011195520]: no such file: /nix/store/4c3wc2ywgysci5l93nn6kwalsssqqkxw-imagescanv3-3.57.0/etc/utsushi/utsushi.conf
2019-Aug-10 14:22:44.590940[140591011195520]: falling back to device defaults
2019-Aug-10 14:22:44.596877[140591011195520]: disabling flip-side scan parameter support
2019-Aug-10 14:22:58.033103[140590813935360]: assuming top-to-bottom scan direction
2019-Aug-10 14:23:00.205905[140591011195520]: sane_utsushi_set_io_mode: Operation not supported
2019-Aug-10 14:23:03.394898[140591011195520]: sane_utsushi_read: End of file reached

(xsane:1903): Gtk-CRITICAL **: 14:23:03.435: IA__gtk_widget_set_sensitive: assertion 'GTK_IS_WIDGET (widget)' failed

utsushi

[thedavidmeister@nixos:~]$ utsushi 

(utsushi-scan-gtkmm:2444): Gtk-WARNING **: 14:24:14.980: Unable to locate theme engine in module_path: "adwaita",

(utsushi-scan-gtkmm:2444): Gtk-WARNING **: 14:24:15.054: Unable to locate theme engine in module_path: "adwaita",
2019-Aug-10 14:24:15.188426[139998712957504]: duplicate key:26:combo007.udi = combo::?adf=esci:usb:04b8:0176&fb=esci:gt-s650:usb:04b8:013c
2019-Aug-10 14:24:15.189154[139998712957504]: duplicate key:30:combo007.udi = combo::?adf=esci:usb:04b8:016b&fb=esci:gt-s650:usb:04b8:013d
2019-Aug-10 14:24:15.189363[139998712957504]: duplicate key:31:combo007.udi = combo::?adf=esci:usb:04b8:0176&fb=esci:gt-s650:usb:04b8:013d
2019-Aug-10 14:24:15.191404[139998712957504]: no such file: /nix/store/4c3wc2ywgysci5l93nn6kwalsssqqkxw-imagescanv3-3.57.0/etc/utsushi/utsushi.conf
2019-Aug-10 14:24:15.907100[139998712957504]: falling back to device defaults
2019-Aug-10 14:24:15.917235[139998712957504]: disabling flip-side scan parameter support
2019-Aug-10 14:24:35.610428[139998485542656]: assuming top-to-bottom scan direction

looks good!

@symphorien
Copy link
Member Author

looks good!

You mean that scanning works with xsane, despite the error messages ?

@thedavidmeister
Copy link
Contributor

@symphorien yeah it all seems to work fine to me on both xsane and utsushi

i'm not expert but i've got PDFs popping out so 🤷‍♂️

@symphorien symphorien marked this pull request as ready for review August 13, 2019 08:10
@symphorien
Copy link
Member Author

Great!
The PR should be good to merge, then :)

@@ -0,0 +1,3 @@
absolute-path-to-convert.patch
print-errors.patch
absolute_path_for_tesseract.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be committed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the patches have to be modified in the future (there are updates of this driver, the last one was this year) it will be easier to do this with quilt and this file. But I agree this is a very small advantage.

*/

stdenv.mkDerivation rec {
pname = "imagescanv3";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably match the package name (utsushi).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Alternatively, this package could use the "community source" at
https://gitlab.com/utsushi/utsushi/
Epson provides proprietary plugins for networking, ocr and some more
scanner models. Those are not (yet ?) packaged here.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be easier to upstream these patches to a community fork.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unable to build the community sources (autoconf fails with

configure.ac:54: error: possibly undefined macro: AS_IF
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:205: error: possibly undefined macro: AC_MSG_ERROR

)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukateras
Copy link
Member

@GrahamcOfBorg build utsushi

@lukateras lukateras merged commit 757ac88 into NixOS:master Aug 14, 2019
@symphorien symphorien mentioned this pull request Sep 30, 2019
10 tasks
@symphorien symphorien deleted the utsushi branch March 21, 2020 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants