From: Doug Goldstein Date: Mon, 23 Dec 2019 03:30:33 +0000 (-0600) Subject: eclass/cargo.eclass: specify --path . to install X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=43c2a717e665e94232f46379013706959207c51a;p=gentoo.git eclass/cargo.eclass: specify --path . to install cargo install has long required --path . for 2018 edition crates but not required it for 2015 edition crates. It is supported however for 2015 edition crates and works for all versions in the tree so it makes sense to make it the default. Added CARGO_INSTALL_PATH as an eclass variable allowing to override the default. Closes: https://bugs.gentoo.org/703590 Signed-off-by: Doug Goldstein Closes: https://github.com/gentoo/gentoo/pull/14097 Tested-by: Georgy Yakovlev Signed-off-by: Georgy Yakovlev --- diff --git a/app-crypt/nitrocli/nitrocli-0.2.4.ebuild b/app-crypt/nitrocli/nitrocli-0.2.4.ebuild index ff6f4c8d1399..8003f3ae49a4 100644 --- a/app-crypt/nitrocli/nitrocli-0.2.4.ebuild +++ b/app-crypt/nitrocli/nitrocli-0.2.4.ebuild @@ -67,7 +67,7 @@ RESTRICT="test" QA_FLAGS_IGNORED="/usr/bin/nitrocli" src_install() { - cargo_src_install --path=. + cargo_src_install einstalldocs doman "doc/nitrocli.1" diff --git a/app-crypt/nitrocli/nitrocli-0.3.0.ebuild b/app-crypt/nitrocli/nitrocli-0.3.0.ebuild index 7f040b5669e2..a39e5325f965 100644 --- a/app-crypt/nitrocli/nitrocli-0.3.0.ebuild +++ b/app-crypt/nitrocli/nitrocli-0.3.0.ebuild @@ -67,7 +67,7 @@ RESTRICT="test" QA_FLAGS_IGNORED="/usr/bin/nitrocli" src_install() { - cargo_src_install --path=. + cargo_src_install einstalldocs doman "doc/nitrocli.1" diff --git a/app-misc/cargo-license/cargo-license-0.3.0.ebuild b/app-misc/cargo-license/cargo-license-0.3.0.ebuild index dce7c3b9fee1..b159a850681c 100644 --- a/app-misc/cargo-license/cargo-license-0.3.0.ebuild +++ b/app-misc/cargo-license/cargo-license-0.3.0.ebuild @@ -69,6 +69,6 @@ KEYWORDS="~amd64 ~x86" QA_FLAGS_IGNORED="/usr/bin/cargo-license" src_install() { - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/app-misc/rpick/rpick-0.4.0.ebuild b/app-misc/rpick/rpick-0.4.0.ebuild index 70cd73d6a23b..4f9ccd1a476e 100644 --- a/app-misc/rpick/rpick-0.4.0.ebuild +++ b/app-misc/rpick/rpick-0.4.0.ebuild @@ -90,7 +90,7 @@ DOCS=( CHANGELOG.md README.md ) QA_FLAGS_IGNORED="usr/bin/rpick" src_install() { - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/app-misc/rpick/rpick-0.5.0.ebuild b/app-misc/rpick/rpick-0.5.0.ebuild index c11bb5b083d0..eb0b0d6af035 100644 --- a/app-misc/rpick/rpick-0.5.0.ebuild +++ b/app-misc/rpick/rpick-0.5.0.ebuild @@ -91,7 +91,7 @@ DOCS=( CHANGELOG.md README.md ) QA_FLAGS_IGNORED="usr/bin/rpick" src_install() { - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/app-misc/skim/skim-0.5.4.ebuild b/app-misc/skim/skim-0.5.4.ebuild index ea4eeca24d46..a5f5292682db 100644 --- a/app-misc/skim/skim-0.5.4.ebuild +++ b/app-misc/skim/skim-0.5.4.ebuild @@ -58,7 +58,7 @@ RDEPEND=" QA_FLAGS_IGNORED="usr/bin/sk" src_install() { - cargo_src_install --path=. + cargo_src_install dodoc CHANGELOG.md README.md use tmux && dobin bin/sk-tmux diff --git a/app-misc/skim/skim-0.5.5.ebuild b/app-misc/skim/skim-0.5.5.ebuild index 37e18dab525f..3c47ec961a96 100644 --- a/app-misc/skim/skim-0.5.5.ebuild +++ b/app-misc/skim/skim-0.5.5.ebuild @@ -57,7 +57,7 @@ RDEPEND=" QA_FLAGS_IGNORED="usr/bin/sk" src_install() { - cargo_src_install --path=. + cargo_src_install dodoc CHANGELOG.md README.md use tmux && dobin bin/sk-tmux diff --git a/app-misc/skim/skim-0.6.4.ebuild b/app-misc/skim/skim-0.6.4.ebuild index 7eab30978e94..8c683ced2c75 100644 --- a/app-misc/skim/skim-0.6.4.ebuild +++ b/app-misc/skim/skim-0.6.4.ebuild @@ -90,7 +90,7 @@ src_install() { # prevent cargo_src_install() blowing up on man installation mv man manpages || die - cargo_src_install --path=. + cargo_src_install dodoc CHANGELOG.md README.md doman manpages/man1/* diff --git a/app-misc/skim/skim-0.6.6.ebuild b/app-misc/skim/skim-0.6.6.ebuild index 406e8b4abca6..ae934bd00fd6 100644 --- a/app-misc/skim/skim-0.6.6.ebuild +++ b/app-misc/skim/skim-0.6.6.ebuild @@ -94,7 +94,7 @@ src_install() { # prevent cargo_src_install() blowing up on man installation mv man manpages || die - cargo_src_install --path=. + cargo_src_install dodoc CHANGELOG.md README.md doman manpages/man1/* diff --git a/app-misc/skim/skim-0.6.7.ebuild b/app-misc/skim/skim-0.6.7.ebuild index cc50f91bb4d3..d52d62ad9eda 100644 --- a/app-misc/skim/skim-0.6.7.ebuild +++ b/app-misc/skim/skim-0.6.7.ebuild @@ -98,7 +98,7 @@ src_install() { # prevent cargo_src_install() blowing up on man installation mv man manpages || die - cargo_src_install --path=. + cargo_src_install dodoc CHANGELOG.md README.md doman manpages/man1/* diff --git a/app-misc/skim/skim-0.6.8.ebuild b/app-misc/skim/skim-0.6.8.ebuild index 0290b225d1de..2ce7a1d1d13d 100644 --- a/app-misc/skim/skim-0.6.8.ebuild +++ b/app-misc/skim/skim-0.6.8.ebuild @@ -97,7 +97,7 @@ src_install() { # prevent cargo_src_install() blowing up on man installation mv man manpages || die - cargo_src_install --path=. + cargo_src_install dodoc CHANGELOG.md README.md doman manpages/man1/* diff --git a/app-shells/mcfly/mcfly-0.3.4.ebuild b/app-shells/mcfly/mcfly-0.3.4.ebuild index 1ce9fc5247ae..282ad8132c06 100644 --- a/app-shells/mcfly/mcfly-0.3.4.ebuild +++ b/app-shells/mcfly/mcfly-0.3.4.ebuild @@ -76,7 +76,7 @@ DEPEND="" RDEPEND="" src_install() { - cargo_src_install --path=. + cargo_src_install insinto "/usr/share/${PN}" doins "${PN}.bash" diff --git a/app-text/fblog/fblog-1.3.1.ebuild b/app-text/fblog/fblog-1.3.1.ebuild index f4b44651c603..c7194a216f99 100644 --- a/app-text/fblog/fblog-1.3.1.ebuild +++ b/app-text/fblog/fblog-1.3.1.ebuild @@ -59,6 +59,6 @@ DOCS=( README.org sample.json.log ) QA_FLAGS_IGNORED="/usr/bin/fblog" src_install() { - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/dev-util/cargo-tree/cargo-tree-0.23.0.ebuild b/dev-util/cargo-tree/cargo-tree-0.23.0.ebuild index 360f71e835a7..52eba65bc491 100644 --- a/dev-util/cargo-tree/cargo-tree-0.23.0.ebuild +++ b/dev-util/cargo-tree/cargo-tree-0.23.0.ebuild @@ -184,6 +184,6 @@ RDEPEND=" DEPEND="${RDEPEND}" src_install(){ - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/dev-util/cargo-tree/cargo-tree-0.24.0.ebuild b/dev-util/cargo-tree/cargo-tree-0.24.0.ebuild index ac198d100457..131d1816df0a 100644 --- a/dev-util/cargo-tree/cargo-tree-0.24.0.ebuild +++ b/dev-util/cargo-tree/cargo-tree-0.24.0.ebuild @@ -176,6 +176,6 @@ RDEPEND=" DEPEND="${RDEPEND}" src_install(){ - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/dev-util/cargo-tree/cargo-tree-0.25.0.ebuild b/dev-util/cargo-tree/cargo-tree-0.25.0.ebuild index cb4b4eb835f9..c291745eb473 100644 --- a/dev-util/cargo-tree/cargo-tree-0.25.0.ebuild +++ b/dev-util/cargo-tree/cargo-tree-0.25.0.ebuild @@ -177,6 +177,6 @@ RDEPEND=" DEPEND="${RDEPEND}" src_install(){ - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/dev-util/cargo-tree/cargo-tree-0.26.0.ebuild b/dev-util/cargo-tree/cargo-tree-0.26.0.ebuild index 6e53a2e0be21..94af6ea62fc4 100644 --- a/dev-util/cargo-tree/cargo-tree-0.26.0.ebuild +++ b/dev-util/cargo-tree/cargo-tree-0.26.0.ebuild @@ -181,6 +181,6 @@ RDEPEND=" DEPEND="${RDEPEND}" src_install(){ - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/dev-util/cargo-tree/cargo-tree-0.27.0.ebuild b/dev-util/cargo-tree/cargo-tree-0.27.0.ebuild index e0917ba37b57..cdcc8337e70c 100644 --- a/dev-util/cargo-tree/cargo-tree-0.27.0.ebuild +++ b/dev-util/cargo-tree/cargo-tree-0.27.0.ebuild @@ -183,6 +183,6 @@ DEPEND="${RDEPEND} " src_install(){ - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/dev-util/sccache/sccache-0.2.10.ebuild b/dev-util/sccache/sccache-0.2.10.ebuild index 09322dc521cc..79d25139c158 100644 --- a/dev-util/sccache/sccache-0.2.10.ebuild +++ b/dev-util/sccache/sccache-0.2.10.ebuild @@ -331,7 +331,7 @@ src_compile(){ } src_install() { - cargo_src_install --path=. ${myfeatures:+--features "${myfeatures[*]}"} --no-default-features + cargo_src_install ${myfeatures:+--features "${myfeatures[*]}"} --no-default-features keepdir /etc/sccache diff --git a/dev-util/sccache/sccache-0.2.8-r2.ebuild b/dev-util/sccache/sccache-0.2.8-r2.ebuild index 21a6f2c2688f..3cec993ae5e8 100644 --- a/dev-util/sccache/sccache-0.2.8-r2.ebuild +++ b/dev-util/sccache/sccache-0.2.8-r2.ebuild @@ -328,7 +328,7 @@ src_compile(){ } src_install() { - cargo_src_install --path=. ${myfeatures:+--features "${myfeatures[*]}"} --no-default-features + cargo_src_install ${myfeatures:+--features "${myfeatures[*]}"} --no-default-features keepdir /etc/sccache diff --git a/dev-util/sccache/sccache-0.2.9.ebuild b/dev-util/sccache/sccache-0.2.9.ebuild index d1941557a46d..9995856c3628 100644 --- a/dev-util/sccache/sccache-0.2.9.ebuild +++ b/dev-util/sccache/sccache-0.2.9.ebuild @@ -331,7 +331,7 @@ src_compile(){ } src_install() { - cargo_src_install --path=. ${myfeatures:+--features "${myfeatures[*]}"} --no-default-features + cargo_src_install ${myfeatures:+--features "${myfeatures[*]}"} --no-default-features keepdir /etc/sccache diff --git a/dev-util/wasmer/wasmer-0.11.0.ebuild b/dev-util/wasmer/wasmer-0.11.0.ebuild index fbef79ddf28a..336e379622d8 100644 --- a/dev-util/wasmer/wasmer-0.11.0.ebuild +++ b/dev-util/wasmer/wasmer-0.11.0.ebuild @@ -191,6 +191,6 @@ src_prepare() { } src_install() { - cargo_src_install --path=. + cargo_src_install einstalldocs } diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 13dd5c355fb3..fb759f95903f 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -34,6 +34,11 @@ IUSE="${IUSE} debug" ECARGO_HOME="${WORKDIR}/cargo_home" ECARGO_VENDOR="${ECARGO_HOME}/gentoo" +# @ECLASS-VARIABLE: CARGO_INSTALL_PATH +# @DESCRIPTION: +# Allows overriding the default cwd to run cargo install from +: ${CARGO_INSTALL_PATH:=.} + # @FUNCTION: cargo_crate_uris # @DESCRIPTION: # Generates the URIs to put in SRC_URI to help fetch dependencies. @@ -156,7 +161,8 @@ cargo_src_compile() { cargo_src_install() { debug-print-function ${FUNCNAME} "$@" - cargo install -vv -j $(makeopts_jobs) --root="${ED}/usr" $(usex debug --debug "") "$@" \ + cargo install -vv -j $(makeopts_jobs) --path ${CARGO_INSTALL_PATH} \ + --root="${ED}/usr" $(usex debug --debug "") "$@" \ || die "cargo install failed" rm -f "${ED}/usr/.crates.toml" diff --git a/media-video/rav1e/rav1e-9999.ebuild b/media-video/rav1e/rav1e-9999.ebuild index 0136a727b3a0..131796f9e62c 100644 --- a/media-video/rav1e/rav1e-9999.ebuild +++ b/media-video/rav1e/rav1e-9999.ebuild @@ -32,7 +32,3 @@ src_unpack() { cargo_live_src_unpack fi } - -src_install() { - cargo_src_install --path . -} diff --git a/sys-apps/bat/bat-0.12.0.ebuild b/sys-apps/bat/bat-0.12.0.ebuild index b64e6923594a..e48ae145f2d0 100644 --- a/sys-apps/bat/bat-0.12.0.ebuild +++ b/sys-apps/bat/bat-0.12.0.ebuild @@ -169,7 +169,7 @@ DOCS=( README.md doc/alternatives.md ) QA_FLAGS_IGNORED="/usr/bin/bat" src_install() { - cargo_src_install --path=. + cargo_src_install doman doc/bat.1 einstalldocs insinto /usr/share/fish/vendor_completions.d/ diff --git a/sys-apps/exa/exa-0.9.0.ebuild b/sys-apps/exa/exa-0.9.0.ebuild index 633657fe1c84..5ef9de3fb7b0 100644 --- a/sys-apps/exa/exa-0.9.0.ebuild +++ b/sys-apps/exa/exa-0.9.0.ebuild @@ -99,7 +99,7 @@ src_compile() { } src_install() { - cargo_src_install --path=./ $(usex git "" --no-default-features) + cargo_src_install $(usex git "" --no-default-features) newbashcomp contrib/completions.bash exa diff --git a/sys-apps/fd/fd-7.3.0-r1.ebuild b/sys-apps/fd/fd-7.3.0-r1.ebuild index 3afbc07ff760..66ffd10fadf6 100644 --- a/sys-apps/fd/fd-7.3.0-r1.ebuild +++ b/sys-apps/fd/fd-7.3.0-r1.ebuild @@ -86,7 +86,7 @@ src_compile() { } src_install() { - cargo_src_install --path=. + cargo_src_install newbashcomp "${T}"/shell_completions/fd.bash fd insinto /usr/share/zsh/site-functions diff --git a/sys-apps/lsd/lsd-0.14.0.ebuild b/sys-apps/lsd/lsd-0.14.0.ebuild index b7706acf02f5..e8451f706387 100644 --- a/sys-apps/lsd/lsd-0.14.0.ebuild +++ b/sys-apps/lsd/lsd-0.14.0.ebuild @@ -59,6 +59,6 @@ BDEPEND=">=virtual/rust-1.31.0" QA_FLAGS_IGNORED="/usr/bin/lsd" src_install() { - cargo_src_install --path . + cargo_src_install einstalldocs } diff --git a/sys-apps/lsd/lsd-0.15.1.ebuild b/sys-apps/lsd/lsd-0.15.1.ebuild index 25a04b987bfc..4eb55bcbe8f0 100644 --- a/sys-apps/lsd/lsd-0.15.1.ebuild +++ b/sys-apps/lsd/lsd-0.15.1.ebuild @@ -62,6 +62,6 @@ BDEPEND=">=virtual/rust-1.31.0" QA_FLAGS_IGNORED="/usr/bin/lsd" src_install() { - cargo_src_install --path . + cargo_src_install einstalldocs } diff --git a/sys-apps/lsd/lsd-0.16.0.ebuild b/sys-apps/lsd/lsd-0.16.0.ebuild index 9e3d88dadba3..4f51333bfcb8 100644 --- a/sys-apps/lsd/lsd-0.16.0.ebuild +++ b/sys-apps/lsd/lsd-0.16.0.ebuild @@ -74,6 +74,6 @@ BDEPEND=">=virtual/rust-1.31.0" QA_FLAGS_IGNORED="/usr/bin/lsd" src_install() { - cargo_src_install --path . + cargo_src_install einstalldocs } diff --git a/sys-apps/ripgrep/ripgrep-11.0.1.ebuild b/sys-apps/ripgrep/ripgrep-11.0.1.ebuild index 7c2dbd8ad9fd..bac0e66e2273 100644 --- a/sys-apps/ripgrep/ripgrep-11.0.1.ebuild +++ b/sys-apps/ripgrep/ripgrep-11.0.1.ebuild @@ -115,7 +115,7 @@ src_compile() { } src_install() { - cargo_src_install --path=. $(usex pcre "--features pcre2" "") + cargo_src_install $(usex pcre "--features pcre2" "") # hack to find/install generated files # stamp file can be present in multiple dirs if we build additional features diff --git a/sys-apps/ripgrep/ripgrep-11.0.2.ebuild b/sys-apps/ripgrep/ripgrep-11.0.2.ebuild index 3d20e3a68a98..fb7f5349baa8 100644 --- a/sys-apps/ripgrep/ripgrep-11.0.2.ebuild +++ b/sys-apps/ripgrep/ripgrep-11.0.2.ebuild @@ -99,7 +99,7 @@ src_compile() { } src_install() { - cargo_src_install --path=. $(usex pcre "--features pcre2" "") + cargo_src_install $(usex pcre "--features pcre2" "") # hack to find/install generated files # stamp file can be present in multiple dirs if we build additional features diff --git a/x11-terms/alacritty/alacritty-0.3.3-r1.ebuild b/x11-terms/alacritty/alacritty-0.3.3-r1.ebuild index 71741cd37be7..20c79816962b 100644 --- a/x11-terms/alacritty/alacritty-0.3.3-r1.ebuild +++ b/x11-terms/alacritty/alacritty-0.3.3-r1.ebuild @@ -320,8 +320,10 @@ QA_FLAGS_IGNORED="usr/bin/alacritty" S="${WORKDIR}/${PN}-${MY_PV}" +CARGO_INSTALL_PATH="alacritty" + src_install() { - cargo_src_install --path=alacritty + cargo_src_install newbashcomp extra/completions/alacritty.bash alacritty diff --git a/x11-terms/alacritty/alacritty-0.4.0.ebuild b/x11-terms/alacritty/alacritty-0.4.0.ebuild index 15df72e2bccb..6fdd26ebf946 100644 --- a/x11-terms/alacritty/alacritty-0.4.0.ebuild +++ b/x11-terms/alacritty/alacritty-0.4.0.ebuild @@ -335,6 +335,8 @@ QA_FLAGS_IGNORED="usr/bin/alacritty" S="${WORKDIR}/${PN}-${MY_PV}" +CARGO_INSTALL_PATH="alacritty" + src_unpack() { if [[ "${PV}" == *9999* ]]; then git-r3_src_unpack @@ -350,7 +352,7 @@ src_prepare() { } src_install() { - cargo_src_install --path=alacritty --offline + cargo_src_install --offline newbashcomp extra/completions/alacritty.bash alacritty diff --git a/x11-terms/alacritty/alacritty-9999.ebuild b/x11-terms/alacritty/alacritty-9999.ebuild index bf9813cb8fae..719e516f5db2 100644 --- a/x11-terms/alacritty/alacritty-9999.ebuild +++ b/x11-terms/alacritty/alacritty-9999.ebuild @@ -50,6 +50,8 @@ QA_FLAGS_IGNORED="usr/bin/alacritty" S="${WORKDIR}/${PN}-${MY_PV}" +CARGO_INSTALL_PATH="alacritty" + src_unpack() { if [[ "${PV}" == *9999* ]]; then git-r3_src_unpack @@ -60,7 +62,7 @@ src_unpack() { } src_install() { - cargo_src_install --path=alacritty --offline + cargo_src_install --offline newbashcomp extra/completions/alacritty.bash alacritty