def build_libxslt(): 'needed by webkit and lxml' from compiledeps import libxml2_dirname libxmlabs = abspath(libxml2_dirname) libxmlinc = pathjoin(libxmlabs, 'include') libxmllib = pathjoin(libxmlabs, 'win32', 'bin.msvc') iconvinc = pathjoin(abspath(iconv_dirname), 'include') libxslt_dir = libxslt.get() with cd(libxslt_dir): with cd('libxslt'): ensure_processonenode_is_public() with cd('win32'): patch_libxml2_h('..', 'libxslt') debug_flag = ['debug=yes'] if DEBUG else [] run(['cscript', 'configure.js', '//E:JavaScript', 'vcmanifest=yes'] + debug_flag + ['include=%s' % os.pathsep.join([libxmlinc, iconvinc]), 'lib=%s' % libxmllib]) filerepl('Makefile.msvc', '/O2', '/Os /GL /GS- /Zi') filerepl('Makefile.msvc', 'LDFLAGS = /nologo', 'LDFLAGS = /OPT:REF /OPT:ICF /nologo /DEBUG') run(['nmake', '-f', 'Makefile.msvc'] + (['clean'] if CLEAN else [])) return libxslt_dir
def build_libxslt(): 'needed by webkit and lxml' from compiledeps import libxml2_dirname libxmlabs = abspath(libxml2_dirname) libxmlinc = pathjoin(libxmlabs, 'include') libxmllib = pathjoin(libxmlabs, 'win32', 'bin.msvc') iconvinc = pathjoin(abspath(iconv_dirname), 'include') libxslt_dir = libxslt.get() with cd(libxslt_dir): with cd('libxslt'): ensure_processonenode_is_public() with cd('win32'): patch_libxml2_h('..', 'libxslt') debug_flag = ['debug=yes'] if DEBUG else [] run([ 'cscript', 'configure.js', '//E:JavaScript', 'vcmanifest=yes' ] + debug_flag + [ 'include=%s' % os.pathsep.join([libxmlinc, iconvinc]), 'lib=%s' % libxmllib ]) filerepl('Makefile.msvc', '/O2', '/Os /GL /GS- /Zi') filerepl('Makefile.msvc', 'LDFLAGS = /nologo', 'LDFLAGS = /OPT:REF /OPT:ICF /nologo /DEBUG') run(['nmake', '-f', 'Makefile.msvc'] + (['clean'] if CLEAN else [])) return libxslt_dir
def build_curl(): # relies on openssl-0.9.8g being in msw/ (should be there from # building Python) new = not os.path.exists(curl.dirname) with cd(curl.get()): if os.name == 'nt' and new: # after pulling a fresh tarball, apply the patch pointed to by curl_patch. # see the note above for an explanation. run([patch_cmd, '-p0', '-i', '../' + curl_patch]) filerepl('lib/Makefile.vc6', '/O2 /DNDEBUG', '/Zi /Ox /GL /GS- /GR- /DNDEBUG') filerepl('lib/Makefile.vc6', 'LFLAGS = /nologo /machine:$(MACHINE)', 'LFLAGS = /DEBUG /nologo /machine:$(MACHINE)') openssl_includes = "../../../../../digsby-venv" # point at includes filerepl( 'lib/Makefile.vc6', '/DUSE_SSLEAY /I "$(OPENSSL_PATH)/inc32"', '/DUSE_SSLEAY /I "%s/PC" /I "%s/PC/openssl" /I "$(OPENSSL_PATH)/inc32"' % (openssl_includes, openssl_includes)) # point at .libs filerepl('lib/Makefile.vc6', 'LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"', 'LFLAGSSSL = "/LIBPATH:%s/libs"' % openssl_includes) with cd('lib'): run([ 'nmake', '/nologo', '/E', '/f', 'Makefile.vc6', 'cfg=%s-dll-ssl-dll-zlib-dll' % ('debug' if DEBUG else 'release'), 'ZLIBLIBSDLL=zlib1%s.lib' % ('d' if DEBUG else ''), 'IMPLIB_NAME=libcurl', 'IMPLIB_NAME_DEBUG=libcurld' ]) # copy libcurl.dll to digsby/build/msw/dependencies from buildutil import copy_different, DEPS_DIR copy_different('libcurl%s.dll' % curl_pfix, DEPS_DIR) copy_different('libcurl%s.pdb' % curl_pfix, DEPS_DIR)
def build_curl(): # relies on openssl-0.9.8g being in msw/ (should be there from # building Python) new = not os.path.exists(curl.dirname) with cd(curl.get()): if os.name == 'nt' and new: # after pulling a fresh tarball, apply the patch pointed to by curl_patch. # see the note above for an explanation. run([patch_cmd, '-p0', '-i', '../' + curl_patch]) filerepl('lib/Makefile.vc6', '/O2 /DNDEBUG', '/Zi /Ox /GL /GS- /GR- /DNDEBUG') filerepl('lib/Makefile.vc6', 'LFLAGS = /nologo /machine:$(MACHINE)', 'LFLAGS = /DEBUG /nologo /machine:$(MACHINE)') openssl_includes = "../../../../../digsby-venv" # point at includes filerepl('lib/Makefile.vc6', '/DUSE_SSLEAY /I "$(OPENSSL_PATH)/inc32"', '/DUSE_SSLEAY /I "%s/PC" /I "%s/PC/openssl" /I "$(OPENSSL_PATH)/inc32"' % (openssl_includes, openssl_includes)) # point at .libs filerepl('lib/Makefile.vc6', 'LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"', 'LFLAGSSSL = "/LIBPATH:%s/libs"' % openssl_includes) with cd('lib'): run(['nmake', '/nologo', '/E', '/f', 'Makefile.vc6', 'cfg=%s-dll-ssl-dll-zlib-dll' % ('debug' if DEBUG else 'release'), 'ZLIBLIBSDLL=zlib1%s.lib' % ('d' if DEBUG else ''), 'IMPLIB_NAME=libcurl', 'IMPLIB_NAME_DEBUG=libcurld'] ) # copy libcurl.dll to digsby/build/msw/dependencies from buildutil import copy_different, DEPS_DIR copy_different('libcurl%s.dll' % curl_pfix, DEPS_DIR) copy_different('libcurl%s.pdb' % curl_pfix, DEPS_DIR)
def fix_build_ssl_py(): # Python's build files aren't quite up to linking against OpenSSL # dynamically, but a few string substitutions are enough to do the # trick. dllbin, staticbin = '$(opensslDir)\\out32dll\\', '$(opensslDir)\\out32\\' hashlib = '_hashlib.vcproj' build_repl = lambda *a: filerepl('build_ssl.py', *a) vcproj_repl = lambda *a: filerepl('_ssl.vcproj', *a) if USE_OPENSSL_DLL: build_repl('nt.mak', 'ntdll.mak') vcproj_repl(staticbin, dllbin) if os.path.isfile(hashlib): filerepl(hashlib, staticbin, dllbin) else: build_repl('ntdll.mak', 'nt.mak') vcproj_repl(dllbin, staticbin) if os.path.isfile(hashlib): # 2.6 filerepl(hashlib, dllbin, staticbin) conf_flags = ['VC-WIN32'] # fix idea compilation problems conf_flags.append('disable-idea') conf_flags.extend(['no-idea', 'no-mdc2', 'no-rc5']) build_repl('configure = "VC-WIN32"', 'configure = "%s"' % ' '.join(conf_flags)) build_repl( 'if not os.path.isfile(makefile) or os.path.getsize(makefile)==0:', 'if True:') if PYTHON_VER == '25': from buildutil import copy_different copy_different('../../_ssl.mak.25.2008', '_ssl.mak') else: print >> sys.stderr, 'WARNING: _ssl.pyd will be built without debugging symbols'
def fix_build_ssl_py(): # Python's build files aren't quite up to linking against OpenSSL # dynamically, but a few string substitutions are enough to do the # trick. dllbin, staticbin = '$(opensslDir)\\out32dll\\', '$(opensslDir)\\out32\\' hashlib = '_hashlib.vcproj' build_repl = lambda *a: filerepl('build_ssl.py', *a) vcproj_repl = lambda *a: filerepl('_ssl.vcproj', *a) if USE_OPENSSL_DLL: build_repl('nt.mak', 'ntdll.mak') vcproj_repl(staticbin, dllbin) if os.path.isfile(hashlib): filerepl(hashlib, staticbin, dllbin) else: build_repl('ntdll.mak', 'nt.mak') vcproj_repl(dllbin, staticbin) if os.path.isfile(hashlib): # 2.6 filerepl(hashlib, dllbin, staticbin) conf_flags = ['VC-WIN32'] # fix idea compilation problems conf_flags.append('disable-idea') conf_flags.extend(['no-idea', 'no-mdc2', 'no-rc5']) build_repl('configure = "VC-WIN32"', 'configure = "%s"' % ' '.join(conf_flags)) build_repl('if not os.path.isfile(makefile) or os.path.getsize(makefile)==0:', 'if True:') if PYTHON_VER == '25': from buildutil import copy_different copy_different('../../_ssl.mak.25.2008', '_ssl.mak') else: print >> sys.stderr, 'WARNING: _ssl.pyd will be built without debugging symbols'