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

cnijfilter-common: add generic build method for Canon printer drivers (help needed) #87083

Open
wants to merge 2 commits into
base: master
from

Conversation

@chpatrick
Copy link
Contributor

chpatrick commented May 6, 2020

Motivation for this change

Older Canon printers need a different driver version for each printer. Currently we have a couple of versions implemented by hand, but it would be much better to have a generic implementation that can build any version. This package is a port of a Gentoo solution found here.

Things done

I've ported the generic framework and mostly got it working. I've also added an instance of a particular driver version. It would be great if someone could help me out with finishing it.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.
@chpatrick chpatrick mentioned this pull request May 6, 2020
5 of 10 tasks complete
@chpatrick chpatrick force-pushed the chpatrick:cnijfilter-common branch from b65d189 to bc55208 May 6, 2020
@turion
Copy link
Contributor

turion commented May 6, 2020

Right now this fails for me:

gcc  -O2 -L../..//libs_bin64  -o cif bjferror.o bjfilter.o bjfimage.o bjfoption.o bjfpos.o bjfrcaccess.o getipc.o bjflist.o -lcnbpcmcm -lcnbpess -lm -ldl -ltiff -lpng -lcnbpcnclapi -lcnbpcnclbjcmd -lcnbpcnclui -lpopt 
/nix/store/sq2b0dqlq243mqn4ql5h36xmpplyy20k-binutils-2.31.1/bin/ld: cannot find -lcnbpcmcm
/nix/store/sq2b0dqlq243mqn4ql5h36xmpplyy20k-binutils-2.31.1/bin/ld: cannot find -lcnbpess
collect2: error: ld returned 1 exit status
@chpatrick
Copy link
Contributor Author

chpatrick commented May 6, 2020

Yes, I see the same thing. Oddly, if I build step-by-step in nix-shell it doesn't happen. BTW, for development it's a good idea to comment out all but one printer model, then it configures much faster.

@turion
Copy link
Contributor

turion commented May 6, 2020

How exactly do you build step by step? (I'd like to reproduce)

BTW, for development it's a good idea to comment out all but one printer model, then it configures much faster.

Oh thanks, that's a good hint :) maybe it's possible to make each printer model its own derivation?

@turion
Copy link
Contributor

turion commented May 6, 2020

My attempt:

$ nix-shell -A pkgs.cnijfilter-common.cnijfilter-3_80

[nix-shell] $ phases="configurePhase buildPhase" genericBuild
configuring
libs
bash: pushd: libs: No such file or directory

exit

Any idea what I'm doing wrong?

@chpatrick
Copy link
Contributor Author

chpatrick commented May 6, 2020

I usually do it like this:

From the nixpkgs directory:

nix-shell default.nix --pure -A pkgs.cnijfilter-common
mkdir /tmp/canon-build
cd /tmp/canon-build
unpackPhase
cd cnijfilter-source-3.80-1
patchPhase
eval "$configurePhase"
eval "$buildPhase"
@chpatrick
Copy link
Contributor Author

chpatrick commented May 6, 2020

Oh thanks, that's a good hint :) maybe it's possible to make each printer model its own derivation?

I think initially we should just replicate what the Gentoo overlay does and have packages supporting multiple printers (since most users will just get it from Hydra anyway). We should also have some nixos module that selects the appropriate package for your printer.

Then for v2, we could move to the approach suggested here where the common part is built separately and each printer has its own package.

@turion
Copy link
Contributor

turion commented May 6, 2020

-lcnbpcmcm

The error must be that some environment variable is not set. The correct library name should be e.g. -lcnbpcmcm402, where 402 corresponds to some model id. I guess this works in the nix-shell because it persists some environment variables differently?

@chpatrick chpatrick force-pushed the chpatrick:cnijfilter-common branch from bc55208 to 43e552a May 6, 2020
@chpatrick
Copy link
Contributor Author

chpatrick commented May 6, 2020

Excellent, thanks for your help. cnijfilter_3_80 now builds, but some stuff seems to end up in $out/usr/libexec/cups/backend/, the cnijnet and cnijusb executables.

@chpatrick
Copy link
Contributor Author

chpatrick commented May 6, 2020

I ported the ebuilds for the other driver versions, sadly most of them don't build yet.

@turion
Copy link
Contributor

turion commented May 7, 2020

@terlar does it work for you on this branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.