Index: lang/rust-nightly/Makefile =================================================================== --- lang/rust-nightly/Makefile +++ lang/rust-nightly/Makefile @@ -85,6 +85,30 @@ IGNORE= please use lang/rust-dragonfly instead .endif +pre-fetch: + # FIXME: This is the same check for CONFLICTS as the standard + # one, except port origins are not compared. This allows + # the port to conflict with itself, because Rust would pick + # installed Rust libraries instead of freshly built ones. + @conflicts_with=$$( \ + { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; } \ + | while read pkgname prfx orgn; do \ + if [ "/${PREFIX}" = "/$${prfx}" ]; then \ + ${ECHO_CMD} -n " $${pkgname}"; \ + fi; \ + done); \ + if [ -n "$${conflicts_with}" ]; then \ + ${ECHO_MSG}; \ + ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \ + for entry in $${conflicts_with}; do \ + ${ECHO_MSG} " $${entry}"; \ + done; \ + ${ECHO_MSG}; \ + ${ECHO_MSG} " They will not build together."; \ + ${ECHO_MSG} " Please remove them first with pkg delete."; \ + exit 1;\ + fi + post-extract: @(${RMDIR} ${WRKSRC}/src/compiler-rt && \ ${MV} ${WRKSRC_compiler_rt} ${WRKSRC}/src/compiler-rt) Index: lang/rust/Makefile =================================================================== --- lang/rust/Makefile +++ lang/rust/Makefile @@ -34,11 +34,19 @@ RUST_BOOT= rust-stage0-${RUST_BOOT_SIG}.tar.bz2 RUST_BOOT_SIG= 2015-04-27-857ef6e-freebsd-x86_64-18925db56f6298cc190d1f41615ab5871de1dda0 +# Rust's libraries are named librustc_${component}-${RUST_VSN_HASH}.so. +# The hash depends on Rust version and channel. See +# $(CFG_FILENAME_EXTRA) definition in src/main.mk. +RUST_VSN= ${PORTVERSION:R} +RUST_CHANNEL= stable +RUST_VSN_HASH!= /usr/bin/printf '%s' ${RUST_VSN}-${RUST_CHANNEL} | /sbin/md5 -q | cut -c 1-8 +PLIST_SUB+= RUST_VSN_HASH=${RUST_VSN_HASH} + USES= gmake python:2,build HAS_CONFIGURE= yes CONFIGURE_ARGS= --disable-valgrind --disable-docs \ --enable-clang --mandir=${MANPREFIX}/man \ - --release-channel=stable + --release-channel=${RUST_CHANNEL} # Use LLVM from ports, instead of the copy shipped with rust. LLVM_VER= 36 @@ -54,7 +62,7 @@ LLNEXTGEN_BUILD_DEPENDS= LLnextgen:${PORTSDIR}/devel/llnextgen -.include +.include .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 BROKEN= Only compiles on FreeBSD 10 and 11 @@ -64,6 +72,30 @@ IGNORE= please use lang/rust-dragonfly instead .endif +pre-fetch: + # FIXME: This is the same check for CONFLICTS as the standard + # one, except port origins are not compared. This allows + # the port to conflict with itself, because Rust would pick + # installed Rust libraries instead of freshly built ones. + @conflicts_with=$$( \ + { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; } \ + | while read pkgname prfx orgn; do \ + if [ "/${PREFIX}" = "/$${prfx}" ]; then \ + ${ECHO_CMD} -n " $${pkgname}"; \ + fi; \ + done); \ + if [ -n "$${conflicts_with}" ]; then \ + ${ECHO_MSG}; \ + ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \ + for entry in $${conflicts_with}; do \ + ${ECHO_MSG} " $${entry}"; \ + done; \ + ${ECHO_MSG}; \ + ${ECHO_MSG} " They will not build together."; \ + ${ECHO_MSG} " Please remove them first with pkg delete."; \ + exit 1;\ + fi + post-extract: @${MKDIR} ${WRKSRC}/dl ${LN} -sf ${DISTDIR}/${RUST_BOOT} ${WRKSRC}/dl @@ -96,4 +128,4 @@ ${STAGEDIR}${PREFIX}/lib/*.so \ ${STAGEDIR}${PREFIX}/lib/rustlib/*/lib/*.so -.include +.include