freebsd-ports/security/libssh2/Makefile
Roman Bogorodskiy 66e4a27d1d security/libssh2: fix the GCRYPT option
The port uses the old crypto configure flags:
--with-libgcrypt and --with-openssl. These flags
are no longer supported.

Besides from the obvious effect of the actual port configuration
not matching user intent, it also produces incorrect pkg-config
file for the given set of dependencies, and other ports that
depend on libssh2 fail when it's configured with GCRYPT=on.

Fix by using the proper configure arguments:
--with-crypto=libgcrypt and --with-crypto=openssl.

PR:		248164
Submitted by:	dgilbert@eicat.ca (bug report), James French (patch)
Approved by:	maintainer timeout
2020-08-08 05:17:01 +00:00

49 lines
1.2 KiB
Makefile

# Created by: Alexander Leidinger <netchild@FreeBSD.org>
# $FreeBSD$
PORTNAME= libssh2
PORTVERSION= 1.9.0
PORTREVISION= 3
PORTEPOCH= 3
CATEGORIES= security devel
MASTER_SITES= https://www.libssh2.org/download/ \
LOCAL/sbz
MAINTAINER= sbz@FreeBSD.org
COMMENT= Library implementing the SSH2 protocol
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/COPYING
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
USES= compiler:c11 libtool pathfix
USE_LDCONFIG= yes
OPTIONS_DEFINE= GCRYPT TRACE ZLIB
OPTIONS_DEFAULT= ZLIB
TRACE_DESC= Enable debug packet traces
TRACE_CONFIGURE_ENABLE= debug
GCRYPT_LIB_DEPENDS= libgcrypt.so:security/libgcrypt
GCRYPT_CONFIGURE_ON= --with-crypto=libgcrypt
GCRYPT_CONFIGURE_OFF= --with-crypto=openssl
GCRYPT_CPPFLAGS= -I${LOCALBASE}/include
GCRYPT_LIBS= -L${LOCALBASE}/lib
GCRYPT_USES_OFF= ssl
ZLIB_CONFIGURE_WITH= libz
.include <bsd.port.pre.mk>
post-patch:
@${REINPLACE_CMD} -e '/Libs:/s/@LIBS@//' \
${WRKSRC}/libssh2.pc.in
.if ! ${PORT_OPTIONS:MGCRYPT}
. if ${SSL_DEFAULT} == base
@${REINPLACE_CMD} -e 's/LIBSREQUIRED="$$LIBSREQUIRED$${LIBSREQUIRED:+ }libssl libcrypto"/LIBS="$$LIBS -lssl -lcrypto"/' \
${WRKSRC}/configure
. endif
.endif
.include <bsd.port.post.mk>