Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/
Date: Fri, 18 Jun 2021 00:44:18
Message-Id: 1623976993.f319b17f45358d91c9e4219e9751251c5459f785.gyakovlev@gentoo
1 commit: f319b17f45358d91c9e4219e9751251c5459f785
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 17 20:21:42 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 18 00:43:13 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f319b17f
7
8 dev-lang/rust: add 1.53.0
9
10 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
11
12 dev-lang/rust/Manifest | 34 ++
13 dev-lang/rust/rust-1.53.0.ebuild | 673 +++++++++++++++++++++++++++++++++++++++
14 2 files changed, 707 insertions(+)
15
16 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
17 index 21031f3704f..44d8e23c432 100644
18 --- a/dev-lang/rust/Manifest
19 +++ b/dev-lang/rust/Manifest
20 @@ -62,7 +62,41 @@ DIST rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz 147543532 BLAKE2B 44ac97f6b650e
21 DIST rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 033c41c165cf50a63479d1352a33abe94a63d9730f02016d09bf2e8a8804587d4fc802c047e7417e0befca2d5df5ca8c79a714ec1c1fb389240b6e8931fb9e9b SHA512 e314a7db9aaff445b67f828bf9a98705032071928e2102524c0c720a3b8feb292b8c6766838b92da2d213e93bf53fb780fc856b0370238fbb7e20431d2de6d5c
22 DIST rust-1.51.0-x86_64-unknown-linux-musl.tar.xz 233773068 BLAKE2B cc9de90b967cc81005ce5c897d3fd6dc4e3880be96ac82c41382d19a8aca0244845830db7a33eaef85b6bdef0c00ae02c0390db932fa49f76e362af2c68edb56 SHA512 d8df3c4c3de435629986e21bc6b31edfb73cba394e76cf87ee98d2936f73aef60c988d020da7ec1188f6448eacad9d5aefed073f4f88ffa2eaac54ac7e3cb3f7
23 DIST rust-1.51.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 2e2c20fe99b33e5361b1945f54b77d5e8acad34d1be9cadfd1971b2882e38bc4403a5a67769a74fdd7ab21434784f03084780ef827e26318168bf5d531f9e9bd SHA512 42392e8283a28d58d4874dbf97caa0377f27c6599c272c715fcdefee48551004d491f0509f2894f5696a2820f11dbb333e3bf878cbdf24b0c58add4a493acecc
24 +DIST rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz 215549836 BLAKE2B d4179cc67772cd6b92085d68f4bb9de006fca7d8470a56766ac5d94a0379ae675d18c5275ec2ed1eab71274ce4f416a77f3ce74d849a1d4118b5a7ddec205a3c SHA512 7a26e14be6b27c7084c7c85b312341ab991c2df91ea53128f14707a4c725dd03ba7df30b9e9fcef39a509ab4f5d5feb028b99d6d9ffcc059996ed29b83eb90b9
25 +DIST rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e66afc44186f48548dffcd7c6d7d92b4fbecea48bf3f7970d211844b5401a2556a138993517d049265109146a48856c7106616100ed63a5fa3f263d7023af6b6 SHA512 75ff89cd071641b01f4d483aca5997f6b3857d477b6fb40e6fdf11ff2ecdca74618cc59a9f0d1d2f942bde2d9a8738ac6f821d21d79f3ed85830ef530636a607
26 +DIST rust-1.52.0-aarch64-unknown-linux-musl.tar.xz 214159336 BLAKE2B 1b2afb80df6bf75d516127f07d57d12d876f12879c1d87059ab1c40ee1325ddb4e0c22f2fa185dab72f7633bce7d2ff5ed92ce4e88d4e118ac80630a061ec0c4 SHA512 9461c7272ac3e2c854e8e5f24cd57e5d648a3f923a9413eebd9f45a143d27378bc09c4d30ee7a1773a56baa31066dcc9f955b0805ce9f47d81b52e47a3a3e369
27 +DIST rust-1.52.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 71e8d615e921a70341b543992eef062186f72169a9763562114af8afd8ab3469a104677fe103a04a03881ec308b25fff412ba4eaac6e4ff02f29527ddefce8b8 SHA512 1033d23a2c05ec207c7fe032f5d9986d5a1d839ca54b0ea57a7a35c8c37512e9732835f2f280f436af326e948da913492f84cd6d0dfb9c397a095167f31e4c04
28 +DIST rust-1.52.0-arm-unknown-linux-gnueabi.tar.xz 195145936 BLAKE2B 3c2e1f947164a18b0a0e642775560c23407eb9f79ce426b6f191eab3204b78288aa404c9f5d388a0831ff124a92c4bad6927edc252ec82f0fed194b361c75256 SHA512 20fd1d03f3c9a935d0fd282fc7ea5808165b45865044ba8a8b09ee07d1410ad80401f800d1c70dab9e42b496deb58def88d8dd10de551e2a086e9cdede06385a
29 +DIST rust-1.52.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B d73e4062015a30339dc0210afaa6779912051968b174a21f09e518ecc74a763d01fee8a813e08dbd7103583d7496b76248755e2c382e8e645c0524982a7bc0bb SHA512 e707a9a1960db80602d6b5d827e81fd828cca30807bdf78e7adf9378526450c5ec87d4068b3c395142fc532cf7dee7782a5f077d8ef5051c79f2b86f8631c21b
30 +DIST rust-1.52.0-arm-unknown-linux-gnueabihf.tar.xz 195367332 BLAKE2B 72bfb4303f3e3077958cea7050dd4100619eb14fb164d33c6ce696d3b6ddbb2099cc2850dd17b961dfb40cb1b5b20ee8158f87e0fe76426e728b2dd7752870bc SHA512 6b2f4d907ebc53983cadce97a10036a6f7e333aea1e301067fccbc38dfcc6a49ad5770cb366bc2df82aee148d88edc122930355409f0926273f85b72bf4b261f
31 +DIST rust-1.52.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 21a835f06fb41677db5cf1a06244b2ea3caa8462330c2599e6a77d4c82054f8bd717ba790cdf06f280f62adaeb839cb1ff7cc6dbce76fac75ca4791f1d72644d SHA512 ff46a6b6b086bc785faeeaa5db2de0c79d1898651f2113a726a08d81136b687e13eb03bb635c6c43cbeae2ec897999d2867a9c925436131871a61d7f93a5bad2
32 +DIST rust-1.52.0-armv7-unknown-linux-gnueabihf.tar.xz 201614124 BLAKE2B 780358a279a80aac343ed737068faea9ddc9ace4a52694a32a0df504e6864fb2da30474ead9e3419370a7c7d6465ffd957fae475d852e504390222a939294270 SHA512 100b9abdc3dc7852f880eea205056a7a6b78af39fc3b7019ebcac712d5eee3c053f0508a6dc1f9da13074ca476e9fb33514bb83098d3b41964e878c0fc6498d4
33 +DIST rust-1.52.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B e93e9ff5068ac52bb85c42c64b528f60fac755e022b9be7680e203ad3acdee44e8cdfa00f06f4096b17106d2fe3287061c66fd411e2e6449301b0c4befd81e98 SHA512 7c8e6cc76b4d22a4b7fdd88e73e5f99fec9bb9d9cd86293a4813d25a11739e4f104f3c8c5a1113240909757b893fd88ef34a6fc7139a6d37923d241ac60c01cf
34 +DIST rust-1.52.0-i686-unknown-linux-gnu.tar.xz 214798144 BLAKE2B dae7a81f1bce6f24d9766621d751b090c4a560af83686f19ae4d309da5fc8f59f1a46caea03bad593018a07ff44bd078ac5e775edf4b92ad178f641a5a3f7626 SHA512 10fcf9e891ae8bc6e83b5e71c83b34773c18b024c9e9b580cfae714b4e135d313ba5434fc28c2dffa3db2e50669b3acd07e6874de0cfab89b343db92bfbdff80
35 +DIST rust-1.52.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 699ca61fbe0f9763b5e3040f0d2854e34d6650f55dae2e864b88aa1d0402551a372970a3b6f4758e03619dba1201fb288c49a255eb1e7ea7ea0cb7668dde9604 SHA512 fc38e23183f104ed092072666bce6e40ab44822568ea69f31d5131508c53532a5db0c7148434605df6ee216559eb5927fac1ac32c17b3a3ebc336953f98a3ae6
36 +DIST rust-1.52.0-mips-unknown-linux-gnu.tar.xz 155487344 BLAKE2B 8f4d1dd47830f9d691e564ccab1a265e4f2622edc93f942d7db222b06c5f855187c855823bf0f38d7c534158905ee9eab6e5455900832891fd34c2b5649f4dc3 SHA512 9395eba6b7c8ddb5a35ff6e7bcc43eddc7fd2c7604a508a30aa63c4648bc3c9fee228cfd54cef6a2604cc8b695178c9d04cd8d05664279ef0bbca886e0d74a6b
37 +DIST rust-1.52.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 8d226ab1e1f85620463e4cb1eaf2d363906d3eb5d7bed82e24b4f84c8969c649fc899b0dc446f4160ebc273850f158322cae1553ad499dfeee4ff34eaf161e52 SHA512 ed26f86680332d82aeb3dc8592f634a56b2269f5c4fbc75223b05cbd3775d6d8b4421dbddce96cd1fbf1f84cdd585f2b779c6a3f11639c101245bfe76a0a0cfa
38 +DIST rust-1.52.0-mips64-unknown-linux-gnuabi64.tar.xz 165086396 BLAKE2B 1241fce74a0583719d5e40cd48239de5fa7e121f87baf0f1e4f18106a69a3e6c6991754cf7c62492f850919ed02fd371c9e7360972d6ab4b556c243c72bcda89 SHA512 6ebda7432d5fd0d5a99c684e2dab2db0446d5d4ba1000696c14c26f5288c763dc0743af197c6fe809e2e6f90d90b12d84714ff64f195ca415760d9110c6f8b0a
39 +DIST rust-1.52.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B 58ebdce3798c0a95a08394bd8398dce5e145848fc2a97233c69befd9b541af526324d777dec4909b7586709bdf6af8ec69cae980032dc86c650047dff057e823 SHA512 34a16221fa0e09acf88e67f7425ed6154caa8b9a1dd2eafe4cc8167204bb57cfc96824047e4e070b5e91109c45376a8873d873b329ed74df43b279f29768fa8a
40 +DIST rust-1.52.0-mipsel-unknown-linux-gnu.tar.xz 158692144 BLAKE2B 331afebbbc7d5c0fa5eaf182e8642f7b38c583418469a7e2b282378556db3813445b552ea89a596df56030a119e1deda1e1bbdc1983f5dacd3115e9de7c860c5 SHA512 0149304d963eeffbbb929eb6f1f24a3f1e5d43c627252bcca8df86fe894858d5d399eb5f8ddabbaf8c2768f93ee05fbaa82b1552c76dbb319614f0e93b21558e
41 +DIST rust-1.52.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B a4b835e14bcd9f1c24cb66dd1daf4777d25681ab175b377dba37ca4bc51e0bf360df4fb6feb3e85e0c05f79be31e51d180ffea30bc0cd96f69ca455cc4b2238d SHA512 c9b33e4ca113343b08e16410b509aca98c08338e131581d223435f8d1eb1248e2abc6a0ef10cf612fd4a305d88d4fb605785d4c067520dff5b699ce00e2799bf
42 +DIST rust-1.52.0-powerpc-unknown-linux-gnu.tar.xz 170724484 BLAKE2B 1e58e0a338498061c0e46e65660fcf01bd8461b3fcded864ba63196d4fc29e0b56e026e4d80b7535b63bb5bc204c748165498e7cfcda3713a97aa17bd8ac65b1 SHA512 44af21d9cf5d5d654f1f9437aefb61ba5bd3f3bdc67c657fba8ab03494a7ead53b6f5be17153f1f20acf099cd90760de29008c76fd766d6facbab32bf7921523
43 +DIST rust-1.52.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 6e42783107d1aae59f771284f15e1304595da710700a7664cc199fe7544dfb9cdfcb8c5f67e3c520a68ffb7fd7202de2f071cf92ce95b858f38e4ceb72649c4c SHA512 a68c780526a0dc3ba6c9e74258b124f4e64f52dab1dc0d1bcac5cbed752a9884caf858be2a1b9eb987b400a26b824e556bbf5280f64a4f51df0aae8c3073b9aa
44 +DIST rust-1.52.0-powerpc64-unknown-linux-gnu.tar.xz 184549672 BLAKE2B 2121f8d22d9348a61ba9eecb40bb13afee199450c7bba2d1852169f3b61ec193ea6979483139875c29a0a767732f5ffe12f81528c713492e0173084691b4b7d2 SHA512 7c24c9193fc4fe2109e38f140a8c240e0535171460de9965291c08003abe7c1ea89796afa7dcb2018eece4d9eed48ebf9469d1a040f06ab4f6a12807c789f7d8
45 +DIST rust-1.52.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7f5d881c1e1618be807ed6f65551fbec9190345f30c24b3c99c69e19cf87cda39c0fa6d0667d6e10e27444a864f9d49638f79fb8ac2d57558d745c3496ed01c7 SHA512 1b73e49173325b3ec9fea1c346f702ae33235aacd0b821d5b9a90148a26046e45fb547223a0cef6fadf03b5124a824a9b83984f3b5841cd5d3b861aa3223aa88
46 +DIST rust-1.52.0-powerpc64le-unknown-linux-gnu.tar.xz 194640544 BLAKE2B aa5e59e6059bbba874c40f7570404fbcfa5108aceb04f53ae42fc8ea4e833917f3cf6e84a1dd69cc5bf9cec3bbf0b3063258ff57699d3d0769038b44f4ccdf33 SHA512 916a3338c850cf804535e25aebc0fdcf6cea8fe9e5df9fed11fbf03ae81fb8220321dc41edd7133f287dfee0dbf19730ff8b020f32322850329865db76bab95e
47 +DIST rust-1.52.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B ee33eefaf5b2eb96ef8fc2746334489b798b95f6b10e64deeaad72c4c1b45c9e335e450d8f896eec50c1b912b8e063ecec246c1d35c97f471236a876af7d36b4 SHA512 a66796a7459316f593649ebb309394d67bcf5ac241fd488c8e480df1837818369f79a198d1e56eb0488ab50dbad8d4162392709a2115005694ca0dd16f7e42ed
48 +DIST rust-1.52.0-riscv64gc-unknown-linux-gnu.tar.xz 181497380 BLAKE2B 40f978a60d7eea43b6e5eaeaff85611bfe571b3908a43aba2405b86ffb07c20043509ecd7f78546b4c6d795dbf4d06217e95c0855039f2cf92c372e0b3f959c9 SHA512 f0486885b26848bb1b910dbd6dd898b208ea0fb2f89714f0a8d59db330471447f4f4aad05ca534bbcf267c95e8eaabcb34d6ba41b576a2a8c77d80431c4212d2
49 +DIST rust-1.52.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 775d1ab86cce821e0dbf95aee99265322cb210745430f48c93e4f51cdbe8cf373f622f7ced8df801aeb830e74b917177cda6839c4504c09f5761d598a145364f SHA512 668f52e962c9b7b0a9efb0f2e33474bdc6cede32c3e657b19a8b374b0d8fa6516d4de42295acd541f6c07683a17f5251ec3fa52be44d573de5cfbb83780f37fb
50 +DIST rust-1.52.0-s390x-unknown-linux-gnu.tar.xz 194810848 BLAKE2B 72d68066f492c2eb2ed7e9061b2a67a603aa6ef8738004a1d7ec21753c3bb1466c81fd7a18f674d156b8b4e3c755d641b0acccfa726ad04ac17be3199e941938 SHA512 6a91adf7c1947b63db0bf02b4aa4a36fbbfcc5b40d9c18175e4c5efe785b8a17ff21a887476cf76f7e3d3854f2cc362b5d2dc8243493291a4d19a705276e6355
51 +DIST rust-1.52.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c9b51ff09e6de5d9d3cf93e0f21df52f1738aa6c1e7b93851512d9f464bec757477183c693a1740082a36564c10cd13569c129f026680506c1e1fae8192c835d SHA512 147498154e9ab97ec4e7c0037e6873f4eb5d23c53e2f53068e979815e7d4883c9a7a338048d21abf685f0fa348cc01e342f2d5a32856b11c52663910786750f3
52 +DIST rust-1.52.0-x86_64-unknown-linux-gnu.tar.xz 143053436 BLAKE2B cdbbd529c5d820318530e56347426bced5addd6f20886719abfbff6e174afadd94be36b1f3e6ba878b14198641b4a53c78f33e79bdc90025696a57659753bdac SHA512 27a8db421ae62af92e2c34dcc1fdd617bf7e8de2c68205773a3037be496ccbf21f5549dd18377a9730102e7915519824231218fef9a09abe9d116441d6ce28d2
53 +DIST rust-1.52.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B ec204ee0968d4114023f40dfdd8654451149b5433dbb4eec192cc68135f45ed28ae7b06eabdab417401529162c11939ee101f7eddce304111fe93e9806347902 SHA512 4ae425def112d8c38e91ded53fdd73a6c7d2043eda22ce955aaa7303ff2cd6e7e8d0cfaa0d596b29195ba449811653f91b9b65c8c96b3cc8136d060609594828
54 +DIST rust-1.52.0-x86_64-unknown-linux-musl.tar.xz 239422556 BLAKE2B 8bef78b335b384e6bf7a5dd4a47511aa69ce0de6f9d1ab78146cd55f37e01b358a0cb82b95dcd27d25d4a114b707155b923415f9a91e6a75ab83bca9f5f7e0e3 SHA512 30a9f45f591c3beb34deee23611b5afe0f90b7a2a1b7b813498547b3264ecb98ef1d6bdfb77468bd5364f2942d927418037eb4ffe413db520c701fdf79c89bf2
55 +DIST rust-1.52.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 2d69f81dd47ce7387311b576a7770f2b457beebba8cd1554e5eac501025b7b54e72078b69c7cf8a61bc295298d7f277f39a070ee8d83564942149a1b42089594 SHA512 688e3eaaf2a7e7995a9b36e6856b7922b4deada31fdab198df335b316672d20bc80e5e717cee4e2fc2f51ec8abaf97880dfa5424a7b122e46b02fb7f62836378
56 DIST rustc-1.51.0-src.tar.xz 109596164 BLAKE2B c1ac89655adfe7db8005476d42c748cf1896f52888141229fd6dda43855dbb08c21c8e1f11398d2f1f9dd5f8d508d9158a3bda4f1b282d1b184ea4c701100837 SHA512 ded91468ddf3e6627f00e7ec3d44452aa24eb727a183c0de9d90264f593119a54300d56b09251a88260db480b48554181ae195c538996a32d68d48b6587ac0df
57 DIST rustc-1.51.0-src.tar.xz.asc 801 BLAKE2B dc06d0bc40bcc5ec5ae247495b6975584a80a35480d36d45db4db57872432cc9c3d38238bf68a56386bffc6987f5c491cc75ef21cc7ba9260073c199d7e1791a SHA512 f00d69117e9f38a179219f976230582fc51b494a71519fd3c032a8abdf8d554d659122f671881783f2a49517b79cc4617986447d5972f7ff2467d56fce312c4c
58 DIST rustc-1.52.1-src.tar.xz 115109508 BLAKE2B c5d73f5884037d287d88ba9fdaf63a36678b692e1b510920045797ab29f1660f05cda901e19411ff83ec3084c4130034c269976b1056220f3e629cff116d07f0 SHA512 55f5053ce40d4eba4663052817aef6a6275139ca229c89cd1ec44711458b412720203301d8c7975aac5720a91fcaf21847f8184f641cbb0004f722520283c73c
59 DIST rustc-1.52.1-src.tar.xz.asc 801 BLAKE2B ea2f89289b4d9cf90a0d10148bf3494805c00e7822cc98addf0b602c35e4635bb1963d79168b395a5f7c7bd024070284fccd19757982daa0d554dcac166fd4d7 SHA512 0d692a085c017b03b8a135a28f7e6f1d7e05642d2e99f0f1fbc397e766bb8fed4b4c6b4c9157b79d9bb0c4229607dbc35711cd463c62a9966a4efb6f197de7d3
60 +DIST rustc-1.53.0-src.tar.xz 115686332 BLAKE2B fa068f89d42f927fdc79ee31aad1386eaf2aa596a060e059c5a1a73fe48c48d008fc952cd6c7912b743e41d77a94b205639eed0f728b2539b62f18a772cabfe3 SHA512 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24
61 +DIST rustc-1.53.0-src.tar.xz.asc 801 BLAKE2B 75d3aa4122968f10a119f7a04df897f496588c7a1a2ddf1ea2222099c9efb0e320f5677a26c3271f86e7f500120664485f54c6025ae3c6df30d2b0fe758f5826 SHA512 e337579b9ab4febca4594c2c5d42c279b51cfc745c383be9a430204188311a25319c04c73fde34fdb2bb98a88bfd8daaddc67765834330e6c279a6e5a5648247
62
63 diff --git a/dev-lang/rust/rust-1.53.0.ebuild b/dev-lang/rust/rust-1.53.0.ebuild
64 new file mode 100644
65 index 00000000000..79a4b179f6b
66 --- /dev/null
67 +++ b/dev-lang/rust/rust-1.53.0.ebuild
68 @@ -0,0 +1,673 @@
69 +# Copyright 1999-2021 Gentoo Authors
70 +# Distributed under the terms of the GNU General Public License v2
71 +
72 +EAPI=7
73 +
74 +PYTHON_COMPAT=( python3_{7..9} )
75 +
76 +inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing \
77 + multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
78 +
79 +if [[ ${PV} = *beta* ]]; then
80 + betaver=${PV//*beta}
81 + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
82 + MY_P="rustc-beta"
83 + SLOT="beta/${PV}"
84 + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz"
85 +else
86 + ABI_VER="$(ver_cut 1-2)"
87 + SLOT="stable/${ABI_VER}"
88 + MY_P="rustc-${PV}"
89 + SRC="${MY_P}-src.tar.xz"
90 + #KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
91 +fi
92 +
93 +RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
94 +
95 +DESCRIPTION="Systems programming language from Mozilla"
96 +HOMEPAGE="https://www.rust-lang.org/"
97 +
98 +SRC_URI="
99 + https://static.rust-lang.org/dist/${SRC}
100 + verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
101 + !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
102 +"
103 +
104 +# keep in sync with llvm ebuild of the same version as bundled one.
105 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
106 + NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
107 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
108 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
109 +
110 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
111 +
112 +IUSE="clippy cpu_flags_x86_sse2 debug doc miri nightly parallel-compiler rls rustfmt system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
113 +
114 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
115 +# we need to *really* make sure we're not pulling more than one slot
116 +# simultaneously.
117 +
118 +# How to use it:
119 +# List all the working slots in LLVM_VALID_SLOTS, newest first.
120 +LLVM_VALID_SLOTS=( 12 )
121 +LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}"
122 +
123 +# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
124 +# (-) usedep needed because we may build with older llvm without that target
125 +LLVM_DEPEND="|| ( "
126 +for _s in ${LLVM_VALID_SLOTS[@]}; do
127 + LLVM_DEPEND+=" ( "
128 + for _x in ${ALL_LLVM_TARGETS[@]}; do
129 + LLVM_DEPEND+="
130 + ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] )"
131 + done
132 + LLVM_DEPEND+=" )"
133 +done
134 +unset _s _x
135 +LLVM_DEPEND+=" )
136 + <sys-devel/llvm-$(( LLVM_MAX_SLOT + 1 )):=
137 + wasm? ( sys-devel/lld )
138 +"
139 +
140 +# to bootstrap we need at least exactly previous version, or same.
141 +# most of the time previous versions fail to bootstrap with newer
142 +# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
143 +# but it fails to bootstrap with 1.48.x
144 +# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.txt
145 +RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
146 +RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
147 +BOOTSTRAP_DEPEND="||
148 + (
149 + =dev-lang/rust-"${RUST_DEP_PREV}"
150 + =dev-lang/rust-bin-"${RUST_DEP_PREV}"
151 + =dev-lang/rust-"${RUST_DEP_CURR}"
152 + =dev-lang/rust-bin-"${RUST_DEP_CURR}"
153 + )
154 +"
155 +
156 +BDEPEND="${PYTHON_DEPS}
157 + app-eselect/eselect-rust
158 + || (
159 + >=sys-devel/gcc-4.7
160 + >=sys-devel/clang-3.5
161 + )
162 + system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
163 + !system-llvm? (
164 + >=dev-util/cmake-3.13.4
165 + dev-util/ninja
166 + )
167 + test? ( sys-devel/gdb )
168 + verify-sig? ( app-crypt/openpgp-keys-rust )
169 +"
170 +
171 +DEPEND="
172 + >=app-arch/xz-utils-5.2
173 + net-misc/curl:=[http2,ssl]
174 + sys-libs/zlib:=
175 + dev-libs/openssl:0=
176 + elibc_musl? ( sys-libs/libunwind:= )
177 + system-llvm? ( ${LLVM_DEPEND} )
178 +"
179 +
180 +# we need to block older versions due to layout changes.
181 +RDEPEND="${DEPEND}
182 + app-eselect/eselect-rust
183 + !<dev-lang/rust-1.47.0-r1
184 + !<dev-lang/rust-bin-1.47.0-r1
185 +"
186 +
187 +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
188 + miri? ( nightly )
189 + parallel-compiler? ( nightly )
190 + test? ( ${ALL_LLVM_TARGETS[*]} )
191 + wasm? ( llvm_targets_WebAssembly )
192 + x86? ( cpu_flags_x86_sse2 )
193 +"
194 +
195 +# we don't use cmake.eclass, but can get a warnings
196 +CMAKE_WARN_UNUSED_CLI=no
197 +
198 +QA_FLAGS_IGNORED="
199 + usr/lib/${PN}/${PV}/bin/.*
200 + usr/lib/${PN}/${PV}/libexec/.*
201 + usr/lib/${PN}/${PV}/lib/lib.*.so
202 + usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/.*
203 + usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
204 +"
205 +
206 +QA_SONAME="
207 + usr/lib/${PN}/${PV}/lib/lib.*.so.*
208 + usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
209 +"
210 +
211 +# causes double bootstrap
212 +RESTRICT="test"
213 +
214 +VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/rust.asc"
215 +
216 +PATCHES=(
217 + "${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch
218 + "${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch
219 +)
220 +
221 +S="${WORKDIR}/${MY_P}-src"
222 +
223 +toml_usex() {
224 + usex "${1}" true false
225 +}
226 +
227 +bootstrap_rust_version_check() {
228 + # never call from pkg_pretend. eselect-rust may be not installed yet.
229 + [[ ${MERGE_TYPE} == binary ]] && return
230 + local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
231 + local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
232 + local rustc_version=( $(eselect --brief rust show 2>/dev/null) )
233 + rustc_version=${rustc_version[0]#rust-bin-}
234 + rustc_version=${rustc_version#rust-}
235 +
236 + [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
237 +
238 + if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
239 + eerror "Rust >=${rustc_wanted} is required"
240 + eerror "please run 'eselect rust' and set correct rust version"
241 + die "selected rust version is too old"
242 + elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
243 + eerror "Rust <${rustc_toonew} is required"
244 + eerror "please run 'eselect rust' and set correct rust version"
245 + die "selected rust version is too new"
246 + else
247 + einfo "Using rust ${rustc_version} to build"
248 + fi
249 +}
250 +
251 +pre_build_checks() {
252 + local M=8192
253 + # multiply requirements by 1.5 if we are doing x86-multilib
254 + if use amd64; then
255 + M=$(( $(usex abi_x86_32 15 10) * ${M} / 10 ))
256 + fi
257 + M=$(( $(usex clippy 128 0) + ${M} ))
258 + M=$(( $(usex miri 128 0) + ${M} ))
259 + M=$(( $(usex rls 512 0) + ${M} ))
260 + M=$(( $(usex rustfmt 256 0) + ${M} ))
261 + # add 2G if we compile llvm and 256M per llvm_target
262 + if ! use system-llvm; then
263 + M=$(( 2048 + ${M} ))
264 + local ltarget
265 + for ltarget in ${ALL_LLVM_TARGETS[@]}; do
266 + M=$(( $(usex ${ltarget} 256 0) + ${M} ))
267 + done
268 + fi
269 + M=$(( $(usex wasm 256 0) + ${M} ))
270 + M=$(( $(usex debug 2 1) * ${M} ))
271 + eshopts_push -s extglob
272 + if is-flagq '-g?(gdb)?([1-9])'; then
273 + M=$(( 15 * ${M} / 10 ))
274 + fi
275 + eshopts_pop
276 + M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
277 + M=$(( $(usex doc 256 0) + ${M} ))
278 + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
279 +}
280 +
281 +llvm_check_deps() {
282 + has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]"
283 +}
284 +
285 +pkg_pretend() {
286 + pre_build_checks
287 +}
288 +
289 +pkg_setup() {
290 + pre_build_checks
291 + python-any-r1_pkg_setup
292 +
293 + export LIBGIT2_NO_PKG_CONFIG=1 #749381
294 +
295 + use system-bootstrap && bootstrap_rust_version_check
296 +
297 + if use system-llvm; then
298 + llvm_pkg_setup
299 +
300 + local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
301 + export LLVM_LINK_SHARED=1
302 + export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
303 + fi
304 +}
305 +
306 +src_prepare() {
307 + if ! use system-bootstrap; then
308 + local rust_stage0_root="${WORKDIR}"/rust-stage0
309 + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
310 +
311 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
312 + --without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
313 + fi
314 +
315 + default
316 +}
317 +
318 +src_configure() {
319 + local rust_target="" rust_targets="" arch_cflags
320 +
321 + # Collect rust target names to compile standard libs for all ABIs.
322 + for v in $(multilib_get_enabled_abi_pairs); do
323 + rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
324 + done
325 + if use wasm; then
326 + rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
327 + if use system-llvm; then
328 + # un-hardcode rust-lld linker for this target
329 + # https://bugs.gentoo.org/715348
330 + sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm32_base.rs || die
331 + fi
332 + fi
333 + rust_targets="${rust_targets#,}"
334 +
335 + local tools="\"cargo\","
336 + if use clippy; then
337 + tools="\"clippy\",$tools"
338 + fi
339 + if use miri; then
340 + tools="\"miri\",$tools"
341 + fi
342 + if use rls; then
343 + tools="\"rls\",\"analysis\",\"src\",$tools"
344 + fi
345 + if use rustfmt; then
346 + tools="\"rustfmt\",$tools"
347 + fi
348 +
349 + local rust_stage0_root
350 + if use system-bootstrap; then
351 + local printsysroot
352 + printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
353 + rust_stage0_root="${printsysroot}"
354 + else
355 + rust_stage0_root="${WORKDIR}"/rust-stage0
356 + fi
357 + # in case of prefix it will be already prefixed, as --print sysroot returns full path
358 + [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
359 +
360 + rust_target="$(rust_abi)"
361 +
362 + cat <<- _EOF_ > "${S}"/config.toml
363 + [llvm]
364 + download-ci-llvm = false
365 + optimize = $(toml_usex !debug)
366 + release-debuginfo = $(toml_usex debug)
367 + assertions = $(toml_usex debug)
368 + ninja = true
369 + targets = "${LLVM_TARGETS// /;}"
370 + experimental-targets = ""
371 + link-shared = $(toml_usex system-llvm)
372 + [build]
373 + build = "${rust_target}"
374 + host = ["${rust_target}"]
375 + target = [${rust_targets}]
376 + cargo = "${rust_stage0_root}/bin/cargo"
377 + rustc = "${rust_stage0_root}/bin/rustc"
378 + rustfmt = "${rust_stage0_root}/bin/rustfmt"
379 + docs = $(toml_usex doc)
380 + compiler-docs = false
381 + submodules = false
382 + python = "${EPYTHON}"
383 + locked-deps = true
384 + vendor = true
385 + extended = true
386 + tools = [${tools}]
387 + verbose = 2
388 + sanitizers = false
389 + profiler = false
390 + cargo-native-static = false
391 + [install]
392 + prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
393 + sysconfdir = "etc"
394 + docdir = "share/doc/rust"
395 + bindir = "bin"
396 + libdir = "lib"
397 + mandir = "share/man"
398 + [rust]
399 + # https://github.com/rust-lang/rust/issues/54872
400 + codegen-units-std = 1
401 + optimize = true
402 + debug = $(toml_usex debug)
403 + debug-assertions = $(toml_usex debug)
404 + debug-assertions-std = $(toml_usex debug)
405 + debuginfo-level = $(usex debug 2 0)
406 + debuginfo-level-rustc = $(usex debug 2 0)
407 + debuginfo-level-std = $(usex debug 2 0)
408 + debuginfo-level-tools = $(usex debug 2 0)
409 + debuginfo-level-tests = 0
410 + backtrace = true
411 + incremental = false
412 + default-linker = "$(tc-getCC)"
413 + parallel-compiler = $(toml_usex parallel-compiler)
414 + channel = "$(usex nightly nightly stable)"
415 + description = "gentoo"
416 + rpath = false
417 + verbose-tests = true
418 + optimize-tests = $(toml_usex !debug)
419 + codegen-tests = true
420 + dist-src = false
421 + remap-debuginfo = true
422 + lld = $(usex system-llvm false $(toml_usex wasm))
423 + # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it
424 + # https://github.com/rust-lang/rust/issues/74976
425 + # https://github.com/rust-lang/rust/issues/76526
426 + deny-warnings = $(usex wasm $(usex doc false true) true)
427 + backtrace-on-ice = true
428 + jemalloc = false
429 + [dist]
430 + src-tarball = false
431 + compression-formats = ["gz"]
432 + _EOF_
433 +
434 + for v in $(multilib_get_enabled_abi_pairs); do
435 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
436 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
437 +
438 + cat <<- _EOF_ >> "${S}"/config.env
439 + CFLAGS_${rust_target}=${arch_cflags}
440 + _EOF_
441 +
442 + cat <<- _EOF_ >> "${S}"/config.toml
443 + [target.${rust_target}]
444 + cc = "$(tc-getBUILD_CC)"
445 + cxx = "$(tc-getBUILD_CXX)"
446 + linker = "$(tc-getCC)"
447 + ar = "$(tc-getAR)"
448 + _EOF_
449 + # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
450 + if use elibc_musl; then
451 + cat <<- _EOF_ >> "${S}"/config.toml
452 + crt-static = false
453 + _EOF_
454 + fi
455 + if use system-llvm; then
456 + cat <<- _EOF_ >> "${S}"/config.toml
457 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
458 + _EOF_
459 + fi
460 + done
461 + if use wasm; then
462 + cat <<- _EOF_ >> "${S}"/config.toml
463 + [target.wasm32-unknown-unknown]
464 + linker = "$(usex system-llvm lld rust-lld)"
465 + _EOF_
466 + fi
467 +
468 + if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below
469 + # experimental cross support
470 + # discussion: https://bugs.gentoo.org/679878
471 + # TODO: c*flags, clang, system-llvm, cargo.eclass target support
472 + # it would be much better if we could split out stdlib
473 + # complilation to separate ebuild and abuse CATEGORY to
474 + # just install to /usr/lib/rustlib/<target>
475 +
476 + # extra targets defined as a bash array
477 + # spec format: <LLVM target>:<rust-target>:<CTARGET>
478 + # best place would be /etc/portage/env/dev-lang/rust
479 + # Example:
480 + # RUST_CROSS_TARGETS=(
481 + # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
482 + # )
483 + # no extra hand holding is done, no target transformations, all
484 + # values are passed as-is with just basic checks, so it's up to user to supply correct values
485 + # valid rust targets can be obtained with
486 + # rustc --print target-list
487 + # matching cross toolchain has to be installed
488 + # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one)
489 + # only gcc toolchains installed with crossdev are checked for now.
490 +
491 + # BUG: we can't pass host flags to cross compiler, so just filter for now
492 + # BUG: this should be more fine-grained.
493 + filter-flags '-mcpu=*' '-march=*' '-mtune=*'
494 +
495 + local cross_target_spec
496 + for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
497 + # extracts first element form <LLVM target>:<rust-target>:<CTARGET>
498 + local cross_llvm_target="${cross_target_spec%%:*}"
499 + # extracts toolchain triples, <rust-target>:<CTARGET>
500 + local cross_triples="${cross_target_spec#*:}"
501 + # extracts first element after before : separator
502 + local cross_rust_target="${cross_triples%%:*}"
503 + # extracts last element after : separator
504 + local cross_toolchain="${cross_triples##*:}"
505 + use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled"
506 + command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain"
507 +
508 + cat <<- _EOF_ >> "${S}"/config.toml
509 + [target.${cross_rust_target}]
510 + cc = "${cross_toolchain}-gcc"
511 + cxx = "${cross_toolchain}-g++"
512 + linker = "${cross_toolchain}-gcc"
513 + ar = "${cross_toolchain}-ar"
514 + _EOF_
515 + if use system-llvm; then
516 + cat <<- _EOF_ >> "${S}"/config.toml
517 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
518 + _EOF_
519 + fi
520 + if [[ "${cross_toolchain}" == *-musl* ]]; then
521 + cat <<- _EOF_ >> "${S}"/config.toml
522 + musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr"
523 + _EOF_
524 + fi
525 +
526 + # append cross target to "normal" target list
527 + # example 'target = ["powerpc64le-unknown-linux-gnu"]'
528 + # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
529 +
530 + rust_targets="${rust_targets},\"${cross_rust_target}\""
531 + sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die
532 +
533 + ewarn
534 + ewarn "Enabled ${cross_rust_target} rust target"
535 + ewarn "Using ${cross_toolchain} cross toolchain"
536 + ewarn
537 + if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
538 + ewarn "'sys-devel/binutils[multitarget]' is not installed"
539 + ewarn "'strip' will be unable to strip cross libraries"
540 + ewarn "cross targets will be installed with full debug information"
541 + ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files"
542 + ewarn
543 + ewarn "Alternatively llvm-strip can be used, it supports stripping any target"
544 + ewarn "define STRIP=\"llvm-strip\" to use it (experimental)"
545 + ewarn
546 + fi
547 + done
548 + fi # I_KNOW_WHAT_I_AM_DOING_CROSS
549 +
550 + einfo "Rust configured with the following flags:"
551 + echo
552 + echo RUSTFLAGS="${RUSTFLAGS:-}"
553 + echo RUSTFLAGS_BOOTSTRAP="${RUSTFLAGS_BOOTSTRAP:-}"
554 + echo RUSTFLAGS_NOT_BOOTSTRAP="${RUSTFLAGS_NOT_BOOTSTRAP:-}"
555 + env | grep "CARGO_TARGET_.*_RUSTFLAGS="
556 + cat "${S}"/config.env || die
557 + echo
558 + einfo "config.toml contents:"
559 + cat "${S}"/config.toml || die
560 + echo
561 +}
562 +
563 +src_compile() {
564 + # we need \n IFS to have config.env with spaces loaded properly. #734018
565 + (
566 + IFS=$'\n'
567 + env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
568 + "${EPYTHON}" ./x.py dist -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
569 + )
570 +}
571 +
572 +src_test() {
573 + # https://rustc-dev-guide.rust-lang.org/tests/intro.html
574 +
575 + # those are basic and codegen tests.
576 + local tests=(
577 + codegen
578 + codegen-units
579 + compile-fail
580 + incremental
581 + mir-opt
582 + pretty
583 + run-make
584 + )
585 +
586 + # fails if llvm is not built with ALL targets.
587 + # and known to fail with system llvm sometimes.
588 + use system-llvm || tests+=( assembly )
589 +
590 + # fragile/expensive/less important tests
591 + # or tests that require extra builds
592 + # TODO: instead of skipping, just make some nonfatal.
593 + if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
594 + tests+=(
595 + rustdoc
596 + rustdoc-js
597 + rustdoc-js-std
598 + rustdoc-ui
599 + run-make-fulldeps
600 + ui
601 + ui-fulldeps
602 + )
603 + fi
604 +
605 + local i failed=()
606 + einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
607 + for i in "${tests[@]}"; do
608 + local t="src/test/${i}"
609 + einfo "rust_src_test: running ${t}"
610 + if ! (
611 + IFS=$'\n'
612 + env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \
613 + "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \
614 + -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"
615 + )
616 + then
617 + failed+=( "${t}" )
618 + eerror "rust_src_test: ${t} failed"
619 + fi
620 + done
621 +
622 + if [[ ${#failed[@]} -ne 0 ]]; then
623 + eerror "rust_src_test: failure summary: ${failed[@]}"
624 + die "aborting due to test failures"
625 + fi
626 +}
627 +
628 +src_install() {
629 + (
630 + IFS=$'\n'
631 + env $(cat "${S}"/config.env) DESTDIR="${D}" \
632 + "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
633 + )
634 +
635 + # bug #689562, #689160
636 + rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die
637 + rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die
638 + newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo
639 +
640 + local symlinks=(
641 + cargo
642 + rustc
643 + rustdoc
644 + rust-gdb
645 + rust-gdbgui
646 + rust-lldb
647 + )
648 +
649 + use clippy && symlinks+=( clippy-driver cargo-clippy )
650 + use miri && symlinks+=( miri cargo-miri )
651 + use rls && symlinks+=( rls )
652 + use rustfmt && symlinks+=( rustfmt cargo-fmt )
653 +
654 + einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}"
655 + local i
656 + for i in "${symlinks[@]}"; do
657 + # we need realpath on /usr/bin/* symlink return version-appended binary path.
658 + # so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver>
659 + # need to fix eselect-rust to remove this hack.
660 + local ver_i="${i}-${PV}"
661 + if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then
662 + einfo "Installing ${i} symlink"
663 + ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die
664 + else
665 + ewarn "${i} symlink requested, but source file not found"
666 + ewarn "please report this"
667 + fi
668 + dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}"
669 + done
670 +
671 + # symlinks to switch components to active rust in eselect
672 + dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}"
673 + dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}"
674 + dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}"
675 + dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}"
676 + dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
677 +
678 + newenvd - "50${P}" <<-_EOF_
679 + LDPATH="${EPREFIX}/usr/lib/rust/lib"
680 + MANPATH="${EPREFIX}/usr/lib/rust/man"
681 + $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
682 + $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
683 + _EOF_
684 +
685 + rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die
686 + rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die
687 +
688 + # note: eselect-rust adds EROOT to all paths below
689 + cat <<-_EOF_ > "${T}/provider-${P}"
690 + /usr/bin/cargo
691 + /usr/bin/rustdoc
692 + /usr/bin/rust-gdb
693 + /usr/bin/rust-gdbgui
694 + /usr/bin/rust-lldb
695 + /usr/lib/rustlib
696 + /usr/lib/rust/lib
697 + /usr/lib/rust/libexec
698 + /usr/lib/rust/man
699 + /usr/share/doc/rust
700 + _EOF_
701 +
702 + if use clippy; then
703 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
704 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
705 + fi
706 + if use miri; then
707 + echo /usr/bin/miri >> "${T}/provider-${P}"
708 + echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
709 + fi
710 + if use rls; then
711 + echo /usr/bin/rls >> "${T}/provider-${P}"
712 + fi
713 + if use rustfmt; then
714 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
715 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
716 + fi
717 +
718 + insinto /etc/env.d/rust
719 + doins "${T}/provider-${P}"
720 +}
721 +
722 +pkg_postinst() {
723 + eselect rust update
724 +
725 + if has_version sys-devel/gdb || has_version dev-util/lldb; then
726 + elog "Rust installs a helper script for calling GDB and LLDB,"
727 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
728 + fi
729 +
730 + if has_version app-editors/emacs; then
731 + elog "install app-emacs/rust-mode to get emacs support for rust."
732 + fi
733 +
734 + if has_version app-editors/gvim || has_version app-editors/vim; then
735 + elog "install app-vim/rust-vim to get vim support for rust."
736 + fi
737 +}
738 +
739 +pkg_postrm() {
740 + eselect rust cleanup
741 +}