poke-devel
[Top][All Lists]
Advanced

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

[COMMITTED] build: support for --jitter-srcdir=DIR in `bootstrap'


From: Jose E. Marchesi
Subject: [COMMITTED] build: support for --jitter-srcdir=DIR in `bootstrap'
Date: Mon, 23 Nov 2020 09:23:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

The patch we sent to gnulib for the `boostrap' script to accept
user-defined hooks to handle command line options has been integrated
upstream.

This patch uses this support it in order to add a new option to our
bootstrap: --jitter-srcdir, which can be used along with --no-git in
order to avoid accessing the internet while bootstrapping.

2020-11-23  Jose E. Marchesi  <jemarch@gnu.org>

        * bootstrap: Updated from latest gnulib.
        * DEV-NEWS: Update.
        * bootstrap.conf (bootstrap_option_hook): New function.
        (bootstrap_print_option_usage_hook): Likewise.
        (bootstrap_post_import_hook): Honor --jitter-srcdir.
---
 ChangeLog      |  4 ++++
 DEV-NEWS       |  4 ++++
 bootstrap.conf | 38 ++++++++++++++++++++++++++++++++++----
 3 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 72a3acab..2af2b7ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 2020-11-23  Jose E. Marchesi  <jemarch@gnu.org>
 
        * bootstrap: Updated from latest gnulib.
+       * DEV-NEWS: Update.
+       * bootstrap.conf (bootstrap_option_hook): New function.
+       (bootstrap_print_option_usage_hook): Likewise.
+       (bootstrap_post_import_hook): Honor --jitter-srcdir.
 
 2020-11-23  Jose E. Marchesi  <jemarch@gnu.org>
 
diff --git a/DEV-NEWS b/DEV-NEWS
index 67810591..e92f1ff3 100644
--- a/DEV-NEWS
+++ b/DEV-NEWS
@@ -7,6 +7,10 @@ poke.
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.
 
+2020-11-22
+* It is now possible to bootstrap without cloning jitter by using
+  bootstrap --no-git --gnulib-srcdir=DIR --jitter-srcdir=DIR.
+
 2020-11-21
 * The contents of HACKING are now generated from etc/hacking.org.
 
diff --git a/bootstrap.conf b/bootstrap.conf
index 7e06e3c2..602c0950 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -159,27 +159,57 @@ pkg-config  -
 makeinfo    6.0
 "
 
+# Process our own command-line options
+
+bootstrap_option_hook ()
+{
+  option=$1
+  case $option in
+  --jitter-srcdir=*)
+  JITTER_SRCDIR=${option#--jitter-srcdir=}; return 0;;
+  esac
+
+  return 1;
+}
+
+bootstrap_print_option_usage_hook ()
+{
+  cat <<EOF
+ --jitter-srcdir=DIRNAME  specify the local directory where jitter
+                          sources reside.  Use this if you already
+                          have jitter sources on your machine, and
+                          do not want to waste your bandwidth downloading
+                          them again.
+EOF
+}
+
 # We have to import Jitter early on, *before* running autoconf on Poke, since
 # Poke's configure.ac requires the Autoconf macros to be copied from Jitter.
 bootstrap_post_import_hook ()
 {
+  $use_git || test -d "$JITTER_SRCDIR" \
+    || die "Error: --no-git requires --jitter-srcdir"
+
   # create gl-libpoke
   ${GNULIB_SRCDIR}/gnulib-tool --import --lib=libgnu --source-base=gl-libpoke 
--m4-base=m4/libpoke --doc-base=doc --aux-dir=build-aux 
--no-conditional-dependencies --libtool --without-tests --macro-prefix=libpoke 
${libpoke_modules}
 
   # create gl-gui
   ${GNULIB_SRCDIR}/gnulib-tool --import --lib=libgnu --source-base=gl-gui 
--m4-base=m4/gui --doc-base=doc --aux-dir=build-aux 
--no-conditional-dependencies --libtool --without-tests --macro-prefix=gui 
${gui_modules}
 
-  echo 'Updating the Jitter submodule'
-  git submodule update --init -- ./jitter
+  if $use_git && test -d .git && check_exists git; then
+    echo 'Updating the Jitter submodule'
+    git submodule update --init -- ./jitter
+    JITTER_SRCDIR=jitter
+  fi
 
   echo 'Bootstrapping Jitter'
   (
-  cd jitter
+  cd $JITTER_SRCDIR
   ./bootstrap --gnulib-srcdir=../gnulib --no-git
   ) || exit $?
 
   echo 'Importing Autoconf macros from Jitter...'
-  cp jitter/autoconf/jitter.m4 m4/
+  cp $JITTER_SRCDIR/autoconf/jitter.m4 m4/
 
   # Copy pkg-config's pkg.m4 so that our downstream users don't need to.
   local ac_dir=`aclocal --print-ac-dir`
-- 
2.25.0.2.g232378479e




reply via email to

[Prev in Thread] Current Thread [Next in Thread]