Changeset View
Standalone View
Mk/Uses/cargo.mk
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | |||||
.if !defined(WITH_DEBUG) | .if !defined(WITH_DEBUG) | ||||
CARGO_BUILD_ARGS+= --release | CARGO_BUILD_ARGS+= --release | ||||
CARGO_TEST_ARGS+= --release | CARGO_TEST_ARGS+= --release | ||||
.else | .else | ||||
CARGO_INSTALL_ARGS+= --debug | CARGO_INSTALL_ARGS+= --debug | ||||
.endif | .endif | ||||
.if ${CARGO_CRATES:Mlibgit2-sys-*} | .if ${CARGO_CRATES:Mbacktrace-sys-[0-9]*} | ||||
BUILD_DEPENDS+= gmake:devel/gmake | |||||
.endif | |||||
.if ${CARGO_CRATES:Mcmake-[0-9]*} | |||||
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" | |||||
jbeich: "issues" are mainly crashes but if not they'd be hard to detect. libc crate "supports" 64-bit… | |||||
CARGO_ENV+= GETTEXT_BIN_DIR=${LOCALBASE}/bin \ | |||||
Done Inline ActionsMmm, the two :M are not the same, if there is a libc.0.1.something, it won't show up in the warning. mat: Mmm, the two `:M` are not the same, if there is a libc.0.1.something, it won't show up in the… | |||||
Done Inline Actions12.0-CURRENT will be obsolete in half a year and contributor may confuse libc with base system package. See also existing DEV_WARNING style under Mk/. Maybe try: .if ${CARGO_CRATES:Mlibc-[0-9]*} # FreeBSD 12.0 changed ABI: r318736 and r320043 # https://github.com/rust-lang/libc/commit/78f93220d70e # https://github.com/rust-lang/libc/commit/969ad2b73cdc _libc_VER= ${CARGO_CRATES:Mlibc-[0-9]*:C/.*-//} . if ${_libc_VER:R:R} == 0 && (${_libc_VER:R:E} < 2 || ${_libc_VER:R:E} == 2 && ${_libc_VER:E} < 38) DEV_WARNING+= "CARGO_CRATES=libc-0.2.37 or older maybe unstable on FreeBSD 12.0. Consider updating to the latest version." . endif .undef _libc_VER .endif jbeich: `12.0-CURRENT` will be obsolete in half a year and contributor may confuse libc with base… | |||||
GETTEXT_INCLUDE_DIR=${LOCALBASE}/include \ | |||||
GETTEXT_LIB_DIR=${LOCALBASE}/lib | |||||
.endif | |||||
.if ${CARGO_CRATES:Mlibc-[0-9]*} | |||||
# FreeBSD 12.0 changed ABI: r318736 and r320043 | |||||
# https://github.com/rust-lang/libc/commit/78f93220d70e | |||||
# https://github.com/rust-lang/libc/commit/969ad2b73cdc | |||||
_libc_VER= ${CARGO_CRATES:Mlibc-[0-9]*:C/.*-//} | |||||
. if ${_libc_VER:R:R} == 0 && (${_libc_VER:R:E} < 2 || ${_libc_VER:R:E} == 2 && ${_libc_VER:E} < 38) | |||||
DEV_WARNING+= "CARGO_CRATES=libc-0.2.37 or older maybe unstable on FreeBSD 12.0. Consider updating to the latest version." | |||||
. endif | |||||
.undef _libc_VER | |||||
.endif | |||||
.if ${CARGO_CRATES:Mlibgit2-sys-[0-9]*} | |||||
# Use the system's libgit2 instead of building the bundled version | # Use the system's libgit2 instead of building the bundled version | ||||
LIB_DEPENDS+= libgit2.so:devel/libgit2 | |||||
CARGO_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1 | CARGO_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1 | ||||
LIB_DEPENDS+= libgit2.so:devel/libgit2 | |||||
.endif | .endif | ||||
.if ${CARGO_CRATES:Mopenssl-sys-*} | .if ${CARGO_CRATES:Monig_sys-[0-9]*} | ||||
# onig_sys always prefers the system library but will try to link | |||||
# statically with it. Since devel/oniguruma doesn't provide a static | |||||
Done Inline ActionsI've looked at the onig crate code, and I guess CARGO_ENV+= RUSTONIG_DYNAMIC_LIBONIG=1 should be more appropriate, but I can be wrong. pizzamig: I've looked at the onig crate code, and I guess
```
CARGO_ENV+= RUSTONIG_DYNAMIC_LIBONIG=1
```… | |||||
Done Inline ActionsHmm, not sure. The onig_sys build script is like this: https://github.com/rust-onig/rust-onig/blob/v3.2.2/onig_sys/build.rs#L126 So I don't think RUSTONIG_DYNAMIC_LIBONIG would ever be used when it can find oniguruma >= 6.8.0 on the system. With RUSTONIG_SYSTEM_LIBONIG bat definitely links with libonig.so: [111amd64-default-job-03] Installing bat-0.3.0_1... =========================================================================== =>> Checking shared library dependencies 0x0000000000000001 NEEDED Shared library: [libc.so.7] 0x0000000000000001 NEEDED Shared library: [libgcc_s.so.1] 0x0000000000000001 NEEDED Shared library: [libm.so.5] 0x0000000000000001 NEEDED Shared library: [libonig.so.5] 0x0000000000000001 NEEDED Shared library: [libthr.so.3] 0x0000000000000001 NEEDED Shared library: [libz.so.6] Maybe both should be defined? tobik: Hmm, not sure. The `onig_sys` build script is like this:
https://github.com/rust-onig/rust… | |||||
Done Inline ActionsIMHO, neither are currently strictly needed, but probably you're right and RUSTONIG_SYSTEM_LIBONIG is the way to go, to be on the safe side. I've tested onig-sys with zero, one or both variables and the result was always the same, because the system library is preferred, if found, and the static library, that would be the default, is missing from devel/oniguruma, so the dynamic one is used. pizzamig: IMHO, neither are currently strictly needed, but probably you're right and… | |||||
Done Inline ActionsThanks. I've added a comment to cargo.mk about this. tobik: Thanks. I've added a comment to cargo.mk about this. | |||||
# library it'll link to libonig.so instead. Strictly speaking setting | |||||
# 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-sys-[0-9]*} | |||||
# Make sure that openssl-sys can find the correct version of OpenSSL | # Make sure that openssl-sys can find the correct version of OpenSSL | ||||
.include "${USESDIR}/ssl.mk" | .include "${USESDIR}/ssl.mk" | ||||
CARGO_ENV+= OPENSSL_LIB_DIR=${OPENSSLLIB} \ | CARGO_ENV+= OPENSSL_LIB_DIR=${OPENSSLLIB} \ | ||||
OPENSSL_INCLUDE_DIR=${OPENSSLINC} | OPENSSL_INCLUDE_DIR=${OPENSSLINC} | ||||
.endif | .endif | ||||
.if ${CARGO_CRATES:Mpkg-config-*} | .if ${CARGO_CRATES:Mpkg-config-[0-9]*} | ||||
.include "${USESDIR}/pkgconfig.mk" | .include "${USESDIR}/pkgconfig.mk" | ||||
.endif | .endif | ||||
.if ${CARGO_CRATES:Mthrussh-libsodium-[0-9]*} | |||||
LIB_DEPENDS+= libsodium.so:security/libsodium | |||||
.endif | |||||
_USES_extract+= 600:cargo-extract | _USES_extract+= 600:cargo-extract | ||||
cargo-extract: | cargo-extract: | ||||
# target for preparing crates directory. It will put all crates in | # target for preparing crates directory. It will put all crates in | ||||
# the local crates directory. | # the local crates directory. | ||||
@${ECHO_MSG} "===> Moving crates to ${CARGO_VENDOR_DIR}" | @${ECHO_MSG} "===> Moving crates to ${CARGO_VENDOR_DIR}" | ||||
@${MKDIR} ${CARGO_VENDOR_DIR} | @${MKDIR} ${CARGO_VENDOR_DIR} | ||||
.for _crate in ${CARGO_CRATES} | .for _crate in ${CARGO_CRATES} | ||||
@${MV} ${WRKDIR}/${_crate} ${CARGO_VENDOR_DIR}/${_crate} | @${MV} ${WRKDIR}/${_crate} ${CARGO_VENDOR_DIR}/${_crate} | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
# cargo-crates-licenses will try to grab license information from | # cargo-crates-licenses will try to grab license information from | ||||
# all downloaded crates. | # all downloaded crates. | ||||
cargo-crates-licenses: configure | cargo-crates-licenses: configure | ||||
@${FIND} ${CARGO_VENDOR_DIR} -name 'Cargo.toml' -maxdepth 2 \ | @${FIND} ${CARGO_VENDOR_DIR} -name 'Cargo.toml' -maxdepth 2 \ | ||||
-exec ${GREP} -H '^license' {} \; \ | -exec ${GREP} -H '^license' {} \; \ | ||||
| ${SED} \ | | ${SED} \ | ||||
-e 's@^${CARGO_VENDOR_DIR}/@@' \ | -e 's@^${CARGO_VENDOR_DIR}/@@' \ | ||||
-e 's@/Cargo.toml:license.*= *"@|@' \ | -e 's@/Cargo.toml:license.*= *"@|@' \ | ||||
-e 's@"$$@@g' | /usr/bin/column -t -s '|' | -e 's@"$$@@g' | sort | /usr/bin/column -t -s '|' | ||||
.endif | .endif |
"issues" are mainly crashes but if not they'd be hard to detect. libc crate "supports" 64-bit inodes and absolute kevent(2) timeouts since 0.2.38. rP468993 simply standardized on the latest version to facilitate debugging and pick up other FreeBSD fixes.