aboutsummaryrefslogtreecommitdiff
path: root/lang/rust
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2020-01-07 07:01:46 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2020-01-07 07:01:46 +0000
commitf998d9199bfe5919899526785f5dd0f460b43f6c (patch)
tree6805dc24b7aa66aa68832bc11587fbba5d178669 /lang/rust
parentced1e88d5ec94a9d75353644b1684410966846e9 (diff)
downloadports-f998d9199bfe5919899526785f5dd0f460b43f6c.tar.gz
ports-f998d9199bfe5919899526785f5dd0f460b43f6c.zip
lang/rust: Simplify do-configure and garbage collect files/config.toml
Notes
Notes: svn path=/head/; revision=522316
Diffstat (limited to 'lang/rust')
-rw-r--r--lang/rust/Makefile44
-rw-r--r--lang/rust/files/config.toml42
2 files changed, 24 insertions, 62 deletions
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 4774a23baadd..796a7217018e 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -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
diff --git a/lang/rust/files/config.toml b/lang/rust/files/config.toml
deleted file mode 100644
index ad7a2643f372..000000000000
--- a/lang/rust/files/config.toml
+++ /dev/null
@@ -1,42 +0,0 @@
-[build]
-
-# Use bundled crates; this should permit offline build.
-vendor = true
-
-# In addition to rustc, rust-std and rust-docs, build Cargo.
-extended = true
-
-# python(1) location.
-python = "%PYTHON_CMD%"
-
-# Do we want to build docs?
-docs = %DOCS%
-
-[install]
-
-# Install location.
-prefix = "%PREFIX%"
-sysconfdir = "%SYSCONFDIR%"
-mandir = "%MANDIR%"
-
-[rust]
-
-# Rust release channel.
-channel = "%CHANNEL%"
-
-default-linker = "%CC%"
-
-[llvm]
-ccache = %CCACHE%
-#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX;Hexagon"
-#experimental-targets = "WebAssembly;RISCV"
-
-[target.%TARGET%]
-cc = "%CC%"
-cxx = "%CXX%"
-linker = "%CC%"
-
-[dist]
-
-# Do not build the source archive.
-src-tarball = false