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.14.0 | PORTVERSION?= 1.14.0 | ||||
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/dist/:bootstrap \ | http://static.rust-lang.org/dist/:bootstrap \ | ||||
https://github.com/dhuseby/rust-manual-snapshots/raw/master/:bootstrap \ | https://github.com/dhuseby/rust-manual-snapshots/raw/master/:bootstrap \ | ||||
LOCAL/marino:bootstrap | LOCAL/marino:bootstrap \ | ||||
https://static.rust-lang.org/dist/:rustc_bootstrap \ | |||||
https://s3.amazonaws.com/rust-lang-ci/cargo-builds/:cargo_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 | .if defined(USE_RUSTBUILD) | ||||
EXTRACT_ONLY?= ${DISTFILES:N*\:bootstrap:C/:.*//} | DISTFILES+= ${RUSTC_BOOTSTRAP}:rustc_bootstrap \ | ||||
${RUST_STD_BOOTSTRAP}:rustc_bootstrap \ | |||||
${CARGO_BOOTSTRAP}:cargo_bootstrap | |||||
.if !defined(SKIP_CARGO_REGISTRY) | |||||
MASTER_SITES+= LOCAL/dumbbell/rust:registry | |||||
DISTFILES+= ${CARGO_REGISTRY}:registry | |||||
.endif | |||||
.else | |||||
DISTFILES+= ${RUSTC_BOOTSTRAP}:bootstrap | |||||
.endif | |||||
EXTRACT_ONLY?= ${DISTFILES:N*\:*bootstrap:C/:.*//} | |||||
MAINTAINER?= riggs@FreeBSD.org | MAINTAINER?= riggs@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 | ||||
# APACHE20 license is standard, see Templates/Licenses/APACHE20 | # APACHE20 license is standard, see Templates/Licenses/APACHE20 | ||||
LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT | LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT | ||||
BUILD_DEPENDS= cmake:devel/cmake | BUILD_DEPENDS= cmake:devel/cmake | ||||
ONLY_FOR_ARCHS?= amd64 i386 | ONLY_FOR_ARCHS?= amd64 i386 | ||||
ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler | ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler | ||||
DISTINFO_FILE?= ${MASTERDIR}/distinfo.${ARCH} | DISTINFO_FILE?= ${MASTERDIR}/distinfo.${ARCH} | ||||
# FIXME: The bootstrapped rustc adds -L/usr/local/lib in front of | # FIXME: The bootstrapped rustc adds -L/usr/local/lib in front of | ||||
# the LDFLAGS. When stage0's rustc is linked, it picks the installed | # the LDFLAGS. When stage0's rustc is linked, it picks the installed | ||||
# librust*so and fails. | # librust*so and fails. | ||||
CONFLICTS_BUILD?= rust-nightly | CONFLICTS_BUILD?= rust-nightly | ||||
CONFLICTS_BUILD+= ${PKGBASE} | CONFLICTS_BUILD+= ${PKGBASE} | ||||
CONFLICTS_INSTALL?= rust-nightly | CONFLICTS_INSTALL?= rust-nightly | ||||
RUST_BOOT_VERSION?= 1.13.0 | RUSTC_BOOTSTRAP_VERSION?= 1.13.0 | ||||
RUST_BOOT= rustc-${RUST_BOOT_VERSION}-${RUST_TARGET}.tar.gz | RUSTC_BOOTSTRAP= ${RUSTC_BOOTSTRAP_DIR}/rustc-${RUSTC_BOOTSTRAP_VERSION}-${RUST_TARGET}.tar.gz | ||||
riggs: This does not work. RUST_BOOTSTRAP_DIR and friends are defined only in the rust-nightly port… | |||||
RUST_STD_BOOTSTRAP= ${RUSTC_BOOTSTRAP_DIR}/rust-std-${RUST_STD_BOOTSTRAP_VERSION}-${RUST_TARGET}.tar.gz | |||||
CARGO_BOOTSTRAP= ${CARGO_BOOTSTRAP_DIR}/cargo-${CARGO_BOOTSTRAP_VERSION}-${RUST_TARGET}.tar.gz | |||||
riggsUnsubmitted Not Done Inline ActionsSame with CARGO_BOOTSTRAP_DIR riggs: Same with CARGO_BOOTSTRAP_DIR | |||||
CARGO_REGISTRY= ${PORTNAME}-registry-${DISTVERSIONFULL}.tar.xz | |||||
# Rust's libraries are named librustc_${component}-${RUST_VSN_HASH}.so. | # Rust's libraries are named librustc_${component}-${RUST_VSN_HASH}.so. | ||||
# The hash depends on Rust version and, if the channel is not "stable", | # The hash depends on Rust version and, if the channel is not "stable", | ||||
# the channel name. See $(CFG_FILENAME_EXTRA) definition in mk/main.mk. | # the channel name. See $(CFG_FILENAME_EXTRA) definition in mk/main.mk. | ||||
RUST_VSN= ${PORTVERSION:C/\.[0-9]{8}$//} | RUST_VSN= ${PORTVERSION:C/\.[0-9]{8}$//} | ||||
.if defined(.PARSEDIR) # fixes |make describe| on 9.x (which is BROKEN) | .if defined(.PARSEDIR) # fixes |make describe| on 9.x (which is BROKEN) | ||||
Not Done Inline ActionsI didn't check this yet since the 9.x EOL. Possibly no longer needed. But we can remove it afterwards. riggs: I didn't check this yet since the 9.x EOL. Possibly no longer needed. But we can remove it… | |||||
RUST_CHANNEL= ${PKGNAMESUFFIX:Ustable:S/^-//} | RUST_CHANNEL= ${PKGNAMESUFFIX:Ustable:S/^-//} | ||||
.endif | .endif | ||||
RUST_VSN_HASH!= /usr/bin/printf '%s' ${RUST_VSN}${PKGNAMESUFFIX} | /sbin/md5 -q | cut -c 1-8 | RUST_VSN_HASH!= /usr/bin/printf '%s' ${RUST_VSN}${PKGNAMESUFFIX} | /sbin/md5 -q | cut -c 1-8 | ||||
PLIST_SUB+= RUST_VSN_HASH=${RUST_VSN_HASH} | PLIST_SUB+= RUST_VSN_HASH=${RUST_VSN_HASH} | ||||
# Rust's target arch string is different from *BSD arch strings | # Rust's target arch string is different from *BSD arch strings | ||||
RUST_ARCH_x86_64= x86_64 # dragonfly | RUST_ARCH_x86_64= x86_64 # dragonfly | ||||
RUST_ARCH_amd64= x86_64 | RUST_ARCH_amd64= x86_64 | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if [ -n "$${conflicts_with}" ]; then \ | ||||
done; \ | done; \ | ||||
${ECHO_MSG}; \ | ${ECHO_MSG}; \ | ||||
${ECHO_MSG} " They will not build together."; \ | ${ECHO_MSG} " They will not build together."; \ | ||||
${ECHO_MSG} " Please remove them first with pkg delete."; \ | ${ECHO_MSG} " Please remove them first with pkg delete."; \ | ||||
exit 1;\ | exit 1;\ | ||||
fi | fi | ||||
post-extract: | post-extract: | ||||
.if defined(USE_RUSTBUILD) | |||||
@${MKDIR} \ | |||||
${WRKSRC}/build/cache/${RUSTC_BOOTSTRAP_DIR} \ | |||||
${WRKSRC}/build/cache/${CARGO_BOOTSTRAP_DIR} | |||||
${LN} -sf ${DISTDIR}/${RUSTC_BOOTSTRAP} ${WRKSRC}/build/cache/${RUSTC_BOOTSTRAP_DIR} | |||||
${LN} -sf ${DISTDIR}/${RUST_STD_BOOTSTRAP} ${WRKSRC}/build/cache/${RUSTC_BOOTSTRAP_DIR} | |||||
${LN} -sf ${DISTDIR}/${CARGO_BOOTSTRAP} ${WRKSRC}/build/cache/${CARGO_BOOTSTRAP_DIR} | |||||
.else | |||||
@${MKDIR} ${WRKSRC}/dl | @${MKDIR} ${WRKSRC}/dl | ||||
${LN} -sf ${DISTDIR}/${RUST_BOOT} ${WRKSRC}/dl | ${LN} -sf ${DISTDIR}/${RUSTC_BOOTSTRAP} ${WRKSRC}/dl | ||||
.endif | |||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ | @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ | ||||
${WRKSRC}/mk/main.mk | ${WRKSRC}/mk/main.mk | ||||
@${REINPLACE_CMD} -e 's|gdb|${LOCALBASE}/bin/gdb|' \ | @${REINPLACE_CMD} -e 's|gdb|${LOCALBASE}/bin/gdb|' \ | ||||
${WRKSRC}/src/etc/rust-gdb | ${WRKSRC}/src/etc/rust-gdb | ||||
# In case the previous "make stage" failed, this ensures rust's | # In case the previous "make stage" failed, this ensures rust's | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | @${STRIP_CMD} \ | ||||
${STAGEDIR}${PREFIX}/lib/rustlib/*/lib/*.so | ${STAGEDIR}${PREFIX}/lib/rustlib/*/lib/*.so | ||||
post-install-DOCS-on: | post-install-DOCS-on: | ||||
@for f in manifest-rust-docs; do \ | @for f in manifest-rust-docs; 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 | ||||
@${RMDIR} ${STAGEDIR}${PREFIX}/share/doc/rust/html/extra | @test ! -d ${STAGEDIR}${PREFIX}/share/doc/rust/html/extra || \ | ||||
${RMDIR} ${STAGEDIR}${PREFIX}/share/doc/rust/html/extra | |||||
Not Done Inline Actionsmake(1) can ignore exit status if you prepend commands with - jbeich: make(1) can ignore exit status if you prepend commands with `-` | |||||
Not Done Inline ActionsDo you say it's preferred to use - over testing? I don't mind either. dumbbell: Do you say it's preferred to use `-` over testing? I don't mind either. | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> | ||||
# "make gen-registry" is a special target to ease this port update. | |||||
# | |||||
# After changing the version number and the Git revision, you can run | |||||
# "make gen-registry" to update the distinfo and create a new snapshot of | |||||
# the registry. The new registry is written to ${DISTDIR} and can be | |||||
# uploaded. | |||||
gen-registry: | |||||
${MAKE} -C${.CURDIR} -DSKIP_CARGO_REGISTRY makesum | |||||
${MAKE} -C${.CURDIR} -DSKIP_CARGO_REGISTRY | |||||
${TAR} cJvf ${_DISTDIR}/${CARGO_REGISTRY} -C${WRKDIR} \ | |||||
--uid 0 --gid 0 \ | |||||
--exclude 'src/*/benches/' \ | |||||
--exclude 'src/*/ci/' \ | |||||
--exclude 'src/*/examples/' \ | |||||
--exclude 'src/*/tests/' \ | |||||
--exclude 'index/github.com-*/.git/' \ | |||||
.cargo | |||||
${MAKE} -C${.CURDIR} makesum |
This does not work. RUST_BOOTSTRAP_DIR and friends are defined only in the rust-nightly port, not here. Hence, "make makesum" in lang/rust tries to place the bootstrap compiler in /