Changeset View
Changeset View
Standalone View
Standalone View
head/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.9.0 | PORTVERSION?= 1.9.0 | ||||
PORTREVISION= 1 | |||||
CATEGORIES= lang | CATEGORIES= lang | ||||
MASTER_SITES= http://static.rust-lang.org/dist/:src \ | MASTER_SITES= http://static.rust-lang.org/dist/:src \ | ||||
http://static.rust-lang.org/stage0-snapshots/:bootstrap \ | http://static.rust-lang.org/stage0-snapshots/:bootstrap \ | ||||
https://github.com/dhuseby/rust-manual-snapshots/raw/master/:bootstrap | https://github.com/dhuseby/rust-manual-snapshots/raw/master/:bootstrap | ||||
DISTNAME?= ${PORTNAME}c-${PORTVERSION} | DISTNAME?= ${PORTNAME}c-${PORTVERSION} | ||||
DISTFILES?= ${DISTNAME}-src${EXTRACT_SUFX}:src | DISTFILES?= ${DISTNAME}-src${EXTRACT_SUFX}:src | ||||
DISTFILES+= ${RUST_BOOT}:bootstrap | DISTFILES+= ${RUST_BOOT}:bootstrap | ||||
EXTRACT_ONLY?= ${DISTFILES:N*\:bootstrap:C/:.*//} | EXTRACT_ONLY?= ${DISTFILES:N*\:bootstrap:C/:.*//} | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
RUST_ARCH_x86_64= x86_64 # dragonfly | RUST_ARCH_x86_64= x86_64 # dragonfly | ||||
RUST_ARCH_amd64= x86_64 | RUST_ARCH_amd64= x86_64 | ||||
RUST_ARCH_i386= i686 | RUST_ARCH_i386= i686 | ||||
RUST_TARGET= ${RUST_ARCH_${ARCH}}-unknown-${OPSYS:tl} | RUST_TARGET= ${RUST_ARCH_${ARCH}}-unknown-${OPSYS:tl} | ||||
PLIST_SUB+= RUST_TARGET=${RUST_TARGET} | PLIST_SUB+= RUST_TARGET=${RUST_TARGET} | ||||
USES= compiler gmake libedit python:2,build | USES= compiler gmake libedit python:2,build | ||||
HAS_CONFIGURE= yes | HAS_CONFIGURE= yes | ||||
CONFIGURE_ARGS= --disable-valgrind --disable-docs \ | CONFIGURE_ARGS= --disable-valgrind \ | ||||
${CHOSEN_COMPILER_TYPE:Mclang:C/.+/--enable-&/} \ | ${CHOSEN_COMPILER_TYPE:Mclang:C/.+/--enable-&/} \ | ||||
--mandir=${MANPREFIX}/man \ | --mandir=${MANPREFIX}/man \ | ||||
--release-channel=${RUST_CHANNEL} | --release-channel=${RUST_CHANNEL} | ||||
PORTDOCS= * | |||||
.if defined(BATCH) || defined(PACKAGE_BUILDING) | .if defined(BATCH) || defined(PACKAGE_BUILDING) | ||||
MAKE_ARGS+= VERBOSE=1 | MAKE_ARGS+= VERBOSE=1 | ||||
.endif | .endif | ||||
OPTIONS_DEFINE= GDB LLNEXTGEN PORT_LLVM | OPTIONS_DEFINE= DOCS GDB LLNEXTGEN PORT_LLVM | ||||
GDB_DESC= Install ports gdb (necessary for debugging rust programs) | GDB_DESC= Install ports gdb (necessary for debugging rust programs) | ||||
LLNEXTGEN_DESC= Build with grammar verification | LLNEXTGEN_DESC= Build with grammar verification | ||||
DOCS_CONFIGURE_ENABLE= docs | |||||
GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | ||||
LLNEXTGEN_BUILD_DEPENDS= LLnextgen:devel/llnextgen | LLNEXTGEN_BUILD_DEPENDS= LLnextgen:devel/llnextgen | ||||
# Rust may pass more regression tests with bundled LLVM | # Rust may pass more regression tests with bundled LLVM | ||||
PORT_LLVM_DESC= Build against devel/llvm${LLVM_VER} instead of bundled version | PORT_LLVM_DESC= Build against devel/llvm${LLVM_VER} instead of bundled version | ||||
PORT_LLVM_BUILD_DEPENDS= ${LLVM_PREFIX}/bin/FileCheck:devel/llvm${LLVM_VER} | PORT_LLVM_BUILD_DEPENDS= ${LLVM_PREFIX}/bin/FileCheck:devel/llvm${LLVM_VER} | ||||
PORT_LLVM_CONFIGURE_ON= --llvm-root=${LLVM_PREFIX} | PORT_LLVM_CONFIGURE_ON= --llvm-root=${LLVM_PREFIX} | ||||
LLVM_VER?= 36 # XXX Move to DEFAULT_VERSIONS | LLVM_VER?= 36 # XXX Move to DEFAULT_VERSIONS | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | pre-install: | ||||
done | done | ||||
@${RM} \ | @${RM} \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/components \ | ${STAGEDIR}${PREFIX}/lib/rustlib/components \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc \ | ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rust-std-${RUST_TARGET} \ | ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rust-std-${RUST_TARGET} \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \ | ${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | ||||
pre-install-DOCS-on: | |||||
@for f in manifest-rust-docs; do \ | |||||
if test -f ${STAGEDIR}${PREFIX}/lib/rustlib/$$f; then \ | |||||
${SED} -E -e 's,^(dir|file:),${STAGEDIR},' \ | |||||
< ${STAGEDIR}${PREFIX}/lib/rustlib/$$f \ | |||||
| ${XARGS} ${RM}; \ | |||||
fi; \ | |||||
done | |||||
@${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rust-docs | |||||
post-install: | post-install: | ||||
@for f in manifest-rustc manifest-rust-std-${RUST_TARGET}; do \ | @for f in manifest-rustc manifest-rust-std-${RUST_TARGET}; do \ | ||||
${REINPLACE_CMD} -e 's|${STAGEDIR}||' \ | ${REINPLACE_CMD} -e 's|${STAGEDIR}||' \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/$$f; \ | ${STAGEDIR}${PREFIX}/lib/rustlib/$$f; \ | ||||
${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/$$f.bak; \ | ${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/$$f.bak; \ | ||||
done | done | ||||
@${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/install.log | @${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/install.log | ||||
# FIXME: Static libraries in lib/rustlib/*/lib/*.rlib are not stripped, | # FIXME: Static libraries in lib/rustlib/*/lib/*.rlib are not stripped, | ||||
# but they contain non-object files which make strip(1) unhappy. | # but they contain non-object files which make strip(1) unhappy. | ||||
@${STRIP_CMD} \ | @${STRIP_CMD} \ | ||||
${STAGEDIR}${PREFIX}/bin/rustc \ | ${STAGEDIR}${PREFIX}/bin/rustc \ | ||||
${STAGEDIR}${PREFIX}/bin/rustdoc \ | ${STAGEDIR}${PREFIX}/bin/rustdoc \ | ||||
${STAGEDIR}${PREFIX}/lib/*.so \ | ${STAGEDIR}${PREFIX}/lib/*.so \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/*/lib/*.so | ${STAGEDIR}${PREFIX}/lib/rustlib/*/lib/*.so | ||||
post-install-DOCS-on: | |||||
@for f in manifest-rust-docs; do \ | |||||
${REINPLACE_CMD} -e 's|${STAGEDIR}||' \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/$$f; \ | |||||
${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/$$f.bak; \ | |||||
done | |||||
@${RMDIR} ${STAGEDIR}${PREFIX}/share/doc/rust/html/extra | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> |