commit:     1d77470d58e206aa88fb7b72473f4b90fd38d191
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Apr  8 01:23:50 2022 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Apr  8 04:58:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d77470d

dev-lang/rust-bin: add 1.60.0

Bug: https://bugs.gentoo.org/835800
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 dev-lang/rust-bin/Manifest               |  33 +++++
 dev-lang/rust-bin/rust-bin-1.60.0.ebuild | 219 +++++++++++++++++++++++++++++++
 2 files changed, 252 insertions(+)

diff --git a/dev-lang/rust-bin/Manifest b/dev-lang/rust-bin/Manifest
index 25210598e2b3..501c63091dfe 100644
--- a/dev-lang/rust-bin/Manifest
+++ b/dev-lang/rust-bin/Manifest
@@ -62,5 +62,38 @@ DIST rust-1.59.0-x86_64-unknown-linux-gnu.tar.xz 151858140 
BLAKE2B 80eda8c19361b
 DIST rust-1.59.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
cd4387ad25b7f000395e336cdc92916ee7260cbf98a397ce02514444c8d2b35c653012ae6a9f1d5598155c06db573e1fe1a3f0bde1693863855dc17c18b478f5
 SHA512 
0b6790f0aa531a8251e1a19e0adfdb16bfd39fcec40b83094c26b7169f833114cc8679e2955fcc5359b05cd67564827aa231c521f81d4c41d561e9ef44eea713
 DIST rust-1.59.0-x86_64-unknown-linux-musl.tar.xz 246630236 BLAKE2B 
c9fe24e92055b2e765a8d96181c7c14a0db329f98e006ea2ade285078cad64fa2ef3419d26f30339685cfbcee672bb5e263dd183c960aa0067a27a0b36fe6fbd
 SHA512 
40a711c015fa8eb07aaa11b0698f20886928230a8441cc7523572c7c2768a52557daf5c02bdf61430dcb9a912b8eeda499794af28f269b319ca7fef848ae4cdd
 DIST rust-1.59.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 
1a96c49754b8670d243d1ad43478d4df8b4f4997490fa9691e3947260d469c7dc9bab192a20fd2ee0592e15785fb059644404d77d716d86b54038d0a76feaf6e
 SHA512 
0c67f2be31fae00a318b5a6184c60f10f80ca5275a5d9dad4459d94aef2fe65624dd7789987d506b691666ac8f7357143fa6bb8207cd5b13b28692aa909a1636
+DIST rust-1.60.0-aarch64-unknown-linux-gnu.tar.xz 225778104 BLAKE2B 
fafd690b1d6b161ba12f2e885e8dacd672999e34523634a2dc198363b6d46c9a5df9628052d4c76fe9c179f0d2d21eed6c9986cbf1cad0d95f42ec89edd6bcb3
 SHA512 
0357abc2f0e3512cbb0b113a7e80e5475ecaaa18f4713d08c1923567ba7ee35cb286e0b62ef564f56b88b183d31462743d041bc733b86c91eccaea29c9bdd61f
+DIST rust-1.60.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
7ee4ca6c179fa41841b8da143582f3454073c62286043cc395611495149a097a48fd885f56ae3dd62220788cc4e235e0a2af9400797090e0e027f4133af275a4
 SHA512 
9059bf5cae423d0dcfaaed56f03a30c998962af3c0f84377bc3af9fed25afedb91f4dc2f40c51fa8d1360330c1a8fccba88b94f069500894fcd7b8ce7fc9b736
+DIST rust-1.60.0-aarch64-unknown-linux-musl.tar.xz 218828768 BLAKE2B 
b6cef5702c0bdc53cad81eb06b09213e90c1ecb89e2734b5bdbbf93969f809d5eec03f802cbaa15ddcd6b0a4a8f02b6027e232a13111a0002efac455ca42e8e7
 SHA512 
