Changeset View
Changeset View
Standalone View
Standalone View
lang/rust/Makefile
# Created by: Jyun-Yan You <jyyou@cs.nctu.edu.tw> | # Created by: Jyun-Yan You <jyyou@cs.nctu.edu.tw> | ||||
PORTNAME= rust | PORTNAME= rust | ||||
PORTVERSION?= 1.59.0 | PORTVERSION?= 1.60.0 | ||||
PORTREVISION?= 0 | PORTREVISION?= 0 | ||||
CATEGORIES= lang | CATEGORIES= lang | ||||
MASTER_SITES= https://static.rust-lang.org/dist/:src \ | MASTER_SITES= https://static.rust-lang.org/dist/:src \ | ||||
https://dev-static.rust-lang.org/dist/:src \ | https://dev-static.rust-lang.org/dist/:src \ | ||||
LOCAL/tobik/rust:bootstrap \ | LOCAL/rust:bootstrap \ | ||||
tobik: Just `LOCAL/rust` | |||||
LOCAL/mikael/rust:bootstrap \ | |||||
https://static.rust-lang.org/dist/:bootstrap | https://static.rust-lang.org/dist/:bootstrap | ||||
Not Done Inline ActionsWe should only have one of those. Remove mine. I'm going to ask clusteradm if we can have a /home/rust on freefall. Other groups also have one. tobik: We should only have one of those. Remove mine. I'm going to ask clusteradm if we can have a… | |||||
DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src | DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src | ||||
DISTFILES?= ${NIGHTLY_DATE:D${NIGHTLY_DATE}/}${DISTNAME}${EXTRACT_SUFX}:src \ | DISTFILES?= ${NIGHTLY_DATE:D${NIGHTLY_DATE}/}${DISTNAME}${EXTRACT_SUFX}:src \ | ||||
${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ | ${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ | ||||
${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ | ${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ | ||||
${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap | ${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap | ||||
DIST_SUBDIR?= rust | DIST_SUBDIR?= rust | ||||
MAINTAINER= rust@FreeBSD.org | MAINTAINER= rust@FreeBSD.org | ||||
COMMENT= Language with a focus on memory safety and concurrency | COMMENT= Language with a focus on memory safety and concurrency | ||||
LICENSE= APACHE20 MIT | LICENSE= APACHE20 MIT | ||||
LICENSE_COMB= dual | LICENSE_COMB= dual | ||||
LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE | LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE | ||||
LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT | LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT | ||||
IGNORE_FreeBSD_12_powerpc= is missing a bootstrap for FreeBSD 12.x powerpc | IGNORE_FreeBSD_12_powerpc= is missing a bootstrap for FreeBSD 12.x powerpc | ||||
ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 powerpc64le \ | ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 powerpc64le \ | ||||
powerpc riscv64 | powerpc riscv64 | ||||
ONLY_FOR_ARCHS_REASON?= requires prebuilt bootstrap compiler | ONLY_FOR_ARCHS_REASON?= requires prebuilt bootstrap compiler | ||||
BUILD_DEPENDS= cmake:devel/cmake | BUILD_DEPENDS= cmake:devel/cmake | ||||
LIB_DEPENDS= libcurl.so:ftp/curl | LIB_DEPENDS= libcurl.so:ftp/curl | ||||
USES= cpe ninja:build pkgconfig python:3.6+,build ssl tar:xz | USES= cpe ninja:build pkgconfig python:3.7+,build shebangfix ssl tar:xz | ||||
CPE_VENDOR= rust-lang | CPE_VENDOR= rust-lang | ||||
MAKE_ENV= DESTDIR=${STAGEDIR} \ | MAKE_ENV= DESTDIR=${STAGEDIR} \ | ||||
LIBGIT2_NO_PKG_CONFIG=1 \ | LIBGIT2_NO_PKG_CONFIG=1 \ | ||||
OPENSSL_DIR="${OPENSSLBASE}" | OPENSSL_DIR="${OPENSSLBASE}" | ||||
TEST_ENV= ${MAKE_ENV} \ | TEST_ENV= ${MAKE_ENV} \ | ||||
ALLOW_NONZERO_RLIMIT_CORE=1 | ALLOW_NONZERO_RLIMIT_CORE=1 | ||||
CONFLICTS_INSTALL?= rust-nightly | CONFLICTS_INSTALL?= rust-nightly | ||||
# rustc stashes intermediary files in TMPDIR (default /tmp) which | # rustc stashes intermediary files in TMPDIR (default /tmp) which | ||||
# might cause issues for users that for some reason space limit | # might cause issues for users that for some reason space limit | ||||
# their /tmp. WRKDIR should have plenty of space. | # their /tmp. WRKDIR should have plenty of space. | ||||
# ?= to allow users to still overwrite it in make.conf. | # ?= to allow users to still overwrite it in make.conf. | ||||
TMPDIR?= ${WRKDIR} | TMPDIR?= ${WRKDIR} | ||||
OPTIONS_DEFINE= DOCS GDB SOURCES WASM | OPTIONS_DEFINE= DOCS GDB SOURCES WASM | ||||
OPTIONS_DEFAULT= SOURCES WASM | OPTIONS_DEFAULT= SOURCES WASM | ||||
OPTIONS_EXCLUDE_armv6= DOCS | OPTIONS_EXCLUDE= DOCS # https://github.com/rust-lang/rust/issues/76526 | ||||
GDB_DESC= Install ports gdb (necessary for debugging rust programs) | GDB_DESC= Install ports gdb (necessary for debugging rust programs) | ||||
SOURCES_DESC= Install source files | SOURCES_DESC= Install source files | ||||
WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) | WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) | ||||
DOCS_VARS= _RUST_BUILD_DOCS=true | DOCS_VARS= _RUST_BUILD_DOCS=true | ||||
DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | ||||
GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | ||||
SOURCES_VARS= _RUST_TOOLS+=src | SOURCES_VARS= _COMPONENTS+=rust-src-${_PACKAGE_VERS} \ | ||||
WASM_VARS= _RUST_BUILD_WASM=true \ | _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 | _RUST_TARGETS+=wasm32-unknown-unknown | ||||
WASM_VARS_OFF= _RUST_BUILD_WASM=false | WASM_VARS_OFF= _RUST_BUILD_WASM=false | ||||
# See WRKSRC/src/stage0.json for the date and version values | # See WRKSRC/src/stage0.json for the date and version values | ||||
BOOTSTRAPS_DATE?= 2022-01-20 | BOOTSTRAPS_DATE?= 2022-02-24 | ||||
RUST_BOOTSTRAP_VERSION?= 1.58.1 | RUST_BOOTSTRAP_VERSION?= 1.59.0 | ||||
BOOTSTRAPS_SUFFIX?= ${BOOTSTRAPS_SUFFIX_${ARCH}} | BOOTSTRAPS_SUFFIX?= ${BOOTSTRAPS_SUFFIX_${ARCH}} | ||||
BOOTSTRAPS_SUFFIX_powerpc64?= -${PPC_ABI:tl} | BOOTSTRAPS_SUFFIX_powerpc64?= -${PPC_ABI:tl} | ||||
CARGO_VENDOR_DIR?= ${WRKSRC}/vendor | CARGO_VENDOR_DIR?= ${WRKSRC}/vendor | ||||
# Rust's target arch string might be different from *BSD arch strings | # Rust's target arch string might be different from *BSD arch strings | ||||
_RUST_ARCH_amd64= x86_64 | _RUST_ARCH_amd64= x86_64 | ||||
_RUST_ARCH_i386= i686 | _RUST_ARCH_i386= i686 | ||||
_RUST_ARCH_riscv64= riscv64gc | _RUST_ARCH_riscv64= riscv64gc | ||||
_RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} | _RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} | ||||
_RUST_TARGETS= ${_RUST_TARGET} | _RUST_TARGETS= ${_RUST_TARGET} | ||||
_RUST_TOOLS= analysis cargo clippy rustfmt | _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} | _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} | _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} | _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 <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
.if ${OPSYS} != FreeBSD | .if ${OPSYS} != FreeBSD | ||||
IGNORE= is only for FreeBSD | IGNORE= is only for FreeBSD | ||||
.endif | .endif | ||||
.if ${ARCH} == powerpc | .if ${ARCH} == powerpc | ||||
# bfd to link rustc_driver; lld currently can't | # bfd to link rustc_driver; lld currently can't | ||||
BUILD_DEPENDS+= ld.bfd:devel/binutils | BUILD_DEPENDS+= ld.bfd:devel/binutils | ||||
.else | .else | ||||
MAKE_ENV+= RUST_BACKTRACE=1 | MAKE_ENV+= RUST_BACKTRACE=1 | ||||
# rls needs 64-bit atomics | .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 | _RUST_TOOLS+= rls | ||||
_COMPONENTS+= rls-${_PACKAGE_VERS}-${_RUST_TARGET} | |||||
.endif | .endif | ||||
# per https://rust-lang.github.io/rustup/concepts/components.html | |||||
# rustc-dev is only usefull on nightly | |||||
Not Done Inline ActionsThis reenables rls on powerpc but it's excluded just above. tobik: This reenables rls on powerpc but it's excluded just above. | |||||
.if defined(NIGHTLY_DATE) | |||||
_COMPONENTS+= rustc-dev-${_PACKAGE_VERS}-${_RUST_TARGET} | |||||
Not Done Inline ActionsShould it use ${_PACKAGE_VERS} too? tobik: Should it use `${_PACKAGE_VERS}` too? | |||||
.endif | |||||
.if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) | .if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) | ||||
EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} | EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} | ||||
.endif | .endif | ||||
# If the kernel does not return sane kern.proc.pathname values | # If the kernel does not return sane kern.proc.pathname values | ||||
# for hardlinks then disable hardlinks in the build to avoid | # for hardlinks then disable hardlinks in the build to avoid | ||||
# intermittent "can't find crate for `std`" build failures, | # intermittent "can't find crate for `std`" build failures, | ||||
Not Done Inline ActionsOptions helpers? WASM_VARS= _COMPONENTS+="rust-analysis-${_PACKAGE_VERS}-wasm32-unknown-unknown rust-std-${_PACKAGE_VERS}-wasm32-unknown-unknown" tobik: Options helpers?
```
WASM_VARS= _COMPONENTS+="rust-analysis-${_PACKAGE_VERS}-wasm32… | |||||
# c.f. PR248184 | # c.f. PR248184 | ||||
# | # | ||||
# XXX: Avoiding OSVERSION since it is derived from userland but | # XXX: Avoiding OSVERSION since it is derived from userland but | ||||
# the running kernel might still be newer with sane behavior | # the running kernel might still be newer with sane behavior | ||||
# anyway... | # anyway... | ||||
.if exists(${PATCHDIR}/no-hardlinks) | .if exists(${PATCHDIR}/no-hardlinks) | ||||
_KERN_OSRELDATE!= ${SYSCTL} -n kern.osreldate 2>/dev/null || echo 0 | _KERN_OSRELDATE!= ${SYSCTL} -n kern.osreldate 2>/dev/null || echo 0 | ||||
. if ${_KERN_OSRELDATE} >= 1400040 | . if ${_KERN_OSRELDATE} >= 1400040 | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | .endfor | ||||
@${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml | ||||
.if defined(NIGHTLY_DATE) | .if defined(NIGHTLY_DATE) | ||||
# Don't abort if optional tools fail to build | # Don't abort if optional tools fail to build | ||||
@${ECHO_CMD} 'missing-tools=true' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'missing-tools=true' >> ${WRKSRC}/config.toml | ||||
.endif | .endif | ||||
do-build: | do-build: | ||||
@cd ${WRKSRC} && \ | @cd ${WRKSRC} && \ | ||||
${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py build --jobs=${MAKE_JOBS_NUMBER} | ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py dist --jobs=${MAKE_JOBS_NUMBER} | ||||
do-install: | do-install: | ||||
@cd ${WRKSRC} && \ | ${RM} -r ${WRKDIR}/_extractdist | ||||
${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py install --jobs=${MAKE_JOBS_NUMBER} | .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 | # We autogenerate the plist file. We do that, instead of the | ||||
# regular pkg-plist, because several libraries have a computed | # regular pkg-plist, because several libraries have a computed | ||||
# filename based on the absolute path of the source files. As it | # filename based on the absolute path of the source files. As it | ||||
# is user-specific, we cannot know their filename in advance. | # is user-specific, we cannot know their filename in advance. | ||||
@${RM} -r ${STAGEDIR}${DOCSDIR}/*.old \ | @${RM} ${STAGEDIR}${DOCSDIR}/*.old \ | ||||
${STAGEDIR}${DOCSDIR}/html/.lock \ | ${STAGEDIR}${PREFIX}/lib/rustlib/components \ | ||||
${STAGEDIR}${DOCSDIR}/html/.stamp \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ | ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \ | ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | ||||
@${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib \ | @${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib \ | ||||
${STAGEDIR}${PREFIX}/libexec -exec ${FILE} -i {} + | \ | ${STAGEDIR}${PREFIX}/libexec -exec ${FILE} -i {} + | \ | ||||
${AWK} -F: '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} | ${AWK} -F: '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} | ||||
@${FIND} ${STAGEDIR}${PREFIX} -not -type d | \ | @${FIND} ${STAGEDIR}${PREFIX} -not -type d | \ | ||||
${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' \ | ${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' \ | ||||
-e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' >> ${TMPPLIST} | -e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' >> ${TMPPLIST} | ||||
Show All 17 Lines |
Just LOCAL/rust