1 Building pyOpenSSL on Windows-7 (64-bit)
2 ========================================
4 This document details the steps to build an pyOpenSSL egg with embedded
5 OpenSSL library, for use by Tahoe-LAFS on Windows.
7 The instructions were tried on Windows-7 64-bit. Building on a 32-bit machine
8 shouldn't be too different.
11 Download and install Microsoft Visual C++ compiler for Python 2.7
12 -----------------------------------------------------------------
14 For reasons detailed in `the Python documentation`_, Python extension modules
15 need to be built using a compiler compatible with the same version of Visual C++
16 that was used to build Python itself. Until recently, this meant downloading
17 Microsoft Visual Studio 2008 Express Edition and Windows SDK 3.5. The recent
18 release of the Microsoft Visual C++ compiler for Python 2.7 made things a lot
21 So, the first step is to download and install the C++ compiler from Microsoft
24 .. _the Python documentation: https://docs.python.org/2/extending/windows.html
25 .. _this link: https://www.microsoft.com/en-us/download/details.aspx?id=44266
28 Download and install Perl
29 -------------------------
31 Download and install ActiveState Perl:
33 * go to `the ActiveState Perl download page`_.
34 * identify the correct link and manually change it from http to https.
36 .. _the ActiveState Perl download page: https://www.activestate.com/activeperl/downloads
39 Download and install the latest OpenSSL version
40 -----------------------------------------------
42 * Download the latest OpenSSL from `the OpenSSL source download page`_ and untar it.
43 At the time of writing, the latest version was OpenSSL 1.0.1m.
45 * Set up the build environment::
47 "%USERPROFILE%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" amd64
49 * Go to the untar'ed OpenSSL source base directory and run the following commands::
52 perl Configure VC-WIN64A --prefix=c:\dist\openssl64 no-asm enable-tlsext
55 nmake -f ms\ntdll.mak install
58 To check that it is working, run ``c:\dist\openssl64\bin\openssl version``.
60 .. _the OpenSSL source download page: https://www.openssl.org/source/
66 * Download and untar pyOpenSSL 0.13.1 (see `ticket #2221`_ for why we
67 currently use this version). The MD5 hash of pyOpenSSL-0.13.1.tar.gz is
68 e27a3b76734c39ea03952ca94cc56715.
70 * Set up the build environment::
72 "%USERPROFILE%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" amd64
74 * Set OpenSSL ``LIB``, ``INCLUDE`` and ``PATH``::
76 set LIB=c:\dist\openssl64\lib;%LIB%
77 set INCLUDE=c:\dist\openssl64\include;%INCLUDE%
78 set PATH=c:\dist\openssl64\bin;%PATH%
80 * A workaround is needed to ensure that the setuptools ``bdist_egg`` command
81 is available. Edit pyOpenSSL's ``setup.py`` around line 13 as follows::
83 < from distutils.core import Extension, setup
85 > from setuptools import setup
86 > from distutils.core import Extension
88 * Run ``python setup.py bdist_egg``
90 The generated egg will be in the ``dist`` directory. It is a good idea
91 to check that Tahoe-LAFS is able to use it before uploading the egg to
92 tahoe-lafs.org. This can be done by putting it in the ``tahoe-deps`` directory
93 of a Tahoe-LAFS checkout or release, then running ``python setup.py test``.
95 .. _ticket #2221: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2221