39de2073c1c393f4675c374b0bd7a75daa7c84e5635b9c50606da0ad7478e828120319a9fc79b534b88570a0408eb1745dbc0f7f4d15825e5f995e16752c5d10
+DIST rust-1.60.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 
655bb6cccc79034f83557b1336d6052523dd25420f9b54ca746946c259026a1e9dce8b5e84d6800dfbbc423dce3413d566de45c9f3424f24330d732f3702d2b5
 SHA512 
ce3131c15a31eb41b6905c3197bd3989a436ea503f9285146dc1c87c1e1f5bc6a606fb3a7ee52fe564bf8196d5eb71fd8325f63a36956d1a2b29d285ff84874f
+DIST rust-1.60.0-arm-unknown-linux-gnueabi.tar.xz 199199568 BLAKE2B 
9fbae45558e5b5ee6c0f025430e355ccf2c9bcf8584eb3ca763e5eccd19a9a89b5b466fbcfa0182810b2bdf764a8ece9277a7bf9b9ae1792e442b6930d769c76
 SHA512 
b14e1e6e3ca58840f2b44473ea7e20afe61f813c6bce7a380d97cf32d9e915a0e369ca1709b2d7207f38ccc4d19db8268412e4dc991cb23612989111677d9fac
+DIST rust-1.60.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 
c79602c7ebfd8789d5c4a8800462b62104f20bfbb9cd07a62ea02faa4721c291de0cd2e877ccaa586c83efd60daaeeb9bf1b6aa0d50c9e8cbbf1e1c76beb8f8b
 SHA512 
58ac1ceec97354aeb020bb8380c0950237052c84188259740335cac235556e7db620ac17861adb065adf4eb90f5dd67af64c7f5247fc5d965633a949eac41de2
+DIST rust-1.60.0-arm-unknown-linux-gnueabihf.tar.xz 199155728 BLAKE2B 
d7bb8b89acc6ae96e9dc88753e03d213456204f1e42e9142c3cf307e68c3fe9039271a87b95f2dd37255249e91239d28571b0eacfaee533c8be2f1f33ee0ed09
 SHA512 
8b4e8fc0824001973bb508341d10b81b5c9ca785e07be2bd9a9cd14a4337983a75dd0e224518adea717a6645a94a7af9c3a51f226acada05d98dc2ee925753c1
+DIST rust-1.60.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 
3976db6e470d120b17b782eb47e8b13d019891a9ae77d0c160ab00dad266a285e72426f4918e0918817243e77f5243a1d840190611d906a259de0592e85b1eae
 SHA512 
e363c8e0dfde0b044a3f7a3a7d9b0f589684019f4a7a81ad5d39ca40662c8b9350dffe26cd8e7f7df5b39b04cb543777e066b71b0b5da393bb2310c51720e3c9
+DIST rust-1.60.0-armv7-unknown-linux-gnueabihf.tar.xz 204846992 BLAKE2B 
1781fcc2f7e079c68230154523e69d4211aac4248a09e10ff05237f67c6d82db91aa3e933d057f68a9c2adbf71be0dd91a053442e0777862f597a7202909c62c
 SHA512 
6cc28ac4430acef8929ec9f9acfef8fa3f0c79758fdd612eb3d0e762986ae7722c3b92dd687be754453a86ecc253341efe2e517e41510bed53e539e79ad21ecf
+DIST rust-1.60.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 
e7adda090a966ad9a2a68b2f7ad3f1a22cee06a5ac02b5f949593e50eecc044dc13552a6299a9c0fb8383e839bb04a6ac16aecc4cc6735c2ffb91e3d244fd71d
 SHA512 
b1a471eaba9f9a4eeb066680b78f4b02cf9d0620b2bcf4e9f07112fb6100acad7f519e149a105fced5cb0e2a91b845d3d682af53ea135af9901dac973c4c5c7b
+DIST rust-1.60.0-i686-unknown-linux-gnu.tar.xz 217159392 BLAKE2B 
18321f1eeff6607eea9bc1f7de571062c3fac1a68bdfc694db8c504331119a86cf8c08f1e1ae32c855d37367bf92de70c9465404e51485d335c530dbadc90c66
 SHA512 
