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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chpatrick
Copy link
Contributor

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.

@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

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

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

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
Copy link
Contributor Author

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?

@stale
Copy link

stale bot commented Nov 3, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 3, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 25, 2020
@SuperSandro2000 SuperSandro2000 added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 25, 2020
@SuperSandro2000 SuperSandro2000 marked this pull request as draft January 18, 2021 19:02
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 18, 2021
@stale
Copy link

stale bot commented Jul 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 19, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
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