dev-util/cargo: preserve older build method
authorDoug Goldstein <cardoe@gentoo.org>
Sat, 26 Nov 2016 15:22:13 +0000 (09:22 -0600)
committerDoug Goldstein <cardoe@gentoo.org>
Wed, 30 Nov 2016 17:17:51 +0000 (11:17 -0600)
Cargo bootstraps itself with a 0.10.0 version of Cargo that does not
support the newer features we're rolling into the eclass. As a result
this lifts out bits from the eclass and moves it into the Cargo ebuilds
so that the eclass can be updated.

Signed-off-by: Doug Goldstein <cardoe@gentoo.org>
dev-util/cargo/cargo-0.12.0.ebuild
dev-util/cargo/cargo-0.13.0-r1.ebuild
dev-util/cargo/cargo-0.13.0.ebuild
dev-util/cargo/cargo-0.14.0.ebuild

index 68140cd502ad4f5007117df13e0baf7406b472e3..3ab9f1147b4e95efe2b28f083e9d614fdefe238f 100644 (file)
@@ -103,6 +103,52 @@ DEPEND="${COMMON_DEPEND}
        sys-apps/findutils
        sys-apps/sed"
 
+# Until cargo bootstraps itself with a version based on 0.13.0, this needs
+# to stay (these variables and src_unpack)
+ECARGO_HOME="${WORKDIR}/cargo_home"
+ECARGO_REPO="github.com-88ac128001ac3a9a"
+ECARGO_INDEX="${ECARGO_HOME}/registry/index/${ECARGO_REPO}"
+ECARGO_SRC="${ECARGO_HOME}/registry/src/${ECARGO_REPO}"
+ECARGO_CACHE="${ECARGO_HOME}/registry/cache/${ECARGO_REPO}"
+
+src_unpack() {
+       mkdir -p "${ECARGO_INDEX}" || die
+       mkdir -p "${ECARGO_CACHE}" || die
+       mkdir -p "${ECARGO_SRC}" || die
+       mkdir -p "${S}" || die
+
+       local archive
+       for archive in ${A}; do
+               case "${archive}" in
+                       *.crate)
+                               ebegin "Unpacking ${archive}"
+                               cp "${DISTDIR}"/${archive} "${ECARGO_CACHE}/" || die
+                               tar -xf "${DISTDIR}"/${archive} -C "${ECARGO_SRC}/" || die
+                               eend $?
+                               ;;
+                       cargo-snapshot*)
+                               ebegin "Unpacking ${archive}"
+                               mkdir -p "${S}"/target/snapshot
+                               tar -xzf "${DISTDIR}"/${archive} -C "${S}"/target/snapshot --strip-components 2 || die
+                               # cargo's makefile needs this otherwise it will try to
+                               # download it
+                               touch "${S}"/target/snapshot/bin/cargo || die
+                               eend $?
+                               ;;
+                       cargo-registry*)
+                               ebegin "Unpacking ${archive}"
+                               tar -xzf "${DISTDIR}"/${archive} -C "${ECARGO_INDEX}" --strip-components 1 || die
+                               # prevent cargo from attempting to download this again
+                               touch "${ECARGO_INDEX}"/.cargo-index-lock || die
+                               eend $?
+                               ;;
+                       *)
+                               unpack ${archive}
+                               ;;
+               esac
+       done
+}
+
 src_configure() {
        # Cargo only supports these GNU triples:
        # - Linux: <arch>-unknown-linux-gnu
index c6a5f05bec40c139d92320d94fc8fd28a891f0ca..12d1dd2f3944415a2af188920b6863edd843d81c 100644 (file)
@@ -115,6 +115,52 @@ DEPEND="${COMMON_DEPEND}
        sys-apps/findutils
        sys-apps/sed"
 
+# Until cargo bootstraps itself with a version based on 0.13.0, this needs
+# to stay (these variables and src_unpack)
+ECARGO_HOME="${WORKDIR}/cargo_home"
+ECARGO_REPO="github.com-88ac128001ac3a9a"
+ECARGO_INDEX="${ECARGO_HOME}/registry/index/${ECARGO_REPO}"
+ECARGO_SRC="${ECARGO_HOME}/registry/src/${ECARGO_REPO}"
+ECARGO_CACHE="${ECARGO_HOME}/registry/cache/${ECARGO_REPO}"
+
+src_unpack() {
+       mkdir -p "${ECARGO_INDEX}" || die
+       mkdir -p "${ECARGO_CACHE}" || die
+       mkdir -p "${ECARGO_SRC}" || die
+       mkdir -p "${S}" || die
+
+       local archive
+       for archive in ${A}; do
+               case "${archive}" in
+                       *.crate)
+                               ebegin "Unpacking ${archive}"
+                               cp "${DISTDIR}"/${archive} "${ECARGO_CACHE}/" || die
+                               tar -xf "${DISTDIR}"/${archive} -C "${ECARGO_SRC}/" || die
+                               eend $?
+                               ;;
+                       cargo-snapshot*)
+                               ebegin "Unpacking ${archive}"
+                               mkdir -p "${S}"/target/snapshot
+                               tar -xzf "${DISTDIR}"/${archive} -C "${S}"/target/snapshot --strip-components 2 || die
+                               # cargo's makefile needs this otherwise it will try to
+                               # download it
+                               touch "${S}"/target/snapshot/bin/cargo || die
+                               eend $?
+                               ;;
+                       cargo-registry*)
+                               ebegin "Unpacking ${archive}"
+                               tar -xzf "${DISTDIR}"/${archive} -C "${ECARGO_INDEX}" --strip-components 1 || die
+                               # prevent cargo from attempting to download this again
+                               touch "${ECARGO_INDEX}"/.cargo-index-lock || die
+                               eend $?
+                               ;;
+                       *)
+                               unpack ${archive}
+                               ;;
+               esac
+       done
+}
+
 src_configure() {
        # Cargo only supports these GNU triples:
        # - Linux: <arch>-unknown-linux-gnu
index 3f74ad6ccd122712ed3ca04ec7fb181778e36374..56c77720b48c9188e9556d6c7cca6fa2e5663440 100644 (file)
@@ -114,6 +114,52 @@ DEPEND="${COMMON_DEPEND}
        sys-apps/findutils
        sys-apps/sed"
 
+# Until cargo bootstraps itself with a version based on 0.13.0, this needs
+# to stay (these variables and src_unpack)
+ECARGO_HOME="${WORKDIR}/cargo_home"
+ECARGO_REPO="github.com-88ac128001ac3a9a"
+ECARGO_INDEX="${ECARGO_HOME}/registry/index/${ECARGO_REPO}"
+ECARGO_SRC="${ECARGO_HOME}/registry/src/${ECARGO_REPO}"
+ECARGO_CACHE="${ECARGO_HOME}/registry/cache/${ECARGO_REPO}"
+
+src_unpack() {
+       mkdir -p "${ECARGO_INDEX}" || die
+       mkdir -p "${ECARGO_CACHE}" || die
+       mkdir -p "${ECARGO_SRC}" || die
+       mkdir -p "${S}" || die
+
+       local archive
+       for archive in ${A}; do
+               case "${archive}" in
+                       *.crate)
+                               ebegin "Unpacking ${archive}"
+                               cp "${DISTDIR}"/${archive} "${ECARGO_CACHE}/" || die
+                               tar -xf "${DISTDIR}"/${archive} -C "${ECARGO_SRC}/" || die
+                               eend $?
+                               ;;
+                       cargo-snapshot*)
+                               ebegin "Unpacking ${archive}"
+                               mkdir -p "${S}"/target/snapshot
+                               tar -xzf "${DISTDIR}"/${archive} -C "${S}"/target/snapshot --strip-components 2 || die
+                               # cargo's makefile needs this otherwise it will try to
+                               # download it
+                               touch "${S}"/target/snapshot/bin/cargo || die
+                               eend $?
+                               ;;
+                       cargo-registry*)
+                               ebegin "Unpacking ${archive}"
+                               tar -xzf "${DISTDIR}"/${archive} -C "${ECARGO_INDEX}" --strip-components 1 || die
+                               # prevent cargo from attempting to download this again
+                               touch "${ECARGO_INDEX}"/.cargo-index-lock || die
+                               eend $?
+                               ;;
+                       *)
+                               unpack ${archive}
+                               ;;
+               esac
+       done
+}
+
 src_configure() {
        # Cargo only supports these GNU triples:
        # - Linux: <arch>-unknown-linux-gnu
index b78e2057d1c2b329d9faaaca075b4dcce97137ff..1b8d661b3a11261d8d80ff8ee2050824e9f0eb70 100644 (file)
@@ -116,6 +116,52 @@ DEPEND="${COMMON_DEPEND}
        sys-apps/findutils
        sys-apps/sed"
 
+# Until cargo bootstraps itself with a version based on 0.13.0, this needs
+# to stay (these variables and src_unpack)
+ECARGO_HOME="${WORKDIR}/cargo_home"
+ECARGO_REPO="github.com-88ac128001ac3a9a"
+ECARGO_INDEX="${ECARGO_HOME}/registry/index/${ECARGO_REPO}"
+ECARGO_SRC="${ECARGO_HOME}/registry/src/${ECARGO_REPO}"
+ECARGO_CACHE="${ECARGO_HOME}/registry/cache/${ECARGO_REPO}"
+
+src_unpack() {
+       mkdir -p "${ECARGO_INDEX}" || die
+       mkdir -p "${ECARGO_CACHE}" || die
+       mkdir -p "${ECARGO_SRC}" || die
+       mkdir -p "${S}" || die
+
+       local archive
+       for archive in ${A}; do
+               case "${archive}" in
+                       *.crate)
+                               ebegin "Unpacking ${archive}"
+                               cp "${DISTDIR}"/${archive} "${ECARGO_CACHE}/" || die
+                               tar -xf "${DISTDIR}"/${archive} -C "${ECARGO_SRC}/" || die
+                               eend $?
+                               ;;
+                       cargo-snapshot*)
+                               ebegin "Unpacking ${archive}"
+                               mkdir -p "${S}"/target/snapshot
+                               tar -xzf "${DISTDIR}"/${archive} -C "${S}"/target/snapshot --strip-components 2 || die
+                               # cargo's makefile needs this otherwise it will try to
+                               # download it
+                               touch "${S}"/target/snapshot/bin/cargo || die
+                               eend $?
+                               ;;
+                       cargo-registry*)
+                               ebegin "Unpacking ${archive}"
+                               tar -xzf "${DISTDIR}"/${archive} -C "${ECARGO_INDEX}" --strip-components 1 || die
+                               # prevent cargo from attempting to download this again
+                               touch "${ECARGO_INDEX}"/.cargo-index-lock || die
+                               eend $?
+                               ;;
+                       *)
+                               unpack ${archive}
+                               ;;
+               esac
+       done
+}
+
 src_configure() {
        # Cargo only supports these GNU triples:
        # - Linux: <arch>-unknown-linux-gnu