[Bug 256581] CARGO_GIT_SUBDIR doesn't work with unpacked [dependencies.<crate>]

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 07 Sep 2021 11:45:53 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256581

--- Comment #2 from Tobias Kortkamp <tobik_at_freebsd.org> ---
patch-in-config has been stabilized in Rust 1.56 (2021-10-21).

To get slightly more concrete it might look like this:

diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index 3d065a45ed3b..46a2ffd40d93 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
_at__at_ -107,8 +107,8 _at__at_ STRIP_CMD=  ${LOCALBASE}/bin/strip # unsupported e_type
with base strip

 # Helper to shorten cargo calls.
 CARGO_CARGO_RUN= \
-       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO_ENV} \
-               ${CARGO_CARGO_BIN}
+       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO_ENV} RUSTC_BOOTSTRAP=1
CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE=1 \
+               ${CARGO_CARGO_BIN} -Zpatch-in-config

 # User arguments for cargo targets.
 CARGO_BUILD_ARGS?=
_at__at_ -296,6 +296,8 _at__at_ cargo-configure:
        _at_${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >>
${WRKDIR}/.cargo/config
        _at_${ECHO_CMD} "[source.crates-io]" >> ${WRKDIR}/.cargo/config
        _at_${ECHO_CMD} "replace-with = 'cargo'" >> ${WRKDIR}/.cargo/config
+       _at_${ECHO_CMD} "[patch.'https://github.com/llogiq/mutagen']" >>
${WRKDIR}/.cargo/config
+       _at_${ECHO_CMD} "mutagen = { path = '${WRKSRC_mutagen}/mutagen' }" >>
${WRKDIR}/.cargo/config
        _at_if ! ${GREP} -qF '[profile.release]' ${CARGO_CARGOTOML}; then \
                ${ECHO_CMD} "" >> ${CARGO_CARGOTOML}; \
                ${ECHO_CMD} "[profile.release]" >> ${CARGO_CARGOTOML}; \
diff --git a/dns/dog/Makefile b/dns/dog/Makefile
index e7b9aa7039de..2cb66d1895fa 100644
--- a/dns/dog/Makefile
+++ b/dns/dog/Makefile
_at__at_ -90,8 +90,15 _at__at_ CARGO_CRATES=        addr2line-0.14.0 \
                winapi-i686-pc-windows-gnu-0.4.0 \
                winapi-x86_64-pc-windows-gnu-0.4.0 \
                winreg-0.6.2
-CARGO_USE_GITHUB=      yes
-CARGO_GIT_SUBDIR=      mutagen:mutagen:mutagen
+# [[package]]
+# name = "mutagen"
+# source =
"git+https://github.com/llogiq/mutagen#c7abc956a10e8a3e2cc71f21279ea0a42f7b7c10"
+#
+# make cargo-crates to turn entries like the above into
+#
+# CARGO_CRATES+=      
git+https://github.com/llogiq/mutagen\#c7abc956a10e8a3e2cc71f21279ea0a42f7b7c10
+#
+# which cargo.mk can then consume to create the appropriate [patch] sections
and GH_TUPLE.

 PORTDOCS=      README.md

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Tue Sep 07 2021 - 11:45:53 UTC

Original text of this message