Created attachment 473662 [details, diff] meson.patch Hello. While reading meson.eclass and porting existing ebuilds to it, I found several problems with meson.eclass. Nothing serious, but some of them are rather annoying. 1. Unneeded dep on dev-util/ninja. meson.eclass calls only eninja (not ninja directly) and shouldn't bother how ninja-utils.eclass provides this function. 2. Unneeded '-v' option passed to eninja calls. ninja-utils.eclass already provides verbose builds as required per devmanual. No need to pass '-v' again. 3. meson_src_install doesn't call einstalldocs. Thus meson_src_install isn't consistent with default_src_install and all meson ebuilds must call einstalldocs manually to provide a complete set of files. 4. @DEFAULT_UNSET attribute is incorrectly applied to BUILD_DIR and EMESON_SOURCE. These variables have default values, they are not unset. 5. Minor inconsistencies in naming and quoting.
(In reply to Coacher from comment #0) > 1. Unneeded dep on dev-util/ninja. meson.eclass calls only eninja (not ninja > directly) and shouldn't bother how ninja-utils.eclass provides this function. The ninja dep is very much needed, or all meson.eclass users will have to manually add it. ninja-utils.eclass doesn't depend on ninja due to it only providing a function that is called; the callers need to provide the dep. This is some cmake-utils.eclass necessity or something (it only optionally uses ninja over make, but eninja function has to be always inherited)
Created attachment 473664 [details, diff] meson.patch (In reply to Mart Raudsepp from comment #1) > (In reply to Coacher from comment #0) > ninja-utils.eclass doesn't depend on ninja due to it only > providing a function that is called; the callers need to provide the dep. > This is some cmake-utils.eclass necessity or something (it only optionally > uses ninja over make, but eninja function has to be always inherited) Ok, I've updated the patch accordingly. Though I must say it is unexpected that consumers must provide the dep.
There is also this QA notice: * QA Notice: EXPORT_FUNCTIONS is called before inherit in meson.eclass. For * compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS after * inherit(s). I'm not sure if it's too serious since the mentioned portage versions are long gone now. But EXPORT_FUNCTIONS along with EAPI check should probably be moved under `if [[ -z ${_MESON_ECLASS} ]];` condition.
(In reply to Coacher from comment #0) > 4. @DEFAULT_UNSET attribute is incorrectly applied to BUILD_DIR and > EMESON_SOURCE. These variables have default values, they are not unset. BUILD_DIR does not have a default value in the global scope. It gets assigned later on, optionally. EMESON_SOURCE does not have a default value and is not assigned by the eclass. It merely has a fallback in the code. (In reply to Coacher from comment #3) > There is also this QA notice: > * QA Notice: EXPORT_FUNCTIONS is called before inherit in meson.eclass. For > * compatibility with <=portage-2.1.6.7, only call EXPORT_FUNCTIONS after > * inherit(s). > > I'm not sure if it's too serious since the mentioned portage versions are > long gone now. But EXPORT_FUNCTIONS along with EAPI check should probably be > moved under `if [[ -z ${_MESON_ECLASS} ]];` condition. Fix it anyway. EXPORT_FUNCTIONS should stay outside to avoid multiple-inheritance-disorder mess.
Created attachment 473666 [details, diff] meson.patch (In reply to Michał Górny from comment #4) > BUILD_DIR does not have a default value in the global scope. It gets > assigned later on, optionally. > > EMESON_SOURCE does not have a default value and is not assigned by the > eclass. It merely has a fallback in the code. I see. My understanding was incorrect. > Fix it anyway. EXPORT_FUNCTIONS should stay outside to avoid > multiple-inheritance-disorder mess. Done. Patch updated.
Created attachment 473670 [details, diff] meson.patch Another update after mgorny's suggestions on IRC re the previous version.
LGTM.
Looks good to me as well.
Fixed in commit 5fe09d0d25b28455f712ceab14fba82c82915531 Author: Coacher <itumaykin+gentoo@gmail.com> AuthorDate: Sun May 21 14:36:29 2017 -0500 Commit: William Hubbs <williamh@gentoo.org> CommitDate: Sun May 21 14:50:49 2017 -0500 meson.eclass: misc improvements for #619178 Thanks everyone.