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

net-print/brother-mfc7460dn-bin: New ebuild #52

Merged

Conversation

automorphism88
Copy link
Contributor

@automorphism88 automorphism88 commented Apr 14, 2018

There's already an ebuild for this printer, but it's effectively just a virtual for net-print/brother-genml1-bin. Brother offers a different driver that's specific to this model and my new ebuild installs that instead.

I'm not 100% sure if RESTRICT="strip" is necessary, I just copied it from the net-print/brother-genml1-bin ebuild, along with the pkg_setup and src_unpack functions.

The src_prepare and src_install functions were written to mimic the behavior of the upstream install script, using the net-print/brother-genml1-bin ebuild as a guide to determine where files should be installed.

I personally own this printer and can confirm that the ebuild in this PR works for me and the version currently in the overlay does not, even though Brother's documentation says that the genml1 driver should work with this model. (For reference, the printer is connected via network, not USB, and has a static IP. Scanning works fine with the existing media-gfx/brother-mfc7460dn-bin ebuild.) I still keyworded my ebuild as testing since it's brand new, but it's already been tested on the actual hardware by me.

Add printer driver specifically for this model, instead of just a
virtual for net-print/brother-genml1-bin
@stefan-langenmaier
Copy link
Owner

Thanks for your extensive pull request. I hope this can be used as a template for further ebuilds. :)

@stefan-langenmaier stefan-langenmaier merged commit 63dbe11 into stefan-langenmaier:master Apr 14, 2018
@stefan-langenmaier
Copy link
Owner

If you want, you can also open an issue concerning the RESTRICT="strip" feature.

@automorphism88
Copy link
Contributor Author

Thanks for your extensive pull request. I hope this can be used as a template for further ebuilds. :)

Part of the reason I created separate files for the sed scripts used in src_prepare instead of using the sed -e option was to make it easier to use them with other ebuilds, possibly with adaptation. I'm not sure how similar the install scripts for other models are in terms of things like the heredoc delimiters that are used, filenames, etc., but if they're similar enough, it seems like this is the sort of thing that could make a good eclass, so that the code can be directly shared between ebuilds, rather than just used as a template.

I would be willing to help create a brother-utils.eclass or something along those lines for other ebuilds to inherit, but I would need to research the other ebuilds in the tree to know how much code could be shared with them. I haven't really looked at any of them closely except for net-print/brother-genml1-bin. But it should at least be possible to share low-level functions to extract the heredocs from the install scripts, and higher-level brother-utils_src_prepare and brother-utils_src_install functions are possible too if the process is similar enough across the different models.

If you want, you can also open an issue concerning the RESTRICT="strip" feature.

I don't really have anything to say on the subject, as I haven't tested it and don't know why it was added in the first place. It's not such a huge deal for these drivers since the binaries that get installed are very small anyway, so making them a few kilobytes smaller by stripping the symbols would be pretty negligible in the greater scheme of things.

However, as a general rule, RESTRICT="strip" should only be used if it's actually necessary, i.e., if it breaks something to not use it. And if it is known to break if symbols are stripped, it'd be a good idea to add a comment explaining the issue. If it needs to be set for all of these ebuilds, that's another thing that could be done from an eclass, so the comment wouldn't need to be duplicated.

@automorphism88
Copy link
Contributor Author

automorphism88 commented Apr 14, 2018

Thanks for your extensive pull request.

Just like Stallman, I only wanted my printer to work :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants