eclass/cargo.eclass: specify --path . to install
authorDoug Goldstein <cardoe@gentoo.org>
Mon, 23 Dec 2019 03:30:33 +0000 (21:30 -0600)
committerGeorgy Yakovlev <gyakovlev@gentoo.org>
Fri, 27 Dec 2019 01:59:29 +0000 (17:59 -0800)
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 <cardoe@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/14097
Tested-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
35 files changed:
app-crypt/nitrocli/nitrocli-0.2.4.ebuild
app-crypt/nitrocli/nitrocli-0.3.0.ebuild
app-misc/cargo-license/cargo-license-0.3.0.ebuild
app-misc/rpick/rpick-0.4.0.ebuild
app-misc/rpick/rpick-0.5.0.ebuild
app-misc/skim/skim-0.5.4.ebuild
app-misc/skim/skim-0.5.5.ebuild
app-misc/skim/skim-0.6.4.ebuild
app-misc/skim/skim-0.6.6.ebuild
app-misc/skim/skim-0.6.7.ebuild
app-misc/skim/skim-0.6.8.ebuild
app-shells/mcfly/mcfly-0.3.4.ebuild
app-text/fblog/fblog-1.3.1.ebuild
dev-util/cargo-tree/cargo-tree-0.23.0.ebuild
dev-util/cargo-tree/cargo-tree-0.24.0.ebuild
dev-util/cargo-tree/cargo-tree-0.25.0.ebuild
dev-util/cargo-tree/cargo-tree-0.26.0.ebuild
dev-util/cargo-tree/cargo-tree-0.27.0.ebuild
dev-util/sccache/sccache-0.2.10.ebuild
dev-util/sccache/sccache-0.2.8-r2.ebuild
dev-util/sccache/sccache-0.2.9.ebuild
dev-util/wasmer/wasmer-0.11.0.ebuild
eclass/cargo.eclass
media-video/rav1e/rav1e-9999.ebuild
sys-apps/bat/bat-0.12.0.ebuild
sys-apps/exa/exa-0.9.0.ebuild
sys-apps/fd/fd-7.3.0-r1.ebuild
sys-apps/lsd/lsd-0.14.0.ebuild
sys-apps/lsd/lsd-0.15.1.ebuild
sys-apps/lsd/lsd-0.16.0.ebuild
sys-apps/ripgrep/ripgrep-11.0.1.ebuild
sys-apps/ripgrep/ripgrep-11.0.2.ebuild
x11-terms/alacritty/alacritty-0.3.3-r1.ebuild
x11-terms/alacritty/alacritty-0.4.0.ebuild
x11-terms/alacritty/alacritty-9999.ebuild

index ff6f4c8d139917eb23dba1fd91991cee0352e315..8003f3ae49a4d927eb9b622ce4bc9f39a7680e14 100644 (file)
@@ -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"
index 7f040b5669e2dc4f32e30f5d87bb23ea0ba72b2a..a39e5325f965f6c20d3db7e4107af3833b2393b4 100644 (file)
@@ -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"
index dce7c3b9fee104c3a653f4eec6e588341fbb19ec..b159a850681cfa2375c1e9e49c258772d390b6ab 100644 (file)
@@ -69,6 +69,6 @@ KEYWORDS="~amd64 ~x86"
 QA_FLAGS_IGNORED="/usr/bin/cargo-license"
 
 src_install() {
-       cargo_src_install --path=.
+       cargo_src_install
        einstalldocs
 }
index 70cd73d6a23b94371958b3fd7157c817ab165188..4f9ccd1a476e056d70edeb9e59664b7382e70d0e 100644 (file)
@@ -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
 }
index c11bb5b083d00b8df03fbe8e0a8df1f251a5c7c5..eb0b0d6af035ccff871ff0a666c6f92f7f4a2edd 100644 (file)
@@ -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
 }
