[Nix-dev] canon printer drivers (cnijfilter)

Matt McHenry matt at mchenryfamily.org
Wed Jun 21 13:47:41 CEST 2017


The error doesn't show up in the cups log -- the only thing it says is
"Error: CNCL_SetParam" -- but to cups, the process it spawned seems to have
succeeded.  See attached log.

As I recall, the problem is that one of the executables that gets built
then tries to load one of binary libraries included in the tarball from
canon, and can't find it.  I'll have to go refresh my memory some more, but
won't have time until this evening.

I have not tried patchelf -- that may be a good lead.

I don't think a FHS env will work, because as you say, the cups service
can't be run in there.

On Wed, Jun 21, 2017 at 2:36 AM, Nawal Husnoo <nawal at husnoo.com> wrote:

> Thanks for that Matt!
>
> I wonder if the versioning thing is a windows-related behaviour.
>
> Could you say a few words about the link errors you had? Have you used
> patchelf?
>
> >* patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
> *>*     --set-rpath $libPath:$out/lib \
> *>*     $out/bin/cngpijmonmp250*
>
> Another option I could live with is if we could create a buildFHSUserEnv -
> I tried it with the binary canon drivers, but it turned out it's cups that
> needs to be inside for the pesky things to be found, but then systemd
> wouldn't let me restart cups.service inside a user env...
>
> Cheers,
>
> Nawal.
>
>
>
> On 21 June 2017 at 01:49, Matt McHenry <matt at mchenryfamily.org> wrote:
>
>> Hi Nawal,
>>
>> I see you've been trying to get canon's linux drivers working on nixos
>> [1][2][3].  I've also tried my hand at this.  I think I've made more
>> progress than you, but was never able to get it working, and eventually
>> resigned myself to just printing with the gutenprint driver.  I'd be
>> interested in continuing to hack at it as time permits, though.
>>
>> I got to the point of cups executing what I think is the correct chain of
>> filters, all built from the source that my nix expression pulls from the
>> Canon Japan website.  However, at least one of the filters is unable to
>> load at least one dynamically linked library, so it fails.  I don't know
>> much about shared libraries on linux in general or NixOS in particular, so
>> I was mostly just thrashing around a lot.
>>
>> I've pushed what I have to the cnijfilter branch in my nixpkgs clone
>> [4].  To try it, just add pkgs.cnijfilter to services.printing.drivers in
>> configuration.nix.  (I also tried adding cnijfilter to
>> environment.systemPackages, that didn't seem to help.)
>>
>> I've gleaned a lot from the other distros builds [5][6][7].  In
>> particular, the cnijfilter-common library does not follow a normal
>> versioning pattern -- each version supports a certain set of printers.  So
>> you don't want the latest, you want whatever matches up with your printer.
>> (My printer is an MX-700, which uses the mp520 driver.  So I've been
>> working on version 2.80 of cnijfilter-common.)  But my hope is that the
>> overall structure of the build would be very portable between versions.
>>
>> It looks like you've worked from the debian packages -- perhaps looking
>> in more detail at how they are built will give us some more clues?
>>
>> I'm not sure whether it makes more sense to open an issue to document
>> this work, or keep discussing on the mailing list.
>>
>> [1] https://mailman.science.uu.nl/pipermail/nix-dev/2017-June/023942.html
>> [2] https://mailman.science.uu.nl/pipermail/nix-dev/2017-June/023943.html
>> [3] https://mailman.science.uu.nl/pipermail/nix-dev/2017-June/023946.html
>>
>> [4] https://github.com/jerith666/nixpkgs/tree/cnijfilter
>>
>> [5] https://bugs.gentoo.org/show_bug.cgi?id=130645
>> [6] https://aur.archlinux.org/packages/cnijfilter-mp620/?comments=all
>> [7] https://github.com/spremi/cnijfilter-source-3.80
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170621/1f72c274/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cups-cnijfilter
Type: application/octet-stream
Size: 17916 bytes
Desc: not available
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170621/1f72c274/attachment-0001.obj>


More information about the nix-dev mailing list