1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
#
# TODO: fix this script to work with sourceforge archive!
#
$homeDir = (pwd)
$boostVersion = $Args[0]
$boostWorkingDir = $Args[1]
$pythonVersion = $Args[2]
$boostRoot = "${boostWorkingDir}\_boost"
$boostMajorMinor = [io.path]::GetFileNameWithoutExtension("$boostVersion")
$boostVersionConcise = $boostVersion -replace '[.]',''
$boostArray = $boostVersion -split "\."
$boostMajor = $boostArray[0]
$boostMinor = $boostArray[1]
$boostPatch = $boostArray[2];
$boostVersionU = "boost_${boostMajor}_${boostMinor}_${boostPatch}"
$boostArchive = "https://sourceforge.net/projects/boost/files/boost-binaries/1.70.0/boost_1_70_0-msvc-14.1-64.exe"
$boostBuildPath = "${boostRoot}\boost-${boostVersion}\${boostVersionU}"
$pythonMajor = ($pythonVersion -split '\.')[0]
$pythonMinor = ($pythonVersion -split '\.')[1]
$pythonMajorMinor = "${pythonMajor}.${pythonMinor}"
Write-Host "boostRoot ${boostRoot}"
Write-Host "boostBuildPath ${boostBuildPath}"
Write-Host "pythonMajorMinor ${pythonMajorMinor}"
if (-NOT (Test-Path $boostRoot))
{
New-Item -ItemType Directory $boostRoot
}
cd $boostRoot
# Retrieve/expand archive
Write-Host "Retrieving ${boostArchive}"
Invoke-WebRequest $boostArchive -OutFile "boost-${boostVersion}.zip"
Write-Host "Expanding archive boost-${boostVersion}.zip"
Expand-Archive "boost-${boostVersion}.zip"
cd "${boostBuildPath}\tools\build"
# Configure and install boost
echo "Configuring boost..."
& .\bootstrap.bat --with-python-version=$pythonMajorMinor
& .\b2 install -j4 variant=release toolset=msvc `
--prefix=$boostBuildPath `
--address-model=64
$env:Path = "${boostBuildPath}\bin;${boostBuildPath};$env:Path"
cd $boostBuildPath
# Build boost-python2 libs
echo "Building boost python..."
& b2 --with-python `
--address-model=64 `
--prefix=$boostBuildPath `
toolset=msvc
cd $homeDir
$env:BOOST_ROOT = $boostBuildPath
echo "BOOST_ROOT = ${env:BOOST_ROOT}"
echo "::set-env name=BOOST_ROOT::$boostBuildPath"
echo "::add-path::$boostBuildPath"
|