index ea4eeca24d4607661e17739bbc7ddbecc2cb81c1..a5f5292682dbb9c90d46e96859b270820c9a48c0 100644 (file)
@@ -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
index 37e18dab525f381527782386c70a46085dd2adba..3c47ec961a96e19dee7709e72f4f2e3f946bf71a 100644 (file)
@@ -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
index 7eab30978e945cf4d0ce32bfb65c8e5b22f3ca2c..8c683ced2c757b627faef94756deb8c34315f74e 100644 (file)
@@ -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/*
 
index 406e8b4abca634d09f2578468da93813936a279e..ae934bd00fd6841d45e88ffa21e0908acc040687 100644 (file)
@@ -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/*
 
index cc50f91bb4d335c18e531d6cf566534e74cbc560..d52d62ad9edada9c944ad9bdd7944e0dd5441e21 100644 (file)
@@ -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/*
 
index 0290b225d1de26f77b6f7f080e699236c9e0f963..2ce7a1d1d13d9e5cbd3e162c16e41255b50df1a0 100644 (file)
@@ -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/*
 
index 1ce9fc5247aeeb5a3df1dbf47788513187f371be..282ad8132c064d4d7f9b919f8aa0cfb1f01f38bb 100644 (file)
@@ -76,7 +76,7 @@ DEPEND=""
 RDEPEND=""
 
 src_install() {
-       cargo_src_install --path=.
+       cargo_src_install
 
        insinto "/usr/share/${PN}"
        doins "${PN}.bash"
index f4b44651c603cebdb43179a17c3f82fdae8dc010..c7194a216f997b8b095f3df3f5c21daacf686369 100644 (file)
@@ -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
 }
index 360f71e835a7850d0981d4e330c719f0987b541b..52eba65bc4912bdcb12c2ad239df5e38902668db 100644 (file)
@@ -184,6 +184,6 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 
 src_install(){
-       cargo_src_install --path=.
+       cargo_src_install
        einstalldocs
 }
index ac198d100457de60af911c439f70f8ab9aa33951..131d1816df0a7a4ae59cb5ec08651df96cb352c1 100644 (file)
@@ -176,6 +176,6 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 
 src_install(){
-       cargo_src_install --path=.
+       cargo_src_install
        einstalldocs
 }
index cb4b4eb835f93514e7445fb4dd3851d7d0dde8ea..c291745eb4736aeb45350d4e4da78dba3746d54f 100644 (file)
@@ -177,6 +177,6 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 
 src_install(){
-       cargo_src_install --path=.
+       cargo_src_install
        einstalldocs
 }
index 6e53a2e0be2103b2d627af7215e30bb2d9a4a3f0..94af6ea62fc4367dec4e4979d2407e79c78fd45f 100644 (file)
@@ -181,6 +181,6 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 
 src_install(){
-       cargo_src_install --path=.
+       cargo_src_install
        einstalldocs
 }
index e0917ba37b57366926c2594480cb3418679c270d..cdcc8337e70c8f9b5e8b7d7e9be1f5877f75e084 100644 (file)
@@ -183,6 +183,6 @@ DEPEND="${RDEPEND}
 "
 
 src_install(){
-       cargo_src_install --path=.
+       cargo_src_install
        einstalldocs
 }
index 09322dc521cc30a3475d7d2d3c89ca05460078ec..79d25139c158d07bdcf2b1897479f203d79b12eb 100644 (file)
@@ -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
 
index 21a6f2c2688f3dec172ab23a43165e0972f92b85..3cec993ae5e8e59b3163edb98fb5fae96a3101f0 100644 (file)
@@ -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
 
index d1941557a46d419ecbee8df18e2b1538b041f745..9995856c36289a378fb2ec17e963bef265c5ad98 100644 (file)
@@ -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
 
index fbef79ddf28a3b08642ecbc1cd93499a06af6481..336e379622d8369bae3d622b752534223b1c117b 100644 (file)
@@ -191,6 +191,6 @@ src_prepare() {
 }
 
 src_install() {
-       cargo_src_install --path=.
+       cargo_src_install
        einstalldocs
 }
index 13dd5c355fb3f19fb6031ec1873b89bc24175ba0..fb759f95903f2144c454d2ad6dbccf61afe68ffa 100644 (file)
@@ -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"
 
index 0136a727b3a04e50190b0d0afdef1c2dfbb571e5..131796f9e62c0525f2ac203f13c70adbdcd1f51e 100644 (file)
@@ -32,7 +32,3 @@ src_unpack() {
                cargo_live_src_unpack
        fi
 }
-
-src_install() {
-       cargo_src_install --path .
-}
index b64e6923594a00b3643870c93ff93c6c1e707d70..e48ae145f2d076964fccf0966197a6719fdac2d2 100644 (file)
@@ -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/
index 633657fe1c840f132bbadc5875917e6e32b9f95c..5ef9de3fb7b0ec4406817a1df890d45c73ee90cb 100644 (file)
@@ -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
 
index 3afbc07ff76065c8a72fc4c3c6996befcc82b46a..66ffd10fadf6473ff270e02ef59beb9835f4c421 100644 (file)
@@ -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
index b7706acf02f5ddb0b3981f76555806a6d7bcbaae..e8451f7063876314aa20d6de7e9673a583429ff9 100644 (file)
@@ -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
 }
index 25a04b987bfcd4292df46f4c00fbba6d70556427..4eb55bcbe8f03e3b5a7db78246a957233c3b7e06 100644 (file)
@@ -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
 }
index 9e3d88dadba3fc1002db6019d95cc79e2ba109a5..4f51333bfcb85106328811263d2aadec7530fe1b 100644 (file)
@@ -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
 }
index 7c2dbd8ad9fd58b55f01a391b4df18cb2c29f727..bac0e66e2273172f5a04b0528641c121513b1f28 100644 (file)
@@ -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
index 3d20e3a68a98ce6d31165e1c4afc8765cb45469a..fb7f5349baa8763827035d42aa81ed96b5b0d098 100644 (file)
@@ -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
index 71741cd37be7b4c4c4fe26435e104d7c3e35aed4..20c79816962b71cc55664f5284f764ab19e566b6 100644 (file)
@@ -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
 
index 15df72e2bccb224bbf01d7db54e3978c867252a6..6fdd26ebf94629e9941199a75e0a4d94b4099b85 100644 (file)
@@ -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
 
index bf9813cb8faec6977117b14b74cf9017c8d915c2..719e516f5db28cf9a2b46a1637d678882e8ffae6 100644 (file)
@@ -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