aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2017-09-15 18:01:17 +0000
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2017-09-15 18:01:17 +0000
commit0cc13b3d48600adaef43b76165d4a694ba0c1ba8 (patch)
treefc0dda6a227504f83fbc652cef96d083c9e79a92
parentc0e6429020a004c023f4b65c1f642437c4879499 (diff)
downloadports-0cc13b3d48600adaef43b76165d4a694ba0c1ba8.tar.gz
ports-0cc13b3d48600adaef43b76165d4a694ba0c1ba8.zip
lang/rust: Install Cargo + use bundled crates
This port now provides Cargo. This is the recommended now because Cargo won't be provided separately in the future. To build Cargo, we set `extended = true` in `config.toml`. As a side effect, this flag also installs Rust source code. The port has a new `SOURCES` option (disabled by default) to keep those sources. As a consequence of this, `devel/cargo` is removed. Several ports and Makefiles in Mk were updated to depend on `lang/rust` instead of `devel/cargo`. The other big change in this patch is the use of the bundled crates, instead of relying on Cargo's registry (which was part of the distfiles, in order to allow offline builds). So now, we don't need to prepare the registry when updating this port. This has several other benefits: * It fixes the build with sudo(8). * It fixes the use of the ino-64 patch (it was not applied to the registry, thus not used). Compilation errors were fixed in the ino-64 patch. Various `.cargo-checksum.json` files are updated after the sources are patched (FBSD10_FIX, ino-64, and so on). This fixes builds which were failing with errors such as: error: the listed checksum of `.../rustc-1.19.0-src/src/vendor/lzma-sys/xz-5.2.3/build-aux/config.rpath` has changed: expected: c8b4c017079da9dfb3086a0583e60ffe736184d89005dc5973f0bb0fd17c04bb actual: 561b00eb30ecaef2c9da17bc195e7d2a7ea63facea38ea9849fbb0ed340bebba PR: 221088 Reported by: joneum@, nwhitehorn@, romain@, Ekaterina Vaartis <vaartis@cock.li>, david@catwhisker.org, fullermd@over-yonder.net, rum1cro@yandex.ru, w.schwarzenfeld@utanet.at Differential Revision: https://reviews.freebsd.org/D11783
Notes
Notes: svn path=/head/; revision=449914
-rw-r--r--MOVED1
-rw-r--r--Mk/Uses/cargo.mk4
-rw-r--r--Mk/bsd.gecko.mk5
-rw-r--r--UPDATING7
-rw-r--r--devel/Makefile1
-rw-r--r--devel/cargo/Makefile145
-rw-r--r--devel/cargo/distinfo13
-rw-r--r--devel/cargo/pkg-descr4
-rw-r--r--devel/cargo/pkg-plist31
-rw-r--r--lang/rust/Makefile124
-rw-r--r--lang/rust/distinfo2
-rw-r--r--lang/rust/files/config.toml11
-rw-r--r--lang/rust/files/extra-patch-ino6428
-rw-r--r--multimedia/librespot/Makefile2
-rw-r--r--www/firefox/Makefile2
15 files changed, 123 insertions, 257 deletions
diff --git a/MOVED b/MOVED
index 552eb84a46c9..66b659927f16 100644
--- a/MOVED
+++ b/MOVED
@@ -9545,3 +9545,4 @@ x11-toolkits/py33-tkinter||2017-09-03|Removed, please update to Python 3.6
devel/py3-enum34||2017-09-03|Removed, Python 3.3 only
security/clambc||2017-09-14|Has expired: Practically unmaintained, featuring issues elsewhere solved 6 years ago
devel/cmake-modules||2017-09-14|Merged with devel/cmake
+devel/cargo|lang/rust|2017-09-15|Merged with lang/rust
diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index c738edd6f30f..b4ee76204a67 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
@@ -46,10 +46,10 @@ DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:S/-//g:S/.//g}
CARGO_BUILDDEP?= yes
.if ${CARGO_BUILDDEP:tl} == "yes"
-BUILD_DEPENDS+= cargo:devel/cargo rustc:lang/rust
+BUILD_DEPENDS+= rust>=1.19.0:lang/rust
.endif
-# Location of cargo binary (default to devel/cargo binary)
+# Location of cargo binary (default to lang/rust's Cargo binary)
CARGO_CARGO_BIN?= ${LOCALBASE}/bin/cargo
# Location of the cargo output directory.
diff --git a/Mk/bsd.gecko.mk b/Mk/bsd.gecko.mk
index 0978fd690aba..45dc8b2322d9 100644
--- a/Mk/bsd.gecko.mk
+++ b/Mk/bsd.gecko.mk
@@ -389,10 +389,7 @@ post-patch-SNDIO-on:
.endif
.if ${PORT_OPTIONS:MRUST}
-BUILD_DEPENDS+= rust>=1.15.1:${RUST_PORT}
-. if ${MOZILLA_VER:R:R} >= 51
-BUILD_DEPENDS+= cargo>=0.16.0:devel/cargo
-. endif
+BUILD_DEPENDS+= rust>=1.19.0:${RUST_PORT}
RUST_PORT?= lang/rust
MOZ_OPTIONS+= --enable-rust
.else
diff --git a/UPDATING b/UPDATING
index 4a1426384d1b..2878f43033e8 100644
--- a/UPDATING
+++ b/UPDATING
@@ -5,6 +5,13 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
+20170915:
+ AFFECTS: users of devel/cargo
+ AUTHOR: rust@FreeBSD.org
+
+ Starting with version 1.19.0, Cargo is provided with Rust. Therefore,
+ devel/cargo was merged into lang/rust.
+
20170914:
AFFECTS: users of CMake
AUTHOR: adridg@freebsd.org
diff --git a/devel/Makefile b/devel/Makefile
index abdbcba0068d..30a960d8ed6c 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -255,7 +255,6 @@
SUBDIR += calibrator
SUBDIR += capstone3
SUBDIR += capstone4
- SUBDIR += cargo
SUBDIR += cask
SUBDIR += catch
SUBDIR += cbrowser
diff --git a/devel/cargo/Makefile b/devel/cargo/Makefile
deleted file mode 100644
index 2333a0ddf4f4..000000000000
--- a/devel/cargo/Makefile
+++ /dev/null
@@ -1,145 +0,0 @@
-# Created by: Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
-# $FreeBSD$
-
-PORTNAME= cargo
-PORTVERSION= 0.19.0
-CATEGORIES= devel
-
-MAINTAINER= rust@FreeBSD.org
-COMMENT= Rust's Package Manager
-# ' <-- Help Vim syntax hilighting...
-
-LICENSE= APACHE20 \
- MIT
-LICENSE_COMB= dual
-# APACHE20 license is standard, see Templates/Licenses/APACHE20
-LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT
-
-# The following files are required:
-#
-# Main source archive from GitHub
-# This is the source of Cargo, taken from GitHub.
-#
-# :cargo_bootstrap
-# Like Rust, this is a prebuilt "cargo" used to bootstrap it, because
-# Cargo is a standard Rust package itself.
-#
-# :registry
-# Cargo clones several Git repositories for its dependencies and
-# caches them in its "registry". This is an archive of this registry
-# so nothing is downloaded during the build.
-#
-# :rust_installer
-# This is a collection of mainly shell scripts which are used to
-# install Cargo.
-
-MASTER_SITES= https://static.rust-lang.org/dist/:cargo_bootstrap \
- https://s3.amazonaws.com/rust-lang-ci/cargo-builds/:cargo_bootstrap \
- LOCAL/dumbbell/rust:cargo_bootstrap
-.if !defined(SKIP_CARGO_REGISTRY)
-MASTER_SITES+= LOCAL/dumbbell/rust:registry
-DISTFILES+= ${CARGO_REGISTRY}:registry
-.endif
-DIST_SUBDIR?= rust
-
-USE_GITHUB= yes
-GH_ACCOUNT= rust-lang
-GH_PROJECT= rust-installer:rust_installer
-GH_TAGNAME= 4f99485:rust_installer
-GH_SUBDIR= src/rust-installer:rust_installer
-
-ONLY_FOR_ARCHS= aarch64 amd64 i386
-ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap cargo
-
-# Rust's target arch string is different from *BSD arch strings
-RUST_ARCH_aarch64= aarch64
-RUST_ARCH_amd64= x86_64
-RUST_ARCH_i386= i686
-RUST_ARCH_x86_64= x86_64 # dragonfly
-RUST_TARGET= ${RUST_ARCH_${ARCH}}-unknown-${OPSYS:tl}
-
-CARGO_BOOTSTRAP_DIR?= 2017-04-27
-CARGO_BOOTSTRAP_DIR_aarch64?= 2017-04-24
-CARGO_BOOTSTRAP_VERSION?= 0.18.0
-CARGO_BOOTSTRAP_VERSION_aarch64?=0.18.0
-CARGO_BOOTSTRAP= ${CARGO_BOOTSTRAP_DIR_${ARCH}:U${CARGO_BOOTSTRAP_DIR}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${RUST_TARGET}${EXTRACT_SUFX}
-CARGO_REGISTRY= ${PORTNAME}-registry-${DISTVERSIONFULL}.tar.xz
-
-# We don't USES=cmake here, because cmake is not Cargo's build system.
-# It's used by a bundled dependency (libgit2).
-BUILD_DEPENDS= cmake:devel/cmake \
- ${RUST_PORT:T}>=1.18.0:${RUST_PORT}
-LIB_DEPENDS= libssh2.so:security/libssh2 \
- libcurl.so:ftp/curl
-RUN_DEPENDS= rustc:${RUST_PORT}
-RUST_PORT?= lang/rust
-
-USES= gmake python:-2.7,build pkgconfig ssl
-HAS_CONFIGURE= yes
-CONFIGURE_ARGS= --prefix="${PREFIX}" --mandir="${MANPREFIX}/man"
-MAKE_ENV= ARGS="${CARGO_ARGS}" \
- OPENSSL_DIR="${OPENSSLBASE}"
-CARGO_ARGS= --jobs ${MAKE_JOBS_NUMBER}
-
-MAKE_ARGS+= VERBOSE=1
-
-OPTIONS_DEFINE= BOOTSTRAP
-OPTIONS_DEFAULT=BOOTSTRAP
-
-BOOTSTRAP_DESC= Bootstrap using pre-built vendor snapshot
-BOOTSTRAP_CONFIGURE_ON= --cargo="${WRKDIR}/${PORTNAME}-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${RUST_TARGET}/cargo/bin/cargo"
-BOOTSTRAP_CONFIGURE_OFF=--cargo="$$(command -v cargo)" # respect PATH
-BOOTSTRAP_DISTFILES= ${CARGO_BOOTSTRAP}:cargo_bootstrap
-BOOTSTRAP_MAKE_ENV= LD_LIBRARY_PATH="${WRKSRC}/target/snapshot/cargo/lib"
-
-post-patch:
-# Fix mandir and don't install licenses outside of ${_LICENSE_DIR}
- @${REINPLACE_CMD} -e 's,share/man,man,' \
- -e 's,$$(S)LICENSE-[^[:space:]]* ,,g' \
- ${WRKSRC}/Makefile.in
-
-# 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-cargo; then \
- ${SED} -E -e 's,^(dir|file:),${STAGEDIR},' \
- < ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-cargo \
- | ${XARGS} ${RM}; \
- fi
- @${RM} \
- ${STAGEDIR}${PREFIX}/lib/rustlib/components \
- ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-cargo \
- ${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \
- ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh
-
-post-install:
- @${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/install.log
- @${REINPLACE_CMD} -i '' -e 's|${STAGEDIR}||' \
- ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-cargo
- @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/cargo
- @${RM} \
- ${STAGEDIR}${PREFIX}/lib/rustlib/components \
- ${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \
- ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh
-
-# "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 libgit2/tests/ \
- --exclude curl/tests/ \
- --exclude 'index/github.com-*/.git/' \
- .cargo
- ${MAKE} -C${.CURDIR} makesum
-
-.include <bsd.port.mk>
diff --git a/devel/cargo/distinfo b/devel/cargo/distinfo
deleted file mode 100644
index c23e8b89be7f..000000000000
--- a/devel/cargo/distinfo
+++ /dev/null
@@ -1,13 +0,0 @@
-TIMESTAMP = 1497712480
-SHA256 (rust/cargo-registry-0.19.0.tar.xz) = dd77a7d109cfe8a04a0f00e19516a41a69b99655bca9a17a38ab6c2d37bb4b53
-SIZE (rust/cargo-registry-0.19.0.tar.xz) = 18957548
-SHA256 (rust/2017-04-27/cargo-0.18.0-x86_64-unknown-freebsd.tar.gz) = 171147f876c08cf82a6da60fabf737fd580df90e2fec9c57368642beaea67450
-SIZE (rust/2017-04-27/cargo-0.18.0-x86_64-unknown-freebsd.tar.gz) = 5039329
-SHA256 (rust/2017-04-27/cargo-0.18.0-i686-unknown-freebsd.tar.gz) = 30ec4cfc667e3a8fca3cb0377b6a6f5dbcd19ad7143046db24e37432646e60a2
-SIZE (rust/2017-04-27/cargo-0.18.0-i686-unknown-freebsd.tar.gz) = 4914461
-SHA256 (rust/2017-04-24/cargo-0.18.0-aarch64-unknown-freebsd.tar.gz) = 8cdbf046bfc98e1cb92b89c306e4389b92a8df9db44b8f7c784aaac25ad52877
-SIZE (rust/2017-04-24/cargo-0.18.0-aarch64-unknown-freebsd.tar.gz) = 2935624
-SHA256 (rust/rust-lang-cargo-0.19.0_GH0.tar.gz) = 9ea59d17a7fa81aa4bdefa2bb45a5315219414386753eaf0988cadd465550b40
-SIZE (rust/rust-lang-cargo-0.19.0_GH0.tar.gz) = 652163
-SHA256 (rust/rust-lang-rust-installer-4f99485_GH0.tar.gz) = daa34a28d8fe64dd358e5a0c3a83b7018da6df41c9b4420d28ffdb8b05a82478
-SIZE (rust/rust-lang-rust-installer-4f99485_GH0.tar.gz) = 19990
diff --git a/devel/cargo/pkg-descr b/devel/cargo/pkg-descr
deleted file mode 100644
index f8eff90f7458..000000000000
--- a/devel/cargo/pkg-descr
+++ /dev/null
@@ -1,4 +0,0 @@
-Cargo is Rust's Package Manager. Cargo downloads your Rust project's
-dependencies and compiles your project.
-
-WWW: http://doc.crates.io/
diff --git a/devel/cargo/pkg-plist b/devel/cargo/pkg-plist
deleted file mode 100644
index 81ffe9d167ac..000000000000
--- a/devel/cargo/pkg-plist
+++ /dev/null
@@ -1,31 +0,0 @@
-bin/cargo
-etc/bash_completion.d/cargo
-lib/rustlib/manifest-cargo
-man/man1/cargo-bench.1.gz
-man/man1/cargo-build.1.gz
-man/man1/cargo-check.1.gz
-man/man1/cargo-clean.1.gz
-man/man1/cargo-doc.1.gz
-man/man1/cargo-fetch.1.gz
-man/man1/cargo-generate-lockfile.1.gz
-man/man1/cargo-init.1.gz
-man/man1/cargo-install.1.gz
-man/man1/cargo-login.1.gz
-man/man1/cargo-metadata.1.gz
-man/man1/cargo-new.1.gz
-man/man1/cargo-owner.1.gz
-man/man1/cargo-package.1.gz
-man/man1/cargo-pkgid.1.gz
-man/man1/cargo-publish.1.gz
-man/man1/cargo-run.1.gz
-man/man1/cargo-rustc.1.gz
-man/man1/cargo-rustdoc.1.gz
-man/man1/cargo-search.1.gz
-man/man1/cargo-test.1.gz
-man/man1/cargo-uninstall.1.gz
-man/man1/cargo-update.1.gz
-man/man1/cargo-version.1.gz
-man/man1/cargo-yank.1.gz
-man/man1/cargo.1.gz
-%%PORTDOCS%%%%DOCSDIR%%/README.md
-share/zsh/site-functions/_cargo
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 25f2a93356f1..d783a02bc1f4 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -3,7 +3,7 @@
PORTNAME= rust
PORTVERSION?= 1.19.0
-PORTREVISION?= 1
+PORTREVISION?= 2
CATEGORIES= lang
MASTER_SITES= http://static.rust-lang.org/dist/:src \
https://static.rust-lang.org/dist/:rust_bootstrap \
@@ -13,20 +13,14 @@ MASTER_SITES= http://static.rust-lang.org/dist/:src \
LOCAL/dumbbell/rust:cargo_bootstrap \
LOCAL/marino:bootstrap
DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src
-BOOTSTRAP_FILES=${RUSTC_BOOTSTRAP}:rust_bootstrap \
+DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}:src \
+ ${RUSTC_BOOTSTRAP}:rust_bootstrap \
${RUST_STD_BOOTSTRAP}:rust_bootstrap \
${CARGO_BOOTSTRAP}:cargo_bootstrap
-DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}:src \
- ${BOOTSTRAP_FILES}
-.if !defined(SKIP_CARGO_REGISTRY)
-MASTER_SITES+= LOCAL/riggs/rust:registry \
- LOCAL/dumbbell/rust:registry
-DISTFILES+= ${CARGO_REGISTRY}:registry
-.endif
DIST_SUBDIR?= rust
EXTRACT_ONLY?= ${DISTFILES:N*\:*bootstrap:C/:.*//}
-MAINTAINER?= rust@FreeBSD.org
+MAINTAINER= rust@FreeBSD.org
COMMENT= Language with a focus on memory safety and concurrency
LICENSE= APACHE20 \
@@ -36,6 +30,8 @@ LICENSE_COMB= dual
LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT
BUILD_DEPENDS= cmake:devel/cmake
+LIB_DEPENDS= libcurl.so:ftp/curl \
+ libssh2.so:security/libssh2
ONLY_FOR_ARCHS?= aarch64 amd64 i386
ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler
@@ -58,7 +54,6 @@ RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${R
CARGO_BOOTSTRAP_VERSION?= 0.19.0
CARGO_BOOTSTRAP_VERSION_aarch64?=0.19.0
CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${RUST_TARGET}${EXTRACT_SUFX}
-CARGO_REGISTRY= ${PORTNAME}-registry-${DISTVERSIONFULL}.tar.xz
RUST_CHANNEL= ${PKGNAMESUFFIX:Ustable:S/^-//}
@@ -70,11 +65,12 @@ RUST_ARCH_x86_64= x86_64 # dragonfly
RUST_TARGET= ${RUST_ARCH_${ARCH}}-unknown-${OPSYS:tl}
PLIST_SUB+= RUST_TARGET=${RUST_TARGET}
-USES= compiler gmake libedit python:2.7,build
+USES= compiler gmake libedit pkgconfig python:2.7,build ssl
-OPTIONS_DEFINE= DOCS GDB LLNEXTGEN PORT_LLVM
+OPTIONS_DEFINE= DOCS GDB LLNEXTGEN PORT_LLVM SOURCES
GDB_DESC= Install ports gdb (necessary for debugging rust programs)
LLNEXTGEN_DESC= Build with grammar verification
+SOURCES_DESC= Install source files
GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb
LLNEXTGEN_BUILD_DEPENDS= LLnextgen:devel/llnextgen
@@ -89,21 +85,29 @@ LLVM_CONFIG= ${LOCALBASE}/bin/llvm-config${LLVM_VER}
# We use them in:
# - pre-install to cleanup the ${STAGEDIR}
# - post-install to populate the ${TMPPLIST}
-RUST_MANIFESTS= lib/rustlib/manifest-rustc \
+RUST_MANIFESTS= lib/rustlib/manifest-cargo \
+ lib/rustlib/manifest-rustc \
+ lib/rustlib/manifest-rust-analysis-${RUST_TARGET} \
lib/rustlib/manifest-rust-std-${RUST_TARGET}
-RUST_DOCS_MANIFESTS= lib/rustlib/manifest-rust-docs
-DOCS_VARS= rust_manifests+=${RUST_DOCS_MANIFESTS}
+RUST_DOCS_MANIFEST= lib/rustlib/manifest-rust-docs
+RUST_SRC_MANIFEST= lib/rustlib/manifest-rust-src
+DOCS_VARS= rust_manifests+=${RUST_DOCS_MANIFEST}
+SOURCES_VARS= rust_manifests+=${RUST_SRC_MANIFEST}
PLIST_FILES= lib/rustlib/components \
lib/rustlib/rust-installer-version
.include <bsd.port.pre.mk>
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200031
-EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-ino64
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-ino64
.endif
-X_PY_ENV = HOME=${WRKDIR}
-X_PY_CMD = ${PYTHON_CMD} ${WRKSRC}/x.py
+X_PY_ENV= HOME="${WRKDIR}" \
+ OPENSSL_DIR="${OPENSSLBASE}"
+X_PY_CMD= ${PYTHON_CMD} ${WRKSRC}/x.py
+
+CRATES_PATCHED_BY_FBSD10_FIX= src/vendor/libssh2-sys \
+ src/vendor/lzma-sys
pre-fetch:
# FIXME: This is the same check for CONFLICTS as the standard
@@ -161,6 +165,9 @@ post-extract:
post-patch:
@${REINPLACE_CMD} -e 's|gdb|${LOCALBASE}/bin/gdb|' \
${WRKSRC}/src/etc/rust-gdb
+# If we override the versions and date of the bootstraps (for instance
+# on aarch64 where we provide our own bootstraps), we need to update
+# places where they are recorded.
@if test "${BOOTSTRAPS_DATE_${ARCH}}"; then \
${REINPLACE_CMD} -e \
's|^date:.*|date: ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}|' \
@@ -179,6 +186,26 @@ post-patch:
's|cargo-nightly-|cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-|' \
${WRKSRC}/src/bootstrap/bootstrap.py; \
fi
+# `extra-patch-ino64` may be applied. If that's the case, we need to
+# update `.cargo-checksum.json` to reflect the new checksums verified by
+# Cargo.
+ @cd "${WRKSRC}/src/vendor/libc"; \
+ for file in $$(${FIND} * -name "*.orig"); do \
+ old_checksum=$$(${SHA256} -q "$$file"); \
+ new_checksum=$$(${SHA256} -q "$${file%%.orig}"); \
+ regex="$$regex -e s|\"$${file%%.orig}\":\"$$old_checksum\"|\"$${file%%.orig}\":\"$$new_checksum\"|"; \
+ done; \
+ if test "$$regex"; then \
+ ${REINPLACE_CMD} -E $$regex .cargo-checksum.json; \
+ fi
+# We make a backup of a few files before the FreeBSD 10 autotools
+# fix is applied. We'll need them in `do-configure` to update the
+# `.cargo-checksum.json` files.
+ @for crate in ${CRATES_PATCHED_BY_FBSD10_FIX}; do \
+ for file in $$(${FIND} "${WRKSRC}/$$crate" -name "config.rpath"); do \
+ ${CP} "$$file" "$$file.orig"; \
+ done; \
+ done
do-configure:
${SED} -E \
@@ -190,6 +217,20 @@ do-configure:
-e 's,%TARGET%,${RUST_TARGET},' \
< ${FILESDIR}/config.toml \
> ${WRKSRC}/config.toml
+# The FreeBSD 10 autotools fix may modify some files just before
+# `do-configure`. Like after `extra-path-ino64`, we need to update
+# `.cargo-checksum.json`.
+ @for crate in ${CRATES_PATCHED_BY_FBSD10_FIX}; do \
+ cd "${WRKSRC}/$$crate"; \
+ for file in $$(${FIND} * -name "*.orig"); do \
+ old_checksum=$$(${SHA256} -q "$$file"); \
+ new_checksum=$$(${SHA256} -q "$${file%%.orig}"); \
+ regex="$$regex -e s|\"$${file%%.orig}\":\"$$old_checksum\"|\"$${file%%.orig}\":\"$$new_checksum\"|"; \
+ done; \
+ if test "$$regex"; then \
+ ${REINPLACE_CMD} -E $$regex .cargo-checksum.json; \
+ fi; \
+ done
post-configure-DOCS-on:
${REINPLACE_CMD} -e 's,%DOCS%,true,' ${WRKSRC}/config.toml
@@ -216,7 +257,7 @@ do-build:
# new ones. Otherwise, the staging directory is polluted with unneeded
# files.
pre-install:
- @for f in ${RUST_MANIFESTS} ${RUST_DOCS_MANIFESTS}; do \
+ @for f in ${RUST_MANIFESTS} ${RUST_DOCS_MANIFEST} ${RUST_SRC_MANIFEST}; do \
if test -f "${STAGEDIR}${PREFIX}/$$f"; then \
${SED} -E -e 's,^(file|dir):,${STAGEDIR},' \
< "${STAGEDIR}${PREFIX}/$$f" \
@@ -243,6 +284,12 @@ do-install:
# 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
# installs them uncompressed but the Ports framework compresses them.
post-install:
@@ -266,17 +313,35 @@ post-install:
}' \
${STAGEDIR}${PREFIX}/$$f >> ${TMPPLIST}; \
done
+ ${RM} ${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/uninstall.sh
# FIXME: Static libraries in lib/rustlib/*/lib/*.rlib are not stripped,
# but they contain non-object files which make strip(1) unhappy.
@${STRIP_CMD} \
+ ${STAGEDIR}${PREFIX}/bin/cargo \
${STAGEDIR}${PREFIX}/bin/rustc \
${STAGEDIR}${PREFIX}/bin/rustdoc \
${STAGEDIR}${PREFIX}/lib/*.so \
${STAGEDIR}${PREFIX}/lib/rustlib/*/lib/*.so
+# We set `extended = true` in config.toml because we want to build
+# Cargo at the same time. However, this installs the rust-src component
+# as well. If the user doesn't want that, I don't know how to prevent
+# its install. So for now, use the rust-src manifest to remove it from
+# ${STAGEDIR}.
+post-install-SOURCES-off:
+ if test -f "${STAGEDIR}${PREFIX}/${RUST_SRC_MANIFEST}"; then \
+ ${SED} -E -e 's,^(file|dir):,,' \
+ < "${STAGEDIR}${PREFIX}/${RUST_SRC_MANIFEST}" \
+ | ${XARGS} ${RM} -r; \
+ ${RM} "${STAGEDIR}${PREFIX}/${RUST_SRC_MANIFEST}"; \
+ ${RM} -r "${STAGEDIR}${PREFIX}/lib/rustlib/src"; \
+ fi
+
# Note that make test does not work when rust is already installed.
do-test:
cd ${WRKSRC} && \
@@ -288,22 +353,3 @@ do-test:
--jobs ${MAKE_JOBS_NUMBER}
.include <bsd.port.post.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}/${DIST_SUBDIR}/${CARGO_REGISTRY} -C${WRKDIR} \
- --uid 0 --gid 0 \
- --exclude 'src/*/benches/' \
- --exclude 'src/*/ci/' \
- --exclude 'src/*/examples/' \
- --exclude 'index/github.com-*/.git/' \
- .cargo
- ${MAKE} -C${.CURDIR} makesum
diff --git a/lang/rust/distinfo b/lang/rust/distinfo
index dfd5ff90e525..f66a04385a8c 100644
--- a/lang/rust/distinfo
+++ b/lang/rust/distinfo
@@ -19,5 +19,3 @@ SHA256 (rust/2017-06-08/rust-std-1.18.0-x86_64-unknown-freebsd.tar.gz) = de7f3bc
SIZE (rust/2017-06-08/rust-std-1.18.0-x86_64-unknown-freebsd.tar.gz) = 66585539
SHA256 (rust/2017-06-08/cargo-0.19.0-x86_64-unknown-freebsd.tar.gz) = a8d45ad508ecbe9ec9e19fddabda4476466486f97cfb1b59d0a43a1012acb788
SIZE (rust/2017-06-08/cargo-0.19.0-x86_64-unknown-freebsd.tar.gz) = 5176510
-SHA256 (rust/rust-registry-1.19.0.tar.xz) = 7f1d5b33ba11bbb05e468317680b54a61557e087e0d0deb0d69c2535f1b61146
-SIZE (rust/rust-registry-1.19.0.tar.xz) = 28571276
diff --git a/lang/rust/files/config.toml b/lang/rust/files/config.toml
index 00fb73b7c908..65e957484950 100644
--- a/lang/rust/files/config.toml
+++ b/lang/rust/files/config.toml
@@ -1,5 +1,11 @@
[build]
+# Use bundled crates; this should permit offline build.
+vendor = true
+
+# In addition to rustc, rust-std and rust-docs, build Cargo.
+extended = true
+
# python(1) location.
python = "%PYTHON_CMD%"
@@ -20,3 +26,8 @@ channel = "%CHANNEL%"
[target.%TARGET%]
llvm-config = "%LLVM_CONFIG%"
+
+[dist]
+
+# Do not build the source archive.
+src-tarball = false
diff --git a/lang/rust/files/extra-patch-ino64 b/lang/rust/files/extra-patch-ino64
index db545435c7ba..1c2bcfb6de34 100644
--- a/lang/rust/files/extra-patch-ino64
+++ b/lang/rust/files/extra-patch-ino64
@@ -29,7 +29,7 @@
- pub st_birthtime: ::time_t,
- pub st_birthtime_nsec: ::c_long,
+ pub st_gen: ::uint64_t,
-+ pub st_spare: [::int64_t; 10],
++ pub st_spare: [::uint64_t; 10],
}
}
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2017-04-24 18:56:45.000000000 +0000
@@ -97,7 +97,7 @@
- pub st_birthtime_nsec: ::c_long,
- __unused: [u8; 8],
+ pub st_gen: ::uint64_t,
-+ pub st_lspare: [::uint64_t; 10],
++ pub st_spare: [::uint64_t; 10],
}
}
--- ./src/liblibc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs.orig 2017-04-24 18:56:45.000000000 +0000
@@ -131,7 +131,7 @@
- pub st_birthtime: ::time_t,
- pub st_birthtime_nsec: ::c_long,
+ pub st_gen: ::uint64_t,
-+ pub st_spare: [::int64_t; 10],
++ pub st_spare: [::uint64_t; 10],
}
}
--- ./src/liblibc/src/unix/bsd/freebsdlike/mod.rs.orig 2017-04-24 18:56:45.000000000 +0000
@@ -270,7 +270,7 @@
- pub st_birthtime: ::time_t,
- pub st_birthtime_nsec: ::c_long,
+ pub st_gen: ::uint64_t,
-+ pub st_spare: [::int64_t; 10],
++ pub st_spare: [::uint64_t; 10],
}
}
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64.rs.orig 2017-04-24 20:20:26.000000000 +0000
@@ -282,10 +282,10 @@
- pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
+ pub st_mode: ::mode_t,
-+ pub st_pad0: u16,
++ pub st_pad0: ::uint16_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
-+ pub st_pad1: ::u32,
++ pub st_pad1: ::uint32_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
@@ -304,7 +304,7 @@
- pub st_birthtime: ::time_t,
- pub st_birthtime_nsec: ::c_long,
+ pub st_gen: ::uint64_t,
-+ pub st_spare: [u64; 10],
++ pub st_spare: [::uint64_t; 10],
}
}
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2017-04-24 20:20:26.000000000 +0000
@@ -345,21 +345,21 @@
- pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
+ pub st_mode: ::mode_t,
-+ pub st_pad0: u16,
++ pub st_pad0: ::uint16_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
-+ pub st_pad1: u32,
++ pub st_pad1: ::uint32_t,
pub st_rdev: ::dev_t,
-+ pub st_atime_ext: ::i32,
++ pub st_atime_ext: ::int32_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
-+ pub st_mtime_ext: ::i32,
++ pub st_mtime_ext: i32,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
-+ pub st_ctime_ext: ::i32,
++ pub st_ctime_ext: ::int32_t,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
-+ pub st_birthtime_ext: ::i32,
++ pub st_birthtime_ext: ::int32_t,
+ pub st_birthtime: ::time_t,
+ pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
@@ -372,7 +372,7 @@
- pub st_birthtime_nsec: ::c_long,
- __unused: [u8; 8],
+ pub st_gen: ::uint64_t,
-+ pub st_spare: [u64; 10],
++ pub st_spare: [::uint64_t; 10],
}
}
--- ./src/vendor/libc/src/unix/bsd/freebsdlike/mod.rs.orig 2017-04-24 20:20:26.000000000 +0000
diff --git a/multimedia/librespot/Makefile b/multimedia/librespot/Makefile
index ca3f021405e3..906eaa4587a0 100644
--- a/multimedia/librespot/Makefile
+++ b/multimedia/librespot/Makefile
@@ -12,7 +12,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BROKEN= tries to clone git repository during build phase
-BUILD_DEPENDS= cargo>0:devel/cargo \
+BUILD_DEPENDS= rust>=1.19.0:lang/rust \
portaudio>0:audio/portaudio
USES= localbase pathfix pkgconfig shebangfix
diff --git a/www/firefox/Makefile b/www/firefox/Makefile
index 3777f1653704..d648ad7a4624 100644
--- a/www/firefox/Makefile
+++ b/www/firefox/Makefile
@@ -48,7 +48,7 @@ MOZ_OPTIONS= --enable-application=browser \
OPTIONS_DEFINE= RUST
OPTIONS_DEFAULT= BUNDLED_CAIRO
OPTIONS_EXCLUDE= GNOMEUI
-# XXX lang/rust and devel/cargo currently build only on these platforms
+# XXX lang/rust currently builds only on these platforms
OPTIONS_DEFAULT_aarch64=RUST
OPTIONS_DEFAULT_amd64= RUST
OPTIONS_DEFAULT_i386= RUST