Skip to content

Commit

Permalink
Fix windows visual cpp runtime build and update dependent packages wi…
Browse files Browse the repository at this point in the history
…th new env setup script

Signed-off-by: Scott Hain <shain@chef.io>
  • Loading branch information
scotthain committed Nov 8, 2018
1 parent 383524c commit 3eac2e5
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 22 deletions.
3 changes: 3 additions & 0 deletions bzip2/plan.ps1
Expand Up @@ -12,6 +12,9 @@ $pkg_bin_dirs=@("bin")
$pkg_lib_dirs=@("lib")
$pkg_include_dirs=@("include")

function Invoke-SetupEnvironment {
. "$(Get-HabPackagePath visual-cpp-build-tools-2015)\setenv.ps1"
}
function Invoke-Build {
cd "$pkg_name-$pkg_version"
nmake -f makefile.msc
Expand Down
4 changes: 4 additions & 0 deletions libarchive/plan.ps1
Expand Up @@ -16,6 +16,10 @@ $pkg_build_deps=@("core/visual-cpp-build-tools-2015", "core/cmake")
$pkg_bin_dirs=@("bin")
$pkg_lib_dirs=@("lib")

function Invoke-SetupEnvironment {
. "$(Get-HabPackagePath visual-cpp-build-tools-2015)\setenv.ps1"
}

function Invoke-Build {
cd "$pkg_name-$pkg_version"

Expand Down
4 changes: 4 additions & 0 deletions libsodium/plan.ps1
Expand Up @@ -12,6 +12,10 @@ $pkg_bin_dirs=@("bin")
$pkg_lib_dirs=@("lib")
$pkg_include_dirs=@("include")

function Invoke-SetupEnvironment {
. "$(Get-HabPackagePath visual-cpp-build-tools-2015)\setenv.ps1"
}

function Invoke-Build {
cd "$pkg_name-$pkg_version"
msbuild.exe /m /p:Configuration=DynRelease /p:Platform=x64 builds/msvc/vs2015/libsodium.sln
Expand Down
4 changes: 4 additions & 0 deletions openssl/plan.ps1
Expand Up @@ -12,6 +12,10 @@ $pkg_bin_dirs=@("bin")
$pkg_include_dirs=@("include")
$pkg_lib_dirs=@("lib")

function Invoke-SetupEnvironment {
. "$(Get-HabPackagePath visual-cpp-build-tools-2015)\setenv.ps1"
}

function Invoke-Build {
cd "$pkg_name-OpenSSL_$_pkg_version_text"
perl Configure VC-WIN64A --prefix=$pkg_prefix
Expand Down
4 changes: 4 additions & 0 deletions perl/plan.ps1
Expand Up @@ -10,6 +10,10 @@ $pkg_build_deps=@("core/visual-cpp-build-tools-2015", "core/dmake")
$pkg_bin_dirs=@("bin")
$pkg_lib_dirs=@("lib")

function Invoke-SetupEnvironment {
. "$(Get-HabPackagePath visual-cpp-build-tools-2015)\setenv.ps1"
}

function Invoke-Build {
$Env:CCTYPE="MSVC140"
$Env:INST_TOP="$pkg_prefix"
Expand Down
19 changes: 19 additions & 0 deletions visual-cpp-build-tools-2015/README.md
@@ -0,0 +1,19 @@
# visual-cpp-build-tools-2015

Standalone compiler, libraries and scripts

## Maintainers

* The Habitat Maintainers: <humans@habitat.sh>

## Usage

To use these build tools in another plan, please use the provided `setenv.ps1` script to set the appropriate environment variables before you build your software.

Example:

```
function Invoke-SetupEnvironment {
. "$(Get-HabPackagePath visual-cpp-build-tools-2015)\setenv.ps1"
}
```
23 changes: 1 addition & 22 deletions visual-cpp-build-tools-2015/plan.ps1
Expand Up @@ -31,28 +31,6 @@ $pkg_include_dirs=@(
"Windows Kits\NETFXSDK\4.6\Include\um"
)

function Invoke-SetupEnvironment {
# These variables set up the correct installation directories for the MSBuild scripts
Push-RuntimeEnv "VCTargetsPath" "$pkg_prefix\Program Files\MSBuild\Microsoft.Cpp\v4.0\v140"
Push-RuntimeEnv "VcInstallDir" "$pkg_prefix\Program Files\Microsoft Visual Studio 14.0\VC"
Push-RuntimeEnv "WindowsSdkDir_81" "$pkg_prefix\Windows Kits\8.1"

# These are so it knows where to find the file tracker (tracker.exe) in all build phases
Push-RuntimeEnv "CLTrackerSdkPath" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64"
Push-RuntimeEnv "CLTrackerFrameworkPath" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64"
Push-RuntimeEnv "LinkTrackerSdkPath" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64"
Push-RuntimeEnv "LinkTrackerFrameworkPath" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64"
Push-RuntimeEnv "LibTrackerSdkPath" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64"
Push-RuntimeEnv "LibTrackerFrameworkPath" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64"
Push-RuntimeEnv "RCTrackerSdkPath" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64"
Push-RuntimeEnv "RCTrackerFrameworkPath" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64"

# This forces the MSBuild scripts to look at the environment variables rather than the
# registry. Both are needed since different scripts use different variables.
Push-RuntimeEnv "DisableRegistryUse" "true"
Push-RuntimeEnv "UseEnv" "true"
}

function Invoke-Unpack {
Start-Process "$HAB_CACHE_SRC_PATH/$pkg_filename" -Wait -ArgumentList "/passive /layout $HAB_CACHE_SRC_PATH/$pkg_dirname"
Push-Location "$HAB_CACHE_SRC_PATH/$pkg_dirname"
Expand All @@ -78,4 +56,5 @@ function Invoke-Install {
}

Copy-Item "$pkg_prefix\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\FromGAC\*" "$pkg_prefix\Program Files\MSBuild\14.0\bin\amd64" -Force
Copy-Item "$PLAN_CONTEXT/setenv.ps1" "$pkg_prefix"
}
13 changes: 13 additions & 0 deletions visual-cpp-build-tools-2015/setenv.ps1
@@ -0,0 +1,13 @@
$env:VCTargetsPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\Microsoft.Cpp\v4.0\v140"
$env:VcInstallDir="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\Microsoft Visual Studio 14.0\VC"
$env:WindowsSdkDir_81="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Windows Kits\8.1"
$env:CLTrackerSdkPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\14.0\bin\amd64"
$env:CLTrackerFrameworkPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\14.0\bin\amd64"
$env:LinkTrackerSdkPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\14.0\bin\amd64"
$env:LinkTrackerFrameworkPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\14.0\bin\amd64"
$env:LibTrackerSdkPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\14.0\bin\amd64"
$env:LibTrackerFrameworkPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\14.0\bin\amd64"
$env:RCTrackerSdkPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\14.0\bin\amd64"
$env:RCTrackerFrameworkPath="$(Get-HabPackagePath visual-cpp-build-tools-2015)\Program Files\MSBuild\14.0\bin\amd64"
$env:DisableRegistryUse="true"
$env:UseEnv="true"
4 changes: 4 additions & 0 deletions zeromq/plan.ps1
Expand Up @@ -13,6 +13,10 @@ $pkg_bin_dirs=("bin")
$pkg_include_dirs=("include")
$pkg_lib_dirs=("lib")

function Invoke-SetupEnvironment {
. "$(Get-HabPackagePath visual-cpp-build-tools-2015)\setenv.ps1"
}

function Invoke-Build {
cd "libzmq-$pkg_version"

Expand Down
3 changes: 3 additions & 0 deletions zlib/plan.ps1
Expand Up @@ -12,6 +12,9 @@ $pkg_bin_dirs=@("bin")
$pkg_lib_dirs=@("lib")
$pkg_include_dirs=@("include")

function Invoke-SetupEnvironment {
. "$(Get-HabPackagePath visual-cpp-build-tools-2015)\setenv.ps1"
}
function Invoke-Build {
cd "$pkg_name-$pkg_version"
msbuild /p:Configuration=Release /p:Platform=x64 "contrib\vstudio\vc14\zlibvc.sln"
Expand Down

0 comments on commit 3eac2e5

Please sign in to comment.