5a1e9f0d7f623af1c46884a23eb5c38927ab9a9b87c9b4f511aa727ee4bd77987358f6211f2a3c6743b01a9695f0823d443069d3020772a87c834141d73e3b05
+DIST rust-1.60.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
09068dbc9cec3164beb94d667bb359295f98578e2eb31e5fde1fafefa58831c2858dc45736aea3daaf6cf3f3620bfc40c0af3a246655618cbca2b733f73ee171
 SHA512 
d237bda70a0b297505d6dcf968330ac8622af77a53241de707d57f265d4762fcbf34fae329c02d2f7f18b97df843f78938f4413425d0d57183cd5bf59aae3e3d
+DIST rust-1.60.0-mips-unknown-linux-gnu.tar.xz 155895536 BLAKE2B 
87fcc3fb92762e3e1e4e29eeff0c556a07b9fb36cc275cd1e74e4411e89a82d1aaf1cda7859b32696b239091758cc54f0d763b14ee1d42898cc4aa3fb37dc6ee
 SHA512 
28e28f4cf077f93a21282756bf69c3ccae2f9e975145cb35b36bf28a3a0ffdafd1dd9c775816f20a2aec557551efc3b4a9c644cff06473fab440e65357aec1b4
+DIST rust-1.60.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
98d5e30917b86aa9bbdb2e0aaa98b19a946320f09331aa4194f1f1536148dc098aefb34646dfed7216d024db8d408901db24663e52414c1d618afc55bd12b97c
 SHA512 
b6e98fbda5d865b8766e62ab9d21bd8d0f1a0796748b12f59988fe66db26d0df3afbc8dbd5ef312224dc81778a799dca57cd05caf4e5f1560a8ff1eb4b3243b4
+DIST rust-1.60.0-mips64-unknown-linux-gnuabi64.tar.xz 161602984 BLAKE2B 
dd2cd07e800b8c53fc6f0fd1d932c58c1d23776a35ac7c10df7b79d8e3c3f401bfcfd87d2740053fcf6b30e314d248ad39f1084ec35008d58676c0c1ecffd323
 SHA512 
2074e4823d1c4f8e2730eca07f8f5d120a1212c67c374c9aa2a167e517779709ebe6b6c33113ac6048bd2ff28c63f6086a0c458830c6cce2e27a1e1ea0e7c9fb
+DIST rust-1.60.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B 
75d23db39da3fda6ac1cabbab84904d9f9a7c0b3c58081f8cfd6952a6df012aba1788a5008fba6156a410b28fd9aec8eb946e24a6217d35023579b8ceb362b63
 SHA512 
eeca039bc3a7610d7ef8a786fc280c18314aa5c5f83b2647fd5130d89b62eeef5e3bc73d140999c0e8b4b2af2efaed27c4dcb20b21a43ccec49c79c76573a73c
+DIST rust-1.60.0-mipsel-unknown-linux-gnu.tar.xz 160546356 BLAKE2B 
1e56b520727f7b6f1e2158db55638b4b8c3ce646ecfcc13a9c511defcfe3aca056ac002ea7e2d5c673594cc9b1611667b1d243766c8b53beefbee7e7f093cba4
 SHA512 
2c48d13fdaa1071f65796edc8193d1fb9be1a5bfb3e349a9bf5f518e02b9d8a0042c0c39ae159e914368f7150ac67b7be9fd115ef5e878bf06651a3f6760e4f5
+DIST rust-1.60.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
2297dd2504735c78fcd6c7e69b1884215db06ae1fbcd31fc8b07586eba10a7f861ba16209be608e3302b3e48f9eaa748d2990fbc4cc21720b705ff67e4dad533
 SHA512 
2972c5ea07d7336c554a232fa7adef474fcdf1b5da8f584e200c303210d248d5acc963646e4fd7c3085fe74b96c6ed4d75607d6fe134247b7932a615b1bb15c9
+DIST rust-1.60.0-powerpc-unknown-linux-gnu.tar.xz 179198588 BLAKE2B 
ffb68761fce839412eb7147c44732f275e27c0e67894b41128936f1ef05e19c9120b3decab6fdb16924688799f035d0c261500651b6eacc415bf65759f246e53
 SHA512 
