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, 08 Apr 2022 05:26:10
Message-Id: 1649393928.1bcdd0766268c493cddfbe5a20637d89d4e8a8f2.gyakovlev@gentoo
1 commit: 1bcdd0766268c493cddfbe5a20637d89d4e8a8f2
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 8 01:24:10 2022 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 8 04:58:48 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bcdd076
7
8 dev-lang/rust: add 1.60.0
9
10 Bug: https://bugs.gentoo.org/835800
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 dev-lang/rust/Manifest | 34 ++
14 dev-lang/rust/rust-1.60.0.ebuild | 703 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 737 insertions(+)
16
17 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
18 index c7a5acf42919..69aba147bcf6 100644
19 --- a/dev-lang/rust/Manifest
20 +++ b/dev-lang/rust/Manifest
21 @@ -62,7 +62,41 @@ DIST rust-1.58.1-x86_64-unknown-linux-gnu.tar.xz 150229600 BLAKE2B 056e5a646d675
22 DIST rust-1.58.1-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B b86d3d2cbf27594dfe55fe2ff52523a9dff08d08ddd30526172f9e07760c2f854698eb8153cb9894588d75759a3d0bb7887756d005a2c69aa9cfeec8e7dee678 SHA512 82dcb22efb94bb19f2338e9cb46e3f6da3d189fe6bff12bf1ec870197d395c2ad58bd15705aa7f3cde38e5ec0266e20eb2e45761e0f55b13261d3e6b14dce60f
23 DIST rust-1.58.1-x86_64-unknown-linux-musl.tar.xz 262511608 BLAKE2B f2ca664fe1ab0614f13ce9d7764eed935b107b393830ad14b64d8b05e032feeec57dd04cdc963ad3eea2cb23558beeb1975722be93412d4ff8fd3a75d2bbb896 SHA512 d064464333a64f91b8a30f267ecfe2b4dc5be6d639bc9f064efa86a54478c8de7156166236b7ff8d96bf8fc8cbbeebf7ac17d8b5dabf24d72e189dbbd8ae0819
24 DIST rust-1.58.1-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 9c58a08b4e5d609230b5aae52fe7eec2dd6a0cc0eb8c257068ac2585918aba6cbe3263a6480860d34a117d3e2ee835fc8d8b1702296369c3a4e0f660f46bd62e SHA512 6c294cbbbf22940e36278e92d5095dbfee0df741694188ef1e6df7740bbe770ffb5b2467bab12825045ebf7d6fb12eebb1ce7edbb32d0afcb114c57e814fe5d7
25 +DIST rust-1.59.0-aarch64-unknown-linux-gnu.tar.xz 217126920 BLAKE2B 87fd1910d76a133624ff860fd3932527b3ce3775db9e03c6d2ab9ad06534e9e63ff7d1eed0c81e3574d676c192495e0f175b2ae0fa706b722ead9a852296b3f4 SHA512 6f5b6fb325ac226bf5f308463a54f59570d9ba5efe4329d6116d79cda1f8572b2e4584d005586759ac60e1e7a10782d8ef8ebf30c980220b4780a9846895fcb0
26 +DIST rust-1.59.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 2b75d91a060376bd0711c18b1b04f7d0c7ded0a64b0b086e7799898db7fe24ff49dc09c76695a151e54bd205aa040775c6a36d10fb21ecb2d89d23398b02dc34 SHA512 a04cb7b03e3b963002357d48ecf92d0aef20464f9da38081411832c07df0a7c9ce3755a7b89c86394933446fc18e83a55a7cc01f3739ddddb19dafcbb7b43960
27 +DIST rust-1.59.0-aarch64-unknown-linux-musl.tar.xz 212064268 BLAKE2B 4636001103fc058c2c14a34449846c0378c26ac4dc29588615c5216bb4759b0e92ec97be25e106a5aaaa07059f404c615272e359b0f3b1e9164437e63d863bd0 SHA512 2ec97a48cdac3fb1f7411fdf3a34aac6f64a09991d25174dff97efab0ee724d4dce2bbe29046d243a72b06d406990adf5d1f3f24286fdfb0e658326e28cf5363
28 +DIST rust-1.59.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 4403c9e26f21504494db6e7368cf6a1dd36fcd283dcaa2aac4efaacba107971f44aaffe032ae1cb2530bb1d29bba3e1953d80d378ca9fabf13364da27d809bbc SHA512 5c789ce4591ba8b0f09a254780e1040f5c959c3a952b89d56bf77f0a0f53be2e5f0e712878d21a060937bcda72e440e591ca206c8540635fcc180a50efef6095
29 +DIST rust-1.59.0-arm-unknown-linux-gnueabi.tar.xz 192892448 BLAKE2B b7d194589b9bd07c34ae681985ecc60ad03d450be9c445dff16730d8019a02e6cb1ec6b8c231f9eb42500eeb8dd6d529ff821b1b9eb64f87f11266411133e5bb SHA512 0be42a92fbbe516c0437afdf279e5bb3d43e073ec5ca3ad297f33ef5ec5e5bd150cb728c7dea5dfdcb7b1d1cf3f4122d529e8cf8abe674651a05272837769887
30 +DIST rust-1.59.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 844f7f3655a974821689aa326d072512a12433daa5805a842e54005b88516013b32e46c21b7813e7f5b919716e73f518195b9247c3b9e1e51e85e4f8b102b9ff SHA512 bf7b9491ff88c6d6e6f91d6b77fa50aec48cda99181aab584b37dd81a2a55564a8d769be8ce1868c02ce4dbc36e98cf7c4d651e9e7d799f907e7f9fadc27b08f
31 +DIST rust-1.59.0-arm-unknown-linux-gnueabihf.tar.xz 192816760 BLAKE2B 565d3ed97da64299d6c5525f3b3068ca8ced1d8d6fddbd90506a41062d66c4223928de031320aad1cb12568ccc7e952243c728e13a8a7d6a60ec8c908829e0dc SHA512 5a3693f7edf0f51ba45d8d1471c4ce75926e9cf9c4eb399c9767da116d2250121ced6f08a5c7ed136cbd144e88f3c9fccbc48f805edc82aedbdca37248c0d092
32 +DIST rust-1.59.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 739967abaddc05a466e4ad88316a89fafeabb3c8b50844b09a4946635f4e19b223a76675026389cdef89f0fbe369e3f5c72a0ab64f63104d2a2d5b0d12efa617 SHA512 336f8d7885dc7cc9e44a9e5df381ce1fe516fddea90666478d65aacbba2ffd2d7312b53a895b809fe0135aef8b5604b3eae7b63d7f0d37776c8c1cf6f88395f4
33 +DIST rust-1.59.0-armv7-unknown-linux-gnueabihf.tar.xz 199147596 BLAKE2B 767aa2429a1d1e5633e17fcdafa1a763fb6c86ce392264445be91f79f924b5f1251aae5ee01d66cc902fe991b7ed42a23345d0460862508948d37af48d49b69f SHA512 590b8252b096331b404ecf02dcc11eb12ad1a751d03791a6eb316a7b7bc546c4e933b0acf66e771d394343b636db4dfba00f467715284fa1537399e161bd2d88
34 +DIST rust-1.59.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 77659e1ac997fee4eb50a969e581158ea622968b6de7d02f493096b1b108bd1f32a8c89b7bf1bdfcc7f346eeb14dde31d9b791624a72966f98937398bb833e58 SHA512 a404ddb78aa0d1dc5a8724b4e5b9d46b3c25ef820d50f9039928ce39169c1f8559ed3910a127f1805d6c07671b127a2adcc111bf8af5c1ae41a6f312492ae873
35 +DIST rust-1.59.0-i686-unknown-linux-gnu.tar.xz 212206848 BLAKE2B 949897daa1ec6e6da986ec030fa25db019ece6a16bc2d3442dcd8255d75a97212c6c214af6755a3231370e138a72dd22155719580631e403df987e992b6de308 SHA512 b6db8bdf25e59bfb64b13abb4a1b95e186aa16e1e165a575197e37c410e64c13c2a2d098b5af3935e2b6319566447c4a05b8e8b08b30476dba9d2c7f30000508
36 +DIST rust-1.59.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B bb0e0cc0aebab03512cb261345319a94e3c2108125a90efd169160bad0a94bb71f717d66ee6c9222d5274f82c437baf435880f38652947b1ac79ec9bd53e586f SHA512 774d622d1b7cfc28a561fc8822865727e0fca698ddca2fca006b52d2b922057619ae65d4bbb03bdb0745458a242ab8724305c5cb4fdc8886f70edfded2b4543f
37 +DIST rust-1.59.0-mips-unknown-linux-gnu.tar.xz 151449792 BLAKE2B 0273b6dcf35af0d85c9adb4018b8ac76bef9895f42268e9ebe086f74c95570614b1cb5927c969e6b4a8366aa7a285a19929b819bbf8977343af899a3969eba7c SHA512 9f2c9ca60cbf38ef3ac23d1df7deb86864017addb7761b94a408c096e0a67bf3666ea05f19a57f902c8cc2f3912a96c5b9b91d1c2cd5ae86596c76d30fcce08b
38 +DIST rust-1.59.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 4a7736612612244ca535fb2056089fd9e0426410dff5c98aa44092af918d528527cc0c12a3249fa3b9a278700c7e5395c6155d28129c3c7bced7056203942fc7 SHA512 18dfd434dc628c7f11de5c5f159afea0dc37a8123f490797bc9869941676fa85920a8bc592d4cd4b505b9fb1d67e35220253d67c878b2d938211c556ae60db4e
39 +DIST rust-1.59.0-mips64-unknown-linux-gnuabi64.tar.xz 156962060 BLAKE2B 64c12ac24a55eaac63d9a5173ebcb1b97709280bc770f02c1ba434e57f77e56847a691f17059e421517e7d5ad60e9e3965173aff29c90abfb1b85179631301c8 SHA512 aaf0b8b2f2ee7a3584fcd9bc690f54ce32c0f6a36f2c37ca9d4a10123ddb6d4e95c9343c88dd0830aa586a5a543dbac440a6644434f8035f1c95b3f046a843fe
40 +DIST rust-1.59.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B 2b3a3f268b6a591e6541d3cb19ca733f393cff178932d06cad8d38d4a74c9e43e9a4aaf75c78d4c8084634e7ce3c5d1cb27a6540cc5f034e940efc276c1a3d11 SHA512 020ac1f172ecf41501218c6268ca2dee37842faa7adefc4d3410531f966aef4aaf66b94cd71237467322feb90cca198fdcc8f20f29a3de8c932e747e454a5852
41 +DIST rust-1.59.0-mipsel-unknown-linux-gnu.tar.xz 154605640 BLAKE2B 7b3410db3f0c534012b47cd564f9c14d7a878c0c1b1079bfc2d4ea13826e097b12e5dbef2a83641a339cbcf8538a1eb8c28005c3d46e8338074ab5c15fffdaa9 SHA512 1c096bed6dcd6499ee796c64b8771696ba0cba2db1793ac681b7c65b96ccde188c84306ff90a339bf49bee10955aeb179f0915ae0613c9deeaf766956661521c
42 +DIST rust-1.59.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 59fb0bd7e88119d9cb71a7af46afe2e3a4f37fb687b98409e7a83e0b57840c5db3eaec8baabac6ed26989b7b1ddcda13a9d221cda75f291a814b40c722b46573 SHA512 7c6c970ff971143338a11d774d0bc2ade2fa0dff185483800a54f07161bb181648e1b700c36cc6aced25bab9a383f7259b474b83379845926cde265e705208e0
43 +DIST rust-1.59.0-powerpc-unknown-linux-gnu.tar.xz 170384720 BLAKE2B adc37005f83854707bfa657e5ce5a247de807bd06bde63e6f65745f376502dd36318ccaced1b6d75c3dd3558dd0bbbd7c291854337180fbb18a1647bfa521749 SHA512 046e75c9540fb493fea1cbe9b37ff10f60abe7e31134de85f0e9503b2ddaeb60a03aabf8dd7bd9f55f3d93b01b40aac7cff4f26fe01ef3e3bf5cb052b42287be
44 +DIST rust-1.59.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B f55215329f865d3a6505fd4203170782459ab81c48b8d6bcf2c3d96ba5d4d7a9c89dfa25eb2a4897f74a168a36b7abc2363007549f7f376205a37635ffe1052e SHA512 0a886d64565227f136b3568f6ff51996a8dddc0f3121174ac1e1d53f9a58d56fc76faffe86b24e274078779521f0be03657d76790951c86efe8640510757048f
45 +DIST rust-1.59.0-powerpc64-unknown-linux-gnu.tar.xz 179493740 BLAKE2B 2ff97ec145bbaead0946efca8097de2a294dad0b4b9293cd768b07d37bb5f2709bbdba3a3d949f4294041b747493f931bae3adcdafb1d2ebd0a88a982e77a7ed SHA512 83f204a2d32025fa88bc627f7f2f548a19941dc8f2575dd5c912f75f556853f63cad3c3145106e264943a915d842139cf34305cfb73c6f20646a022f949e1e3a
46 +DIST rust-1.59.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c9bddaa104146bbc04553f2000c06ee4655583251cddd222d6b9e629d74cfd9762d3ee6de732ec1c243ba28ccbfa2ee7fbad499a46a12b5edb6a755c23d7fe02 SHA512 586b9785e8cbb6eef9a7266ac9e0cd295aac93219cde7a7c42270baab417d4d43acffedf300a43d454be3487b0f0402617e78451d2da4bdc3b2a45bae6bece0e
47 +DIST rust-1.59.0-powerpc64le-unknown-linux-gnu.tar.xz 189083640 BLAKE2B 209b02e4ead2cbbfe87e59d8367526b9ecdcb324898e6b8398ddd8f21f0fb89a5d68bd3bcba84bafb435a2092c2c19b81171d4631f1eadc438ff9f29f3f72af0 SHA512 443e0c509df5337ffbef7407aee5fb1260583b0a85bede2a12995bbd4b1719e2865a73d0b79e47ac96d5f53f5c79e9903a22868683a9c0251bbb7ffb09f59fb5
48 +DIST rust-1.59.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 68abc7aa27c59ce7f59f7a4de400ad431c568262263f17af32d8999a5b68d4ed5df067aa8f41a226277f3bccc4908fe1326eecb6142401707f90a6f73b185614 SHA512 731dd8b0f3c33cc37dc783ee07f97727e227ce1a7856f73e87a4b937f6a8ecd1d778e65f1f484faa399795d94b10623fce56d056082bcec460e15fcdea9dbfea
49 +DIST rust-1.59.0-riscv64gc-unknown-linux-gnu.tar.xz 182319648 BLAKE2B 4e2a86431cd0c737ef86cd2bd308c6cf42f6f908a96456de4e2ab3d42f574c56dfd73933ee0177c8d797f17c8566e66d239406360d923797fa5eb49760e698d1 SHA512 4fecc8048270026f3bf5ca63ca32a657c62282e50132cff7af168168063beb65797626ce1ffe90a929e528d8b010193b1d67cbe87782d0b30c7b4e170eba081d
50 +DIST rust-1.59.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 37ec085b78b9b8cb076f676168b7f26d73b593ca4d2231ded00fa3d9f74b16b1e5d99a389df594b7ac75a8f9342ea25a5efb901931662d7a9362c3c14def5e13 SHA512 29b4c934c2a773968f8acdf469b081438780a4f2d1dc460fc851587719373b2151718f4ef3af81043d4ebb39ff2dfe8f4e4612276cfa1fc1946fada57adf133f
51 +DIST rust-1.59.0-s390x-unknown-linux-gnu.tar.xz 186264196 BLAKE2B f1c28c8cbff8dbd476daf7a3dee443aa4d90ea3432813d247853c159f20ee2347159f734ecce4ee85e36dfa886770c841355073c2220c016feb809225f4bd50f SHA512 3e9d86c84867d1f96f4cec4e2312ae604896b4fa61b9ab5b563fafe50b4e63a1bad9ccb90770a672c7730d14dc0235b50f2ca3cbe292220eb4e48a66a8f9d924
52 +DIST rust-1.59.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e97d2b8e50c69311c3d7c2a4fda1f3ae6803e5f53f9a0d2787e816297ffded53ac47e8033e0d5da2d078327133b528328edc9f610483cd1c0ef384317c947f4b SHA512 9e2cc63cd784134fdee91f8603629cdb7227cf56df2a5095cc06ce38df81b6bd3ace24f319c518bbb7619c6f17fc32e9c79bf0b0f57b1db8cd81302d66435a0a
53 +DIST rust-1.59.0-x86_64-unknown-linux-gnu.tar.xz 151858140 BLAKE2B 80eda8c19361b286aaa6ed6178df7f93a131414f6307c87849fa902d373d072643c65642c69ef7302488e0b4ad7883ced1c589606f91edeac83843ed0f6fe124 SHA512 df080a6225275945b0c028099e19aeb0ae34ffcec952b9ce19a6116feddbb29f4f4d27ed30f2c69c108652af637329c20a0d2875d0ff98dd9f7f4902039b6740
54 +DIST rust-1.59.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B cd4387ad25b7f000395e336cdc92916ee7260cbf98a397ce02514444c8d2b35c653012ae6a9f1d5598155c06db573e1fe1a3f0bde1693863855dc17c18b478f5 SHA512 0b6790f0aa531a8251e1a19e0adfdb16bfd39fcec40b83094c26b7169f833114cc8679e2955fcc5359b05cd67564827aa231c521f81d4c41d561e9ef44eea713
55 +DIST rust-1.59.0-x86_64-unknown-linux-musl.tar.xz 246630236 BLAKE2B c9fe24e92055b2e765a8d96181c7c14a0db329f98e006ea2ade285078cad64fa2ef3419d26f30339685cfbcee672bb5e263dd183c960aa0067a27a0b36fe6fbd SHA512 40a711c015fa8eb07aaa11b0698f20886928230a8441cc7523572c7c2768a52557daf5c02bdf61430dcb9a912b8eeda499794af28f269b319ca7fef848ae4cdd
56 +DIST rust-1.59.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 1a96c49754b8670d243d1ad43478d4df8b4f4997490fa9691e3947260d469c7dc9bab192a20fd2ee0592e15785fb059644404d77d716d86b54038d0a76feaf6e SHA512 0c67f2be31fae00a318b5a6184c60f10f80ca5275a5d9dad4459d94aef2fe65624dd7789987d506b691666ac8f7357143fa6bb8207cd5b13b28692aa909a1636
57 DIST rustc-1.58.1-src.tar.xz 124353160 BLAKE2B 686c7272db544ad46f7fb01b4e05f24f4e08ff959a000cadfaef5d8fc413b93f5ed839077bc9715defc7a0a179af091f65c7a5d7104b0b3153f0654c237c094b SHA512 eff3279d2e519343cea542a9ae2daab592e44f35af344e33ff43ed55fc7c824511790d1991dd36a603d12465de8c3688e7194c2b9557f288c587ffa04738c2ce
58 DIST rustc-1.58.1-src.tar.xz.asc 801 BLAKE2B f0b600a503b0ca777dd5d690dca7252ecc6d7d49ca4a9cc8edc0647038f727e9052a861f9868292f837d78d6b02efe9ed5efa85843262c44cf6f73254cc7c9b0 SHA512 983c1ffdc4febf8bce6efc123c76b13f233772bc0a152ffaeb7ebf8f1f7b82a6b5d653407a4d293953d6fbf62c0df4ff4d398a1133061b53ae0f85317a14380b
59 DIST rustc-1.59.0-src.tar.xz 128942756 BLAKE2B b28114f14c9a0fec7db56fde79a985360fd8438c3b14eede49ed12e540c2636be960d0fd800c569af193886ac76fe8bf604d5dae59214ae08cb0cc6cc0ca404e SHA512 acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365
60 DIST rustc-1.59.0-src.tar.xz.asc 801 BLAKE2B 061701c4fdbde930798f9f938ca3642204ae4a2ad9396937ca7d604268813d6d68f4979f20d35abdbbfeec0bb389acd86c9d3d84256db85861f6b11e3dbef80e SHA512 1b90bc01f9d68ba1f70591c4ae707295d7727b790d170a0b757d654684e59d3c26c45b66a21f9ac762debb6867494660c73daaf10be9bd567a38be44c0009f72
61 +DIST rustc-1.60.0-src.tar.xz 136183048 BLAKE2B 8030f32c21f81af6abc7a282aab1189cb7d680c6bce58c119a1beaad71a3eeb36a696eef46a22d366e2c41a2f9182a9a5aa527426f2c8db05278184c37297dd0 SHA512 d0c113e8c2c67bf10773c9403dc4c4700c4deb2fb287bfec51e565d3473d2b481d8ae2c90b272cd67b3a87d7443ea25a34c7b40ba8cd7106bf5d71126ab141c3
62 +DIST rustc-1.60.0-src.tar.xz.asc 801 BLAKE2B 02a2c140e091ea6913a760daa93aa57ba6a7631d0b99867669ce68641d562d436f13ed1f1578713184f06c9307d46e19dfd7c8d74a516b04293bc65c02b90707 SHA512 8136d19d4f3f4c45249b59b689f01d4edf108535ffe1f813771bd244cde1c66184a0bde5a0acfed4fb01015812458204244bbb54e6f5fa86e9b1ef5e92e805e3
63
64 diff --git a/dev-lang/rust/rust-1.60.0.ebuild b/dev-lang/rust/rust-1.60.0.ebuild
65 new file mode 100644
66 index 000000000000..52373f38bea0
67 --- /dev/null
68 +++ b/dev-lang/rust/rust-1.60.0.ebuild
69 @@ -0,0 +1,703 @@
70 +# Copyright 1999-2022 Gentoo Authors
71 +# Distributed under the terms of the GNU General Public License v2
72 +
73 +EAPI=8
74 +
75 +PYTHON_COMPAT=( python3_{8..10} )
76 +
77 +inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing \
78 + multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
79 +
80 +if [[ ${PV} = *beta* ]]; then
81 + betaver=${PV//*beta}
82 + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
83 + MY_P="rustc-beta"
84 + SLOT="beta/${PV}"
85 + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz"
86 +else
87 + ABI_VER="$(ver_cut 1-2)"
88 + SLOT="stable/${ABI_VER}"
89 + MY_P="rustc-${PV}"
90 + SRC="${MY_P}-src.tar.xz"
91 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
92 +fi
93 +
94 +RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
95 +
96 +DESCRIPTION="Systems programming language from Mozilla"
97 +HOMEPAGE="https://www.rust-lang.org/"
98 +
99 +SRC_URI="
100 + https://static.rust-lang.org/dist/${SRC}
101 + verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
102 + !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
103 +"
104 +
105 +# keep in sync with llvm ebuild of the same version as bundled one.
106 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
107 + NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
108 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
109 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
110 +
111 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
112 +
113 +IUSE="clippy cpu_flags_x86_sse2 debug dist doc miri nightly parallel-compiler rls rustfmt rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
114 +
115 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
116 +# we need to *really* make sure we're not pulling more than one slot
117 +# simultaneously.
118 +
119 +# How to use it:
120 +# List all the working slots in LLVM_VALID_SLOTS, newest first.
121 +LLVM_VALID_SLOTS=( 14 )
122 +LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}"
123 +
124 +# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
125 +# (-) usedep needed because we may build with older llvm without that target
126 +LLVM_DEPEND="|| ( "
127 +for _s in ${LLVM_VALID_SLOTS[@]}; do
128 + LLVM_DEPEND+=" ( "
129 + for _x in ${ALL_LLVM_TARGETS[@]}; do
130 + LLVM_DEPEND+="
131 + ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] )"
132 + done
133 + LLVM_DEPEND+=" )"
134 +done
135 +unset _s _x
136 +LLVM_DEPEND+=" )
137 + <sys-devel/llvm-$(( LLVM_MAX_SLOT + 1 )):=
138 + wasm? ( sys-devel/lld )
139 +"
140 +
141 +# to bootstrap we need at least exactly previous version, or same.
142 +# most of the time previous versions fail to bootstrap with newer
143 +# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
144 +# but it fails to bootstrap with 1.48.x
145 +# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.txt
146 +RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
147 +RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
148 +BOOTSTRAP_DEPEND="||
149 + (
150 + =dev-lang/rust-"${RUST_DEP_PREV}"
151 + =dev-lang/rust-bin-"${RUST_DEP_PREV}"
152 + =dev-lang/rust-"${RUST_DEP_CURR}"
153 + =dev-lang/rust-bin-"${RUST_DEP_CURR}"
154 + )
155 +"
156 +
157 +BDEPEND="${PYTHON_DEPS}
158 + app-eselect/eselect-rust
159 + || (
160 + >=sys-devel/gcc-4.7
161 + >=sys-devel/clang-3.5
162 + )
163 + system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
164 + !system-llvm? (
165 + >=dev-util/cmake-3.13.4
166 + dev-util/ninja
167 + )
168 + test? ( sys-devel/gdb )
169 + verify-sig? ( sec-keys/openpgp-keys-rust )
170 +"
171 +
172 +DEPEND="
173 + >=app-arch/xz-utils-5.2
174 + net-misc/curl:=[http2,ssl]
175 + sys-libs/zlib:=
176 + dev-libs/openssl:0=
177 + elibc_musl? ( sys-libs/libunwind:= )
178 + system-llvm? ( ${LLVM_DEPEND} )
179 +"
180 +
181 +RDEPEND="${DEPEND}
182 + app-eselect/eselect-rust
183 + sys-apps/lsb-release
184 +"
185 +
186 +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
187 + miri? ( nightly )
188 + parallel-compiler? ( nightly )
189 + rls? ( rust-src )
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 warning
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 +QA_PRESTRIPPED="
212 + usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/rust-llvm-dwp
213 +"
214 +
215 +# An rmeta file is custom binary format that contains the metadata for the crate.
216 +# rmeta files do not support linking, since they do not contain compiled object files.
217 +# so we can safely silence the warning for this QA check.
218 +QA_EXECSTACK="usr/lib/${PN}/${PV}/lib/rustlib/*/lib*.rlib:lib.rmeta"
219 +
220 +# causes double bootstrap
221 +RESTRICT="test"
222 +
223 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/rust.asc
224 +
225 +PATCHES=(
226 + "${FILESDIR}"/1.55.0-ignore-broken-and-non-applicable-tests.patch
227 + "${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch
228 +)
229 +
230 +S="${WORKDIR}/${MY_P}-src"
231 +
232 +toml_usex() {
233 + usex "${1}" true false
234 +}
235 +
236 +bootstrap_rust_version_check() {
237 + # never call from pkg_pretend. eselect-rust may be not installed yet.
238 + [[ ${MERGE_TYPE} == binary ]] && return
239 + local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
240 + local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
241 + local rustc_version=( $(eselect --brief rust show 2>/dev/null) )
242 + rustc_version=${rustc_version[0]#rust-bin-}
243 + rustc_version=${rustc_version#rust-}
244 +
245 + [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
246 +
247 + if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
248 + eerror "Rust >=${rustc_wanted} is required"
249 + eerror "please run 'eselect rust' and set correct rust version"
250 + die "selected rust version is too old"
251 + elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
252 + eerror "Rust <${rustc_toonew} is required"
253 + eerror "please run 'eselect rust' and set correct rust version"
254 + die "selected rust version is too new"
255 + else
256 + einfo "Using rust ${rustc_version} to build"
257 + fi
258 +}
259 +
260 +pre_build_checks() {
261 + local M=4096
262 + # multiply requirements by 1.5 if we are doing x86-multilib
263 + if use amd64; then
264 + M=$(( $(usex abi_x86_32 15 10) * ${M} / 10 ))
265 + fi
266 + M=$(( $(usex clippy 128 0) + ${M} ))
267 + M=$(( $(usex miri 128 0) + ${M} ))
268 + M=$(( $(usex rls 512 0) + ${M} ))
269 + M=$(( $(usex rustfmt 256 0) + ${M} ))
270 + # add 2G if we compile llvm and 256M per llvm_target
271 + if ! use system-llvm; then
272 + M=$(( 2048 + ${M} ))
273 + local ltarget
274 + for ltarget in ${ALL_LLVM_TARGETS[@]}; do
275 + M=$(( $(usex ${ltarget} 256 0) + ${M} ))
276 + done
277 + fi
278 + M=$(( $(usex wasm 256 0) + ${M} ))
279 + M=$(( $(usex debug 2 1) * ${M} ))
280 + eshopts_push -s extglob
281 + if is-flagq '-g?(gdb)?([1-9])'; then
282 + M=$(( 15 * ${M} / 10 ))
283 + fi
284 + eshopts_pop
285 + M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
286 + M=$(( $(usex doc 256 0) + ${M} ))
287 + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
288 +}
289 +
290 +llvm_check_deps() {
291 + has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]"
292 +}
293 +
294 +pkg_pretend() {
295 + pre_build_checks
296 +}
297 +
298 +pkg_setup() {
299 + pre_build_checks
300 + python-any-r1_pkg_setup
301 +
302 + export LIBGIT2_NO_PKG_CONFIG=1 #749381
303 +
304 + use system-bootstrap && bootstrap_rust_version_check
305 +
306 + if use system-llvm; then
307 + llvm_pkg_setup
308 +
309 + local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
310 + export LLVM_LINK_SHARED=1
311 + export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
312 + fi
313 +}
314 +
315 +src_prepare() {
316 + if ! use system-bootstrap; then
317 + local rust_stage0_root="${WORKDIR}"/rust-stage0
318 + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
319 +
320 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
321 + --without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
322 + fi
323 +
324 + default
325 +}
326 +
327 +src_configure() {
328 + local rust_target="" rust_targets="" arch_cflags
329 +
330 + # Collect rust target names to compile standard libs for all ABIs.
331 + for v in $(multilib_get_enabled_abi_pairs); do
332 + rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
333 + done
334 + if use wasm; then
335 + rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
336 + if use system-llvm; then
337 + # un-hardcode rust-lld linker for this target
338 + # https://bugs.gentoo.org/715348
339 + sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm_base.rs || die
340 + fi
341 + fi
342 + rust_targets="${rust_targets#,}"
343 +
344 + local tools="\"cargo\","
345 + if use clippy; then
346 + tools="\"clippy\",$tools"
347 + fi
348 + if use miri; then
349 + tools="\"miri\",$tools"
350 + fi
351 + if use rls; then
352 + tools="\"rls\",\"analysis\",$tools"
353 + fi
354 + if use rustfmt; then
355 + tools="\"rustfmt\",$tools"
356 + fi
357 + if use rust-src; then
358 + tools="\"src\",$tools"
359 + fi
360 +
361 + local rust_stage0_root
362 + if use system-bootstrap; then
363 + local printsysroot
364 + printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
365 + rust_stage0_root="${printsysroot}"
366 + else
367 + rust_stage0_root="${WORKDIR}"/rust-stage0
368 + fi
369 + # in case of prefix it will be already prefixed, as --print sysroot returns full path
370 + [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
371 +
372 + rust_target="$(rust_abi)"
373 +
374 + cat <<- _EOF_ > "${S}"/config.toml
375 + changelog-seen = 2
376 + [llvm]
377 + download-ci-llvm = false
378 + optimize = $(toml_usex !debug)
379 + release-debuginfo = $(toml_usex debug)
380 + assertions = $(toml_usex debug)
381 + ninja = true
382 + targets = "${LLVM_TARGETS// /;}"
383 + experimental-targets = ""
384 + link-shared = $(toml_usex system-llvm)
385 + $(case "${rust_target}" in
386 + i586-*-linux-*)
387 + # https://github.com/rust-lang/rust/issues/93059
388 + echo 'cflags = "-fcf-protection=none"'
389 + echo 'cxxflags = "-fcf-protection=none"'
390 + echo 'ldflags = "-fcf-protection=none"'
391 + ;;
392 + esac)
393 + [build]
394 + build-stage = 2
395 + test-stage = 2
396 + doc-stage = 2
397 + build = "${rust_target}"
398 + host = ["${rust_target}"]
399 + target = [${rust_targets}]
400 + cargo = "${rust_stage0_root}/bin/cargo"
401 + rustc = "${rust_stage0_root}/bin/rustc"
402 + rustfmt = "${rust_stage0_root}/bin/rustfmt"
403 + docs = $(toml_usex doc)
404 + compiler-docs = false
405 + submodules = false
406 + python = "${EPYTHON}"
407 + locked-deps = true
408 + vendor = true
409 + extended = true
410 + tools = [${tools}]
411 + verbose = 2
412 + sanitizers = false
413 + profiler = false
414 + cargo-native-static = false
415 + [install]
416 + prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
417 + sysconfdir = "etc"
418 + docdir = "share/doc/rust"
419 + bindir = "bin"
420 + libdir = "lib"
421 + mandir = "share/man"
422 + [rust]
423 + # https://github.com/rust-lang/rust/issues/54872
424 + codegen-units-std = 1
425 + optimize = true
426 + debug = $(toml_usex debug)
427 + debug-assertions = $(toml_usex debug)
428 + debug-assertions-std = $(toml_usex debug)
429 + debuginfo-level = $(usex debug 2 0)
430 + debuginfo-level-rustc = $(usex debug 2 0)
431 + debuginfo-level-std = $(usex debug 2 0)
432 + debuginfo-level-tools = $(usex debug 2 0)
433 + debuginfo-level-tests = 0
434 + backtrace = true
435 + incremental = false
436 + default-linker = "$(tc-getCC)"
437 + parallel-compiler = $(toml_usex parallel-compiler)
438 + channel = "$(usex nightly nightly stable)"
439 + description = "gentoo"
440 + rpath = false
441 + verbose-tests = true
442 + optimize-tests = $(toml_usex !debug)
443 + codegen-tests = true
444 + dist-src = false
445 + remap-debuginfo = true
446 + lld = $(usex system-llvm false $(toml_usex wasm))
447 + # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it
448 + # https://github.com/rust-lang/rust/issues/74976
449 + # https://github.com/rust-lang/rust/issues/76526
450 + deny-warnings = $(usex wasm $(usex doc false true) true)
451 + backtrace-on-ice = true
452 + jemalloc = false
453 + [dist]
454 + src-tarball = false
455 + compression-formats = ["xz"]
456 + _EOF_
457 +
458 + for v in $(multilib_get_enabled_abi_pairs); do
459 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
460 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
461 +
462 + cat <<- _EOF_ >> "${S}"/config.env
463 + CFLAGS_${rust_target}=${arch_cflags}
464 + _EOF_
465 +
466 + cat <<- _EOF_ >> "${S}"/config.toml
467 + [target.${rust_target}]
468 + ar = "$(tc-getAR)"
469 + cc = "$(tc-getCC)"
470 + cxx = "$(tc-getCXX)"
471 + linker = "$(tc-getCC)"
472 + ranlib = "$(tc-getRANLIB)"
473 + _EOF_
474 + # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
475 + if use elibc_musl; then
476 + cat <<- _EOF_ >> "${S}"/config.toml
477 + crt-static = false
478 + _EOF_
479 + fi
480 + if use system-llvm; then
481 + cat <<- _EOF_ >> "${S}"/config.toml
482 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
483 + _EOF_
484 + fi
485 + done
486 + if use wasm; then
487 + cat <<- _EOF_ >> "${S}"/config.toml
488 + [target.wasm32-unknown-unknown]
489 + linker = "$(usex system-llvm lld rust-lld)"
490 + _EOF_
491 + fi
492 +
493 + if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below
494 + # experimental cross support
495 + # discussion: https://bugs.gentoo.org/679878
496 + # TODO: c*flags, clang, system-llvm, cargo.eclass target support
497 + # it would be much better if we could split out stdlib
498 + # complilation to separate ebuild and abuse CATEGORY to
499 + # just install to /usr/lib/rustlib/<target>
500 +
501 + # extra targets defined as a bash array
502 + # spec format: <LLVM target>:<rust-target>:<CTARGET>
503 + # best place would be /etc/portage/env/dev-lang/rust
504 + # Example:
505 + # RUST_CROSS_TARGETS=(
506 + # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
507 + # )
508 + # no extra hand holding is done, no target transformations, all
509 + # values are passed as-is with just basic checks, so it's up to user to supply correct values
510 + # valid rust targets can be obtained with
511 + # rustc --print target-list
512 + # matching cross toolchain has to be installed
513 + # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one)
514 + # only gcc toolchains installed with crossdev are checked for now.
515 +
516 + # BUG: we can't pass host flags to cross compiler, so just filter for now
517 + # BUG: this should be more fine-grained.
518 + filter-flags '-mcpu=*' '-march=*' '-mtune=*'
519 +
520 + local cross_target_spec
521 + for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
522 + # extracts first element form <LLVM target>:<rust-target>:<CTARGET>
523 + local cross_llvm_target="${cross_target_spec%%:*}"
524 + # extracts toolchain triples, <rust-target>:<CTARGET>
525 + local cross_triples="${cross_target_spec#*:}"
526 + # extracts first element after before : separator
527 + local cross_rust_target="${cross_triples%%:*}"
528 + # extracts last element after : separator
529 + local cross_toolchain="${cross_triples##*:}"
530 + use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled"
531 + command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain"
532 +
533 + cat <<- _EOF_ >> "${S}"/config.toml
534 + [target.${cross_rust_target}]
535 + ar = "${cross_toolchain}-ar"
536 + cc = "${cross_toolchain}-gcc"
537 + cxx = "${cross_toolchain}-g++"
538 + linker = "${cross_toolchain}-gcc"
539 + ranlib = "${cross_toolchain}-ranlib"
540 + _EOF_
541 + if use system-llvm; then
542 + cat <<- _EOF_ >> "${S}"/config.toml
543 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
544 + _EOF_
545 + fi
546 + if [[ "${cross_toolchain}" == *-musl* ]]; then
547 + cat <<- _EOF_ >> "${S}"/config.toml
548 + musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr"
549 + _EOF_
550 + fi
551 +
552 + # append cross target to "normal" target list
553 + # example 'target = ["powerpc64le-unknown-linux-gnu"]'
554 + # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
555 +
556 + rust_targets="${rust_targets},\"${cross_rust_target}\""
557 + sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die
558 +
559 + ewarn
560 + ewarn "Enabled ${cross_rust_target} rust target"
561 + ewarn "Using ${cross_toolchain} cross toolchain"
562 + ewarn
563 + if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
564 + ewarn "'sys-devel/binutils[multitarget]' is not installed"
565 + ewarn "'strip' will be unable to strip cross libraries"
566 + ewarn "cross targets will be installed with full debug information"
567 + ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files"
568 + ewarn
569 + ewarn "Alternatively llvm-strip can be used, it supports stripping any target"
570 + ewarn "define STRIP=\"llvm-strip\" to use it (experimental)"
571 + ewarn
572 + fi
573 + done
574 + fi # I_KNOW_WHAT_I_AM_DOING_CROSS
575 +
576 + einfo "Rust configured with the following flags:"
577 + echo
578 + echo RUSTFLAGS="${RUSTFLAGS:-}"
579 + echo RUSTFLAGS_BOOTSTRAP="${RUSTFLAGS_BOOTSTRAP:-}"
580 + echo RUSTFLAGS_NOT_BOOTSTRAP="${RUSTFLAGS_NOT_BOOTSTRAP:-}"
581 + env | grep "CARGO_TARGET_.*_RUSTFLAGS="
582 + cat "${S}"/config.env || die
583 + echo
584 + einfo "config.toml contents:"
585 + cat "${S}"/config.toml || die
586 + echo
587 +}
588 +
589 +src_compile() {
590 + # we need \n IFS to have config.env with spaces loaded properly. #734018
591 + (
592 + IFS=$'\n'
593 + env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
594 + "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
595 + )
596 +}
597 +
598 +src_test() {
599 + # https://rustc-dev-guide.rust-lang.org/tests/intro.html
600 +
601 + # those are basic and codegen tests.
602 + local tests=(
603 + codegen
604 + codegen-units
605 + compile-fail
606 + incremental
607 + mir-opt
608 + pretty
609 + run-make
610 + )
611 +
612 + # fails if llvm is not built with ALL targets.
613 + # and known to fail with system llvm sometimes.
614 + use system-llvm || tests+=( assembly )
615 +
616 + # fragile/expensive/less important tests
617 + # or tests that require extra builds
618 + # TODO: instead of skipping, just make some nonfatal.
619 + if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
620 + tests+=(
621 + rustdoc
622 + rustdoc-js
623 + rustdoc-js-std
624 + rustdoc-ui
625 + run-make-fulldeps
626 + ui
627 + ui-fulldeps
628 + )
629 + fi
630 +
631 + local i failed=()
632 + einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
633 + for i in "${tests[@]}"; do
634 + local t="src/test/${i}"
635 + einfo "rust_src_test: running ${t}"
636 + if ! (
637 + IFS=$'\n'
638 + env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \
639 + "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \
640 + -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"
641 + )
642 + then
643 + failed+=( "${t}" )
644 + eerror "rust_src_test: ${t} failed"
645 + fi
646 + done
647 +
648 + if [[ ${#failed[@]} -ne 0 ]]; then
649 + eerror "rust_src_test: failure summary: ${failed[@]}"
650 + die "aborting due to test failures"
651 + fi
652 +}
653 +
654 +src_install() {
655 + (
656 + IFS=$'\n'
657 + env $(cat "${S}"/config.env) DESTDIR="${D}" \
658 + "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
659 + )
660 +
661 + # bug #689562, #689160
662 + rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die
663 + rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die
664 + newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo
665 +
666 + local symlinks=(
667 + cargo
668 + rustc
669 + rustdoc
670 + rust-gdb
671 + rust-gdbgui
672 + rust-lldb
673 + )
674 +
675 + use clippy && symlinks+=( clippy-driver cargo-clippy )
676 + use miri && symlinks+=( miri cargo-miri )
677 + use rls && symlinks+=( rls )
678 + use rustfmt && symlinks+=( rustfmt cargo-fmt )
679 +
680 + einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}"
681 + local i
682 + for i in "${symlinks[@]}"; do
683 + # we need realpath on /usr/bin/* symlink return version-appended binary path.
684 + # so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver>
685 + # need to fix eselect-rust to remove this hack.
686 + local ver_i="${i}-${PV}"
687 + if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then
688 + einfo "Installing ${i} symlink"
689 + ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die
690 + else
691 + ewarn "${i} symlink requested, but source file not found"
692 + ewarn "please report this"
693 + fi
694 + dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}"
695 + done
696 +
697 + # symlinks to switch components to active rust in eselect
698 + dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}"
699 + dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}"
700 + dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}"
701 + dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}"
702 + dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
703 +
704 + newenvd - "50${P}" <<-_EOF_
705 + LDPATH="${EPREFIX}/usr/lib/rust/lib"
706 + MANPATH="${EPREFIX}/usr/lib/rust/man"
707 + $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
708 + $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
709 + _EOF_
710 +
711 + rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die
712 + rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die
713 +
714 + # note: eselect-rust adds EROOT to all paths below
715 + cat <<-_EOF_ > "${T}/provider-${P}"
716 + /usr/bin/cargo
717 + /usr/bin/rustdoc
718 + /usr/bin/rust-gdb
719 + /usr/bin/rust-gdbgui
720 + /usr/bin/rust-lldb
721 + /usr/lib/rustlib
722 + /usr/lib/rust/lib
723 + /usr/lib/rust/libexec
724 + /usr/lib/rust/man
725 + /usr/share/doc/rust
726 + _EOF_
727 +
728 + if use clippy; then
729 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
730 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
731 + fi
732 + if use miri; then
733 + echo /usr/bin/miri >> "${T}/provider-${P}"
734 + echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
735 + fi
736 + if use rls; then
737 + echo /usr/bin/rls >> "${T}/provider-${P}"
738 + fi
739 + if use rustfmt; then
740 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
741 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
742 + fi
743 +
744 + insinto /etc/env.d/rust
745 + doins "${T}/provider-${P}"
746 +
747 + if use dist; then
748 + insinto "/usr/lib/${PN}/${PV}/dist"
749 + doins -r "${S}/build/dist/."
750 + fi
751 +}
752 +
753 +pkg_postinst() {
754 + eselect rust update
755 +
756 + if has_version sys-devel/gdb || has_version dev-util/lldb; then
757 + elog "Rust installs a helper script for calling GDB and LLDB,"
758 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
759 + fi
760 +
761 + if has_version app-editors/emacs; then
762 + elog "install app-emacs/rust-mode to get emacs support for rust."
763 + fi
764 +
765 + if has_version app-editors/gvim || has_version app-editors/vim; then
766 + elog "install app-vim/rust-vim to get vim support for rust."
767 + fi
768 +}
769 +
770 +pkg_postrm() {
771 + eselect rust cleanup
772 +}