# $Id$ PNAME="cargo" PVER="0.18.0" PBUILD="r1" PCAT="dev-util" DESCRIPTION="Systems programming language focused on safety, speed and concurrency." HOMEPAGE="https://crates.io/" # enable bootstrap of cargo with prebuild binary cargo # 0=no, 1=yes BOOTSTRAP=1 DEPEND=">= dev-lang/rust-1.18 >= net-misc/curl-7" SDEPEND=">= dev-util/cmake-3.6 >= dev-lang/python-2.7" if [[ ${BOOTSTRAP} = 0 ]] then SDEPEND="${SDEPEND} >= dev-util/cargo-0.18" fi SRCFILE="${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" msetfeature "!check" # no check target in makefile sminclude mbuild mtools SRC_URI=( https://github.com/rust-lang/${PNAME}/archive/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) UP2SEPERATOR="\/" UP2DATE="updatecmd https://github.com/rust-lang/cargo/releases | highesttarball gz" if [[ ${BOOTSTRAP} = 1 ]] then CARGOBIN_PVER="${PVER}" CARGOBIN_SRCFILE_x86_64="cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu.tar.gz" CARGOBIN_SRCDIR_x86_64="${BUILDDIR}/cargo-${CARGOBIN_PVER}-x86_64-unknown-linux-gnu" CARGOBIN_SRCFILE_x86="cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu.tar.gz" CARGOBIN_SRCDIR_x86="${BUILDDIR}/cargo-${CARGOBIN_PVER}-i686-unknown-linux-gnu" CARGOBIN_SRCFILE="$(marchsrcfile CARGOBIN_SRCFILE)" CARGOBIN_SRCDIR="$(marchsrcdir CARGOBIN_SRCDIR)" SRC_URI+=( https://static.rust-lang.org/dist/${CARGOBIN_SRCFILE_x86_64} https://static.rust-lang.org/dist/${CARGOBIN_SRCFILE_x86} ) fi src_prepare() { munpack ${SRCFILE} || die if [[ ${BOOTSTRAP} = 1 ]] then munpack ${CARGOBIN_SRCFILE} || die fi } src_compile() { cd ${SRCDIR} local myconf # enforce rust-bin chost local myARCH [[ ${ARCH} = i*86 ]] && myARCH=i686 myconf+=" --host=${myARCH}-unknown-linux-gnu --build=${myARCH}-unknown-linux-gnu" if [[ ${BOOTSTRAP} = 1 ]] then myconf+=" --cargo=${CARGOBIN_SRCDIR}/cargo/bin/cargo" fi mconfigure \ --release-channel=stable \ --enable-optimize \ ${myconf} \ || die mmake VERBOSE=1 || die } src_install() { cd ${SRCDIR} local myARCH [[ ${ARCH} = i*86 ]] && myARCH=i686 make prepare-image-${myARCH}-unknown-linux-gnu IMGDIR_${myARCH}-unknown-linux-gnu=${BINDIR}/usr || die # remove unnecessary files mdelete -r /usr/etc || die minstalldocs LICENSE-* || die }