0233c9381ff27642fe76ad856af9f51257b25c6a428255dc9c1c9c9993fcc943f551244f07838541d63a99c0481d95fad3749921dbc6766378d313f49e7e1dc8
+DIST rust-1.60.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
c35cb2d813e578464af34f5a3597d7a88009041c04ca32c57f0daf5953b27ee5c7ffde98da6d6ae85dda07559391c0bcbdb5c1c92d41159f8fa79d7a8d3c2345
 SHA512 
9fba91f8f84bd677ce44dbb3206e87308ac7337115b312904cb199caa3ebbf4d1efc53eb27da38829f5b41b6b6078309386be7f6dd8ee33f6f67e7aecd077c1f
+DIST rust-1.60.0-powerpc64-unknown-linux-gnu.tar.xz 185903604 BLAKE2B 
bea00626f9278c2f67ddd44dca6a7fd4931f1c3a5b76eb70a2b98717425a7f8439efc3de19d555ceba5b83e0262de77e043771e3c31cbc2a0e09264a5b607c7c
 SHA512 
002f8ea3d25ca9c57c66fd027a903cafdec199ab8d7f63c68b1d7b8bb9607b2eb69ce98d322ebcb8476bcb8e28d292f285925b7a2f2ffe23fc45b9a626420675
+DIST rust-1.60.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
419738f90082f4ff68f6b01c0d6ef467fb856dea7320cc70b07ce569adb712673e09d632156927603e9577d6c88d0b2409c9b9e5edce0a2ad60f17b7489d346c
 SHA512 
b060a7909ae72d7f92e0a99362c38be20ea4d2e2a68c3e502d1fcf1f667a8bf80d117e67c8ae3922dda35214b0cd091b53085603f89952c4647fced34c9d52fa
+DIST rust-1.60.0-powerpc64le-unknown-linux-gnu.tar.xz 195616532 BLAKE2B 
4f69ee1719874789b309f4ff098e96848e496acc1a5c126296ecaa3b021b5fca6c7b2995ea121482d7a282c86a988c0f28275f7474f7a63e5877819e3c8a57b2
 SHA512 
6259fa02a62008c63874405be80f3ab7b3d8564b71d18297857cf80db417792a3215fd85e53b297823bc9dc8968d5e035a1b959671a039391616ed62bd48cbd9
+DIST rust-1.60.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
27461458d3fc0c65d25ed310269e52acb1d332411af32922a418dc32c9998653411e68daae8dee81f595b52a0176f517cb2d57ca7c438cd1cce91ad44c376b3e
 SHA512 
6edc6ced24d85faf12000cad3d21b8da93635f88c1e6c8ab0614313f04ca466489f84e6acc3f0d35e42f9430499123cddbd48c474554fc408d50df17714a65fa
+DIST rust-1.60.0-riscv64gc-unknown-linux-gnu.tar.xz 188464956 BLAKE2B 
ea9fb3e59ad558b0a704a84d54f555717d4f158b1d15e3577e6411becdebb86144cd78500521fdeacf38e4301ec86db088822c19a608a8808b9a7c2172befc41
 SHA512 
41c12e2a0a2a4f63d8ef321e30ded7cd9fedf732699e73e7ada32590c13ead6805cee7b089858eb7ce340ad6e55d364eb700c35efbd640b126b811f27ab6e395
+DIST rust-1.60.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
9dca4b3ba2949e04c94ad57e14f576bb34e1c9966c9954ebee7549a5fa6a6fba57000138128bf12f93a0cec59715cd32dde7242c363c3de265e7f95ad8fd44b9
 SHA512 
2601feb20c211ae55fd051225d1b1c209e40c4d23c4dc79b5d85ca0b21de833fb8432fcd45fefc1484ca5987660e6625d1a6c69cdd4d05b2f84212bca1f82611
+DIST rust-1.60.0-s390x-unknown-linux-gnu.tar.xz 187797152 BLAKE2B 
5a86b4bce61d65d29769b652d030f936adf669986aba91f1cf09edcc346942acc2bfa26bd568635889e89a1059eea988eef9ad300469b416eaf87e8d97b2cd15
 SHA512 
