pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/rust rust: use files directory rather than echo



details:   https://anonhg.NetBSD.org/pkgsrc/rev/33356ea45f31
branches:  trunk
changeset: 369895:33356ea45f31
user:      maya <maya%pkgsrc.org@localhost>
date:      Sat Oct 07 17:40:27 2017 +0000

description:
rust: use files directory rather than echo

diffstat:

 lang/rust/Makefile          |  39 +++++++++------------------------------
 lang/rust/files/config.toml |  22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+), 30 deletions(-)

diffs (81 lines):

diff -r 767824d7a32d -r 33356ea45f31 lang/rust/Makefile
--- a/lang/rust/Makefile        Sat Oct 07 17:29:44 2017 +0000
+++ b/lang/rust/Makefile        Sat Oct 07 17:40:27 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2017/10/07 13:08:37 wiz Exp $
+# $NetBSD: Makefile,v 1.13 2017/10/07 17:40:27 maya Exp $
 
 DISTNAME=      rustc-1.20.0-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -115,37 +115,16 @@
        ${MV} ${WRKDIR}/rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}/rust-std-${RUST_ARCH}/lib/rustlib/${RUST_ARCH} \
                ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/rustc/lib/rustlib
 
-do-configure:
-       echo '[build]' > ${WRKSRC}/config.toml
-       echo 'rustc = "${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/rustc/bin/rustc"' \
-               >> ${WRKSRC}/config.toml
-       echo 'cargo = "${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/cargo/bin/cargo"' \
-               >> ${WRKSRC}/config.toml
-       echo 'python = "${PYTHONBIN}"' >> ${WRKSRC}/config.toml
-       echo 'vendor = true' >> ${WRKSRC}/config.toml
-       echo 'extended = true' >> ${WRKSRC}/config.toml
-       echo 'verbose = 2' >> ${WRKSRC}/config.toml
-
-       echo '[install]' >> ${WRKSRC}/config.toml
-       echo 'prefix = "${PREFIX}"' >> ${WRKSRC}/config.toml
-       echo 'sysconfdir = "${SYSCONFDIR}"' >> ${WRKSRC}/config.toml
-       echo 'mandir = "${PKGMANDIR}"' >> ${WRKSRC}/config.toml
+RUSTC=                 ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/rustc/bin/rustc
+CARGO=                 ${WRKDIR}/rust-${RUST_STAGE0_VER}-${RUST_ARCH}/cargo/bin/cargo
 
-       echo '[rust]' >> ${WRKSRC}/config.toml
-       echo 'channel = "stable"' >> ${WRKSRC}/config.toml
-       echo 'rpath = true' >> ${WRKSRC}/config.toml
-       echo 'codegen-tests = false' >> ${WRKSRC}/config.toml
-
-       echo '[dist]' >> ${WRKSRC}/config.toml
-       echo 'src-tarball = false' >> ${WRKSRC}/config.toml
+SUBST_CLASSES+=                config
+SUBST_STAGE.config=    post-configure
+SUBST_FILES.config+=   config.toml
+SUBST_VARS.config+=    RUSTC CARGO PREFIX PYTHONBIN
 
-       echo '[llvm]' >> ${WRKSRC}/config.toml
-       echo 'static-libstdcpp = false' >> ${WRKSRC}/config.toml
-       echo 'ninja = true' >> ${WRKSRC}/config.toml
-
-       echo '[target.${RUST_ARCH}]' >> ${WRKSRC}/config.toml
-       echo 'llvm-config = "${LOCALBASE}/bin/llvm-config"' \
-               >> ${WRKSRC}/config.toml
+do-configure:
+       ${CP} ${FILESDIR}/config.toml ${WRKSRC}/config.toml
 
 do-build:
        cd ${WRKSRC} \
diff -r 767824d7a32d -r 33356ea45f31 lang/rust/files/config.toml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/files/config.toml       Sat Oct 07 17:40:27 2017 +0000
@@ -0,0 +1,22 @@
+[build]
+rustc = "@RUSTC@"
+cargo = "@CARGO@"
+python = "@PYTHONBIN@"
+vendor = true
+extended = true
+verbose = 2
+[install]
+prefix = "@PREFIX@"
+sysconfdir = ""
+mandir = "man"
+[rust]
+channel = "stable"
+rpath = true
+codegen-tests = false
+[dist]
+src-tarball = false
+[llvm]
+static-libstdcpp = false
+ninja = true
+[target.x86_64-unknown-netbsd]
+llvm-config = "@PREFIX@/bin/llvm-config"



Home | Main Index | Thread Index | Old Index