[gtk-osx: 41/48] Fix finding bootstrap.modules locally.



commit 0d7b042d0658557ff60df4c0fa093a5a40f65b57
Author: John Ralls <jralls ceridwen us>
Date:   Tue May 7 12:04:47 2019 -0700

    Fix finding bootstrap.modules locally.
    
    It was defaulting to the one in jhbuild sources that doesn't work.

 README.md         | 21 ++++++++++++++++-----
 jhbuildrc-gtk-osx | 12 +++++++++---
 2 files changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/README.md b/README.md
index 20be519..eb381bd 100644
--- a/README.md
+++ b/README.md
@@ -144,11 +144,22 @@ Instead, jhbuildrc provides a new command
 jhbuild bootstrap-gtk-osx
 ```
 
-that looks for the gtk-osx bootstrap.modules, first in the configured
-modulesets_dir (you can set it in jhbuildrc-custom), then in the same
-directory as the target moduleset (set either in jhbuildrc-custom or
-with the -m command line option), and finally by retrieving it from
-gitlab.gnome.org.
+This command will by default load the bootstrap.modules from gtk-osx's
+Gitlab repository. If ```use_local_modules``` is true (default is
+false, override it in jhbuildrc-custom) and a file named
+bootstrap.modules exists in the same directory as the moduleset you've
+told jhbuild to use (set with ```moduleset = ``` in jhbuildrc-custom
+or the ```-m``` option to jhbuild) it will build that. This allows you
+to have a custom bootstrap.modules for your project.
+
+If you set ```use_local_modules``` to true and set ```modulesets_dir =
+``` to a valid path containing a file named bootstrap.modules then
+bootstrap-gtk-osx will build that moduleset instead.
+
+Note that in order to actually work the bootstrap.modules moduleset
+file must contain a meta-module named ```meta-bootstrap``` that
+depends on all of the modules that you want to build.
+
 
 ## Build Problems ##
 
diff --git a/jhbuildrc-gtk-osx b/jhbuildrc-gtk-osx
index 1be7542..3be1ddb 100644
--- a/jhbuildrc-gtk-osx
+++ b/jhbuildrc-gtk-osx
@@ -73,12 +73,17 @@ class _cmd_bootstrap_gtk_osx(jhbuild.commands.base.cmd_build):
     name = 'bootstrap-gtk-osx'
 
     def run(self, config, options, args, help=None):
+        global use_local_modulesets
         moduleset="bootstrap"
         modulesets_dir = os.path.dirname(config.moduleset)
-        if os.path.exists(os.path.join(modulesets_dir, moduleset + '.modules')):
+        if (use_local_modulesets and
+            os.path.exists(os.path.join(modulesets_dir,
+                                        moduleset + '.modules'))):
             config.modulesets_dir = modulesets_dir
             config.moduleset = moduleset
-        elif os.path.exists(os.path.join(config.modulesets_dir, moduleset + '.modules')):
+        elif (use_local_modulesets and config.modulesets_dir and
+              os.path.exists(os.path.join(config.modulesets_dir,
+                                          moduleset + '.modules'))):
             config.moduleset = moduleset
         else:
             config.moduleset = 
'https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/modulesets-stable/bootstrap.modules'
@@ -380,7 +385,8 @@ def setup_sdk(target=_target, sdk_version=None, architectures=[_default_arch]):
 # the command line.
 #
 moduleset = 'http://gitlab.gnome.org/GNOME/gtk-osx/raw/master/modulesets-stable/gtk-osx.modules'
-use_local_modulesets = True
+use_local_modulesets = False
+modulesets_dir = ""
 
 # A list of the modules to build. You can override this in
 # .jhbuildrc-custom or on the command line.


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