]> granicus.if.org Git - python/commitdiff
Add option to pass vcs info into Mac installer build
authorNed Deily <nad@python.org>
Fri, 16 Jun 2017 22:47:48 +0000 (18:47 -0400)
committerNed Deily <nad@python.org>
Sat, 17 Jun 2017 06:58:07 +0000 (02:58 -0400)
Mac/BuildScript/build-installer.py

index 7b4376f42b88f3b0b7a88b05e99b2a1b24673f77..e17299affba11c9f3e7ea7fee68f92866d8e1206 100755 (executable)
@@ -1142,8 +1142,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"%(