6be266c6191f35c1525618e986e1725b0e8b306990deeef5cda7aff4f5999680e84597a00d4c2c38099131604f436529420ebf4515501df1328dbe3118637ae4
+DIST rust-1.60.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
5460b62ec3b461ce4d92b57debfc82329ec19ce5c38ce2a72e9700e9d4da767134738148d12fbeb0d6ef74f2dbfbba132571c9a8925b007d19432eecbf57b381
 SHA512 
1c285460c49be405361ef5ed2dbf9f720e7a9fce4d34b16aa5b2f29afa4fcc399f252b48cb4cf05e95a57869455a31ab5237deefe4e900c03ad3dd5887e70ea9
+DIST rust-1.60.0-x86_64-unknown-linux-gnu.tar.xz 154271340 BLAKE2B 
7ee48c165e6ec7a6cbc49c46bc4a7eee735988808866024de87eec2312427d939158e03e443cc537034110e640c19fc920458f8259ee022f3aa9eaa617207d55
 SHA512 
d27f1d78b2535f9acbd8af079b853f0590725c9f5db31ac074685f2722f0270a9f8d417abc6af8be413598315c568333e3011ea07eef9c47a5c4e328a39aee47
+DIST rust-1.60.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
7454407a16e2b6c89226252c7e706086c9bb8016183df1180c54e88ec0d6622a0829d4acda959a093702bb1d95d4f2678976ced69fcc219afb42ab631e459d40
 SHA512 
eb3550e27e361860075a22d9b4821c6d078d7e4c82ad688a64e813adbce9922b9ab2dc64d1fd4d74d20be9af122ff05819d521677a43ad1c1092bd498d325a8a
+DIST rust-1.60.0-x86_64-unknown-linux-musl.tar.xz 258420992 BLAKE2B 
6b446c06fd8d511910110eccfd55c1116f3468ffe87274d6b90c7a2a1ccd298471f62d1bfb807ddab2f66fbac58995e903414455c76fe2b14c9659f00e8413a0
 SHA512 
6f5a53968f44bf7be563d32eaddea439d8f388858db3d3b58a89b22cc2252e195b56b0e8895f4254c40274035e221657504958c8f1e331befca012d480118f3b
+DIST rust-1.60.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 
680e7267a188a5286938d9c3284968121a7783cba196bf863affd6b927344e1a88cf7b97016d53c74560179439fc7fe9dd700a295c7c00b139472320323861cb
 SHA512 
071efcfad0074a03de454835c512e98b466662b27bef2fb31def0bb82531b4048eba59a529621fda515800e19c4f3c62a33a364ecca8cecbaa09fae842b894b6
 DIST rust-src-1.58.1.tar.xz 2827736 BLAKE2B 
7ed64fa6688c230eb53bc141ccfb14b9f84114f344ee6aef26c78bea7700a924ae9f2d57f5f81eec514f9dd06cfce899c5fb7e0bb23ccf7f5fdfc0ccb940130d
 SHA512 
cba8a85edde1e6587674274c97c526c0ccb2c4d81a5f23f8f826ee74e903bb7e8ef8d29f9c36559148fcaa1cc98cc3f63f6b5265172c4fe9af8ffee026e48690
 DIST rust-src-1.59.0.tar.xz 2861676 BLAKE2B 
83c7c9f222cdc5de787243154aec1b62914badbd65c8defd7c0e48dad9018806d7befb0e419204c5a782d83e386609071c11a6e445df80ab593917b58f7712e5
 SHA512 
006cb2b29e0db69f4f241a6b44b1491f840503d953919722da5924eba4fbc13d09f8f20d35614e4069bc745facecfb20ef771ddc95560c94b5745b66047c5a0e
+DIST rust-src-1.60.0.tar.xz 2898184 BLAKE2B 
5810f14110398bc41342ec620a77da34c805b8c2bfb6c45c869c8d41a464b83825936a596f286c9c3f69a7453afd2542eb2971b768c923afdd24444a62359061
 SHA512 
