[pywin32-checkins] pywin32 setup_win32all_core.py,1.20,1.21
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-11-29 06:41:58
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1:/tmp/cvs-serv24298 Modified Files: setup_win32all_core.py Log Message: Build the scintilla DLL, and don't run post-install script for a dry-run. Index: setup_win32all_core.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all_core.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** setup_win32all_core.py 25 Nov 2003 13:24:36 -0000 1.20 --- setup_win32all_core.py 29 Nov 2003 06:41:55 -0000 1.21 *************** *** 4,9 **** # # Things known to be missing: ! # * Install of .exe/.dlls - most .exe files go next to python.exe ! # * "dbi" was built as .dll, as odbc depends on it. does it work? from distutils.core import setup, Extension, Command --- 4,11 ---- # # Things known to be missing: ! # * Newer win32all.exes installed Pythonwin.exe next to python.exe. This ! # leaves it in the pythonwin directory, but it seems to work fine. ! # It may not for a non-admin Python install, where Pythonxx.dll is ! # not in the system32 directory. from distutils.core import setup, Extension, Command *************** *** 12,15 **** --- 14,19 ---- from distutils.dep_util import newer_group from distutils import log + from distutils import spawn + from distutils import dir_util, file_util from distutils.sysconfig import get_python_lib from distutils.filelist import FileList *************** *** 175,180 **** self.excluded_extensions = [] # list of (ext, why) ! # Here we hack a "pywin32" directory into the mix. Distutils ! # doesn't seem to like the concept of multiple top-level directories. assert self.package is None for ext in self.extensions: --- 179,185 ---- self.excluded_extensions = [] # list of (ext, why) ! # Here we hack a "pywin32" directory (one of 'win32', 'win32com', ! # 'pythonwin' etc), as distutils doesn't seem to like the concept ! # of multiple top-level directories. assert self.package is None for ext in self.extensions: *************** *** 192,195 **** --- 197,229 ---- self.build_exefile(ext) + # Not sure how to make this completely generic, and there is no + # need at this stage. + path = 'pythonwin\\Scintilla' + makefile = 'makefile_pythonwin' + makeargs = ["QUIET=1"] + if self.dry_run: + makeargs.append("-n") + # We build the DLL into our own temp directory, then copy it to the + # real directory - this avoids the generated .lib/.exp + build_temp = os.path.abspath(os.path.join(self.build_temp, "scintilla")) + dir_util.mkpath(build_temp, verbose=self.verbose, dry_run=self.dry_run) + makeargs.append("SUB_DIR_O=%s" % build_temp) + makeargs.append("SUB_DIR_BIN=%s" % build_temp) + + cwd = os.getcwd() + os.chdir(path) + try: + cmd = ["nmake.exe", "/nologo", "/f", makefile] + makeargs + # dry_run handled by 'make /n' + spawn.spawn(cmd, verbose=self.verbose, dry_run=0) + finally: + os.chdir(cwd) + + # The DLL goes in the Pythonwin directory. + file_util.copy_file( + os.path.join(self.build_temp, "scintilla", "scintilla.dll"), + os.path.join(self.build_lib, "Pythonwin"), + verbose = self.verbose, dry_run = self.dry_run) + def build_exefile(self, ext): from types import ListType, TupleType *************** *** 676,680 **** # some 'no wait' executor - spawn seems fine! We pass the PID of this # process so the child will wait for us. ! if dist.command_obj.has_key('install'): # What executable to use? This one I guess. Maybe I could just import # as a module and execute? --- 710,714 ---- # some 'no wait' executor - spawn seems fine! We pass the PID of this # process so the child will wait for us. ! if not dist.dry_run and dist.command_obj.has_key('install'): # What executable to use? This one I guess. Maybe I could just import # as a module and execute? |