Skip to content

Commit 4da5224

Browse files
committed
Add option to pass vcs info into Mac installer build
1 parent 0a794a3 commit 4da5224

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Mac/BuildScript/build-installer.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,8 +1142,25 @@ def buildPython():
11421142
shellQuote(WORKDIR)[1:-1],
11431143
shellQuote(WORKDIR)[1:-1]))
11441144

1145-
print("Running make")
1146-
runCommand("make")
1145+
# Look for environment value BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS
1146+
# and, if defined, append its value to the make command. This allows
1147+
# us to pass in version control tags, like GITTAG, to a build from a
1148+
# tarball rather than from a vcs checkout, thus eliminating the need
1149+
# to have a working copy of the vcs program on the build machine.
1150+
#
1151+
# A typical use might be:
1152+
# export BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS=" \
1153+
# GITVERSION='echo 123456789a' \
1154+
# GITTAG='echo v3.6.0' \
1155+
# GITBRANCH='echo 3.6'"
1156+
1157+
make_extras = os.getenv("BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS")
1158+
if make_extras:
1159+
make_cmd = "make " + make_extras
1160+
else:
1161+
make_cmd = "make"
1162+
print("Running " + make_cmd)
1163+
runCommand(make_cmd)
11471164

11481165
print("Running make install")
11491166
runCommand("make install DESTDIR=%s"%(

0 commit comments

Comments
 (0)