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.0.0 | PORTVERSION= 1.0.0 | ||||
PORTREVISION= 1 | |||||
robak: That looks ugly and non intuitive, why dont you do it the other way around with RUST_VERSION… | |||||
Done Inline ActionsI read the Porter's handbook again and I missed the paragraph about "1.0.0-beta.4" -> "1.0.0b4". Sorry, I'm fixing it. dumbbell: I read the Porter's handbook again and I missed the paragraph about "1.0.0-beta.4" -> "1.0.0b4". | |||||
Done Inline Actionshow about DISTVERSION like graphics/ImageMagick uses? kwm: how about DISTVERSION like graphics/ImageMagick uses? | |||||
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 | ||||
DISTNAME= ${PORTNAME}c-${PORTVERSION} | DISTNAME= ${PORTNAME}c-${PORTVERSION} | ||||
DISTFILES= ${RUST_SOURCE}:src \ | DISTFILES= ${RUST_SOURCE}:src \ | ||||
${RUST_BOOT}:bootstrap | ${RUST_BOOT}:bootstrap | ||||
EXTRACT_ONLY= ${RUST_SOURCE} | EXTRACT_ONLY= ${RUST_SOURCE} | ||||
MAINTAINER= ports@FreeBSD.org | MAINTAINER= ports@FreeBSD.org | ||||
COMMENT= Language with a focus on memory safety and concurrency | COMMENT= Language with a focus on memory safety and concurrency | ||||
LICENSE= APACHE20 \ | LICENSE= APACHE20 \ | ||||
MIT | MIT | ||||
LICENSE_COMB= dual | LICENSE_COMB= dual | ||||
LICENSE_FILE= ${WRKSRC}/LICENSE-APACHE \ | LICENSE_FILE= ${WRKSRC}/LICENSE-APACHE \ | ||||
${WRKSRC}/LICENSE-MIT | ${WRKSRC}/LICENSE-MIT | ||||
ONLY_FOR_ARCHS= amd64 | ONLY_FOR_ARCHS= amd64 | ||||
ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler | ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler | ||||
# FIXME: The bootstrapped rustc adds -L/usr/local/lib in front of | |||||
# the LDFLAGS. When stage0's rustc is linked, it picks the installed | |||||
# librust*so and fails. | |||||
CONFLICTS_BUILD=rust | |||||
RUST_SOURCE= ${DISTNAME}-src${EXTRACT_SUFX} | RUST_SOURCE= ${DISTNAME}-src${EXTRACT_SUFX} | ||||
RUST_BOOT= rust-stage0-${RUST_BOOT_SIG}.tar.bz2 | RUST_BOOT= rust-stage0-${RUST_BOOT_SIG}.tar.bz2 | ||||
RUST_BOOT_SIG= 2015-03-27-5520801-freebsd-x86_64-0910bbad35e213f679d0433884fd51398eb3bc8d | RUST_BOOT_SIG= 2015-03-27-5520801-freebsd-x86_64-0910bbad35e213f679d0433884fd51398eb3bc8d | ||||
USES= gmake perl5 python:2 | USES= gmake python:2,build | ||||
HAS_CONFIGURE= yes | HAS_CONFIGURE= yes | ||||
CONFIGURE_ARGS= --disable-valgrind --disable-docs \ | CONFIGURE_ARGS= --disable-valgrind --disable-docs \ | ||||
--enable-clang --mandir=${MANPREFIX}/man | --enable-clang --mandir=${MANPREFIX}/man | ||||
USE_LDCONFIG= yes | |||||
USE_PERL5= build | |||||
MAKE_ARGS= ARCH=x86_64 | |||||
# Use LLVM from ports, instead of the copy shipped with rust. | |||||
LLVM_VER= 36 | |||||
BUILD_DEPENDS+= llvm${LLVM_VER}>=0:${PORTSDIR}/devel/llvm${LLVM_VER} | |||||
CONFIGURE_ARGS+=--llvm-root=${LOCALBASE}/llvm${LLVM_VER} | |||||
Not Done Inline ActionsThere is no link with the llvm libraries, like the mesa ports do? kwm: There is no link with the llvm libraries, like the mesa ports do? | |||||
Not Done Inline ActionsNo, there isn't. dumbbell: No, there isn't. | |||||
.if defined(BATCH) || defined(PACKAGE_BUILDING) | .if defined(BATCH) || defined(PACKAGE_BUILDING) | ||||
MAKE_ARGS+= VERBOSE=1 | MAKE_ARGS+= VERBOSE=1 | ||||
.endif | .endif | ||||
OPTIONS_DEFINE= LLNEXTGEN | OPTIONS_DEFINE= LLNEXTGEN | ||||
LLNEXTGEN_DESC= Build with grammar verification | LLNEXTGEN_DESC= Build with grammar verification | ||||
LLNEXTGEN_BUILD_DEPENDS= LLnextgen:${PORTSDIR}/devel/llnextgen | LLNEXTGEN_BUILD_DEPENDS= LLnextgen:${PORTSDIR}/devel/llnextgen | ||||
.include <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 | .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000 | ||||
BROKEN= Only compiles on FreeBSD 10 and 11 | BROKEN= Only compiles on FreeBSD 10 and 11 | ||||
.endif | .endif | ||||
.if ${OPSYS} == DragonFly | .if ${OPSYS} == DragonFly | ||||
IGNORE= please use lang/rust-dragonfly instead | IGNORE= please use lang/rust-dragonfly instead | ||||
.endif | .endif | ||||
post-extract: | post-extract: | ||||
@${MKDIR} ${WRKSRC}/dl | @${MKDIR} ${WRKSRC}/dl | ||||
${LN} -sf ${DISTDIR}/${RUST_BOOT} ${WRKSRC}/dl | ${LN} -sf ${DISTDIR}/${RUST_BOOT} ${WRKSRC}/dl | ||||
(cd ${WRKSRC} && find . -type d -exec chmod 0755 {} \;) | |||||
# In case the previous "make stage" failed, this ensures rust's | |||||
# install.sh won't backup previously staged files before reinstalling | |||||
# new ones. Otheriwe, the staging directory is polluted with unneeded | |||||
# files. | |||||
pre-install: | |||||
@if test -f ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc; then \ | |||||
${SED} -E -e 's,^(dir|file:),${STAGEDIR},' \ | |||||
< ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc \ | |||||
| ${XARGS} ${RM}; \ | |||||
fi | |||||
@${RM} \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/components \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | |||||
post-install: | post-install: | ||||
Done Inline ActionsIn version 1.0.0 source was restricted to owner rwx which means (cd ${WRKSRC}; \ find . -type d -exec chmod 0755 {} \;) which only covers directories portmaster_BSDforge.com: In version 1.0.0 source was restricted to owner rwx which means
only root can install. I had to… | |||||
@${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc | |||||
@${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/install.log | @${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/install.log | ||||
@${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh | @${REINPLACE_CMD} -e 's|${STAGEDIR}||' \ | ||||
@${STRIP_CMD} `${GREP} -v -e '^@dir' -e '^man' -e 'rlib$$' \ | ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc | ||||
-e '^.*\.a$$' -e '^.*\.py$$' -e '^%' -e '^.*/rust-gdb$$' \ | @${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-rustc.bak | ||||
-e '^.*rustlib/components$$' -e '^.*/rust-installer-version$$' \ | @${STRIP_CMD} \ | ||||
${PLIST} | ${SED} 's:^:${STAGEDIR}${PREFIX}/:'` | ${STAGEDIR}${PREFIX}/bin/rustc \ | ||||
${STAGEDIR}${PREFIX}/bin/rustdoc \ | |||||
${STAGEDIR}${PREFIX}/lib/*.so \ | |||||
${STAGEDIR}${PREFIX}/lib/rustlib/*/lib/*.so | |||||
Done Inline ActionsUgh this looks ugly. This might not work but could you try: INSTALL_TARGET=install-stripinstead of the strip_CMD line? @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/rust* \ ${STAGEDIR}${PREFIX}/lib/rustlib/*.soYes it is longer but imo, it readable atleast :) kwm: Ugh this looks ugly. This might not work but could you try:
-------
INSTALL_TARGET=install… | |||||
.include <bsd.port.post.mk> | .include <bsd.port.post.mk> |
That looks ugly and non intuitive, why dont you do it the other way around with RUST_VERSION being built out of PORTVERSION?