libssh2: fix linking on macOS (#16012)

* libssh2: fix linking on macOS

* Fix libgit2 linkage to libssh2
This commit is contained in:
Adam J. Stewart 2020-04-14 17:10:45 -05:00 committed by GitHub
parent cba5f71eee
commit 69f7bae8fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -57,6 +57,7 @@ class Libgit2(CMakePackage):
# Build Dependencies
depends_on('cmake@2.8:', type='build', when="@:0.28")
depends_on('cmake@3.5:', type='build', when="@0.99:")
depends_on('pkgconfig', type='build')
# Runtime Dependencies
depends_on('libssh2', when='+ssh')

View file

@ -28,3 +28,9 @@ def cmake_args(self):
spec = self.spec
return [
'-DBUILD_SHARED_LIBS=%s' % ('YES' if '+shared' in spec else 'NO')]
@run_after('install')
def darwin_fix(self):
# The shared library is not installed correctly on Darwin; fix this
if self.spec.satisfies('platform=darwin'):
fix_darwin_install_name(self.prefix.lib)