42a45093bdcfe6ca5fde7701cd17e15438c8f064ac87c5606527b2196258a9285dbd195137ad41c43d77afade34e30061ad36ce58db783fa61037ec146f0e501

diff --git a/dev-lang/rust-bin/rust-bin-1.60.0.ebuild 
b/dev-lang/rust-bin/rust-bin-1.60.0.ebuild
new file mode 100644
index 000000000000..d16a36720206
--- /dev/null
+++ b/dev-lang/rust-bin/rust-bin-1.60.0.ebuild
@@ -0,0 +1,219 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib prefix rust-toolchain toolchain-funcs verify-sig 
multilib-minimal
+
+MY_P="rust-${PV}"
+# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep 
"xz_url.*rust-src"
+MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2022-04-07/rust-src-${PV}.tar.xz"
+
+DESCRIPTION="Systems programming language from Mozilla"
+HOMEPAGE="https://www.rust-lang.org/";
+SRC_URI="$(rust_all_arch_uris ${MY_P})
+       rust-src? ( ${MY_SRC_URI} )
+"
+
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
+SLOT="stable"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
+IUSE="clippy cpu_flags_x86_sse2 doc prefix rls rust-src rustfmt"
+
+DEPEND=""
+
+RDEPEND="
+       >=app-eselect/eselect-rust-20190311
+       sys-apps/lsb-release
+"
+
+BDEPEND="
+       prefix? ( dev-util/patchelf )
+       verify-sig? ( sec-keys/openpgp-keys-rust )
+"
+
+REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
+QA_PREBUILT="
+       opt/${P}/bin/.*
+       opt/${P}/lib/.*.so
+       opt/${P}/libexec/.*
+       opt/${P}/lib/rustlib/.*/bin/.*
+       opt/${P}/lib/rustlib/.*/lib/.*
+"
+
+# An rmeta file is custom binary format that contains the metadata for the 
crate.
+# rmeta files do not support linking, since they do not contain compiled 
object files.
+# so we can safely silence the warning for this QA check.
+QA_EXECSTACK="opt/${P}/lib/rustlib/*/lib*.rlib:lib.rmeta"
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/rust.asc"
+
+pkg_pretend() {
+       if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then
+               die "${CHOST} is not supported by upstream Rust. You must use a 
hard float version."
+       fi
+}
+
+src_unpack() {
+       # sadly rust-src tarball does not have corresponding .asc file
+       # so do partial verification
+       if use verify-sig; then
+               for f in ${A}; do
+                       if [[ -f ${DISTDIR}/${f}.asc ]]; then
+                               verify-sig_verify_detached "${DISTDIR}/${f}" 
"${DISTDIR}/${f}.asc"
+                       fi
+               done
+       fi
+
+       default_src_unpack
+
+       mv "${WORKDIR}/${MY_P}-$(rust_abi)" "${S}" || die
+}
+
+patchelf_for_bin() {
+       local filetype=$(file -b ${1})
+       if [[ ${filetype} == *ELF*interpreter* ]]; then
+               einfo "${1}'s interpreter changed"
+               patchelf ${1} --set-interpreter ${2} || die
+       elif [[ ${filetype} == *script* ]]; then
+               hprefixify ${1}
+       fi
+}
+
+multilib_src_install() {
+       if multilib_is_native_abi; then
+
+       # start native abi install
+       pushd "${S}" >/dev/null || die
+       local analysis std
+       analysis="$(grep 'analysis' ./components)"
+       std="$(grep 'std' ./components)"
+       local components="rustc,cargo,${std}"
+       use doc && components="${components},rust-docs"
+       use clippy && components="${components},clippy-preview"
+       use rls && components="${components},rls-preview,${analysis}"
+       use rustfmt && components="${components},rustfmt-preview"
+       # Rust component 'rust-src' is extracted from separate archive
+       if use rust-src; then
+               einfo "Combining rust and rust-src installers"
+               mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die
+               echo rust-src >> ./components || die
+               components="${components},rust-src"
+       fi
+       ./install.sh \
+               --components="${components}" \
+               --disable-verify \
+               --prefix="${ED}/opt/${P}" \
+               --mandir="${ED}/opt/${P}/man" \
+               --disable-ldconfig \
+               || die
+
+       if use prefix; then
+               local interpreter=$(patchelf --print-interpreter 
${EPREFIX}/bin/bash)
+               ebegin "Changing interpreter to ${interpreter} for Gentoo 
prefix at ${ED}/opt/${P}/bin"
+               find "${ED}/opt/${P}/bin" -type f -print0 | \
+                       while IFS=  read -r -d '' filename; do
+                               patchelf_for_bin ${filename} ${interpreter} \; 
|| die
+                       done
+               eend $?
+       fi
+
+       local symlinks=(
+               cargo
+               rustc
+               rustdoc
+               rust-gdb
+               rust-gdbgui
+               rust-lldb
+       )
+
+       use clippy && symlinks+=( clippy-driver cargo-clippy )
+       use rls && symlinks+=( rls )
+       use rustfmt && symlinks+=( rustfmt cargo-fmt )
+
+       einfo "installing eselect-rust symlinks and paths"
+       local i
+       for i in "${symlinks[@]}"; do
+               # we need realpath on /usr/bin/* symlink return 
version-appended binary path.
+               # so /usr/bin/rustc should point to 
/opt/rust-bin-<ver>/bin/rustc-<ver>
+               local ver_i="${i}-bin-${PV}"
+               ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}"
+               dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}"
+       done
+
+       # symlinks to switch components to active rust in eselect
+       dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}"
+       dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}"
+       dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}"
+       dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}"
+
+       # musl logic can be improved a bit, but fine as is for now
+       cat <<-_EOF_ > "${T}/50${P}"
+       LDPATH="${EPREFIX}/usr/lib/rust/lib"
+       MANPATH="${EPREFIX}/usr/lib/rust/man"
+       $(use amd64 && usex elibc_musl 
'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C 
target-feature=-crt-static"' '')
+       $(use arm64 && usex elibc_musl 
'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C 
target-feature=-crt-static"' '')
+       _EOF_
+       doenvd "${T}/50${P}"
+
+       # note: eselect-rust adds EROOT to all paths below
+       cat <<-_EOF_ > "${T}/provider-${P}"
+       /usr/bin/cargo
+       /usr/bin/rustdoc
+       /usr/bin/rust-gdb
+       /usr/bin/rust-gdbgui
+       /usr/bin/rust-lldb
+       /usr/lib/rustlib
+       /usr/lib/rust/lib
+       /usr/lib/rust/man
+       /usr/share/doc/rust
+       _EOF_
+
+       if use clippy; then
+               echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
+               echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
+       fi
+       if use rls; then
+               echo /usr/bin/rls >> "${T}/provider-${P}"
+       fi
+       if use rustfmt; then
+               echo /usr/bin/rustfmt >> "${T}/provider-${P}"
+               echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
+       fi
+
+       insinto /etc/env.d/rust
+       doins "${T}/provider-${P}"
+       popd >/dev/null || die
+       #end native abi install
+
+       else
+               local rust_target
+               rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))"
+               dodir "/opt/${P}/lib/rustlib"
+               cp -vr 
"${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\
+                       "${ED}/opt/${P}/lib/rustlib" || die
+       fi
+
+       # BUG: installs x86_64 binary on other arches
+       rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die
+}
+
+pkg_postinst() {
+       eselect rust update
+
+       elog "Rust installs a helper script for calling GDB now,"
+       elog "for your convenience it is installed under 
/usr/bin/rust-gdb-bin-${PV}."
+
+       if has_version app-editors/emacs; then
+               elog "install app-emacs/rust-mode to get emacs support for 
rust."
+       fi
+
+       if has_version app-editors/gvim || has_version app-editors/vim; then
+               elog "install app-vim/rust-vim to get vim support for rust."
+       fi
+}
+
+pkg_postrm() {
+       eselect rust cleanup
+}

Reply via email to