brother-overlay icon indicating copy to clipboard operation
brother-overlay copied to clipboard

eclass for shared code

Open automorphism88 opened this issue 6 years ago • 1 comments

As suggested in the comments on this PR, it might be useful to create an eclass to share code between ebuilds for different printers. Specifically, I think the following could be shared:

  • Common dependencies (i.e. cups for net-print ebuilds, sane for media-gfx ebuilds)
  • Any necessary settings of RESTRICT or other global variables
  • Inherit linux-info and multilib eclasses to use in a shared pkg_setup phase function
  • Inherit rpm eclass to use in a shared src_unpack phase function
  • Low level functions to fix paths, extract PPD, etc.
  • Possibly shared src_prepare and src_install phase functions using the above low-level functions

I'm willing to help in creating this eclass, and think much of the code could be copy/pasted from my net-print/brother-mfc7460dn-bin ebuild, with appropriate adaptation. However, before actually creating the eclass, I thought it'd be useful to discuss what exactly it should do, to maximize its usefulness. The drivers for different models are similar enough that I envision the possibility of individual ebuilds not having to do much more than inherit a common eclass.

automorphism88 avatar Apr 21 '18 00:04 automorphism88

Sorry, I still haven't looked into this, but I find it a highly interesting direction and a very good approach. By now this repository contains a lot more scanner and printer then I would have assumed and I'm not able to test the ebuilds on only on a fraction of the devices. So already from the point of maintenance I think it would be good to centralise some of this functionality.

At the moment it's not clear for me which printer drivers are affected by issue #48 . I think these should be the first that profit from the eclass to start working properly.

In the long run all/most of the other existing ebuilds should be updated, but this should happen in an automated way as there are just too many. For me the question is more in the way of "for which subset of printers" should this eclass be useful and how can the script generator/brother-generator.sh be used to regenerate up-to-date ebuilds?

I don't know if this helps but that's currently in my head. :)

stefan-langenmaier avatar May 02 '18 21:05 stefan-langenmaier