diff --git a/docs/Install.windows b/docs/Install.windows index cba3fcec..38a871d5 100644 --- a/docs/Install.windows +++ b/docs/Install.windows @@ -1,160 +1,203 @@ SIP SIMPLE SDK installation on Microsoft Windows ------------------------------------------------ Note: This document is work in progress. Home page: http://sipsimpleclient.org This document describes the installation procedure on Microsoft Windows operating systems. Supported versions are Windows XP or higher. Step 1. Prerequisites --------------------- The building process is designed to work with the MSYS2 environment and the MinGW-w64 compiler toolchain. Other approaches might work but they are not tested nor supported. MSYS2: MSYS2 is a minimal Unix-like environment for Windows. It includes a port of the 'pacman' package manager (ported from Arch Linux) and a pretty extensive collection of packages which can be easily installed. It contains packages for the MinGW-w64 toolchain, for 32 and 64 bit architectures. MinGW-w64: MinGW is a minimal compilation toolchain for Windows. It contains GCC and allows for compilation of native applications for Windows. The original MinGW project (available at http://mingw.org, henceforth referred to as 'MinGW32') didn't support 64 bit Windows so the MinGW-w64 project was created. It contains support for both 32 and 64 bit architectures and generally it's better maintained than MinGW32. Step 1.1. Installing MSYS2 and MinGW-w64 ---------------------------------------- The following instructions will guide you through the installation of a MSYS2 and MinGW-w64. * Go to http://msys2.github.io and download the MSYS2 installer * Run it and install it on C:\msys2 (or any other path, but note it has to be ASCII only and with no spaces! The no spaces restriction also applies to the paths of the packages that will be built during the installation) * Upgrade the system packages by following the instructions from: http://msys2.github.io Launch MSYS MINGW64 * Install the compiler toolchain and assorted tools: pacman -S mingw-w64-x86_64-toolchain Step 1.2. Installing Python-PIP ------------------------------- The Python binaries that are available for download on Python's official website are compiled with Visual Studio, and if we use MinGW to compile libraries which are then used by Python modules we are at risk because the resulting application would load 2 different C runtimes. So you should remove python3 if it is installed in Windows. * Install pip/setuptools: pacman -S mingw-w64-x86_64-python3-pip Step 2. Install dependencies ---------------------------- See Dependencies.txt for detailed description of the required libraries and their minimum version number. * Install required dependencies with pacman: pacman -S mingw-w64-x86_64-gnutls mingw-w64-x86_64-python3-lxml \ mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-sqlite3 msys2-w32api-headers \ mingw-w64-x86_64-gmp mingw-w64-x86_64-mpc mingw-w64-x86_64-mpfr * Install the Python package dependencies: - pip3 install cython==0.29.37 dnspython twisted python-dateutil greenlet + pip3 install cython==0.29.37 dnspython twisted python-dateutil greenlet Step 2.1. Install python3-application, python3-gnults and python3-otr --------------------------------------------------------------------- * Install git: pacman -S git * Install python3-application pip3 install git+https://github.com/AGProjects/python3-application.git * Install python3-gnutls: - git clone https://github.com/AGProjects/python3-gnutls.git - empty requirements.txt - pip3 install . + pacman -S mingw-w64-x86_64-python-pyopenssl + pip install git+https://github.com/AGProjects/python3-gnutls.git --no-build-isolation * Install cryptography: - pacman -S mingw-w64-x86_64-python-cffi + pacman -S --overwrite '*' mingw-w64-x86_64-python-setuptools-rust patch wget https://mirror.msys2.org/mingw/sources/mingw-w64-python-cryptography-38.0.4-1.src.tar.zst Extract this and cd into the dir: tar --zstd -xvf ./mingw-w64-python-cryptography-38.0.4-1.src.tar.zst cd mingw-w64-python-cryptography makepkg-mingw -cfiL --nocheck --nosign * Install gmpy2: pacman -S mingw-w64-x86_64-python-gmpy2 * Install python3-otr: - git clone https://github.com/AGProjects/python3-otr.git - python setup.py install + pip install git+https://github.com/AGProjects/python3-otr.git --no-build-isolation Step 2.2. Build and install some extra packages ----------------------------------------------- mingw-w64-intsafe-headers * Get the package code: darcs get http://devel.ag-projects.com/repositories/windows/mingw-w64-intsafe-headers * Enter the directory and build+install the package: cd mingw-w64-intsafe-headers && makepkg-mingw -cfiL --nocheck --nosign +* Install will probably fail, so install with pacman -S --overwrite '*' ./mingw-w64-intsafe-headers-1.1.0-1-any.pkg.tar.zst mingw-w64-dshow-baseclasses * Get the package code: darcs get http://devel.ag-projects.com/repositories/windows/mingw-w64-dshow-baseclasses * Enter the directory and build+install the package: cd mingw-w64-dshow-baseclasses && makepkg-mingw -cfiL --nocheck --nosign Step 3. Install SIP SIMPLE client SDK ------------------------------------- The SDK consists of four parts: 1. python-eventlib 2. XCAP library 3. MSRP library 4. SIP SIMPLE library itself Make sure that the path where you download the software below does not contain any space in its name. # Eventlib git clone https://github.com/AGProjects/python3-eventlib.git cd python3-eventlib - pip3 install . + + Eventlib needs to be patched: + + diff --git a/eventlib/green/socket.py b/eventlib/green/socket.py + index 7a4623b..0455e2e 100644 + + --- a/eventlib/green/socket.py + +++ b/eventlib/green/socket.py + @@ -1,5 +1,5 @@ + import socket as __socket + -from socket import (__all__, error, AF_INET, AF_UNIX, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR, getdefaulttimeout, gethostname, getnameinfo, getservbyname, herror, htonl, SOCK_DGRAM, timeout, gaierror, SOCK_RAW, setdefaulttimeout, getservbyport, gethostbyaddr, ntohl, htons, ntohs, getfqdn, SOCK_RDM, SOCK_SEQPACKET) + +from socket import (__all__, error, AF_INET, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR, getdefaulttimeout, gethostname, getnameinfo, getservbyname, herror, htonl, SOCK_DGRAM, timeout, gaierror, SOCK_RAW, setdefaulttimeout, getservbyport, gethostbyaddr, ntohl, htons, ntohs, getfqdn, SOCK_RDM, SOCK_SEQPACKET) + + from eventlib.api import get_hub + from eventlib.greenio import GreenSocket as socket + + pip install . cd .. # XCAP library git clone https://github.com/AGProjects/python3-xcaplib.git cd python3-xcaplib - pip3 install . + Gevent does not work yet. So we need to patch xcaplib: + + diff --git a/xcaplib/client.py b/xcaplib/client.py + index 6b489cb..3f904ca 100644 + --- a/xcaplib/client.py + +++ b/xcaplib/client.py + @@ -1,8 +1,8 @@ + -import gevent + -from gevent import monkey + +#import gevent + +#from gevent import monkey + + -monkey.patch_socket() + -monkey.patch_ssl() + +#monkey.patch_socket() + +#monkey.patch_ssl() + + from xcaplib import __version__ + from xcaplib.httpclient import HTTPClient + + pip install . cd .. # MSRP library - git clone https://github.com/AGProjects/python3-msrplib.git - cd python3-msrplib - pip3 install . - cd .. + pip install git+https://github.com/AGProjects/python3-msrplib.git --no-build-isolation + +# SIPSimple SDK + git clone https://github.com/AGProjects/python3-sipsimple.git + pacman -S msys/make + cd python3-sipsimple + ./get_dependencies.sh + Gevent does not work yet. So we need to patch xcap: + patch -p1 < ./deps/patches/windows/001_disable_gevent.patch + pip install . --no-build-isolation + +