[gjs: 1/2] package: Reverse order of running-from-source checks
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/2] package: Reverse order of running-from-source checks
- Date: Sun, 6 Mar 2022 00:45:34 +0000 (UTC)
commit 70739bee12f2f9c229978dd2dfda27f201373fbe
Author: Philip Chimento <philip chimento gmail com>
Date: Wed Mar 2 21:12:05 2022 -0800
package: Reverse order of running-from-source checks
The "run from source" feature has recently broken, though I'm not sure
exactly how recently. My best theory is that this is because Meson may
have changed how it organizes its build directory in recent versions, and
the new layout unfortunately means that the check in _runningFromSource()
succeeds under Meson, where before it did not.
Switching the order of _runningFromSource() and _runningFromMesonSource()
fixes the problem, since _runningFromMesonSource() relies on
Meson-specific environment variables and will definitely not succeed in a
non-Meson environment.
modules/script/package.js | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/modules/script/package.js b/modules/script/package.js
index 757f263e7..1491b0639 100644
--- a/modules/script/package.js
+++ b/modules/script/package.js
@@ -115,20 +115,7 @@ function init(params) {
datadir = GLib.build_filenamev([prefix, 'share']);
let libpath, girpath;
- if (_runningFromSource()) {
- log('Running from source tree, using local files');
- // Running from source directory
- _base = GLib.get_current_dir();
- _submoduledir = _base;
- pkglibdir = GLib.build_filenamev([_base, 'lib']);
- libpath = GLib.build_filenamev([pkglibdir, '.libs']);
- girpath = pkglibdir;
- pkgdatadir = GLib.build_filenamev([_base, 'data']);
- localedir = GLib.build_filenamev([_base, 'po']);
- moduledir = GLib.build_filenamev([_base, 'src']);
-
- GLib.setenv('GSETTINGS_SCHEMA_DIR', pkgdatadir, true);
- } else if (_runningFromMesonSource()) {
+ if (_runningFromMesonSource()) {
log('Running from Meson, using local files');
let bld = GLib.getenv('MESON_BUILD_ROOT');
let src = GLib.getenv('MESON_SOURCE_ROOT');
@@ -147,6 +134,19 @@ function init(params) {
} catch (e) {
moduledir = GLib.build_filenamev([src, 'src']);
}
+ } else if (_runningFromSource()) {
+ log('Running from source tree, using local files');
+ // Running from source directory
+ _base = GLib.get_current_dir();
+ _submoduledir = _base;
+ pkglibdir = GLib.build_filenamev([_base, 'lib']);
+ libpath = GLib.build_filenamev([pkglibdir, '.libs']);
+ girpath = pkglibdir;
+ pkgdatadir = GLib.build_filenamev([_base, 'data']);
+ localedir = GLib.build_filenamev([_base, 'po']);
+ moduledir = GLib.build_filenamev([_base, 'src']);
+
+ GLib.setenv('GSETTINGS_SCHEMA_DIR', pkgdatadir, true);
} else {
_base = prefix;
pkglibdir = GLib.build_filenamev([libdir, _pkgname]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]