diff --git a/pytest.ini b/pytest.ini index c372f3404d1b..fd510238c86b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -12,7 +12,6 @@ pep8ignore = setup.py E402 setupext.py E301 E302 E501 - setup_external_compile.py E302 E711 versioneer.py ALL # External file. tools/gh_api.py ALL # External file. diff --git a/setup_external_compile.py b/setup_external_compile.py deleted file mode 100644 index 40f5e8f4aa89..000000000000 --- a/setup_external_compile.py +++ /dev/null @@ -1,33 +0,0 @@ -# This file is copied from https://github.com/jbmohler/matplotlib-winbuild -# Only the needed functions were kept. -""" -This file extracts and builds library dependencies libpng, zlib, & freetype2 on -MS Windows. It also extract tcl/tk for the header files. - -There are four possible build targets -- one for each permutation of VS 2008, -2010 and 32/64 bit. This builds the configuration that matches the Python -install that is executing. - -For Python 2.6, 2.7, 3.2: - -- VS 2008, 32 bit -- Windows SDK v7.0 -- VS 2008, 64 bit -- Windows SDK v7.0 - -For Python 3.3, 3.4: - -- VS 2010, 32 bit -- Windows SDK v7.1 -- VS 2010, 64 bit -- Windows SDK v7.1 -""" - -import platform -import distutils.msvc9compiler as msvc - -# Configuration selection & declaration: -X64 = platform.architecture()[0] == '64bit' -xXX = 'x64' if X64 else 'x86' - -def prepare_build_cmd(build_cmd, **kwargs): - VCVARSALL = msvc.find_vcvarsall(10.0) - if VCVARSALL == None: - raise RuntimeError('Microsoft VS 2010 required') - return build_cmd.format(vcvarsall=VCVARSALL, xXX=xXX, **kwargs) diff --git a/setupext.py b/setupext.py index 752ef3246cae..fbf8a8f599c6 100644 --- a/setupext.py +++ b/setupext.py @@ -1124,26 +1124,27 @@ def do_custom_build(self): subprocess.check_call(["make"], env=env, cwd=src_path) else: # compilation on windows + shutil.rmtree(str(Path(src_path, "objs")), ignore_errors=True) FREETYPE_BUILD_CMD = r""" call "%ProgramFiles%\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.Cmd" ^ /Release /{xXX} /xp call "{vcvarsall}" {xXX} set MSBUILD=C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe %MSBUILD% "builds\windows\{vc20xx}\freetype.sln" ^ - /t:Clean;Build /p:Configuration="{config}";Platform={WinXX} + /t:Clean;Build /p:Configuration="Release";Platform={WinXX} """ - from setup_external_compile import prepare_build_cmd, X64, xXX + import distutils.msvc9compiler as msvc # Note: freetype has no build profile for 2014, so we don't bother... vc = 'vc2010' - WinXX = 'x64' if X64 else 'Win32' - - cmdfile = os.path.join("build", "build_freetype.cmd") - with open(cmdfile, 'w') as cmd: - cmd.write(prepare_build_cmd(FREETYPE_BUILD_CMD, vc20xx=vc, WinXX=WinXX, - config='Release')) - - shutil.rmtree(str(Path(src_path, "objs")), ignore_errors=True) - subprocess.check_call([os.path.abspath(cmdfile)], + WinXX = 'x64' if platform.architecture()[0] == '64bit' else 'Win32' + xXX = 'x64' if platform.architecture()[0] == '64bit' else 'x86' + vcvarsall = msvc.find_vcvarsall(10.0) + if vcvarsall is None: + raise RuntimeError('Microsoft VS 2010 required') + cmdfile = Path("build/build_freetype.cmd") + cmdfile.write_text(FREETYPE_BUILD_CMD.format( + vc20xx=vc, WinXX=WinXX, xXX=xXX, vcvarsall=vcvarsall)) + subprocess.check_call([str(cmdfile.resolve())], shell=True, cwd=src_path) # Move to the corresponding Unix build path. Path(src_path, "objs/.libs").mkdir()