svn commit: r522316 - in head/lang/rust: . files
Tobias Kortkamp
tobik at FreeBSD.org
Tue Jan 7 07:01:46 UTC 2020
Author: tobik
Date: Tue Jan 7 07:01:46 2020
New Revision: 522316
URL: https://svnweb.freebsd.org/changeset/ports/522316
Log:
lang/rust: Simplify do-configure and garbage collect files/config.toml
Deleted:
head/lang/rust/files/config.toml
Modified:
head/lang/rust/Makefile
Modified: head/lang/rust/Makefile
==============================================================================
--- head/lang/rust/Makefile Tue Jan 7 04:55:40 2020 (r522315)
+++ head/lang/rust/Makefile Tue Jan 7 07:01:46 2020 (r522316)
@@ -141,32 +141,36 @@ post-patch-SOURCES-off:
@${REINPLACE_CMD} -e 's/config.tools.*"src".*/false;/' \
${WRKSRC}/src/bootstrap/install.rs
+do-configure:
+ @${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'docs=${_RUST_BUILD_DOCS}' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} '[install]' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'prefix="${PREFIX}"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'sysconfdir="${PREFIX}/etc"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'mandir="${MANPREFIX}/man"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'channel="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml
.if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE)
-CCACHE_VALUE= "${CCACHE_BIN}"
+ @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml
.else
-CCACHE_VALUE= false
+ @${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml
.endif
-
-do-configure:
- ${SED} -E \
- -e 's,%PREFIX%,${PREFIX},' \
- -e 's,%SYSCONFDIR%,${PREFIX}/etc,' \
- -e 's,%MANDIR%,${MANPREFIX}/man,' \
- -e 's,%PYTHON_CMD%,${PYTHON_CMD},' \
- -e 's,%CHANNEL%,${PKGNAMESUFFIX:Ustable:S/^-//},' \
- -e 's,%TARGET%,${_RUST_TARGET},' \
- -e 's,%CCACHE%,${CCACHE_VALUE},' \
- -e 's,%CC%,${CC},' \
- -e 's,%CXX%,${CXX},' \
- -e 's,%DOCS%,${_RUST_BUILD_DOCS},' \
- < ${FILESDIR}/config.toml \
- > ${WRKSRC}/config.toml
# no need to build a crosscompiler for these targets
.if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == powerpc64
- @${REINPLACE_CMD} -e 's,^#targets =.*,targets = "${_LLVM_TARGET}",' \
- -e 's,^#experimental-targets =.*,experimental-targets = "",' \
- ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'targets="${_LLVM_TARGET}"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'experimental-targets=""' >> ${WRKSRC}/config.toml
.endif
+ @${ECHO_CMD} '[target.${_RUST_TARGET}]' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml
+ @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml
@${REINPLACE_CMD} -e 's,%CC%,${CC},g' \
${WRKSRC}/src/librustc_llvm/build.rs \
${WRKSRC}/src/bootstrap/native.rs
More information about the svn-ports-all
mailing list