GNOME Bugzilla – Bug 781883
Add Meson running from source support to package.js
Last modified: 2017-05-02 05:52:50 UTC
Created attachment 350619 [details] [review] package: Support running Meson projects from source This allows easily running a Meson project from source similar to the Autotools support.
Review of attachment 350619 [details] [review]: This seems fine, but could you give some more background about why it's needed? Who defines the MESON_BUILD_ROOT and MESON_SOURCE_ROOT variables? ::: modules/package.js @@ +61,3 @@ +function _runningFromMesonSource() { + return ( Minor nitpick: parentheses not necessary @@ +142,3 @@ + } else if (_runningFromMesonSource()) { + log('Running from Meson, using local files'); + let _bld = GLib.getenv('MESON_BUILD_ROOT'); Minor nitpick: underscores not necessary - those were only needed for module-level private variables
(In reply to Philip Chimento from comment #1) > Review of attachment 350619 [details] [review] [review]: > > This seems fine, but could you give some more background about why it's > needed? Who defines the MESON_BUILD_ROOT and MESON_SOURCE_ROOT variables? It is needed because unlike Autotools Meson always builds out of tree, so you can't just use relative paths to the script for everything. These env vars are set by Meson itself when you use the `run_target()` function in Meson. An example of this is here: https://github.com/TingPing/gjs-meson-template/blob/master/src/meson.build So you can just do `ninja run` and it will run out of tree.
OK, `ninja run` was the piece of the puzzle I was missing, thanks. It would be good if you could add that context to the commit message.
Created attachment 350793 [details] [review] package: Support running Meson projects from source
Review of attachment 350793 [details] [review]: +1, thanks for the changes.
Attachment 350793 [details] pushed as d083e39 - package: Support running Meson projects from source