[gjs] package: Fix initSubmodule() with Meson.



commit edd761920b3897fd7781f560e9e9c5ba4bb4ed6f
Author: Patrick Griffis <tingping tingping se>
Date:   Tue May 2 08:36:02 2017 -0400

    package: Fix initSubmodule() with Meson.
    
    Meson enforces that submodules go under a subprojects directory.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782065

 modules/package.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/modules/package.js b/modules/package.js
index ca167c2..87bbe6b 100644
--- a/modules/package.js
+++ b/modules/package.js
@@ -44,6 +44,7 @@ var localedir;
 /*< private >*/
 let _pkgname;
 let _base;
+let _submoduledir;
 
 function _findEffectiveEntryPointName() {
     let entryPoint = System.programInvocationName;
@@ -131,6 +132,7 @@ function init(params) {
         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;
@@ -145,6 +147,7 @@ function init(params) {
         pkglibdir = libpath = girpath = GLib.build_filenamev([bld, 'lib']);
         pkgdatadir = GLib.build_filenamev([bld, 'data']);
         localedir = GLib.build_filenamev([bld, 'po']);
+        _submoduledir = GLib.build_filenamev([bld, 'subprojects']);
 
         try {
             let resource = Gio.Resource.load(GLib.build_filenamev([bld, 'src',
@@ -259,8 +262,12 @@ function initSubmodule(name) {
     if (moduledir != pkgdatadir) {
         // Running from source tree, add './name' to search paths
 
-        let submoduledir = GLib.build_filenamev([_base, name]);
-        let libpath = GLib.build_filenamev([submoduledir, '.libs']);
+        let submoduledir = GLib.build_filenamev([_submoduledir, name]);
+        let libpath;
+        if (_runningFromMesonSource())
+            libpath = submoduledir;
+        else
+            libpath = GLib.build_filenamev([submoduledir, '.libs']);
         GIRepository.Repository.prepend_search_path(submoduledir);
         GIRepository.Repository.prepend_library_path(libpath);
     } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]