Skip to content

Commit

Permalink
Merge pull request #5 from menpo/vs2010_fixes
Browse files Browse the repository at this point in the history
VS2010 fixes
  • Loading branch information
Patrick Snape committed Aug 19, 2015
2 parents 61b7965 + ec98110 commit 0bd60a7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions condaci.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

VS2008_PATH = r'C:\Program Files (x86)\Microsoft Visual Studio 9.0'
VS2008_BIN_PATH = os.path.join(VS2008_PATH, 'VC', 'bin')
VS2010_PATH = r'C:\Program Files (x86)\Microsoft Visual Studio 10.0'
VS2010_BIN_PATH = os.path.join(VS2010_PATH, 'VC', 'bin')
VS2010_AMD64_VCVARS_CMD = r'CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64'

# a random string we can use for the miniconda installer
# (to avoid name collisions)
Expand Down Expand Up @@ -279,22 +282,21 @@ def conda_build_package_win(mc, path):
'stop vcvarsall from telling the world')
del os.environ['BINSTAR_KEY']
os.environ['PYTHON_ARCH'] = host_arch()[:2]
os.environ['PYTHON_VERSION'] = '{}.{}'.format(sys.version_info.major,
sys.version_info.minor)
os.environ['PYTHON_VERSION'] = PYTHON_VERSION
print('PYTHON_ARCH={} PYTHON_VERSION={}'.format(os.environ['PYTHON_ARCH'],
os.environ['PYTHON_VERSION']))
execute(['cmd', '/E:ON', '/V:ON', '/C', MAGIC_WIN_SCRIPT_PATH,
conda(mc), 'build', '-q', path])


def windows_setup_compiler():
if PYTHON_VERSION == "2.7":
arch = host_arch()
if PYTHON_VERSION == '2.7':
download_file(VS2008_PATCH_URL, VS2008_PATCH_PATH)
if not os.path.exists(VS2008_PATCH_FOLDER_PATH):
os.makedirs(VS2008_PATCH_FOLDER_PATH)
extract_zip(VS2008_PATCH_PATH, VS2008_PATCH_FOLDER_PATH)

arch = host_arch()
if arch == '64bit':
execute([os.path.join(VS2008_PATCH_FOLDER_PATH, 'setup_x64.bat')])

Expand All @@ -309,6 +311,14 @@ def windows_setup_compiler():
pass
else:
raise ValueError('Unexpected architecture {}'.format(arch))
elif PYTHON_VERSION == '3.4' and arch == '64bit':
VS2010_AMD64_PATH = os.path.join(VS2010_BIN_PATH, 'amd64')
if not os.path.exists(VS2010_AMD64_PATH):
os.makedirs(VS2010_AMD64_PATH)
VS2010_AMD64_VCVARS_PATH = os.path.join(VS2010_AMD64_PATH,
'vcvars64.bat')
with open(VS2010_AMD64_VCVARS_PATH, 'w') as f:
f.write(VS2010_AMD64_VCVARS_CMD)


def build_conda_package(mc, path, binstar_user=None):
Expand Down

0 comments on commit 0bd60a7

Please sign in to comment.