Mk/Uses/cargo.mk: Push lib dependencies back down into ports

Some crates are optional via Cargo features or are only used during
tests, however the framework has no way to discriminate between
test or run dependencies using just CARGO_CRATES leading to more
run dependencies than necessary for some packages.  With more ported
Rust applications it's time to let individual ports make that
decision now.

The environmental setup to use dependencies from ports instead of
bundled ones and implied build dependencies (cmake, gmake, pkgconf)
are left in place for now.

Assign cargo.mk to rust@ while here.
This commit is contained in:
Tobias Kortkamp
2019-04-17 07:33:34 +00:00
parent f567316342
commit 23e6c4fb94
12 changed files with 24 additions and 24 deletions
+1 -16
View File
@@ -7,7 +7,7 @@
# Usage: USES=cargo
# Valid ARGS: none
#
# MAINTAINER: ports@FreeBSD.org
# MAINTAINER: rust@FreeBSD.org
.if !defined(_INCLUDE_USES_CARGO_MK)
_INCLUDE_USES_CARGO_MK= yes
@@ -126,12 +126,7 @@ BUILD_DEPENDS+= gmake:devel/gmake
BUILD_DEPENDS+= cmake:devel/cmake
.endif
.if ${CARGO_CRATES:Mfreetype-sys-[0-9]*}
LIB_DEPENDS+= libfreetype.so:print/freetype2
.endif
.if ${CARGO_CRATES:Mgettext-sys-[0-9]*}
.include "${USESDIR}/gettext.mk"
CARGO_ENV+= GETTEXT_BIN_DIR=${LOCALBASE}/bin \
GETTEXT_INCLUDE_DIR=${LOCALBASE}/include \
GETTEXT_LIB_DIR=${LOCALBASE}/lib
@@ -154,13 +149,11 @@ DEV_WARNING+= "CARGO_CRATES=${libc} may be unstable on aarch64 or not build on a
.if ${CARGO_CRATES:Mlibgit2-sys-[0-9]*}
# Use the system's libgit2 instead of building the bundled version
CARGO_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1
LIB_DEPENDS+= libgit2.so:devel/libgit2
.endif
.if ${CARGO_CRATES:Mlibssh2-sys-[0-9]*}
# Use the system's libssh2 instead of building the bundled version
CARGO_ENV+= LIBSSH2_SYS_USE_PKG_CONFIG=1
LIB_DEPENDS+= libssh2.so:security/libssh2
.endif
.if ${CARGO_CRATES:Monig_sys-[0-9]*}
@@ -170,7 +163,6 @@ LIB_DEPENDS+= libssh2.so:security/libssh2
# RUSTONIG_SYSTEM_LIBONIG is not necessary, but will force onig_sys to
# always use the system's libonig as returned by `pkg-config oniguruma`.
CARGO_ENV+= RUSTONIG_SYSTEM_LIBONIG=1
LIB_DEPENDS+= libonig.so:devel/oniguruma
.endif
.if ${CARGO_CRATES:Mopenssl-0.[0-9].*}
@@ -187,21 +179,14 @@ DEV_WARNING+= "CARGO_CRATES=openssl-0.10.3 or older do not support OpenSSL 1.1.1
.if ${CARGO_CRATES:Mopenssl-sys-[0-9]*}
# Make sure that openssl-sys can find the correct version of OpenSSL
.include "${USESDIR}/ssl.mk"
CARGO_ENV+= OPENSSL_LIB_DIR=${OPENSSLLIB} \
OPENSSL_INCLUDE_DIR=${OPENSSLINC}
# Silence bogus QA warning about needing USES=ssl
QA_ENV+= USESSSL=yes
.endif
.if ${CARGO_CRATES:Mpkg-config-[0-9]*}
.include "${USESDIR}/pkgconfig.mk"
.endif
.if ${CARGO_CRATES:Mthrussh-libsodium-[0-9]*}
LIB_DEPENDS+= libsodium.so:security/libsodium
.endif
_USES_extract+= 600:cargo-extract
cargo-extract:
# target for preparing crates directory. It will put all crates in
+1 -1
View File
@@ -16,7 +16,7 @@ BROKEN_SSL_REASON_libressl= Needs an old version of OpenSSL (older than 1.1)
BROKEN_SSL_REASON_libressl-devel= Needs an old version of OpenSSL (older than 1.1)
BROKEN_SSL_REASON_openssl111= Needs an older version of OpenSSL (older than 1.1)
USES= cargo perl5
USES= cargo perl5 ssl
USE_GITHUB= yes
USE_PERL5= build
+2
View File
@@ -11,6 +11,8 @@ COMMENT= Git command for automating fixup/autosquash commits
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.md
LIB_DEPENDS= libgit2.so:devel/libgit2
USES= cargo
USE_GITHUB= yes
GH_ACCOUNT= tummychow
+2
View File
@@ -9,6 +9,8 @@ COMMENT= Improved sequence editor for Git
LICENSE= ISCL
LIB_DEPENDS= libgit2.so:devel/libgit2
USES= cargo ncurses
USE_GITHUB= yes
GH_ACCOUNT= MitMaro
+3 -1
View File
@@ -15,7 +15,9 @@ LICENSE= GPLv2
BROKEN_aarch64= fails to compile: aesv8-armx-linux64.S:53:2: instruction requires: crypto aese v6.16b,v0.16b
USES= cargo
LIB_DEPENDS= libsodium.so:security/libsodium
USES= cargo ssl
CARGO_CRATES= adler32-1.0.3 \
advapi32-sys-0.2.0 \
aho-corasick-0.6.8 \
+1 -1
View File
@@ -11,7 +11,7 @@ COMMENT= Like ccache with cloud storage support
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= cargo
USES= cargo ssl
USE_GITHUB= yes
GH_ACCOUNT= mozilla
+4 -1
View File
@@ -14,7 +14,10 @@ LICENSE_COMB= dual
LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE
LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT
USES= cargo
LIB_DEPENDS= libgit2.so:devel/libgit2 \
libssh2.so:security/libssh2
USES= cargo ssl
USE_GITHUB= yes
GH_ACCOUNT= RustSec
+2
View File
@@ -12,6 +12,8 @@ COMMENT= Modern replacement for ls
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENCE
LIB_DEPENDS= libgit2.so:devel/libgit2
USES= cargo
USE_GITHUB= yes
GH_ACCOUNT= ogham
+1 -1
View File
@@ -12,7 +12,7 @@ COMMENT= Fast data collector
LICENSE= MPL20
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= cargo
USES= cargo ssl
USE_GITHUB= yes
GH_ACCOUNT= jedisct1
GH_TUPLE= Manishearth:rust-clippy:387efd459c0ad3db7af15f1a573057b8587f9748:clippy \
+3
View File
@@ -11,6 +11,9 @@ COMMENT= Clone of cat with syntax highlighting
LICENSE= APACHE20
LIB_DEPENDS= libgit2.so:devel/libgit2 \
libonig.so:devel/oniguruma
USES= cargo
USE_GITHUB= yes
GH_ACCOUNT= sharkdp
+1 -1
View File
@@ -13,7 +13,7 @@ COMMENT= WebSockets tools
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= cargo
USES= cargo ssl
USE_GITHUB= yes
GH_ACCOUNT= vi
+3 -2
View File
@@ -12,9 +12,10 @@ COMMENT= GPU-accelerated terminal emulator
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE-APACHE
LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig
LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2
USES= cargo
USES= cargo ssl
USE_GITHUB= yes
GH_ACCOUNT= jwilm