Gentoo Archives: gentoo-commits

From: Quentin Retornaz <gentoo@××××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: dev-lang/rust/
Date: Thu, 28 Apr 2022 23:41:04
Message-Id: 1651189206.72b02c8993197c9207963cde5d2a491b0d5b9dfa.quentin@gentoo
1 commit: 72b02c8993197c9207963cde5d2a491b0d5b9dfa
2 Author: orbea <orbea <AT> riseup <DOT> net>
3 AuthorDate: Wed Apr 27 18:21:57 2022 +0000
4 Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
5 CommitDate: Thu Apr 28 23:40:06 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=72b02c89
7
8 dev-lang/rust: Updated for version 1.60.0.
9
10 Signed-off-by: orbea <orbea <AT> riseup.net>
11 Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>
12
13 dev-lang/rust/Manifest | 34 ++
14 dev-lang/rust/rust-1.60.0.ebuild | 704 +++++++++++++++++++++++++++++++++++++++
15 2 files changed, 738 insertions(+)
16
17 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
18 index c7a5acf..69aba14 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 0000000..65daf58
67 --- /dev/null
68 +++ b/dev-lang/rust/rust-1.60.0.ebuild
69 @@ -0,0 +1,704 @@
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.59.0-libressl.patch
227 + "${FILESDIR}"/1.55.0-ignore-broken-and-non-applicable-tests.patch
228 + "${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch
229 +)
230 +
231 +S="${WORKDIR}/${MY_P}-src"
232 +
233 +toml_usex() {
234 + usex "${1}" true false
235 +}
236 +
237 +bootstrap_rust_version_check() {
238 + # never call from pkg_pretend. eselect-rust may be not installed yet.
239 + [[ ${MERGE_TYPE} == binary ]] && return
240 + local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
241 + local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
242 + local rustc_version=( $(eselect --brief rust show 2>/dev/null) )
243 + rustc_version=${rustc_version[0]#rust-bin-}
244 + rustc_version=${rustc_version#rust-}
245 +
246 + [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
247 +
248 + if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
249 + eerror "Rust >=${rustc_wanted} is required"
250 + eerror "please run 'eselect rust' and set correct rust version"
251 + die "selected rust version is too old"
252 + elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
253 + eerror "Rust <${rustc_toonew} is required"
254 + eerror "please run 'eselect rust' and set correct rust version"
255 + die "selected rust version is too new"
256 + else
257 + einfo "Using rust ${rustc_version} to build"
258 + fi
259 +}
260 +
261 +pre_build_checks() {
262 + local M=4096
263 + # multiply requirements by 1.5 if we are doing x86-multilib
264 + if use amd64; then
265 + M=$(( $(usex abi_x86_32 15 10) * ${M} / 10 ))
266 + fi
267 + M=$(( $(usex clippy 128 0) + ${M} ))
268 + M=$(( $(usex miri 128 0) + ${M} ))
269 + M=$(( $(usex rls 512 0) + ${M} ))
270 + M=$(( $(usex rustfmt 256 0) + ${M} ))
271 + # add 2G if we compile llvm and 256M per llvm_target
272 + if ! use system-llvm; then
273 + M=$(( 2048 + ${M} ))
274 + local ltarget
275 + for ltarget in ${ALL_LLVM_TARGETS[@]}; do
276 + M=$(( $(usex ${ltarget} 256 0) + ${M} ))
277 + done
278 + fi
279 + M=$(( $(usex wasm 256 0) + ${M} ))
280 + M=$(( $(usex debug 2 1) * ${M} ))
281 + eshopts_push -s extglob
282 + if is-flagq '-g?(gdb)?([1-9])'; then
283 + M=$(( 15 * ${M} / 10 ))
284 + fi
285 + eshopts_pop
286 + M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
287 + M=$(( $(usex doc 256 0) + ${M} ))
288 + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
289 +}
290 +
291 +llvm_check_deps() {
292 + has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]"
293 +}
294 +
295 +pkg_pretend() {
296 + pre_build_checks
297 +}
298 +
299 +pkg_setup() {
300 + pre_build_checks
301 + python-any-r1_pkg_setup
302 +
303 + export LIBGIT2_NO_PKG_CONFIG=1 #749381
304 +
305 + use system-bootstrap && bootstrap_rust_version_check
306 +
307 + if use system-llvm; then
308 + llvm_pkg_setup
309 +
310 + local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
311 + export LLVM_LINK_SHARED=1
312 + export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
313 + fi
314 +}
315 +
316 +src_prepare() {
317 + if ! use system-bootstrap; then
318 + local rust_stage0_root="${WORKDIR}"/rust-stage0
319 + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
320 +
321 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
322 + --without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
323 + fi
324 +
325 + default
326 +}
327 +
328 +src_configure() {
329 + local rust_target="" rust_targets="" arch_cflags
330 +
331 + # Collect rust target names to compile standard libs for all ABIs.
332 + for v in $(multilib_get_enabled_abi_pairs); do
333 + rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
334 + done
335 + if use wasm; then
336 + rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
337 + if use system-llvm; then
338 + # un-hardcode rust-lld linker for this target
339 + # https://bugs.gentoo.org/715348
340 + sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm_base.rs || die
341 + fi
342 + fi
343 + rust_targets="${rust_targets#,}"
344 +
345 + local tools="\"cargo\","
346 + if use clippy; then
347 + tools="\"clippy\",$tools"
348 + fi
349 + if use miri; then
350 + tools="\"miri\",$tools"
351 + fi
352 + if use rls; then
353 + tools="\"rls\",\"analysis\",$tools"
354 + fi
355 + if use rustfmt; then
356 + tools="\"rustfmt\",$tools"
357 + fi
358 + if use rust-src; then
359 + tools="\"src\",$tools"
360 + fi
361 +
362 + local rust_stage0_root
363 + if use system-bootstrap; then
364 + local printsysroot
365 + printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
366 + rust_stage0_root="${printsysroot}"
367 + else
368 + rust_stage0_root="${WORKDIR}"/rust-stage0
369 + fi
370 + # in case of prefix it will be already prefixed, as --print sysroot returns full path
371 + [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
372 +
373 + rust_target="$(rust_abi)"
374 +
375 + cat <<- _EOF_ > "${S}"/config.toml
376 + changelog-seen = 2
377 + [llvm]
378 + download-ci-llvm = false
379 + optimize = $(toml_usex !debug)
380 + release-debuginfo = $(toml_usex debug)
381 + assertions = $(toml_usex debug)
382 + ninja = true
383 + targets = "${LLVM_TARGETS// /;}"
384 + experimental-targets = ""
385 + link-shared = $(toml_usex system-llvm)
386 + $(case "${rust_target}" in
387 + i586-*-linux-*)
388 + # https://github.com/rust-lang/rust/issues/93059
389 + echo 'cflags = "-fcf-protection=none"'
390 + echo 'cxxflags = "-fcf-protection=none"'
391 + echo 'ldflags = "-fcf-protection=none"'
392 + ;;
393 + esac)
394 + [build]
395 + build-stage = 2
396 + test-stage = 2
397 + doc-stage = 2
398 + build = "${rust_target}"
399 + host = ["${rust_target}"]
400 + target = [${rust_targets}]
401 + cargo = "${rust_stage0_root}/bin/cargo"
402 + rustc = "${rust_stage0_root}/bin/rustc"
403 + rustfmt = "${rust_stage0_root}/bin/rustfmt"
404 + docs = $(toml_usex doc)
405 + compiler-docs = false
406 + submodules = false
407 + python = "${EPYTHON}"
408 + locked-deps = true
409 + vendor = true
410 + extended = true
411 + tools = [${tools}]
412 + verbose = 2
413 + sanitizers = false
414 + profiler = false
415 + cargo-native-static = false
416 + [install]
417 + prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
418 + sysconfdir = "etc"
419 + docdir = "share/doc/rust"
420 + bindir = "bin"
421 + libdir = "lib"
422 + mandir = "share/man"
423 + [rust]
424 + # https://github.com/rust-lang/rust/issues/54872
425 + codegen-units-std = 1
426 + optimize = true
427 + debug = $(toml_usex debug)
428 + debug-assertions = $(toml_usex debug)
429 + debug-assertions-std = $(toml_usex debug)
430 + debuginfo-level = $(usex debug 2 0)
431 + debuginfo-level-rustc = $(usex debug 2 0)
432 + debuginfo-level-std = $(usex debug 2 0)
433 + debuginfo-level-tools = $(usex debug 2 0)
434 + debuginfo-level-tests = 0
435 + backtrace = true
436 + incremental = false
437 + default-linker = "$(tc-getCC)"
438 + parallel-compiler = $(toml_usex parallel-compiler)
439 + channel = "$(usex nightly nightly stable)"
440 + description = "gentoo"
441 + rpath = false
442 + verbose-tests = true
443 + optimize-tests = $(toml_usex !debug)
444 + codegen-tests = true
445 + dist-src = false
446 + remap-debuginfo = true
447 + lld = $(usex system-llvm false $(toml_usex wasm))
448 + # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it
449 + # https://github.com/rust-lang/rust/issues/74976
450 + # https://github.com/rust-lang/rust/issues/76526
451 + deny-warnings = $(usex wasm $(usex doc false true) true)
452 + backtrace-on-ice = true
453 + jemalloc = false
454 + [dist]
455 + src-tarball = false
456 + compression-formats = ["xz"]
457 + _EOF_
458 +
459 + for v in $(multilib_get_enabled_abi_pairs); do
460 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
461 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
462 +
463 + cat <<- _EOF_ >> "${S}"/config.env
464 + CFLAGS_${rust_target}=${arch_cflags}
465 + _EOF_
466 +
467 + cat <<- _EOF_ >> "${S}"/config.toml
468 + [target.${rust_target}]
469 + ar = "$(tc-getAR)"
470 + cc = "$(tc-getCC)"
471 + cxx = "$(tc-getCXX)"
472 + linker = "$(tc-getCC)"
473 + ranlib = "$(tc-getRANLIB)"
474 + _EOF_
475 + # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
476 + if use elibc_musl; then
477 + cat <<- _EOF_ >> "${S}"/config.toml
478 + crt-static = false
479 + _EOF_
480 + fi
481 + if use system-llvm; then
482 + cat <<- _EOF_ >> "${S}"/config.toml
483 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
484 + _EOF_
485 + fi
486 + done
487 + if use wasm; then
488 + cat <<- _EOF_ >> "${S}"/config.toml
489 + [target.wasm32-unknown-unknown]
490 + linker = "$(usex system-llvm lld rust-lld)"
491 + _EOF_
492 + fi
493 +
494 + if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below
495 + # experimental cross support
496 + # discussion: https://bugs.gentoo.org/679878
497 + # TODO: c*flags, clang, system-llvm, cargo.eclass target support
498 + # it would be much better if we could split out stdlib
499 + # complilation to separate ebuild and abuse CATEGORY to
500 + # just install to /usr/lib/rustlib/<target>
501 +
502 + # extra targets defined as a bash array
503 + # spec format: <LLVM target>:<rust-target>:<CTARGET>
504 + # best place would be /etc/portage/env/dev-lang/rust
505 + # Example:
506 + # RUST_CROSS_TARGETS=(
507 + # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
508 + # )
509 + # no extra hand holding is done, no target transformations, all
510 + # values are passed as-is with just basic checks, so it's up to user to supply correct values
511 + # valid rust targets can be obtained with
512 + # rustc --print target-list
513 + # matching cross toolchain has to be installed
514 + # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one)
515 + # only gcc toolchains installed with crossdev are checked for now.
516 +
517 + # BUG: we can't pass host flags to cross compiler, so just filter for now
518 + # BUG: this should be more fine-grained.
519 + filter-flags '-mcpu=*' '-march=*' '-mtune=*'
520 +
521 + local cross_target_spec
522 + for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
523 + # extracts first element form <LLVM target>:<rust-target>:<CTARGET>
524 + local cross_llvm_target="${cross_target_spec%%:*}"
525 + # extracts toolchain triples, <rust-target>:<CTARGET>
526 + local cross_triples="${cross_target_spec#*:}"
527 + # extracts first element after before : separator
528 + local cross_rust_target="${cross_triples%%:*}"
529 + # extracts last element after : separator
530 + local cross_toolchain="${cross_triples##*:}"
531 + use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled"
532 + command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain"
533 +
534 + cat <<- _EOF_ >> "${S}"/config.toml
535 + [target.${cross_rust_target}]
536 + ar = "${cross_toolchain}-ar"
537 + cc = "${cross_toolchain}-gcc"
538 + cxx = "${cross_toolchain}-g++"
539 + linker = "${cross_toolchain}-gcc"
540 + ranlib = "${cross_toolchain}-ranlib"
541 + _EOF_
542 + if use system-llvm; then
543 + cat <<- _EOF_ >> "${S}"/config.toml
544 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
545 + _EOF_
546 + fi
547 + if [[ "${cross_toolchain}" == *-musl* ]]; then
548 + cat <<- _EOF_ >> "${S}"/config.toml
549 + musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr"
550 + _EOF_
551 + fi
552 +
553 + # append cross target to "normal" target list
554 + # example 'target = ["powerpc64le-unknown-linux-gnu"]'
555 + # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
556 +
557 + rust_targets="${rust_targets},\"${cross_rust_target}\""
558 + sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die
559 +
560 + ewarn
561 + ewarn "Enabled ${cross_rust_target} rust target"
562 + ewarn "Using ${cross_toolchain} cross toolchain"
563 + ewarn
564 + if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
565 + ewarn "'sys-devel/binutils[multitarget]' is not installed"
566 + ewarn "'strip' will be unable to strip cross libraries"
567 + ewarn "cross targets will be installed with full debug information"
568 + ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files"
569 + ewarn
570 + ewarn "Alternatively llvm-strip can be used, it supports stripping any target"
571 + ewarn "define STRIP=\"llvm-strip\" to use it (experimental)"
572 + ewarn
573 + fi
574 + done
575 + fi # I_KNOW_WHAT_I_AM_DOING_CROSS
576 +
577 + einfo "Rust configured with the following flags:"
578 + echo
579 + echo RUSTFLAGS="${RUSTFLAGS:-}"
580 + echo RUSTFLAGS_BOOTSTRAP="${RUSTFLAGS_BOOTSTRAP:-}"
581 + echo RUSTFLAGS_NOT_BOOTSTRAP="${RUSTFLAGS_NOT_BOOTSTRAP:-}"
582 + env | grep "CARGO_TARGET_.*_RUSTFLAGS="
583 + cat "${S}"/config.env || die
584 + echo
585 + einfo "config.toml contents:"
586 + cat "${S}"/config.toml || die
587 + echo
588 +}
589 +
590 +src_compile() {
591 + # we need \n IFS to have config.env with spaces loaded properly. #734018
592 + (
593 + IFS=$'\n'
594 + env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
595 + "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
596 + )
597 +}
598 +
599 +src_test() {
600 + # https://rustc-dev-guide.rust-lang.org/tests/intro.html
601 +
602 + # those are basic and codegen tests.
603 + local tests=(
604 + codegen
605 + codegen-units
606 + compile-fail
607 + incremental
608 + mir-opt
609 + pretty
610 + run-make
611 + )
612 +
613 + # fails if llvm is not built with ALL targets.
614 + # and known to fail with system llvm sometimes.
615 + use system-llvm || tests+=( assembly )
616 +
617 + # fragile/expensive/less important tests
618 + # or tests that require extra builds
619 + # TODO: instead of skipping, just make some nonfatal.
620 + if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
621 + tests+=(
622 + rustdoc
623 + rustdoc-js
624 + rustdoc-js-std
625 + rustdoc-ui
626 + run-make-fulldeps
627 + ui
628 + ui-fulldeps
629 + )
630 + fi
631 +
632 + local i failed=()
633 + einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
634 + for i in "${tests[@]}"; do
635 + local t="src/test/${i}"
636 + einfo "rust_src_test: running ${t}"
637 + if ! (
638 + IFS=$'\n'
639 + env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \
640 + "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \
641 + -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"
642 + )
643 + then
644 + failed+=( "${t}" )
645 + eerror "rust_src_test: ${t} failed"
646 + fi
647 + done
648 +
649 + if [[ ${#failed[@]} -ne 0 ]]; then
650 + eerror "rust_src_test: failure summary: ${failed[@]}"
651 + die "aborting due to test failures"
652 + fi
653 +}
654 +
655 +src_install() {
656 + (
657 + IFS=$'\n'
658 + env $(cat "${S}"/config.env) DESTDIR="${D}" \
659 + "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
660 + )
661 +
662 + # bug #689562, #689160
663 + rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die
664 + rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die
665 + newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo
666 +
667 + local symlinks=(
668 + cargo
669 + rustc
670 + rustdoc
671 + rust-gdb
672 + rust-gdbgui
673 + rust-lldb
674 + )
675 +
676 + use clippy && symlinks+=( clippy-driver cargo-clippy )
677 + use miri && symlinks+=( miri cargo-miri )
678 + use rls && symlinks+=( rls )
679 + use rustfmt && symlinks+=( rustfmt cargo-fmt )
680 +
681 + einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}"
682 + local i
683 + for i in "${symlinks[@]}"; do
684 + # we need realpath on /usr/bin/* symlink return version-appended binary path.
685 + # so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver>
686 + # need to fix eselect-rust to remove this hack.
687 + local ver_i="${i}-${PV}"
688 + if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then
689 + einfo "Installing ${i} symlink"
690 + ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die
691 + else
692 + ewarn "${i} symlink requested, but source file not found"
693 + ewarn "please report this"
694 + fi
695 + dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}"
696 + done
697 +
698 + # symlinks to switch components to active rust in eselect
699 + dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}"
700 + dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}"
701 + dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}"
702 + dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}"
703 + dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
704 +
705 + newenvd - "50${P}" <<-_EOF_
706 + LDPATH="${EPREFIX}/usr/lib/rust/lib"
707 + MANPATH="${EPREFIX}/usr/lib/rust/man"
708 + $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
709 + $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
710 + _EOF_
711 +
712 + rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die
713 + rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die
714 +
715 + # note: eselect-rust adds EROOT to all paths below
716 + cat <<-_EOF_ > "${T}/provider-${P}"
717 + /usr/bin/cargo
718 + /usr/bin/rustdoc
719 + /usr/bin/rust-gdb
720 + /usr/bin/rust-gdbgui
721 + /usr/bin/rust-lldb
722 + /usr/lib/rustlib
723 + /usr/lib/rust/lib
724 + /usr/lib/rust/libexec
725 + /usr/lib/rust/man
726 + /usr/share/doc/rust
727 + _EOF_
728 +
729 + if use clippy; then
730 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
731 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
732 + fi
733 + if use miri; then
734 + echo /usr/bin/miri >> "${T}/provider-${P}"
735 + echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
736 + fi
737 + if use rls; then
738 + echo /usr/bin/rls >> "${T}/provider-${P}"
739 + fi
740 + if use rustfmt; then
741 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
742 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
743 + fi
744 +
745 + insinto /etc/env.d/rust
746 + doins "${T}/provider-${P}"
747 +
748 + if use dist; then
749 + insinto "/usr/lib/${PN}/${PV}/dist"
750 + doins -r "${S}/build/dist/."
751 + fi
752 +}
753 +
754 +pkg_postinst() {
755 + eselect rust update
756 +
757 + if has_version sys-devel/gdb || has_version dev-util/lldb; then
758 + elog "Rust installs a helper script for calling GDB and LLDB,"
759 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
760 + fi
761 +
762 + if has_version app-editors/emacs; then
763 + elog "install app-emacs/rust-mode to get emacs support for rust."
764 + fi
765 +
766 + if has_version app-editors/gvim || has_version app-editors/vim; then
767 + elog "install app-vim/rust-vim to get vim support for rust."
768 + fi
769 +}
770 +
771 +pkg_postrm() {
772 + eselect rust cleanup
773 +}