{"action":"created","issue":{"url":"https://api.github.com/repos/stefan-langenmaier/brother-overlay/issues/52","repository_url":"https://api.github.com/repos/stefan-langenmaier/brother-overlay","labels_url":"https://api.github.com/repos/stefan-langenmaier/brother-overlay/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/stefan-langenmaier/brother-overlay/issues/52/comments","events_url":"https://api.github.com/repos/stefan-langenmaier/brother-overlay/issues/52/events","html_url":"https://github.com/stefan-langenmaier/brother-overlay/pull/52","id":314303089,"number":52,"title":"net-print/brother-mfc7460dn-bin: New ebuild","user":{"login":"automorphism88","id":19507282,"avatar_url":"https://avatars3.githubusercontent.com/u/19507282?v=4","gravatar_id":"","url":"https://api.github.com/users/automorphism88","html_url":"https://github.com/automorphism88","followers_url":"https://api.github.com/users/automorphism88/followers","following_url":"https://api.github.com/users/automorphism88/following{/other_user}","gists_url":"https://api.github.com/users/automorphism88/gists{/gist_id}","starred_url":"https://api.github.com/users/automorphism88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automorphism88/subscriptions","organizations_url":"https://api.github.com/users/automorphism88/orgs","repos_url":"https://api.github.com/users/automorphism88/repos","events_url":"https://api.github.com/users/automorphism88/events{/privacy}","received_events_url":"https://api.github.com/users/automorphism88/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-14T06:09:43Z","updated_at":"2018-04-14T09:29:18Z","closed_at":"2018-04-14T08:19:47Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/stefan-langenmaier/brother-overlay/pulls/52","html_url":"https://github.com/stefan-langenmaier/brother-overlay/pull/52","diff_url":"https://github.com/stefan-langenmaier/brother-overlay/pull/52.diff","patch_url":"https://github.com/stefan-langenmaier/brother-overlay/pull/52.patch"},"body":"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.\r\n\r\nI'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.\r\n\r\nThe `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.\r\n\r\nI 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."},"comment":{"url":"https://api.github.com/repos/stefan-langenmaier/brother-overlay/issues/comments/381316443","html_url":"https://github.com/stefan-langenmaier/brother-overlay/pull/52#issuecomment-381316443","issue_url":"https://api.github.com/repos/stefan-langenmaier/brother-overlay/issues/52","id":381316443,"user":{"login":"automorphism88","id":19507282,"avatar_url":"https://avatars3.githubusercontent.com/u/19507282?v=4","gravatar_id":"","url":"https://api.github.com/users/automorphism88","html_url":"https://github.com/automorphism88","followers_url":"https://api.github.com/users/automorphism88/followers","following_url":"https://api.github.com/users/automorphism88/following{/other_user}","gists_url":"https://api.github.com/users/automorphism88/gists{/gist_id}","starred_url":"https://api.github.com/users/automorphism88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/automorphism88/subscriptions","organizations_url":"https://api.github.com/users/automorphism88/orgs","repos_url":"https://api.github.com/users/automorphism88/repos","events_url":"https://api.github.com/users/automorphism88/events{/privacy}","received_events_url":"https://api.github.com/users/automorphism88/received_events","type":"User","site_admin":false},"created_at":"2018-04-14T09:29:18Z","updated_at":"2018-04-14T09:29:18Z","author_association":"CONTRIBUTOR","body":"> Thanks for your extensive pull request. I hope this can be used as a template for further ebuilds. :)\r\n\r\nPart 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.\r\n\r\nI 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.\r\n\r\n> If you want, you can also open an issue concerning the `RESTRICT=\"strip\"` feature.\r\n\r\nI 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.\r\n\r\nHowever, 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."}}
{"actor":{"display_login":"automorphism88"}}