diff --git a/lang/rust-nightly/Makefile b/lang/rust-nightly/Makefile index 72cc3b06a6ff..69510560fe8f 100644 --- a/lang/rust-nightly/Makefile +++ b/lang/rust-nightly/Makefile @@ -1,25 +1,23 @@ # Created by: Jean-Sébastien Pédron # Run update.sh to update to the latest nightly PORTVERSION= 1.62.0.${NIGHTLY_DATE:C,-,,g} # Always set PORTREVISION explicitly as otherwise it is inherited from lang/rust PORTREVISION= 0 PKGNAMESUFFIX= -nightly DISTNAME= rustc-nightly-src ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= upstream does not provide bootstraps for other architectures CONFLICTS_INSTALL= rust MASTERDIR= ${.CURDIR}/../rust PATCHDIR= ${.CURDIR}/files DISTINFO_FILE= ${.CURDIR}/distinfo -OPTIONS_EXCLUDE= DOCS - -NIGHTLY_DATE= 2022-04-09 +NIGHTLY_DATE= 2022-05-02 BOOTSTRAPS_DATE= 2022-04-05 RUST_BOOTSTRAP_VERSION= beta .include "${MASTERDIR}/Makefile" diff --git a/lang/rust-nightly/distinfo b/lang/rust-nightly/distinfo index 6e397a600a31..8bfb4d5e8109 100644 --- a/lang/rust-nightly/distinfo +++ b/lang/rust-nightly/distinfo @@ -1,9 +1,9 @@ -TIMESTAMP = 1649492829 -SHA256 (rust/2022-04-09/rustc-nightly-src.tar.xz) = b31ec602bf925d2af2ea242ca7d539b5e25332590d4b41da188d997cb7ce3fc3 -SIZE (rust/2022-04-09/rustc-nightly-src.tar.xz) = 136886400 +TIMESTAMP = 1651565397 +SHA256 (rust/2022-05-02/rustc-nightly-src.tar.xz) = 21cfcbc8ddc69b0dfc6dfc17c818cf327f94140f182633613d6f7d77387d2ce9 +SIZE (rust/2022-05-02/rustc-nightly-src.tar.xz) = 135572540 SHA256 (rust/2022-04-05/rustc-beta-x86_64-unknown-freebsd.tar.xz) = 5b461322da60b08554f2557deb69485d3991abf13b75750a307c004d6547a42f SIZE (rust/2022-04-05/rustc-beta-x86_64-unknown-freebsd.tar.xz) = 77575576 SHA256 (rust/2022-04-05/rust-std-beta-x86_64-unknown-freebsd.tar.xz) = d457f1c09dd446e30e94e4bcb1e3b5fde9cc54080cbe5e0a329ee810ab07d312 SIZE (rust/2022-04-05/rust-std-beta-x86_64-unknown-freebsd.tar.xz) = 27789452 SHA256 (rust/2022-04-05/cargo-beta-x86_64-unknown-freebsd.tar.xz) = 832c90d532ffcba10039f1244bf06c7121ddd3b7fd7c0d913b62fd0ad82e1dce SIZE (rust/2022-04-05/cargo-beta-x86_64-unknown-freebsd.tar.xz) = 6743924 diff --git a/lang/rust-nightly/files/no-hardlinks/patch-src_bootstrap_native.rs b/lang/rust-nightly/files/no-hardlinks/patch-src_bootstrap_native.rs index c1469453237d..1484fdeee67e 100644 --- a/lang/rust-nightly/files/no-hardlinks/patch-src_bootstrap_native.rs +++ b/lang/rust-nightly/files/no-hardlinks/patch-src_bootstrap_native.rs @@ -1,35 +1,39 @@ There seems to be some kind of race when using llvm-config-wrapper for building rust-lld. Attempt to improve reliability of the build by not using it. llvm-config-wrapper is a hack in the first place that is only really needed on Windows. ---- src/bootstrap/native.rs.orig 2020-07-17 17:26:27 UTC +--- src/bootstrap/native.rs.orig 2022-05-01 20:28:31 UTC +++ src/bootstrap/native.rs -@@ -542,26 +542,9 @@ impl Step for Lld { +@@ -918,22 +918,6 @@ impl Step for Lld { let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/lld")); - configure_cmake(builder, target, &mut cfg, true); + configure_cmake(builder, target, &mut cfg, true, LdFlags::default()); - // This is an awful, awful hack. Discovered when we migrated to using - // clang-cl to compile LLVM/LLD it turns out that LLD, when built out of - // tree, will execute `llvm-config --cmakedir` and then tell CMake about - // that directory for later processing. Unfortunately if this path has - // forward slashes in it (which it basically always does on Windows) - // then CMake will hit a syntax error later on as... something isn't - // escaped it seems? - // - // Instead of attempting to fix this problem in upstream CMake and/or - // LLVM/LLD we just hack around it here. This thin wrapper will take the - // output from llvm-config and replace all instances of `\` with `/` to - // ensure we don't hit the same bugs with escaping. It means that you - // can't build on a system where your paths require `\` on Windows, but - // there's probably a lot of reasons you can't do that other than this. - let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper"); - + // Re-use the same flags as llvm to control the level of debug information + // generated for lld. + let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) { +@@ -945,7 +929,7 @@ impl Step for Lld { cfg.out_dir(&out_dir) - .profile("Release") -- .env("LLVM_CONFIG_REAL", &llvm_config) + .profile(profile) + .env("LLVM_CONFIG_REAL", &llvm_config) - .define("LLVM_CONFIG_PATH", llvm_config_shim) + .define("LLVM_CONFIG_PATH", &llvm_config) .define("LLVM_INCLUDE_TESTS", "OFF"); // While we're using this horrible workaround to shim the execution of diff --git a/lang/rust-nightly/files/patch-src_bootstrap_builder.rs b/lang/rust-nightly/files/patch-src_bootstrap_builder.rs new file mode 100644 index 000000000000..a694feae0641 --- /dev/null +++ b/lang/rust-nightly/files/patch-src_bootstrap_builder.rs @@ -0,0 +1,20 @@ +From 934145eb7023047e1add14f8bdad8e62a7c08d00 Mon Sep 17 00:00:00 2001 +From: alexey semenyuk +Date: Mon, 2 May 2022 19:24:50 +0000 +Subject: [PATCH] Enables option split-debuginfo on all platforms + +https://github.com/rust-lang/rust/pull/96648 + +--- src/bootstrap/builder.rs.orig 2022-05-01 20:28:31 UTC ++++ src/bootstrap/builder.rs +@@ -1406,9 +1406,7 @@ impl<'a> Builder<'a> { + // FIXME(davidtwco): #[cfg(not(bootstrap))] - #95612 needs to be in the bootstrap compiler + // for this conditional to be removed. + if !target.contains("windows") || compiler.stage >= 1 { +- if target.contains("linux") || target.contains("windows") { +- rustflags.arg("-Zunstable-options"); +- } ++ rustflags.arg("-Zunstable-options"); + match self.config.rust_split_debuginfo { + SplitDebuginfo::Packed => rustflags.arg("-Csplit-debuginfo=packed"), + SplitDebuginfo::Unpacked => rustflags.arg("-Csplit-debuginfo=unpacked"), diff --git a/lang/rust-nightly/files/patch-src_bootstrap_install.rs b/lang/rust-nightly/files/patch-src_bootstrap_install.rs index 59e25e10468d..e3afe8bad00c 100644 --- a/lang/rust-nightly/files/patch-src_bootstrap_install.rs +++ b/lang/rust-nightly/files/patch-src_bootstrap_install.rs @@ -1,17 +1,17 @@ Only install docs for the host target It otherwise wastes significant time (there are a lot of individual files) and stages host docs, wasm docs, which unstages the host docs first. ---- src/bootstrap/install.rs.orig 2021-03-22 17:05:25 UTC +--- src/bootstrap/install.rs.orig 2022-05-01 20:28:31 UTC +++ src/bootstrap/install.rs -@@ -133,7 +133,7 @@ macro_rules! install { +@@ -138,7 +138,7 @@ macro_rules! install { } install!((self, builder, _config), -- Docs, "src/doc", _config.docs, only_hosts: false, { -+ Docs, "src/doc", _config.docs, only_hosts: true, { +- Docs, path = "src/doc", _config.docs, only_hosts: false, { ++ Docs, path = "src/doc", _config.docs, only_hosts: true, { let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); }; diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 63cbce92cd92..f3fad6b4c84e 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -1,314 +1,316 @@ # Created by: Jyun-Yan You PORTNAME= rust PORTVERSION?= 1.60.0 PORTREVISION?= 0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:src \ https://dev-static.rust-lang.org/dist/:src \ LOCAL/rust:bootstrap \ https://static.rust-lang.org/dist/:bootstrap DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src DISTFILES?= ${NIGHTLY_DATE:D${NIGHTLY_DATE}/}${DISTNAME}${EXTRACT_SUFX}:src \ ${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ ${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ ${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap DIST_SUBDIR?= rust MAINTAINER= rust@FreeBSD.org COMMENT= Language with a focus on memory safety and concurrency LICENSE= APACHE20 MIT LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT IGNORE_FreeBSD_12_powerpc= is missing a bootstrap for FreeBSD 12.x powerpc ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 powerpc64le \ powerpc riscv64 ONLY_FOR_ARCHS_REASON?= requires prebuilt bootstrap compiler BUILD_DEPENDS= cmake:devel/cmake LIB_DEPENDS= libcurl.so:ftp/curl USES= cpe ninja:build pkgconfig python:3.7+,build shebangfix ssl tar:xz CPE_VENDOR= rust-lang MAKE_ENV= DESTDIR=${STAGEDIR} \ LIBGIT2_NO_PKG_CONFIG=1 \ OPENSSL_DIR="${OPENSSLBASE}" TEST_ENV= ${MAKE_ENV} \ ALLOW_NONZERO_RLIMIT_CORE=1 CONFLICTS_INSTALL?= rust-nightly # rustc stashes intermediary files in TMPDIR (default /tmp) which # might cause issues for users that for some reason space limit # their /tmp. WRKDIR should have plenty of space. # ?= to allow users to still overwrite it in make.conf. TMPDIR?= ${WRKDIR} OPTIONS_DEFINE= DOCS GDB SOURCES WASM OPTIONS_DEFAULT= SOURCES WASM +.if !defined(NIGHTLY_DATE) OPTIONS_EXCLUDE= DOCS # https://github.com/rust-lang/rust/issues/76526 +.endif GDB_DESC= Install ports gdb (necessary for debugging rust programs) SOURCES_DESC= Install source files WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) DOCS_VARS= _RUST_BUILD_DOCS=true DOCS_VARS_OFF= _RUST_BUILD_DOCS=false GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb SOURCES_VARS= _COMPONENTS+=rust-src-${_PACKAGE_VERS} \ _RUST_TOOLS+=src WASM_VARS= _COMPONENTS+="rust-analysis-${_PACKAGE_VERS}-wasm32-unknown-unknown rust-std-${_PACKAGE_VERS}-wasm32-unknown-unknown" \ _RUST_BUILD_WASM=true \ _RUST_TARGETS+=wasm32-unknown-unknown WASM_VARS_OFF= _RUST_BUILD_WASM=false # See WRKSRC/src/stage0.json for the date and version values BOOTSTRAPS_DATE?= 2022-02-24 RUST_BOOTSTRAP_VERSION?= 1.59.0 BOOTSTRAPS_SUFFIX?= ${BOOTSTRAPS_SUFFIX_${ARCH}} BOOTSTRAPS_SUFFIX_powerpc64?= -${PPC_ABI:tl} CARGO_VENDOR_DIR?= ${WRKSRC}/vendor # Rust's target arch string might be different from *BSD arch strings _RUST_ARCH_amd64= x86_64 _RUST_ARCH_i386= i686 _RUST_ARCH_riscv64= riscv64gc _RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} _RUST_TARGETS= ${_RUST_TARGET} _RUST_TOOLS= analysis cargo clippy rustfmt _RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _PACKAGE_VERS= ${NIGHTLY_DATE:?nightly:${PORTVERSION}} _COMPONENTS+= cargo-${_PACKAGE_VERS}-${_RUST_TARGET} \ clippy-${_PACKAGE_VERS}-${_RUST_TARGET} \ rustc-${_PACKAGE_VERS}-${_RUST_TARGET} \ rustfmt-${_PACKAGE_VERS}-${_RUST_TARGET} \ rust-analysis-${_PACKAGE_VERS}-${_RUST_TARGET} \ rust-std-${_PACKAGE_VERS}-${_RUST_TARGET} # https://github.com/bjorn3/rustc_codegen_cranelift/commit/83d470d91c15d0cb5890705291e6ee9e5be8a842 # https://github.com/rust-lang/rustc_codegen_gcc/pull/160 SHEBANG_FILES= compiler/rustc_codegen_cranelift/scripts/* \ compiler/rustc_codegen_gcc/*.sh compiler/rustc_codegen_gcc/build_sysroot/*.sh .include .if ${OPSYS} != FreeBSD IGNORE= is only for FreeBSD .endif .if ${ARCH} == powerpc # bfd to link rustc_driver; lld currently can't BUILD_DEPENDS+= ld.bfd:devel/binutils .else MAKE_ENV+= RUST_BACKTRACE=1 .endif # rls doesn't build on rust nightly # rls needs 64-bit atomics: it doesn't build on powerpc .if !defined(NIGHTLY_DATE) && ${ARCH} != powerpc _RUST_TOOLS+= rls _COMPONENTS+= rls-${_PACKAGE_VERS}-${_RUST_TARGET} .endif # per https://rust-lang.github.io/rustup/concepts/components.html # rustc-dev is only usefull on nightly .if defined(NIGHTLY_DATE) _COMPONENTS+= rustc-dev-${_PACKAGE_VERS}-${_RUST_TARGET} .endif .if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} .endif # If the kernel does not return sane kern.proc.pathname values # for hardlinks then disable hardlinks in the build to avoid # intermittent "can't find crate for `std`" build failures, # c.f. PR248184 # # XXX: Avoiding OSVERSION since it is derived from userland but # the running kernel might still be newer with sane behavior # anyway... .if exists(${PATCHDIR}/no-hardlinks) _KERN_OSRELDATE!= ${SYSCTL} -n kern.osreldate 2>/dev/null || echo 0 . if ${_KERN_OSRELDATE} >= 1400040 . elif ${_KERN_OSRELDATE} >= 1300521 . else EXTRA_PATCHES+= ${PATCHDIR}/no-hardlinks . endif .endif .if defined(PPC_ABI) && ${PPC_ABI} == ELFv1 # The bootstrap is hardcoded to use gcc9 # but we can build with a newer or older compiler as provided by USE_GCC=yes BUILD_DEPENDS+= gcc9:lang/gcc9 USE_GCC= yes STRIP_CMD= ${LOCALBASE}/bin/strip # unsupported e_type with base strip .endif .ifdef QEMU_EMULATING IGNORE= fails to build with qemu-user-static .endif .if make(makesum) DISTFILES:= ${DISTFILES:M*\:src} \ ${ONLY_FOR_ARCHS:O:@_arch@${:!${MAKE} ARCH=${_arch} PPC_ABI=ELFv1 -V'DISTFILES:N*\:src'!}@} \ ${ONLY_FOR_ARCHS:Mpowerpc64:@_arch@${:!${MAKE} ARCH=${_arch} PPC_ABI=ELFv2 -V'DISTFILES:N*\:src'!}@} .endif post-patch: @${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb .if defined(NIGHTLY_DATE) @${REINPLACE_CMD} 's/"rustfmt"/"nothx"/' ${WRKSRC}/src/stage0.json .endif # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json .if defined(PPC_ABI) && ${PPC_ABI} == ELFv1 @${REINPLACE_CMD} 's,%CC%,${CC},g' \ ${WRKSRC}/compiler/rustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs .if ${LOCALBASE} != /usr/local @${REINPLACE_CMD} 's,/usr/local/,${LOCALBASE}/,g' \ ${WRKSRC}/compiler/rustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs .endif .endif do-configure: # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh .for _component in cargo rust-std rustc @cd ${WRKDIR}/${_component}-*-${OPSYS:tl} && \ ${SH} install.sh --prefix=${WRKDIR}/bootstrap --verbose .endfor @${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml @${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-dir="${WRKDIR}/_build"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-stage=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'doc-stage=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'test-stage=2' >> ${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} 'verbose=2' >> ${WRKSRC}/config.toml .if defined(NIGHTLY_DATE) @${ECHO_CMD} 'profiler=true' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} 'target=[${_RUST_TARGETS:@.target.@"${.target.}"@:ts,}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cargo="${WRKDIR}/bootstrap/bin/cargo"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'rustc="${WRKDIR}/bootstrap/bin/rustc"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'tools=[${_RUST_TOOLS:@.tool.@"${.tool.}"@:ts,}]' >> ${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} '[rust]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'channel="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} 'ninja=true' >> ${WRKSRC}/config.toml .if ${ARCH} == powerpc # Rust doesn't call the system compiler with the full version of the target. # This makes powerpc miscompile due to the secure-plt ABI change. # Additionally, force using ld.bfd to work around a linking problem in rustc_mir @${PRINTF} '#!/bin/sh\nexec ${CC} "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/cc-wrapper @${CHMOD} +x ${WRKDIR}/cc-wrapper @${PRINTF} '#!/bin/sh\nexec ${CXX} "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/cxx-wrapper @${CHMOD} +x ${WRKDIR}/cxx-wrapper @${PRINTF} '#!/bin/sh\nexec ${CC} -fuse-ld=bfd "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/ld-wrapper @${CHMOD} +x ${WRKDIR}/ld-wrapper .endif .for _target in ${_RUST_TARGETS} @${ECHO_CMD} '[target.${_target}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'ar="${AR}"' >> ${WRKSRC}/config.toml .if ${ARCH} == powerpc @${ECHO_CMD} 'cc="${WRKDIR}/cc-wrapper"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${WRKDIR}/cxx-wrapper"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml .endif .if ${ARCH} == powerpc @${ECHO_CMD} 'linker="${WRKDIR}/ld-wrapper"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml .endif .endfor @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml .if defined(NIGHTLY_DATE) # Don't abort if optional tools fail to build @${ECHO_CMD} 'missing-tools=true' >> ${WRKSRC}/config.toml .endif do-build: @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py dist --jobs=${MAKE_JOBS_NUMBER} do-install: ${RM} -r ${WRKDIR}/_extractdist .for _c in ${_COMPONENTS} ${MKDIR} ${WRKDIR}/_extractdist ${TAR} xf ${WRKDIR}/_build/dist/${_c}.tar.xz -C ${WRKDIR}/_extractdist cd ${WRKDIR}/_extractdist/${_c} && \ ${SH} install.sh \ --docdir="${STAGEDIR}${DOCSDIR}" \ --mandir="${STAGEDIR}${PREFIX}/share/man" \ --prefix="${STAGEDIR}${PREFIX}" ${RM} -r ${WRKDIR}/_extractdist .endfor # We autogenerate the plist file. We do that, instead of the # regular pkg-plist, because several libraries have a computed # filename based on the absolute path of the source files. As it # is user-specific, we cannot know their filename in advance. @${RM} ${STAGEDIR}${DOCSDIR}/*.old \ ${STAGEDIR}${PREFIX}/lib/rustlib/components \ ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \ ${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \ ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh @${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib \ ${STAGEDIR}${PREFIX}/libexec -exec ${FILE} -i {} + | \ ${AWK} -F: '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} @${FIND} ${STAGEDIR}${PREFIX} -not -type d | \ ${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' \ -e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' >> ${TMPPLIST} post-install-DOCS-on: # Ignore any left behind empty directories in case some docs fail # to build (failures are ignored due to deny-warnings=false). @${FIND} ${STAGEDIR}${DOCSDIR}/html -empty -type d | \ ${SED} 's,^${STAGEDIR},@comment @dir ,' >> ${TMPPLIST} post-install-SOURCES-on: # Silence stage-qa warnings by sanitizing permissions on sources @${FIND} ${STAGEDIR}${PREFIX}/lib/rustlib/src -type f -exec ${CHMOD} \ ${SHAREMODE} {} + # Note that make test does not work when rust is already installed. do-test: @cd ${WRKSRC} && \ ${SETENV} ${TEST_ENV} ${PYTHON_CMD} x.py test --jobs=${MAKE_JOBS_NUMBER} .include