Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2016 16:02:46 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r406867 - branches/2016Q1/devel/cargo
Message-ID:  <201601211602.u0LG2kEN083345@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Thu Jan 21 16:02:45 2016
New Revision: 406867
URL: https://svnweb.freebsd.org/changeset/ports/406867

Log:
  MFH: r406516
  
  devel/cargo: update to 0.7.0 (release) and cleanup
  
  - Compress :registry with xz(1) to save a few megabytes
  - Add BOOTSTRAP option to build with already installed Cargo
  - Generate distfiles with BOOTSTRAP=off for extra deps
  - Require recent lang/rust to build (older versions not tested)
  - Drop cargo-nightly and rust-nightly hacks. The latter is still supported
    via RUST_PORT=lang/rust-nightly in environment, make.conf, Makefile.local
  - Drop MAKE_JOBS_UNSAFE, builds fine with MAKE_JOBS_NUMBER=32
  - Drop _GH0 suffix from non-GitHub distfile
  - Don't use OpenSSL port on 11.0-CURRENT (no RPATH in bootstrap)
  - Don't install duplicate licenses under DOCSDIR
  - Don't depend on lang/python2 when only lang/python27 is used
  - Simplify manpage directory substitution
  - Fix LICENSE_FILE when used with LICENSE_COMB != single
  - Fix gen-registry target when WRKDIRPREFIX == MAKEOBJDIRPREFIX
  - Cleanup gen-registry target
  - Respect PREFIX != /usr/local
  - Prepare CARGO_BOOT_SIG for i386 and DragonFly
  - Apply minor style
  
  PR:		205529
  Approved by:	maintainer timeout (1 month)
  Approved by:	ports-secteam (feld)
  Differential Revision:	https://reviews.freebsd.org/D4562

Modified:
  branches/2016Q1/devel/cargo/Makefile
  branches/2016Q1/devel/cargo/distinfo
  branches/2016Q1/devel/cargo/pkg-descr
  branches/2016Q1/devel/cargo/pkg-plist
Directory Properties:
  branches/2016Q1/   (props changed)

Modified: branches/2016Q1/devel/cargo/Makefile
==============================================================================
--- branches/2016Q1/devel/cargo/Makefile	Thu Jan 21 15:59:40 2016	(r406866)
+++ branches/2016Q1/devel/cargo/Makefile	Thu Jan 21 16:02:45 2016	(r406867)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	cargo
-PORTVERSION=	0.4.0.20150720
+PORTVERSION=	0.7.0
 CATEGORIES=	devel
 
 MAINTAINER=	dumbbell@FreeBSD.org
@@ -12,8 +12,8 @@ COMMENT=	Rust's Package Manager
 LICENSE=	APACHE20 \
 		MIT
 LICENSE_COMB=	dual
-LICENSE_FILE=	${WRKSRC}/LICENSE-APACHE \
-		${WRKSRC}/LICENSE-MIT
+# APACHE20 license is standard, see Templates/Licenses/APACHE20
+LICENSE_FILE_MIT=	${WRKSRC}/LICENSE-MIT
 
 # The following files are required:
 #
@@ -34,73 +34,69 @@ LICENSE_FILE=	${WRKSRC}/LICENSE-APACHE \
 #   install Cargo.
 
 MASTER_SITES=	https://static.rust-lang.org/cargo-dist/2015-04-02/:bootstrap \
-		LOCAL/dumbbell:registry
-
-DISTFILES=	${CARGO_BOOT}:bootstrap
-EXTRACT_ONLY=	${DISTNAME}${_GITHUB_EXTRACT_SUFX} \
-		${DISTFILE_rust_installer}
-
-.if (${.TARGET} != gen-registry) && !defined(SKIP_CARGO_REGISTRY)
+		LOCAL/jbeich:registry
+.if !defined(SKIP_CARGO_REGISTRY)
 DISTFILES+=	${CARGO_REGISTRY}:registry
