diff --git a/README.rst b/README.rst index 8058812c..e3b6cf38 100644 --- a/README.rst +++ b/README.rst @@ -55,12 +55,18 @@ decoding errors. For example:: chcp 1252 python build.py ... +In addition, some tasks within the build currently expect to be able to use +Cygwin on Windows (https://www.cygwin.com/) to do its work. If you have +Cygwin installed in one of the default locations (c:\cygwin or c:\cygwin64) +then all is well. If you have it installed somewhere else then you can set +CYGWIN_BASE in the environment and the build tool will use that for the base +dir. -If you just want to do a standard setuptools-style build using setup.py and -are using a full source tarball, then you can stop reading at this point. If -you want to build from a source repository checkout, or need to make changes -and/or to regenerate some of the generated source files, then please continue -reading. +On the other hand, if you just want to do a standard setuptools-style build +using setup.py and are using a full source tarball, then you can stop reading +at this point. If you want to build from a source repository checkout, or +need to make changes and/or to regenerate some of the generated source files, +then please continue reading. Building wxWidgets diff --git a/build.py b/build.py index c9effa64..56309643 100755 --- a/build.py +++ b/build.py @@ -85,6 +85,7 @@ doxygenMD5 = { # And the location where they can be downloaded from toolsURL = 'http://wxpython.org/Phoenix/tools' + #--------------------------------------------------------------------------- def usage(): @@ -240,7 +241,7 @@ def setPythonVersion(args): # TOOLS = os.environ.get('TOOLS') if 'cygdrive' in TOOLS: - TOOLS = runcmd('c:/cygwin/bin/cygpath -w '+TOOLS, True, False) + TOOLS = runcmd(getCygwinPath()+'/bin/cygpath -w '+TOOLS, True, False) use64flag = '--x64' in args if use64flag: args.remove('--x64') @@ -707,6 +708,24 @@ def getWafBuildBase(): return base +def getCygwinPath(): + """ + Try to locate the path where cygwin is installed. + + If CYGWIN_BASE is set in the environment then use that. Otherwise look in + default install locations. + """ + if os.environ.get('CYGWIN_BASE'): + return os.environ.get('CYGWIN_BASE') + + for path in ['c:/cygwin', 'c:/cygwin64']: + if os.path.isdir(path): + return path + + return None + + + #--------------------------------------------------------------------------- # Command functions and helpers #--------------------------------------------------------------------------- @@ -717,13 +736,14 @@ def _doDox(arg): doxCmd = os.path.abspath(doxCmd) if isWindows: + cygwin_path = getCygwinPath() doxCmd = doxCmd.replace('\\', '/') - doxCmd = runcmd('c:/cygwin/bin/cygpath -u '+doxCmd, True, False) + doxCmd = runcmd(cygwin_path+'/bin/cygpath -u '+doxCmd, True, False) os.environ['DOXYGEN'] = doxCmd os.environ['WX_SKIP_DOXYGEN_VERSION_CHECK'] = '1' d = posixjoin(wxDir(), 'docs/doxygen') d = d.replace('\\', '/') - cmd = 'c:/cygwin/bin/bash.exe -l -c "cd %s && ./regen.sh %s"' % (d, arg) + cmd = '%s/bin/bash.exe -l -c "cd %s && ./regen.sh %s"' % (cygwin_path, d, arg) else: os.environ['DOXYGEN'] = doxCmd os.environ['WX_SKIP_DOXYGEN_VERSION_CHECK'] = '1' diff --git a/sphinxtools/inheritance.py b/sphinxtools/inheritance.py index b1dc5318..d2c970bf 100644 --- a/sphinxtools/inheritance.py +++ b/sphinxtools/inheritance.py @@ -269,9 +269,18 @@ class InheritanceDiagram(object): dot_args.extend(['-Tpng', '-o' + outfn]) dot_args.extend(['-Tcmapx', '-o' + mapfile]) + popen_args = { + 'stdout': PIPE, + 'stdin': PIPE, + 'stderr': PIPE + } + + if sys.platform == 'win32': + popen_args['shell'] = True + try: - p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE) + p = Popen(dot_args, **popen_args) except OSError as err: