]> granicus.if.org Git - python/commitdiff
Add option to pass vcs info into Mac installer build (#2832)
authorNed Deily <nad@python.org>
Sun, 23 Jul 2017 22:09:14 +0000 (18:09 -0400)
committerGitHub <noreply@github.com>
Sun, 23 Jul 2017 22:09:14 +0000 (18:09 -0400)
(cherry picked from commit 4da52247d6ae53b8384f9753430e8cd2672ff97d)

Mac/BuildScript/build-installer.py

index fb112741e05a004d6cecef961c9f156578fa683f..d7d40110a66a767d00189bb9f3a23ff12ec68b6b 100755 (executable)
@@ -1168,8 +1168,25 @@ def buildPython():
         shellQuote(WORKDIR)[1:-1],
         shellQuote(WORKDIR)[1:-1]))
 
-    print("Running make")
-    runCommand("make")
+    # Look for environment value BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS
+    # and, if defined, append its value to the make command.  This allows
+    # us to pass in version control tags, like GITTAG, to a build from a
+    # tarball rather than from a vcs checkout, thus eliminating the need
+    # to have a working copy of the vcs program on the build machine.
+    #
+    # A typical use might be:
+    #      export BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS=" \
+    #                         GITVERSION='echo 123456789a' \
+    #                         GITTAG='echo v3.6.0' \
+    #                         GITBRANCH='echo 3.6'"
+
+    make_extras = os.getenv("BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS")
+    if make_extras:
+        make_cmd = "make " + make_extras
+    else:
+        make_cmd = "make"
+    print("Running " + make_cmd)
+    runCommand(make_cmd)
 
     print("Running make install")
     runCommand("make install DESTDIR=%s"%(