-EXTRACT_ONLY+=	${CARGO_REGISTRY}
 .endif
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	rust-lang
-GH_PROJECT=	${PORTNAME} \
-		rust-installer:rust_installer
-GH_TAGNAME=	9c5ffcb871 \
-		c37d374:rust_installer
+GH_PROJECT=	rust-installer:rust_installer
+GH_TAGNAME=	4915c75:rust_installer
 
-CARGO_BOOT_SIG=	x86_64-unknown-freebsd
+CARGO_BOOT_SIG=	${ARCH:S/amd64/x86_64/}-unknown-${OPSYS:tl}
 CARGO_BOOT=	${PORTNAME}-nightly-${CARGO_BOOT_SIG}${EXTRACT_SUFX}
-CARGO_REGISTRY=	${DISTNAME:S/${GH_ACCOUNT}-${PORTNAME}/${PORTNAME}-registry/}${EXTRACT_SUFX}
-
-USES=		gmake python:2,build pkgconfig
-
-# The bootstrapped cargo is built with OpenSSL from ports (libssl.so.8).
-USE_OPENSSL=	yes
-WITH_OPENSSL_PORT=yes
+CARGO_REGISTRY=	${PORTNAME}-registry-${DISTVERSIONFULL}.tar.xz
+CARGO_REGISTRY_BOOT_HASH=	1ecc6299db9ec823
+# Like above but with: pnacl-build-helper, libressl-pnacl-sys
+CARGO_REGISTRY_CUR_HASH=	88ac128001ac3a9a
 
 # We don't USES=cmake here, because cmake is not Cargo's build system.
 # It's used by a bundled dependency (libgit2).
-BUILD_DEPENDS=	${LOCALBASE}/bin/cmake:${PORTSDIR}/devel/cmake \
-		rustc:${PORTSDIR}/lang/rust-nightly
+BUILD_DEPENDS=	cmake:${PORTSDIR}/devel/cmake \
+		${RUST_PORT:T}>=1.5.0:${PORTSDIR}/${RUST_PORT}
 LIB_DEPENDS=	libssh2.so:${PORTSDIR}/security/libssh2 \
 		libcurl.so:${PORTSDIR}/ftp/curl
+RUN_DEPENDS=	rustc:${PORTSDIR}/${RUST_PORT}
+RUST_PORT?=	lang/rust
 
-# FIXME: Don't add rust as a runtime dependency. As we need rust-nightly
-# to build Cargo, the same version would be pulled by installing Cargo,
-# preventing its use with the stable version of Rust.
-# RUN_DEPENDS=	rustc:${PORTSDIR}/lang/rust
-
+USES=		gmake python:-2.7,build pkgconfig
+USE_OPENSSL=	yes
 HAS_CONFIGURE=	yes
-CONFIGURE_ARGS=	--mandir=${MANPREFIX}/man
-MAKE_ENV+=	LD_LIBRARY_PATH="${WRKSRC}/target/snapshot/cargo/lib"
-
-# git log -1 --date=short --pretty=format:'%cd'
-CFG_VER_DATE=	${PORTVERSION:C/.*\.([0-9]{4})([0-9]{2})([0-9]{2})/\1-\2-\3/}
-# git rev-parse --short HEAD
-CFG_VER_HASH=	${GH_TAGNAME}
+CONFIGURE_ARGS=	--prefix="${PREFIX}" --mandir="${MANPREFIX}/man"
+MAKE_ENV=	ARGS="${CARGO_ARGS}"
+CARGO_ARGS=	--jobs ${MAKE_JOBS_NUMBER}
 
 .if defined(BATCH) || defined(PACKAGE_BUILDING)
 MAKE_ARGS+=	VERBOSE=1
 .endif
 
-MAKE_JOBS_UNSAFE=	yes
+OPTIONS_DEFINE=	BOOTSTRAP
+OPTIONS_DEFAULT=BOOTSTRAP
 
