Either a Windows machine or a Linux box with wine installed will do to produce a w32 binary.
Automatic Download (Recommended)
- Execute the
fetch-and-verify.shscript - Copy all the files to your windows computer
- Download the VS 2008 redistributable
Manual Download
- Git
- Python 2.7 (sig)
- Python Windows 32 Bindings
- PyInstaller Development Version
- Setuptools Bootstrap
- MingW Installer
- OpenSSL-Win32
- MS VS 2008 redistributable
- PyCrypto Source (sig)
- Pure Python OTR Source
- Pidgin (sig)
- Pidgin OTR Plugin (sig)
Builds on Linux
Install wine:
- Debian/Ubuntu:
sudo apt-get install wine - Fedora:
sudo yum install wine
- Execute the installer
- Follow the wizard
- When prompted in the installer choose this options:
C compiler
C++ compiler
Msys basic system
MinGW Developer Toolkit
- Execute the installer
- Choose to add git to the PATH
- Execute the vcredist_x86.exe package
- Install it completely
- Execute the OpenSSL installer
- When prompted choose "Copy OpenSSL DLLs to: The OpenSSL binaries (/bin) directory"
- Execute the Python installer, use default options
- Linux+Wine: you must use
msiexec /i python-2.7.5.msi
- Linux+Wine: you must use
Configure the PATH environment variable
Windows:
-
Right-click on My Computer and select properties
-
Go to the 'Advanced' section and select 'Environment variables'
-
Select 'Path' from the 'System Variables' and click the 'Edit button'
-
Append the following to your PATH variable:
C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\Python27;C:\Python27\Scripts;C:\OpenSSL-Win32\bin;
Linux+Wine:
- Open regedit using the
regeditcommand - Edit
HKEY_CURRENT_USER/Environment - Add a new String value called
PATHusing the value above
Set Python to use MinGW
- Create the following file: C:\Python27\Lib\distutils\distutils.cfg
- Append:
[build]
compiler=mingw32
- Save and close
Fix -mno-cygwin error
To prevent the following error when building Python modules, we must edit a distutils file.
gcc: error: unrecognized command line option '-mno-cygwin'
- Edit the file
C:\Python27\Lib\distutils\cygwinccompiler.py - Look for the class:
Mingw32CCompileraround line 297 - Find the block that beings with 'self.set_executables('
- Delete all the '-mno-cygwin' flags
- Save and close
Note: your $HOME when using MinGW shell is in C:\MinGW\msys\1.0\home\USERNAME
- Open your MinGW Shell
- Windows: Start -> MinGW -> MinGW Shell
- Linux+Wine:
wine cmd.exe /C C:\MinGW/msys/1.0/msys.bat
- cd to where you downloaded ez_setup.py
- Windows: Access the normal windows FS using the /c/ path (i.e., /c/ corresponds to C:)
- Linux+Wine: Access your native root fs with /z/
- Execute:
python ez_setup.py- Execute the Python installer, use default options
Note: If using a virtual environment (virtualenv), then you must open a command shell that has your virtualenv activated and execute:
easy_install /c/path/to/pywin32-218.win32-py2.7.exe
Otherwise pywin32 will be installed into the system site-packages dir, and not be available to your virtualenv.
For some reason we must install PyCrypto this way, instead of relying on it to be installed via setup.py along with the rest of the dependencies.
- cd to your extracted pycrypto dir:
cd pycrypto-2.6 python seutp.py install
cd keysyncpython setup.py install
This will download, compile, and install all the remaining python modules.
At this point, all the dependencies for keysync should be installed and functioning, so keysync should work. You can test it by running keysync-gui:
You'll probably want to install Pidgin, pidgin-otr, and configure an account before running keysync.
cd keysync
python keysync-guiDo not proceed unless the GUI pops up and the app functions as expected.
Note: Due to bug 651 the development version of PyInstaller must be used.
KeySync's setup.py script automatically installs pyinstaller, so all you need to do is execute pyinstaller and point it at the script you want to turn into an EXE. Build the package:
pyinstaller --onefile keysync-gui.specYou can omit the --onefile parameter, see the PyInstaller
Manual
for what exactly the consequences of both modes are.
If the process succeeds, then check the dist/ directory
inside the pyinstaller directory.
Unfortunately most of the dependencies and toolchain used above are not available to download over HTTPS nor do they have signatures to verify. Even MinGW lacks any sort of secure download, so securely building the dependencies from source may not be possible.
Also, according to this ticket the Python Win32 bindings are not easily buildable with MinGW.
