Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Backport changes to batch files
  • Loading branch information
zooba committed Jul 18, 2017
commit 552ac67bd9d54ce420362632d6801abf85cdb679
13 changes: 12 additions & 1 deletion Doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ pushd %~dp0

set this=%~n0

if "%SPHINXBUILD%" EQU "" set SPHINXBUILD=sphinx-build
call ..\PCBuild\find_python.bat %PYTHON%
if "%SPHINXBUILD%" EQU "" if "%PYTHON%" NEQ "" (
set SPHINXBUILD=%PYTHON%\..\Scripts\sphinx-build.exe
rem Cannot use %SPHINXBUILD% in the same block where we set it
if not exist "%PYTHON%\..\Scripts\sphinx-build.exe" (
echo Installing sphinx with %PYTHON%
"%PYTHON%" -m pip install sphinx
if errorlevel 1 exit /B
)
)

if "%PYTHON%" EQU "" set PYTHON=py
if "%SPHINXBUILD%" EQU "" set SPHINXBUILD=sphinx-build

if "%1" NEQ "htmlhelp" goto :skiphhcsearch
if exist "%HTMLHELP%" goto :skiphhcsearch
Expand Down
2 changes: 0 additions & 2 deletions PCbuild/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ echo.%~nx0 [flags and arguments] [quoted MSBuild options]
echo.
echo.Build CPython from the command line. Requires the appropriate
echo.version(s) of Microsoft Visual Studio to be installed (see readme.txt).
echo.Also requires Subversion (svn.exe) to be on PATH if the '-e' flag is
echo.given.
echo.
echo.After the flags recognized by this script, up to 9 arguments to be passed
echo.directly to MSBuild may be passed. If the argument contains an '=', the
Expand Down
20 changes: 1 addition & 19 deletions PCbuild/get_externals.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ rem Simple script to fetch source for external libraries

if "%PCBUILD%"=="" (set PCBUILD=%~dp0)
if "%EXTERNALS_DIR%"=="" (set EXTERNALS_DIR=%PCBUILD%\..\externals)
if "%NUGET%"=="" (set NUGET=%EXTERNALS_DIR%\nuget.exe)
if "%NUGET_URL%"=="" (set NUGET_URL=https://aka.ms/nugetclidl)

set DO_FETCH=true
set DO_CLEAN=false
Expand Down Expand Up @@ -33,23 +31,7 @@ if "%DO_FETCH%"=="false" goto end

if "%ORG%"=="" (set ORG=python)

if "%PYTHON_FOR_BUILD%"=="" (
echo Checking for installed python...
py -3.6 -V >nul 2>&1 && (set PYTHON_FOR_BUILD=py -3.6)
)
if "%PYTHON_FOR_BUILD%"=="" (
if NOT exist "%EXTERNALS_DIR%" mkdir "%EXTERNALS_DIR%"
if NOT exist "%NUGET%" (
echo Downloading nuget...
rem NB: Must use single quotes around NUGET here, NOT double!
rem Otherwise, a space in the path would break things
powershell.exe -Command Invoke-WebRequest %NUGET_URL% -OutFile '%NUGET%'
)
echo Installing Python via nuget...
"%NUGET%" install pythonx86 -ExcludeVersion -OutputDirectory "%EXTERNALS_DIR%"
rem Quote it here; it's not quoted later because "py -3.6" wouldn't work
set PYTHON_FOR_BUILD="%EXTERNALS_DIR%\pythonx86\tools\python.exe"
)
call "%PCBUILD%find_python.bat" "%PYTHON%"

if "%PYTHON%"=="" (
where /Q git || echo Python 3.6 could not be found or installed, and git.exe is not on your PATH && exit /B 1
Expand Down
3 changes: 0 additions & 3 deletions Tools/msi/buildrelease.bat
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable &
if "%SKIPBUILD%" EQU "1" goto skipdoc
if "%SKIPDOC%" EQU "1" goto skipdoc

if not defined PYTHON where py -q || echo Cannot find py on path and PYTHON is not set. && exit /B 1
if not defined SPHINXBUILD where sphinx-build -q || echo Cannot find sphinx-build on path and SPHINXBUILD is not set. && exit /B 1

call "%D%..\..\doc\make.bat" htmlhelp
if errorlevel 1 goto :eof
:skipdoc
Expand Down
24 changes: 4 additions & 20 deletions Tools/msi/get_externals.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set DO_FETCH=true
set DO_CLEAN=false

:CheckOpts
if "%~1"=="--python" (set PYTHON_FOR_BUILD=%2) & shift & shift & goto CheckOpts
if "%~1"=="--python" (set PYTHON=%2) & shift & shift & goto CheckOpts
if "%~1"=="--organization" (set ORG=%2) & shift & shift & goto CheckOpts
if "%~1"=="-c" (set DO_CLEAN=true) & shift & goto CheckOpts
if "%~1"=="--clean" (set DO_CLEAN=true) & shift & goto CheckOpts
Expand All @@ -32,23 +32,7 @@ if "%DO_FETCH%"=="false" goto end

if "%ORG%"=="" (set ORG=python)

if "%PYTHON_FOR_BUILD%"=="" (
echo Checking for installed python...
py -3.6 -V >nul 2>&1 && (set PYTHON_FOR_BUILD=py -3.6)
)
if "%PYTHON_FOR_BUILD%"=="" (
if NOT exist "%EXTERNALS_DIR%" mkdir "%EXTERNALS_DIR%"
if NOT exist "%NUGET%" (
echo Downloading nuget...
rem NB: Must use single quotes around NUGET here, NOT double!
rem Otherwise, a space in the path would break things
powershell.exe -Command Invoke-WebRequest %NUGET_URL% -OutFile '%NUGET%'
)
echo Installing Python via nuget...
"%NUGET%" install pythonx86 -ExcludeVersion -OutputDirectory "%EXTERNALS_DIR%"
rem Quote it here; it's not quoted later because "py -3.6" wouldn't work
set PYTHON_FOR_BUILD="%EXTERNALS_DIR%\pythonx86\tools\python.exe"
)
call "%PCBUILD%\find_python.bat" "%PYTHON%"

echo.Fetching external libraries...

Expand All @@ -59,7 +43,7 @@ for %%e in (%libraries%) do (
echo.%%e already exists, skipping.
) else (
echo.Fetching %%e...
%PYTHON_FOR_BUILD% "%PCBUILD%get_external.py" -e "%EXTERNALS_DIR%" -O %ORG% %%e
%PYTHON% "%PCBUILD%get_external.py" -e "%EXTERNALS_DIR%" -O %ORG% %%e
)
)

Expand All @@ -79,7 +63,7 @@ for %%b in (%binaries%) do (
echo.%%b already exists, skipping.
) else (
echo.Fetching %%b...
%PYTHON_FOR_BUILD% "%PCBUILD%get_external.py" -e "%EXTERNALS_DIR%" -b -O %ORG% %%b
%PYTHON% "%PCBUILD%get_external.py" -e "%EXTERNALS_DIR%" -b -O %ORG% %%b
)
)

Expand Down