mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Instructions for compiling pywin32 with VS 2015
This commit is contained in:
parent
c0cf5adfd8
commit
ef8d72900e
@ -27,7 +27,7 @@ Cygwin
|
|||||||
This is needed for automation of the build process, and the ease of use of the
|
This is needed for automation of the build process, and the ease of use of the
|
||||||
unix shell (zsh). Install it by running: https://www.cygwin.com/setup-x86_64.exe
|
unix shell (zsh). Install it by running: https://www.cygwin.com/setup-x86_64.exe
|
||||||
|
|
||||||
In cygwin, install vim, dos2unix, rsync, openssh, unzip, wget, make, zsh, bash-completion, curl
|
In cygwin, install vim, dos2unix, rsync, openssh, unzip, wget, make, zsh, bash-completion, curl, patch
|
||||||
|
|
||||||
Run::
|
Run::
|
||||||
mkdir -p ~/sw/bin ~/sw/sources ~/sw/build ~/sw/lib ~/sw/private
|
mkdir -p ~/sw/bin ~/sw/sources ~/sw/build ~/sw/lib ~/sw/private
|
||||||
@ -146,35 +146,29 @@ Add `source ~/.vcvars` to `~/.zshenv`
|
|||||||
This will allow you to use the Visual Studio tools in the cygwin shell.
|
This will allow you to use the Visual Studio tools in the cygwin shell.
|
||||||
|
|
||||||
|
|
||||||
Python packages
|
setuptools
|
||||||
------------------
|
--------------
|
||||||
|
Download and extract setuptools from https://pypi.python.org/pypi/setuptools/
|
||||||
Install setuptools from http://pypi.python.org/pypi/setuptools. Use the source
|
Run::
|
||||||
tarball. Edit setup.py and set zip_safe=False. Then run::
|
cd ~/sw/build/setuptools-* && sed -i.bak 's/zip_safe\s*=\s*True/zip_safe=False/' setup.py && \
|
||||||
|
|
||||||
python setup.py install
|
python setup.py install
|
||||||
|
|
||||||
Run the following command to install python dependencies::
|
Miscellaneous python packages
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
easy_install --always-unzip -U mechanize python-dateutil dnspython cssutils clientform pycrypto pygments
|
Run::
|
||||||
|
~/sw/private/python/Scripts/easy_install.exe --always-unzip -U python-dateutil dnspython mechanize pygments pyreadline cssutils pycrypto
|
||||||
|
|
||||||
Install pyreadline from https://pypi.python.org/pypi/pyreadline/2.0
|
pywin32
|
||||||
|
----------
|
||||||
|
|
||||||
Install pywin32 and edit win32com\__init__.py setting _frozen = True and
|
Run::
|
||||||
__gen_path__ to a temp dir (otherwise it tries to set it to a dir in the
|
|
||||||
install tree which leads to permission errors)
|
|
||||||
Note that you should use::
|
|
||||||
|
|
||||||
import tempfile
|
git clone --depth 1 https://github.com/kovidgoyal/pywin32.git
|
||||||
__gen_path__ = os.path.join(
|
chmod +x swig/swig.exe
|
||||||
tempfile.gettempdir(), "gen_py",
|
python setup.py -q build --plat-name=(win32|win-amd64) # Do this
|
||||||
"%d.%d" % (sys.version_info[0], sys.version_info[1]))
|
# repeatedly until you stop getting .manifest file errors
|
||||||
|
python setup.py -q install
|
||||||
Use gettempdir instead of the win32 api method as gettempdir returns a temp dir
|
|
||||||
that is guaranteed to actually work.
|
|
||||||
|
|
||||||
Also edit win32com\client\gencache.py and change the except IOError on line 57
|
|
||||||
to catch all exceptions.
|
|
||||||
|
|
||||||
SQLite
|
SQLite
|
||||||
---------
|
---------
|
||||||
|
@ -61,6 +61,7 @@ paths = env['path'].split(';')
|
|||||||
lib = env['lib']
|
lib = env['lib']
|
||||||
include = env['include']
|
include = env['include']
|
||||||
libpath = env['libpath']
|
libpath = env['libpath']
|
||||||
|
sdkdir = env['windowssdkdir']
|
||||||
|
|
||||||
def unix(paths):
|
def unix(paths):
|
||||||
up = []
|
up = []
|
||||||
@ -80,7 +81,9 @@ export INCLUDE="%s"
|
|||||||
|
|
||||||
export LIBPATH="%s"
|
export LIBPATH="%s"
|
||||||
|
|
||||||
'''%(unix(paths), lib.replace('\\', r'\\'), include.replace('\\', r'\\'), libpath.replace('\\', r'\\'))
|
export WindowsSdkDir="%s"
|
||||||
|
|
||||||
|
'''%(unix(paths), lib.replace('\\', r'\\'), include.replace('\\', r'\\'), libpath.replace('\\', r'\\'), sdkdir.replace('\\', r'\\'))
|
||||||
|
|
||||||
print(raw.encode('utf-8'))
|
print(raw.encode('utf-8'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user