Skip to content

Commit 5a494f9

Browse files
author
Pan
committed
Migrated Windows wheels to openssl backend. Added openssl libraries to windows wheels.
1 parent c6a043a commit 5a494f9

File tree

6 files changed

+52
-16
lines changed

6 files changed

+52
-16
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ install:
7575

7676
# Upgrade to the latest version of pip to avoid it displaying warnings
7777
# about it being out of date.
78-
- "pip install --disable-pip-version-check --user --upgrade pip"
78+
# - "pip install --disable-pip-version-check --user --upgrade pip"
7979

8080
# Install the build dependencies of the project. If some dependencies contain
8181
# compiled extensions and are not provided as pre-built wheel packages,

.travis.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,16 @@ jobs:
3535
include:
3636
- stage: OSX wheel build
3737
os: osx
38-
if: tag IS present
38+
# if: tag IS present
3939
before_install:
4040
- brew update
4141
install:
42-
- brew install libssh2
42+
# - brew install libssh2
43+
- brew upgrade openssl
44+
- export PATH="/usr/local/opt/openssl/bin:$PATH"
45+
# - export OPENSSL_ROOT_DIR="/usr/local/opt/openssl"
46+
# - export OPENSSL_INCLUDE_DIR="/usr/local/opt/openssl/include"
47+
- sudo ci/install-ssh2.sh
4348
- sudo -H pip2 install -U delocate twine wheel pip setuptools
4449
- pip2 wheel .
4550
script:
@@ -61,11 +66,14 @@ jobs:
6166
- stage: OSX wheel build
6267
os: osx
6368
osx_image: xcode8
64-
if: tag IS present
69+
# if: tag IS present
6570
before_install:
6671
- brew update
6772
install:
68-
- brew install libssh2
73+
# - brew install libssh2
74+
- brew upgrade openssl
75+
- export PATH="/usr/local/opt/openssl/bin:$PATH"
76+
- sudo ci/install-ssh2.sh
6977
- sudo -H pip2 install -U delocate twine wheel pip setuptools
7078
- pip2 wheel .
7179
script:
@@ -87,11 +95,14 @@ jobs:
8795
- stage: OSX wheel build
8896
os: osx
8997
osx_image: xcode6.4
90-
if: tag IS present
98+
# if: tag IS present
9199
before_install:
92100
- brew update
93101
install:
94-
- brew install libssh2
102+
# - brew install libssh2
103+
- brew upgrade openssl
104+
- export PATH="/usr/local/opt/openssl/bin:$PATH"
105+
- sudo ci/install-ssh2.sh
95106
- python --version
96107
- wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
97108
- sudo python get-pip.py

Changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Change Log
22
=============
33

4-
0.12.0
4+
0.13.0
55
+++++++
66

77
Changes
@@ -11,6 +11,7 @@ Changes
1111
* Adds support for ECDSA host and client keys.
1212
* Adds support for SHA-256 host key fingerprints.
1313
* Added SSH agent forwarding implementation.
14+
* Windows wheels switched to OpenSSL back end.
1415

1516
Note - binary wheels only.
1617

ci/appveyor/build_ssh2.bat

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,33 @@ IF "%MSVC%" == "Visual Studio 9" (
44
ECHO "Building without platform set"
55
cmake ..\libssh2 -G "NMake Makefiles" ^
66
-DCMAKE_BUILD_TYPE=Release ^
7-
-DCRYPTO_BACKEND=WinCNG ^
7+
-DCRYPTO_BACKEND=OpenSSL ^
88
-DBUILD_SHARED_LIBS=OFF
99
) ELSE (
1010
ECHO "Building with platform %MSVC%"
1111
cmake ..\libssh2 -G "NMake Makefiles" ^
1212
-DCMAKE_BUILD_TYPE=Release ^
13-
-DCRYPTO_BACKEND=WinCNG ^
13+
-DCRYPTO_BACKEND=OpenSSL ^
1414
-G"%MSVC%" ^
1515
-DBUILD_SHARED_LIBS=OFF
1616
)
1717

18+
IF "%PYTHON_ARCH%" == "32" (
19+
set OPENSSL_DIR="C:\OpenSSL-Win32"
20+
) ELSE (
21+
set OPENSSL_DIR="C:\OpenSSL-Win64"
22+
)
23+
24+
cp %OPENSSL_DIR%\lib\VC\libeay32MD.lib %APPVEYOR_BUILD_FOLDER%
25+
cp %OPENSSL_DIR%\lib\VC\ssleay32MD.lib %APPVEYOR_BUILD_FOLDER%
26+
cp %OPENSSL_DIR%\libeay32.dll %APPVEYOR_BUILD_FOLDER%\ssh2\
27+
cp %OPENSSL_DIR%\ssleay32.dll %APPVEYOR_BUILD_FOLDER%\ssh2\
28+
1829
cmake --build . --config Release
1930
cd ..
31+
ls %OPENSSL_DIR%\
32+
ls
33+
ls ssh2
2034
ls src/src
2135
cp src/src/libssh2.lib %PYTHON%/libs/ || cp src/src/Release/libssh2.lib %PYTHON%/libs/
2236
ls %PYTHON%/libs/

libssh2

setup.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
else:
2121
USING_CYTHON = True
2222

23+
ON_WINDOWS = platform.system() == 'Windows'
24+
2325
ext = 'pyx' if USING_CYTHON else 'c'
2426
sources = glob('ssh2/*.%s' % (ext,))
25-
_libs = ['ssh2'] if platform.system() != 'Windows' else [
27+
if ON_WINDOWS:
2628
# For libssh2 OpenSSL backend on Windows.
27-
# Windows native WinCNG is used by default.
28-
# 'libeay32', 'ssleay32',
29-
'Ws2_32', 'libssh2', 'user32']
29+
_libs = ['Ws2_32', 'libssh2', 'user32',
30+
'libeay32MD', 'ssleay32MD']
31+
else:
32+
_libs = ['ssh2']
3033

3134
# _comp_args = ["-ggdb"]
3235
_comp_args = ["-O3"] if platform.system() != 'Windows' else None
@@ -51,6 +54,13 @@
5154
)
5255
for i in range(len(sources))]
5356

57+
package_data = {'ssh2': ['*.pxd']}
58+
59+
if ON_WINDOWS:
60+
package_data['ssh2'].extend(['libeay32.dll', 'ssleay32.dll'])
61+
62+
print("Using package data %s" % package_data)
63+
5464
cmdclass = versioneer.get_cmdclass()
5565
if USING_CYTHON:
5666
cmdclass['build_ext'] = build_ext
@@ -89,5 +99,5 @@
8999
'Operating System :: POSIX :: BSD',
90100
],
91101
ext_modules=extensions,
92-
package_data={'ssh2': ['*.pxd']},
102+
package_data=package_data,
93103
)

0 commit comments

Comments
 (0)