-.include <bsd.port.pre.mk>
+BOOTSTRAP_DESC=		Bootstrap using pre-built vendor snapshot
+BOOTSTRAP_CONFIGURE_OFF=--local-cargo="$$(command -v cargo)" # respect PATH
+BOOTSTRAP_VARS_OFF=	EXTRACT_AFTER_ARGS="-s/${CARGO_REGISTRY_BOOT_HASH}/${CARGO_REGISTRY_CUR_HASH}/"
+BOOTSTRAP_DISTFILES=	${CARGO_BOOT}:bootstrap
+BOOTSTRAP_EXTRACT_ONLY=	${DISTFILES:N*\:bootstrap:C/:.*//}
+BOOTSTRAP_MAKE_ENV=	LD_LIBRARY_PATH="${WRKSRC}/target/snapshot/cargo/lib"
+BOOTSTRAP_VARS=		EXTRACT_AFTER_ARGS="-s/${CARGO_REGISTRY_CUR_HASH}/${CARGO_REGISTRY_BOOT_HASH}/"
+.if !exists(/usr/lib/libssl.so.8) # OPENSSL_SHLIBVER
+BOOTSTRAP_VARS+=	WITH_OPENSSL_PORT=yes
+.endif
 
 post-extract:
-	@(${RMDIR} ${WRKSRC}/src/rust-installer && \
-	  ${MV} ${WRKSRC_rust_installer} ${WRKSRC}/src/rust-installer)
+	@${RMDIR} ${WRKSRC}/src/rust-installer
+	@${MV} ${WRKSRC_rust_installer} ${WRKSRC}/src/rust-installer
+
+post-extract-BOOTSTRAP-on:
 	@${MKDIR} ${WRKSRC}/target/dl
 	${LN} -sf ${DISTDIR}/${CARGO_BOOT} ${WRKSRC}/target/dl/
 
 post-patch:
-	${REINPLACE_CMD} \
-		-e 's|^CFG_VER_DATE =.*|CFG_VER_DATE = ${CFG_VER_DATE}|' \
-		-e 's|^CFG_VER_HASH =.*|CFG_VER_HASH = ${CFG_VER_HASH}|' \
+# Fix mandir and don't install licenses outside of ${_LICENSE_DIR}
+	@${REINPLACE_CMD} -e 's,share/man,man,' \
+		-e 's, LICENSE-[^[:space:]]*,,g' \
 		${WRKSRC}/Makefile.in
 
 # In case the previous "make stage" failed, this ensures rust's
@@ -121,14 +117,8 @@ pre-install:
 
 post-install:
 	@${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/install.log
-	@${MV} ${STAGEDIR}${PREFIX}/share/man/man1/cargo.1 \
-		${STAGEDIR}${PREFIX}/man/man1/cargo.1
-	@${RMDIR} ${STAGEDIR}${PREFIX}/share/man/man1 \
-		${STAGEDIR}${PREFIX}/share/man
-	@${REINPLACE_CMD} -e 's|${STAGEDIR}||' \
-		-e 's|share/man/man1/cargo\.1|man/man1/cargo.1.gz|' \
+	@${REINPLACE_CMD} -i '' -e 's|${STAGEDIR}||' \
 		${STAGEDIR}${PREFIX}/lib/rustlib/manifest-cargo
-	@${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-cargo.bak
 	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/cargo
 	@${RM} \
 		${STAGEDIR}${PREFIX}/lib/rustlib/components \
@@ -138,19 +128,19 @@ post-install:
 # "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 registry" to update the distinfo and create a new snapshot of
+# "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} -DSKIP_CARGO_REGISTRY makesum
-	${MAKE} -DSKIP_CARGO_REGISTRY
-	cd ${WRKDIR} && \
-		${TAR} cvf - \
+	${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 | ${GZIP_CMD} > ${DISTDIR}/${CARGO_REGISTRY}
-	${MAKE} makesum
+		.cargo
+	${MAKE} -C${.CURDIR} makesum
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

Modified: branches/2016Q1/devel/cargo/distinfo
==============================================================================
--- branches/2016Q1/devel/cargo/distinfo	Thu Jan 21 15:59:40 2016	(r406866)
+++ branches/2016Q1/devel/cargo/distinfo	Thu Jan 21 16:02:45 2016	(r406867)
@@ -1,8 +1,10 @@
+SHA256 (cargo-registry-0.7.0.tar.xz) = 72542abb20b8871d3f030c5c3855cf49902300fa3dfc58cef74fdb8984a579c9
+SIZE (cargo-registry-0.7.0.tar.xz) = 17769584
+SHA256 (cargo-nightly-x86_64-unknown-dragonfly.tar.gz) = 49d70c798362fba7d691144a4c97ce1be29a921c3a38d2fe8ffa76f9daf628ab
+SIZE (cargo-nightly-x86_64-unknown-dragonfly.tar.gz) = 2621548
 SHA256 (cargo-nightly-x86_64-unknown-freebsd.tar.gz) = de678e858de5d2923cc206b7aa1cc84ddc67be00748160f66fc9b7325409e7c7
 SIZE (cargo-nightly-x86_64-unknown-freebsd.tar.gz) = 7663548
-SHA256 (cargo-registry-0.4.0.20150720-9c5ffcb871_GH0.tar.gz) = 7d8b5d53e0d3f28e0f8d0078586a8d94c834d9f6c35e00b56abe00bd54ee9944
-SIZE (cargo-registry-0.4.0.20150720-9c5ffcb871_GH0.tar.gz) = 16391914
-SHA256 (rust-lang-cargo-0.4.0.20150720-9c5ffcb871_GH0.tar.gz) = af6a6b609b3d6bf52f55fdcc2f8e299016e9b805748e824ec6b92d4f8ed92c07
-SIZE (rust-lang-cargo-0.4.0.20150720-9c5ffcb871_GH0.tar.gz) = 351554
-SHA256 (rust-lang-rust-installer-c37d374_GH0.tar.gz) = 7cc41029b14de023dd4f250b332470c98cf9d1a77d174a20e93d78d07e4255f1
-SIZE (rust-lang-rust-installer-c37d374_GH0.tar.gz) = 19267
+SHA256 (rust-lang-cargo-0.7.0_GH0.tar.gz) = b1067d710e64b66a197294df2fa3dd4fb1d645171eaa517b93d42678bb687338
+SIZE (rust-lang-cargo-0.7.0_GH0.tar.gz) = 512415
+SHA256 (rust-lang-rust-installer-4915c75_GH0.tar.gz) = 022116173684c97d61e014940aada20f3830d2d3e1670887bf1861997133c234
+SIZE (rust-lang-rust-installer-4915c75_GH0.tar.gz) = 19234

Modified: branches/2016Q1/devel/cargo/pkg-descr
==============================================================================
--- branches/2016Q1/devel/cargo/pkg-descr	Thu Jan 21 15:59:40 2016	(r406866)
+++ branches/2016Q1/devel/cargo/pkg-descr	Thu Jan 21 16:02:45 2016	(r406867)
@@ -1,4 +1,4 @@
 Cargo is Cargo, Rust's Package Manager. Cargo downloads your Rust
-project’s dependencies and compiles your project.
+project's dependencies and compiles your project.
 
 WWW: http://doc.crates.io/

Modified: branches/2016Q1/devel/cargo/pkg-plist
==============================================================================
--- branches/2016Q1/devel/cargo/pkg-plist	Thu Jan 21 15:59:40 2016	(r406866)
+++ branches/2016Q1/devel/cargo/pkg-plist	Thu Jan 21 16:02:45 2016	(r406867)
@@ -2,8 +2,5 @@ bin/cargo
 etc/bash_completion.d/cargo
 lib/rustlib/manifest-cargo
 man/man1/cargo.1.gz
-%%PORTDOCS%%%%DOCSDIR%%/LICENSE-APACHE
-%%PORTDOCS%%%%DOCSDIR%%/LICENSE-MIT
-%%PORTDOCS%%%%DOCSDIR%%/LICENSE-THIRD-PARTY
 %%PORTDOCS%%%%DOCSDIR%%/README.md
 share/zsh/site-functions/_cargo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601211602.u0LG2kEN083345>