We at GNU Wget have been using the new Python implementation of gnulib-tool for
a while now and it has been working pretty smoothly. However, we always have to
patch the bootstrap script manually to enable use of the tool since there is
currently no way in gnulib to enable it. The attached patch adds a new option
to botstrap.conf that allows the developers to enable the new Python version of
the gnulib tool.


-- 
Thanking You,
Darshit Shah
PGP Fingerprint: 7845 120B 07CB D8D6 ECE5 FF2B 2A17 43ED A91A 35B6
From 5ceff6bed76fb11ba6b70c1cc62b230c54cbc6e9 Mon Sep 17 00:00:00 2001
From: Darshit Shah <dar...@gnu.org>
Date: Sat, 13 Oct 2018 21:12:23 +0200
Subject: [PATCH 1/2] pygnulib: Add support to enable usage of gnulib-tool.py

* build-aux/bootstrap.conf: Add new option, use_pygnulib to enable usage
of the new python based gnulib-tool
* build-aux/bootstrap: Default use_pygnulib to false.
Add a check for Python 2.7 to buildreq if pygnulib is requested
Select the correct $gnulib_tool based on the value of use_pygnulib
---
 ChangeLog                |  7 +++++++
 build-aux/bootstrap      | 20 +++++++++++++++++++-
 build-aux/bootstrap.conf |  2 ++
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ecd69df04..b0aa8e29d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-10-13  Darshit Shah   <dar...@gnu.org>
+
+       * bootstrap.conf: Introduce option use_pygnulib
+       * bootstrap: Default use_pygnulib to false.
+       Add a check for Python 2.7 to buildreq if pygnulib is requested
+       Select the correct $gnulib_tool based on the value of use_pygnulib
+
 2018-10-13  Akim Demaille  <a...@lrde.epita.fr>
 
        bootstrap: fix wget command for po files.
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 5264d9f1e..ad90adb16 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -246,6 +246,10 @@ bootstrap_sync=false
 # Use git to update gnulib sources
 use_git=true
 
+# Use the new Python implementation of gnulib-tool (Experimental)
+# Set to true in bootstrap.conf to enable
+use_pygnulib=false
+
 check_exists() {
   if test "$1" = "--verbose"; then
     ($2 --version </dev/null) >/dev/null 2>&1
@@ -586,6 +590,16 @@ case $buildreq in
 $buildreq" ;;
 esac
 
+# If we're going to use gnulib-tool.py, then ensure that Python 2.7+ is
+# available on the system.
+if $use_pygnulib; then
+       case $buildreq in
+               *python*) ;;
+               *) buildreq="python 2.7
+$buildreq" ;;
+       esac
+fi
+
 # When we can deduce that gnulib-tool will require patch,
 # and when patch is not already listed as a prerequisite, add it, too.
 if test -d "$local_gl_dir" \
@@ -724,7 +738,11 @@ if $use_gnulib; then
     }
   fi
 
-  gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
+  if $use_pygnulib; then
+    gnulib_tool=$GNULIB_SRCDIR/gnulib-tool.py
+  else
+    gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
+  fi
   <$gnulib_tool || exit $?
 fi
 
diff --git a/build-aux/bootstrap.conf b/build-aux/bootstrap.conf
index 777bbad05..954359d62 100644
--- a/build-aux/bootstrap.conf
+++ b/build-aux/bootstrap.conf
@@ -20,6 +20,8 @@
 gnulib_modules="
 "
 
+use_pygnulib=true
+
 # Additional xgettext options to use.  Use "\\\newline" to break lines.
 XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
  --from-code=UTF-8\\\
-- 
2.19.1

Attachment: signature.asc
Description: PGP signature

Reply via email to