Skip to content

Commit 1fa7a2c

Browse files
author
Pan
committed
Added zlib and enabled compression for windows wheels. Enabled no mac/no encryption options for windows wheels.
1 parent 2692480 commit 1fa7a2c

File tree

5 files changed

+40
-1
lines changed

5 files changed

+40
-1
lines changed

.appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ install:
100100
# do not cause a version change.
101101
- python ci/appveyor/fix_version.py .
102102
- mv -f .git .git.bak
103+
- appveyor DownloadFile http://zlib.net/zlib1211.zip
104+
- 7z x zlib1211.zip
103105
- appveyor DownloadFile https://indy.fulgan.com/SSL/openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip
104106
- 7z x openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip
105107
- cp ssleay32.dll ssh2\
@@ -108,6 +110,7 @@ install:
108110

109111
build_script:
110112
# Build the compiled extension
113+
- "%CMD_IN_ENV% ci\\appveyor\\build_zlib.bat"
111114
- "%CMD_IN_ENV% ci\\appveyor\\build_ssh2.bat"
112115
- rm -f ssh2/*.c
113116
- "%CMD_IN_ENV% python setup.py build"

Changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Changes
1212
* Adds support for SHA-256 host key fingerprints.
1313
* Added SSH agent forwarding implementation.
1414
* Windows wheels switched to OpenSSL back end.
15+
* Windows wheels include zlib and have compression enabled.
16+
* Windows wheels no MAC and no encryption options enabled, same as posix wheels.
1517

1618
Note - binary wheels only.
1719

ci/appveyor/build_ssh2.bat

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
mkdir src && cd src
1+
mkdir src
2+
cd src
23

34
IF "%PYTHON_ARCH%" == "32" (
45
set OPENSSL_DIR="C:\OpenSSL-Win32"
@@ -16,6 +17,11 @@ IF "%MSVC%" == "Visual Studio 9" (
1617
-DCMAKE_BUILD_TYPE=Release ^
1718
-DCRYPTO_BACKEND=OpenSSL ^
1819
-DBUILD_SHARED_LIBS=OFF ^
20+
-DENABLE_ZLIB_COMPRESSION=ON ^
21+
-DENABLE_CRYPT_NONE=ON ^
22+
-DENABLE_MAC_NONE=ON ^
23+
-DZLIB_LIBRARY=C:/zlib/lib/zlib.lib ^
24+
-DZLIB_INCLUDE_DIR=C:/zlib/include ^
1925
-DOPENSSL_ROOT_DIR=%OPENSSL_DIR%
2026
REM -DOPENSSL_MSVC_STATIC_RT=TRUE
2127
REM -DOPENSSL_USE_STATIC_LIBS=TRUE
@@ -26,6 +32,11 @@ REM -DOPENSSL_USE_STATIC_LIBS=TRUE
2632
-DCRYPTO_BACKEND=OpenSSL ^
2733
-G"%MSVC%" ^
2834
-DBUILD_SHARED_LIBS=OFF ^
35+
-DENABLE_ZLIB_COMPRESSION=ON ^
36+
-DENABLE_CRYPT_NONE=ON ^
37+
-DENABLE_MAC_NONE=ON ^
38+
-DZLIB_LIBRARY=C:/zlib/lib/zlib.lib ^
39+
-DZLIB_INCLUDE_DIR=C:/zlib/include ^
2940
-DOPENSSL_ROOT_DIR=%OPENSSL_DIR%
3041
REM -DOPENSSL_MSVC_STATIC_RT=TRUE
3142
REM -DOPENSSL_USE_STATIC_LIBS=TRUE

ci/appveyor/build_zlib.bat

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
mkdir zlib_build && cd zlib_build
2+
3+
IF "%MSVC%" == "Visual Studio 9" (
4+
ECHO "Building without platform set"
5+
cmake ..\zlib-1.2.11 -G "NMake Makefiles" ^
6+
-DCMAKE_INSTALL_PREFIX="C:\zlib" ^
7+
-DCMAKE_BUILD_TYPE=Release ^
8+
-DBUILD_SHARED_LIBS=OFF
9+
) ELSE (
10+
ECHO "Building with platform %MSVC%"
11+
cmake ..\zlib-1.2.11 ^
12+
-G"%MSVC%" ^
13+
-DCMAKE_INSTALL_PREFIX="C:\zlib" ^
14+
-DCMAKE_BUILD_TYPE=Release ^
15+
-DBUILD_SHARED_LIBS=OFF
16+
)
17+
18+
cmake --build . --config Release --target install
19+
cp C:/zlib/lib/zlibstatic.lib %PYTHON%/libs/
20+
cd ..
21+
ls %PYTHON%/libs/

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# For libssh2 OpenSSL backend on Windows.
2929
_libs = ['Ws2_32', 'libssh2', 'user32',
3030
'libeay32MD', 'ssleay32MD',
31+
'zlibstatic',
3132
]
3233
else:
3334
_libs = ['ssh2']
@@ -89,6 +90,7 @@
8990
'Operating System :: OS Independent',
9091
'Programming Language :: Python',
9192
'Programming Language :: Python :: 2',
93+
'Programming Language :: Python :: 2.6',
9294
'Programming Language :: Python :: 2.7',
9395
'Programming Language :: Python :: 3',
9496
'Programming Language :: Python :: 3.4',

0 commit comments

Comments
 (0)