Skip to content

Commit

Permalink
Added zlib and enabled compression for windows wheels. Enabled no mac…
Browse files Browse the repository at this point in the history
…/no encryption options for windows wheels.
  • Loading branch information
pkittenis committed May 14, 2018
1 parent 2692480 commit 1fa7a2c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ install:
# do not cause a version change.
- python ci/appveyor/fix_version.py .
- mv -f .git .git.bak
- appveyor DownloadFile http://zlib.net/zlib1211.zip
- 7z x zlib1211.zip
- appveyor DownloadFile https://indy.fulgan.com/SSL/openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip
- 7z x openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip
- cp ssleay32.dll ssh2\
Expand All @@ -108,6 +110,7 @@ install:

build_script:
# Build the compiled extension
- "%CMD_IN_ENV% ci\\appveyor\\build_zlib.bat"
- "%CMD_IN_ENV% ci\\appveyor\\build_ssh2.bat"
- rm -f ssh2/*.c
- "%CMD_IN_ENV% python setup.py build"
Expand Down
2 changes: 2 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Changes
* Adds support for SHA-256 host key fingerprints.
* Added SSH agent forwarding implementation.
* Windows wheels switched to OpenSSL back end.
* Windows wheels include zlib and have compression enabled.
* Windows wheels no MAC and no encryption options enabled, same as posix wheels.

Note - binary wheels only.

Expand Down
13 changes: 12 additions & 1 deletion ci/appveyor/build_ssh2.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mkdir src && cd src
mkdir src
cd src

IF "%PYTHON_ARCH%" == "32" (
set OPENSSL_DIR="C:\OpenSSL-Win32"
Expand All @@ -16,6 +17,11 @@ IF "%MSVC%" == "Visual Studio 9" (
-DCMAKE_BUILD_TYPE=Release ^
-DCRYPTO_BACKEND=OpenSSL ^
-DBUILD_SHARED_LIBS=OFF ^
-DENABLE_ZLIB_COMPRESSION=ON ^
-DENABLE_CRYPT_NONE=ON ^
-DENABLE_MAC_NONE=ON ^
-DZLIB_LIBRARY=C:/zlib/lib/zlib.lib ^
-DZLIB_INCLUDE_DIR=C:/zlib/include ^
-DOPENSSL_ROOT_DIR=%OPENSSL_DIR%
REM -DOPENSSL_MSVC_STATIC_RT=TRUE
REM -DOPENSSL_USE_STATIC_LIBS=TRUE
Expand All @@ -26,6 +32,11 @@ REM -DOPENSSL_USE_STATIC_LIBS=TRUE
-DCRYPTO_BACKEND=OpenSSL ^
-G"%MSVC%" ^
-DBUILD_SHARED_LIBS=OFF ^
-DENABLE_ZLIB_COMPRESSION=ON ^
-DENABLE_CRYPT_NONE=ON ^
-DENABLE_MAC_NONE=ON ^
-DZLIB_LIBRARY=C:/zlib/lib/zlib.lib ^
-DZLIB_INCLUDE_DIR=C:/zlib/include ^
-DOPENSSL_ROOT_DIR=%OPENSSL_DIR%
REM -DOPENSSL_MSVC_STATIC_RT=TRUE
REM -DOPENSSL_USE_STATIC_LIBS=TRUE
Expand Down
21 changes: 21 additions & 0 deletions ci/appveyor/build_zlib.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mkdir zlib_build && cd zlib_build

IF "%MSVC%" == "Visual Studio 9" (
ECHO "Building without platform set"
cmake ..\zlib-1.2.11 -G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX="C:\zlib" ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_SHARED_LIBS=OFF
) ELSE (
ECHO "Building with platform %MSVC%"
cmake ..\zlib-1.2.11 ^
-G"%MSVC%" ^
-DCMAKE_INSTALL_PREFIX="C:\zlib" ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_SHARED_LIBS=OFF
)

cmake --build . --config Release --target install
cp C:/zlib/lib/zlibstatic.lib %PYTHON%/libs/
cd ..
ls %PYTHON%/libs/
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# For libssh2 OpenSSL backend on Windows.
_libs = ['Ws2_32', 'libssh2', 'user32',
'libeay32MD', 'ssleay32MD',
'zlibstatic',
]
else:
_libs = ['ssh2']
Expand Down Expand Up @@ -89,6 +90,7 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
Expand Down

0 comments on commit 1fa7a2c

Please sign in to comment.