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> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= rust | PORTNAME= rust | ||||
PORTVERSION?= 1.41.0 | PORTVERSION?= 1.41.1 | ||||
PORTREVISION?= 0 | PORTREVISION?= 0 | ||||
CATEGORIES= lang | CATEGORIES= lang | ||||
MASTER_SITES= https://static.rust-lang.org/dist/:src \ | MASTER_SITES= https://dev-static.rust-lang.org/dist/:src \ | ||||
LOCAL/tobik/rust:bootstrap \ | LOCAL/tobik/rust:bootstrap \ | ||||
https://static.rust-lang.org/dist/:bootstrap | https://static.rust-lang.org/dist/:bootstrap | ||||
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 | ||||
Show All 22 Lines | MAKE_ENV= LIBGIT2_SYS_USE_PKG_CONFIG=1 \ | ||||
LIBSSH2_SYS_USE_PKG_CONFIG=1 \ | LIBSSH2_SYS_USE_PKG_CONFIG=1 \ | ||||
OPENSSL_DIR="${OPENSSLBASE}" \ | OPENSSL_DIR="${OPENSSLBASE}" \ | ||||
RUST_BACKTRACE=1 | RUST_BACKTRACE=1 | ||||
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 | ||||
PLIST_FILES= lib/rustlib/components \ | |||||
lib/rustlib/rust-installer-version | |||||
OPTIONS_DEFINE= DOCS GDB SOURCES WASM | OPTIONS_DEFINE= DOCS GDB SOURCES WASM | ||||
OPTIONS_DEFAULT= SOURCES WASM | |||||
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_OFF= _RUST_BUILD_DOCS=false | DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | ||||
DOCS_VARS= _RUST_BUILD_DOCS=true | DOCS_VARS= _RUST_BUILD_DOCS=true | ||||
GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | ||||
WASM_VARS_OFF= _RUST_BUILD_WASM=false | WASM_VARS_OFF= _RUST_BUILD_WASM=false | ||||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | .endif | ||||
@${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml | ||||
@${REINPLACE_CMD} 's,%CC%,${CC},g' \ | @${REINPLACE_CMD} 's,%CC%,${CC},g' \ | ||||
${WRKSRC}/src/librustc_llvm/build.rs \ | ${WRKSRC}/src/librustc_llvm/build.rs \ | ||||
${WRKSRC}/src/bootstrap/native.rs | ${WRKSRC}/src/bootstrap/native.rs | ||||
do-build: | do-build: | ||||
@cd ${WRKSRC} && \ | @cd ${WRKSRC} && \ | ||||
${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py build --config=config.toml \ | ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py build --jobs=${MAKE_JOBS_NUMBER} | ||||
--jobs=${MAKE_JOBS_NUMBER} | |||||
do-install: | do-install: | ||||
# DESTDIR not in MAKE_ENV as it would cause the bundled LLVM to be | # DESTDIR not in MAKE_ENV as it would cause the bundled LLVM to be | ||||
# staged into it during do-build. | # staged into it during do-build. | ||||
@cd ${WRKSRC} && \ | @cd ${WRKSRC} && \ | ||||
${SETENV} ${MAKE_ENV} DESTDIR=${STAGEDIR} ${PYTHON_CMD} \ | ${SETENV} ${MAKE_ENV} DESTDIR=${STAGEDIR} ${PYTHON_CMD} \ | ||||
x.py install --config=config.toml --jobs=${MAKE_JOBS_NUMBER} | x.py install --jobs=${MAKE_JOBS_NUMBER} | ||||
# We autogenerate the plist file. We do that, instead of the | |||||
# In post-install, we use the manifests generated during Rust install | # regular pkg-plist, because several libraries have a computed | ||||
# to in turn generate the PLIST. We do that, instead of the regular | # filename based on the absolute path of the source files. As it | ||||
# `pkg-plist`, because several libraries have a computed filename based | # is user-specific, we cannot know their filename in advance. | ||||
# on the absolute path of the source files. As it is user-specific, we | |||||
# can't know their filename in advance. | |||||
# | # | ||||
# Both rustc and Cargo components install the same README.md and LICENSE | |||||
# files. The install process backs up the first copy to install the | |||||
# second. Thus here, we need to remove those backups. We also need to | |||||
# dedup the entries in the generated PLIST, because both components' | |||||
# manifests list them. | |||||
# | |||||
# We fix manpage entries in the generated manifests because Rust | # We fix manpage entries in the generated manifests because Rust | ||||
# installs them uncompressed but the Ports framework compresses them. | # installs them uncompressed but the Ports framework compresses them. | ||||
post-install: | @${RM} -r ${STAGEDIR}${DOCSDIR}/*.old \ | ||||
for f in ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-*; do \ | ${STAGEDIR}${DOCSDIR}/html/.lock \ | ||||
${REINPLACE_CMD} -i '' -E \ | ${STAGEDIR}${DOCSDIR}/html/.stamp \ | ||||
-e 's,:${STAGEDIR},:,' \ | |||||
-e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' \ | |||||
"$$f"; \ | |||||
${ECHO_CMD} "$${f#${STAGEDIR}}" >> ${TMPPLIST}; \ | |||||
${AWK} '\ | |||||
/^file:/ { \ | |||||
file=$$0; \ | |||||
sub(/^file:/, "", file); \ | |||||
print file; \ | |||||
} \ | |||||
/^dir:/ { \ | |||||
dir=$$0; \ | |||||
sub(/^dir:/, "", dir); \ | |||||
system("find ${STAGEDIR}" dir " -type f | ${SED} -E -e \"s,${STAGEDIR},,\""); \ | |||||
}' \ | |||||
"$$f" >> ${TMPPLIST}; \ | |||||
done | |||||
${RM} -r ${STAGEDIR}${PREFIX}/share/doc/rust/*.old | |||||
${SORT} -u < ${TMPPLIST} > ${TMPPLIST}.uniq | |||||
${MV} ${TMPPLIST}.uniq ${TMPPLIST} | |||||
@${RM} \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ | ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | ||||
@${FIND} ${STAGEDIR}${PREFIX}/bin -exec ${FILE} -i {} + | ${AWK} -F: \ | @${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib -exec ${FILE} -i {} + | \ | ||||
'/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} | ${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-SOURCES-on: | post-install-SOURCES-on: | ||||
# Silence stage-qa warnings by sanitizing permissions on sources | # Silence stage-qa warnings by sanitizing permissions on sources | ||||
@${FIND} ${STAGEDIR}${PREFIX}/lib/rustlib/src -type f -exec ${CHMOD} \ | @${FIND} ${STAGEDIR}${PREFIX}/lib/rustlib/src -type f -exec ${CHMOD} \ | ||||
${SHAREMODE} {} + | ${SHAREMODE} {} + | ||||
# Note that make test does not work when rust is already installed. | # Note that make test does not work when rust is already installed. | ||||
do-test: | do-test: | ||||
@cd ${WRKSRC} && \ | @cd ${WRKSRC} && \ | ||||
${SETENV} ${TEST_ENV} ${PYTHON_CMD} x.py test --config=config.toml \ | ${SETENV} ${TEST_ENV} ${PYTHON_CMD} x.py test --jobs=${MAKE_JOBS_NUMBER} | ||||
--jobs=${MAKE_JOBS_NUMBER} | |||||
.if !defined(_RUST_MAKESUM_GUARD) | .if !defined(_RUST_MAKESUM_GUARD) | ||||
makesum: | makesum: | ||||
${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=${ONLY_FOR_ARCHS:O:[1]} DISTINFO_FILE=${DISTINFO_FILE}.tmp | ${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=${ONLY_FOR_ARCHS:O:[1]} DISTINFO_FILE=${DISTINFO_FILE}.tmp | ||||
.for arch in ${ONLY_FOR_ARCHS:O:[2..-1]} | .for arch in ${ONLY_FOR_ARCHS:O:[2..-1]} | ||||
${MAKE} -D_RUST_MAKESUM_GUARD makesum PPC_ABI=ELFv1 ARCH=${arch} DISTINFO_FILE=${DISTINFO_FILE}.${arch} | ${MAKE} -D_RUST_MAKESUM_GUARD makesum PPC_ABI=ELFv1 ARCH=${arch} DISTINFO_FILE=${DISTINFO_FILE}.${arch} | ||||
${SED} 1d ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp | ${SED} 1d ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp | ||||
${RM} ${DISTINFO_FILE}.${arch} | ${RM} ${DISTINFO_FILE}.${arch} | ||||
Show All 11 Lines |