Skip to content

Commit e883ddf

Browse files
committed
setup: install libssh (to build dir) instead of only building it
1 parent 6580055 commit e883ddf

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

_setup_libssh.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,19 @@ def build_ssh():
1616

1717
if not os.path.exists('src'):
1818
os.mkdir('src')
19+
if not os.path.exists('local'):
20+
os.mkdir('local')
21+
if not os.path.exists('local/lib'):
22+
os.mkdir('local/lib')
23+
# Depending on architecture cmake installs libraries into lib64,
24+
# but we don't care about that.
25+
os.symlink('lib', 'local/lib64')
1926

2027
os.chdir('src')
21-
check_call('cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GSS_API=ON ../libssh',
28+
check_call('cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../local -DWITH_GSS_API=ON ../libssh',
2229
shell=True, env=os.environ)
23-
check_call(['make', '-j%s' % (cpu_count(),)])
30+
check_call(['make', '-j%s' % (cpu_count(),), 'all', 'install'])
2431
os.chdir('..')
2532

26-
for src in glob('src/lib/libssh.so*'):
33+
for src in glob('local/lib/libssh.so*'):
2734
copy2(src, 'ssh/')

ci/appveyor/build_ssh.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ cp %OPENSSL_DIR%\lib\VC\libcrypto%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
1717
cp %OPENSSL_DIR%\lib\VC\libssl%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
1818

1919
cmake --build . --config Release
20+
cmake --install . --prefix ../local
2021

2122
cd ..

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363

6464

6565
runtime_library_dirs = ["$ORIGIN/."] if not SYSTEM_LIBSSH else None
66-
_lib_dir = os.path.abspath("./src/lib") if not SYSTEM_LIBSSH else "/usr/local/lib"
67-
include_dirs = ["libssh/include", "./src/include"] if (ON_WINDOWS or ON_RTD) or \
66+
_lib_dir = os.path.abspath("./local/lib") if not SYSTEM_LIBSSH else "/usr/local/lib"
67+
include_dirs = ["./local/include"] if (ON_WINDOWS or ON_RTD) or \
6868
not SYSTEM_LIBSSH else ["/usr/local/include"]
6969

7070
extensions = [

tests/test_channel.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ def test_channel_non_blocking_exec(self):
103103
break
104104
lines = [s.decode('utf-8') for s in all_data.splitlines()]
105105
self.assertEqual(lines[0], self.resp)
106-
self.assertRaises(SSHError, chan.read)
107106
self.assertRaises(EOF, chan.poll)
108107
self.assertTrue(chan.is_eof())
109108
rc = chan.close()

0 commit comments

Comments
 (0)