Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144130113
D2799.id6687.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D2799.id6687.diff
View Options
Index: devel/Makefile
===================================================================
--- devel/Makefile
+++ devel/Makefile
@@ -191,6 +191,7 @@
SUBDIR += caf
SUBDIR += calibrator
SUBDIR += capstone
+ SUBDIR += cargo
SUBDIR += cask
SUBDIR += catch
SUBDIR += cbind
Index: devel/cargo/Makefile
===================================================================
--- /dev/null
+++ devel/cargo/Makefile
@@ -0,0 +1,148 @@
+# Created by: Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= cargo
+PORTVERSION= 0.4.0.20150703
+CATEGORIES= devel
+
+MAINTAINER= dumbbell@FreeBSD.org
+COMMENT= Rust's Package Manager
+# ' <-- Help Vim syntax hilighting...
+
+LICENSE= APACHE20 \
+ MIT
+LICENSE_COMB= dual
+LICENSE_FILE= ${WRKSRC}/LICENSE-APACHE \
+ ${WRKSRC}/LICENSE-MIT
+
+# The following files are required:
+#
+# GH:src
+# This is the source of Cargo, taken from GitHub.
+#
+# LOCAL/dumbbell:bootstrap
+# Like Rust, this is a prebuilt "cargo" used to bootstrap it, because
+# Cargo is a standard Rust package itself.
+#
+# LOCAL/dumbbell:registry
+# Cargo clones several Git repositories for its dependencies and
+# caches them in its "registry". This is a archive of this registry so
+# nothing is downloaded during the build.
+#
+# GH:rust_installer
+# This is a collection of mainly shell scripts which are used to
+# 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)
+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= a48fe5f4c1 \
+ 8e4f8ea:rust_installer
+
+CARGO_BOOT_SIG= x86_64-unknown-freebsd
+CARGO_BOOT= ${PORTNAME}-nightly-${CARGO_BOOT_SIG}${EXTRACT_SUFX}
+CARGO_REGISTRY= ${DISTNAME:S/${GH_ACCOUNT}-${PORTNAME}/${PORTNAME}-registry/}${EXTRACT_SUFX}
+RUST_INSTALLER= ${GH_ACCOUNT}-rust-installer-${PORTVERSION}-e54d4823d26cdb3f98e5a1b17e1c257cd329aa61_GH0${EXTRACT_SUFX}
+
+USES= gmake python:2,build pkgconfig
+
+# 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
+LIB_DEPENDS= libssh2.so:${PORTSDIR}/security/libssh2 \
+ libcurl.so:${PORTSDIR}/ftp/curl
+
+# 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
+
+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= 2015-07-03
+# git rev-parse --short HEAD
+CFG_VER_HASH= ${GH_TAGNAME}
+
+.if defined(BATCH) || defined(PACKAGE_BUILDING)
+MAKE_ARGS+= VERBOSE=1
+.endif
+
+MAKE_JOBS_UNSAFE= yes
+
+.include <bsd.port.pre.mk>
+
+post-extract:
+ @(${RMDIR} ${WRKSRC}/src/rust-installer && \
+ ${MV} ${WRKSRC_rust_installer} ${WRKSRC}/src/rust-installer)
+ @${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}|' \
+ ${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
+ @${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|' \
+ ${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 \
+ ${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \
+ ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh
+
+gen-registry:
+ ${MAKE} -DSKIP_CARGO_REGISTRY makesum
+ ${MAKE} -DSKIP_CARGO_REGISTRY
+ cd ${WRKDIR} && \
+ ${TAR} cvf - \
+ --exclude git/checkouts/ \
+ --exclude git/db/ \
+ --exclude libgit2/tests/ \
+ --exclude curl/tests/ \
+ --exclude 'index/github.com-*/.git/' \
+ .cargo | ${GZIP_CMD} > ${DISTDIR}/${CARGO_REGISTRY}
+ ${MAKE} makesum
+
+.include <bsd.port.post.mk>
Index: devel/cargo/distinfo
===================================================================
--- /dev/null
+++ devel/cargo/distinfo
@@ -0,0 +1,8 @@
+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.20150703-a48fe5f4c1_GH0.tar.gz) = 41695e9731c2db42aace6a03c630ea98262935b1e55e8031511b837a33183036
+SIZE (cargo-registry-0.4.0.20150703-a48fe5f4c1_GH0.tar.gz) = 15978359
+SHA256 (rust-lang-cargo-0.4.0.20150703-a48fe5f4c1_GH0.tar.gz) = ead99ba14bb53c6d1fb0740a8ff8499560203acdf69eb581d0abc2d0e7b835c4
+SIZE (rust-lang-cargo-0.4.0.20150703-a48fe5f4c1_GH0.tar.gz) = 347404
+SHA256 (rust-lang-rust-installer-8e4f8ea_GH0.tar.gz) = c865d4d2542e2a6588d928857caf910e201e32e200005c485964717bde7970aa
+SIZE (rust-lang-rust-installer-8e4f8ea_GH0.tar.gz) = 14602
Index: devel/cargo/files/patch-configure
===================================================================
--- /dev/null
+++ devel/cargo/files/patch-configure
@@ -0,0 +1,12 @@
+--- configure.orig 2015-05-02 23:16:20 UTC
++++ configure
+@@ -341,8 +341,7 @@ validate_opt
+
+ step_msg "looking for build programs"
+
+-probe_need CFG_CURLORWGET curl wget
+-probe_need CFG_PYTHON python
++probe_need CFG_PYTHON python2.7 python2 python
+ probe_need CFG_CC cc gcc clang
+
+ if [ ! -z "${CFG_LOCAL_RUST_ROOT}" ]; then
Index: devel/cargo/pkg-descr
===================================================================
--- /dev/null
+++ devel/cargo/pkg-descr
@@ -0,0 +1,4 @@
+Cargo is Cargo, Rust's Package Manager. Cargo downloads your Rust
+project’s dependencies and compiles your project.
+
+WWW: http://doc.crates.io/
Index: devel/cargo/pkg-plist
===================================================================
--- /dev/null
+++ devel/cargo/pkg-plist
@@ -0,0 +1,9 @@
+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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 6, 6:20 AM (16 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28447035
Default Alt Text
D2799.id6687.diff (7 KB)
Attached To
Mode
D2799: devel/cargo: New port for Rust's package manager
Attached
Detach File
Event Timeline
Log In to Comment