From 43c2a717e665e94232f46379013706959207c51a Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sun, 22 Dec 2019 21:30:33 -0600 Subject: [PATCH] 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 --- app-crypt/nitrocli/nitrocli-0.2.4.ebuild | 2 +- app-crypt/nitrocli/nitrocli-0.3.0.ebuild | 2 +- app-misc/cargo-license/cargo-license-0.3.0.ebuild | 2 +- app-misc/rpick/rpick-0.4.0.ebuild | 2 +- app-misc/rpick/rpick-0.5.0.ebuild | 2 +- app-misc/skim/skim-0.5.4.ebuild | 2 +- app-misc/skim/skim-0.5.5.ebuild | 2 +- app-misc/skim/skim-0.6.4.ebuild | 2 +- app-misc/skim/skim-0.6.6.ebuild | 2 +- app-misc/skim/skim-0.6.7.ebuild | 2 +- app-misc/skim/skim-0.6.8.ebuild | 2 +- app-shells/mcfly/mcfly-0.3.4.ebuild | 2 +- app-text/fblog/fblog-1.3.1.ebuild | 2 +- dev-util/cargo-tree/cargo-tree-0.23.0.ebuild | 2 +- dev-util/cargo-tree/cargo-tree-0.24.0.ebuild | 2 +- dev-util/cargo-tree/cargo-tree-0.25.0.ebuild | 2 +- dev-util/cargo-tree/cargo-tree-0.26.0.ebuild | 2 +- dev-util/cargo-tree/cargo-tree-0.27.0.ebuild | 2 +- dev-util/sccache/sccache-0.2.10.ebuild | 2 +- dev-util/sccache/sccache-0.2.8-r2.ebuild | 2 +- dev-util/sccache/sccache-0.2.9.ebuild | 2 +- dev-util/wasmer/wasmer-0.11.0.ebuild | 2 +- eclass/cargo.eclass | 8 +++++++- media-video/rav1e/rav1e-9999.ebuild | 4 ---- sys-apps/bat/bat-0.12.0.ebuild | 2 +- sys-apps/exa/exa-0.9.0.ebuild | 2 +- sys-apps/fd/fd-7.3.0-r1.ebuild | 2 +- sys-apps/lsd/lsd-0.14.0.ebuild | 2 +- sys-apps/lsd/lsd-0.15.1.ebuild | 2 +- sys-apps/lsd/lsd-0.16.0.ebuild | 2 +- sys-apps/ripgrep/ripgrep-11.0.1.ebuild | 2 +- sys-apps/ripgrep/ripgrep-11.0.2.ebuild | 2 +- x11-terms/alacritty/alacritty-0.3.3-r1.ebuild | 4 +++- x11-terms/alacritty/alacritty-0.4.0.ebuild | 4 +++- x11-terms/alacritty/alacritty-9999.ebuild | 4 +++- 35 files changed, 46 insertions(+), 38 deletions(-) diff --git a/app-crypt/nitrocli/nitrocli-0.2.4.ebuild b/app-crypt/nitrocli/nitrocli-0.2.4.ebuild index ff6f4c8d13991..8003f3ae49a4d 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 7f040b5669e2d..a39e5325f965f 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 dce7c3b9fee10..b159a850681cf 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 70cd73d6a23b9..4f9ccd1a476e0 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 c11bb5b083d00..eb0b0d6af035c 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 ea4eeca24d460..a5f5292682dbb 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 37e18dab525f3..3c47ec961a96e 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 7eab30978e945..8c683ced2c757 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 406e8b4abca63..ae934bd00fd68 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 cc50f91bb4d33..d52d62ad9edad 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 0290b225d1de2..2ce7a1d1d13d9 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 1ce9fc5247aee..282ad8132c064 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 f4b44651c603c..c7194a216f997 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 360f71e835a78..52eba65bc4912 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 ac198d100457d..131d1816df0a7 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 cb4b4eb835f93..c291745eb4736 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 6e53a2e0be210..94af6ea62fc43 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 e0917ba37b573..cdcc8337e70c8 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 09322dc521cc3..79d25139c158d 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 21a6f2c2688f3..3cec993ae5e8e 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 d1941557a46d4..9995856c36289 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 fbef79ddf28a3..336e379622d83 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 13dd5c355fb3f..fb759f95903f2 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 0136a727b3a04..131796f9e62c0 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 b64e6923594a0..e48ae145f2d07 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 633657fe1c840..5ef9de3fb7b0e 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 3afbc07ff7606..66ffd10fadf64 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 b7706acf02f5d..e8451f7063876 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 25a04b987bfcd..4eb55bcbe8f03 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 9e3d88dadba3f..4f51333bfcb85 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 7c2dbd8ad9fd5..bac0e66e22731 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 3d20e3a68a98c..fb7f5349baa87 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 71741cd37be7b..20c79816962b7 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 15df72e2bccb2..6fdd26ebf9462 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 bf9813cb8faec..719e516f5db28 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