commit:     fb680c283e21b67a3faa57589d47293f5c2c3acf
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 20 21:19:22 2023 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Thu Apr 20 22:16:22 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb680c28

dev-lang/rust: add 1.69.0

Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 dev-lang/rust/Manifest           |  34 ++
 dev-lang/rust/rust-1.69.0.ebuild | 741 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 775 insertions(+)

diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
index 67f681f8cb1b..391a1139b10f 100644
--- a/dev-lang/rust/Manifest
+++ b/dev-lang/rust/Manifest
@@ -126,6 +126,38 @@ DIST rust-1.67.1-x86_64-unknown-linux-gnu.tar.xz 186714164 
BLAKE2B 648efbb302333
 DIST rust-1.67.1-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
669b7c4b0d5382a7d1d0fe49405f2798f67a9e745711dc2c8e7548ea6fdc8f0fefdab37d0594aec14b2745ce45e7c469e79c0cb1d86077ad9c7b6aafc2656827
 SHA512 
067681cb4140a29adfa5f4b141e2f3450dad34b95a1e549a6bc8d759e57da5d2ae69cc165efcdef9d83e2eee06edb6acd587d38c9b2f3d000d7a3f79daccc671
 DIST rust-1.67.1-x86_64-unknown-linux-musl.tar.xz 269831452 BLAKE2B 
a36498528454f1bf0e1812eba005f27e3e281e4e2c117477785f5e48468c3fe316947b7e4360f573f0f4cd6f117e4102db8aeaa616be5bef09fb7518fd230b23
 SHA512 
9a3eb67239a88b875fe55846a2fffbbb1f2a4cc8eed18b5558f0f989d544a8ddfe0861d5b2b860a779833a1660ee622b30320ec9ef83e841724f7a32f08fda06
 DIST rust-1.67.1-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 
b12d0ce1136e355ee027780dfe185ee443de402e531ecc743600aecf081990d4e998fa4a6e6f0f46a886cd806918e23c5e4ccb7cecb0324cb67189984192283f
 SHA512 
37428f0d1d8e2ddb7ce52bce3a297a7f666789d00e7e240180c3e1f7fb5b30bf5e17593cbedebdef95c50406ee82d40ef1f75a576a1a0e02387e1a12ed977c77
+DIST rust-1.68.2-aarch64-unknown-linux-gnu.tar.xz 257441012 BLAKE2B 
621615e68cfffb46552577a9e30e863518fa37f53bb8e00bc639f048d7f05910fd31473ca00242a83b3dafd96db73a19648e0b11641f26ccfaaca5ed17abb2b8
 SHA512 
77fabd0ff2a4e7df8142663932ca146c7f5b463cc7f1d4c2b3ca1c862c29f746a0ca77eff6d37fe582aa4c2cb2c007a1e5d0a1c0214caf1b0792b14934f693aa
+DIST rust-1.68.2-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
eeba8414c9bf414f9a6de46045f9e49ab1a6436c30fcce989aedd2c0658557336f9e919b0372f33fcf11ff3fe64ab9ede54fb9d6e6f4ae8504a6b9401a6f7933
 SHA512 
f2edefb84d75653d3f107349f3962983ff56cc6538c75b8b00e25e790a51e19be10848906ccb90b80bf7742fca2dfa3bfdc4ce974aae6130c7dd71905c9bbbad
+DIST rust-1.68.2-aarch64-unknown-linux-musl.tar.xz 235749524 BLAKE2B 
fc90040069f265d781d73f46bccff8df773830d2d178205126f7a1e67b5c22ca0d87dfeb47f46370522c758804e26fe29cdad29706045bd07404685afc2f77c3
 SHA512 
fceddcdb17f618c576b74590067f9cd476133e86b9c22079400de98489247aba07e12987f29c043067daf1f86e240d8990f0c02b7d58e647d75d8fe82d3229f5
+DIST rust-1.68.2-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 
14e072f897ceb80afc01c9bd531f3f85c9b5dffdfe9a0d6e9a41d9c6f5177427afb0a97916385b480594eee4a787184d9d66d05863d0c6885ab1bb0e37a224c6
 SHA512 
05c42ebcd370782ec5eaeca05fbb5da929eb2f555a8f3e68f622d153f0076cebf7eb78151e95b02e7959b431a7cee670033a172a5eb77116c802e68c20ee622e
+DIST rust-1.68.2-arm-unknown-linux-gnueabi.tar.xz 213433720 BLAKE2B 
29d1040c4f553a52b996720b37d26f76f21f7cefb8152eb50166668bf2b380c0e3202e9d6e2643846fdb957b25d4d07f50be4c41d0055c8d7f2bfcb4f5a4a5bf
 SHA512 
851efffc3b47237f1516198c7dd6ea23d432126854707fcc5e23b7de0d8e149d34b53aafa6af7ad2bdee8d45e61c4771fdc96867635aa8ce2f76fe14e450ed2b
+DIST rust-1.68.2-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 
7f36e95ed463f260db65f50e0b469789007436f4bf560573a5ca0d6e1c23c99b62a361b98c6c5fa6a7c4056007ef2427f7fd61a501f73750470626a5b70db473
 SHA512 
6dcea7816a2be7292bcd1ffc50bb11db9803bc5d93207be99c03089d324bb527f117106f55b215069bbb5e84806beb30073d226e2cc6d257402b073b6561ed18
+DIST rust-1.68.2-arm-unknown-linux-gnueabihf.tar.xz 214517972 BLAKE2B 
76fb64798cc6e7a1c9c6334e6cef0ab18c72f2c00c0399e55f9344565c0fcd19941eabafadc46351cc4fd940fd5b0c199754621614fa72b9d6d0c1d3286b3dc0
 SHA512 
d66922d4d2260ecc66e8de5863b946609e7452f8c76585e7399d1c08865f273bd2a6d2037ad36fd2c02ab7c3010f1e84d252adadca2a9662d16a8f70b920c7ba
+DIST rust-1.68.2-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 
ca3a22fceb130eb57a6b645fa5e9697044cbb6a09365c73a31410dd734cfe81fb79b2c2e706435e483f12436bf77dad26d22e9a92f0d8bb2e7c084a0324dc5c8
 SHA512 
4b630cd85b773f0105d14702fbb8e6ec83d97f73a0cd3e06fec92fcea5806f7ee44d4c83d50f181d8d87a64416f5a79eb1cbee7ffedb1934ab1716ee7812f8ce
+DIST rust-1.68.2-armv7-unknown-linux-gnueabihf.tar.xz 218111640 BLAKE2B 
13a22fdc55de06c0f4172aa34fda616596cac9bf80a9da9aaed5be9ac44d559e682e3f352a72a8beebb7eee6c0d2c561575f73f28436606e84857b9ed2af48c1
 SHA512 
a1855a420ca87d72c50465c282236f42ad1ccffbc746f5dcd0f7abc908fcde512228fcc80fc1babaa7ba10ce9f1d841e3eaf577e892644a1260cff110e2e5327
+DIST rust-1.68.2-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 
e2db4662c03f7e419f190eefd1334b0d59b768d670376810246e186ce6f9041b103c72946c35d3c459b194962f06c9120d239aeb0988dbd54dee698b2bf304a2
 SHA512 
5a700f246674136a42884f9888b6a625578fa07d238764d8f72a0092ab1e3b0f4afcbd8e35b5a4a91389fcd181278563cbb694a60d779a272951948487c811bc
+DIST rust-1.68.2-i686-unknown-linux-gnu.tar.xz 234323888 BLAKE2B 
71cda528925d6b3200c9e1c5350f276cb653c727186f1ce235f82aff9cf65f28dad01f221b46c32825222cbf59605f4011d9e4c2324bdb06d3f57cdba80391b6
 SHA512 
f804b8327d6811a88884d928f77325645da1de0fa2b957f3cde3658474e720015ddadb5d38229d62bb46469df4d7c54511f774289157910e07cce51bd6685059
+DIST rust-1.68.2-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
aad0ddb4ea4a9d0a886e1682a255e994ebf24e2a75c54b92a00a511e4334625acc55d4ea0556d5e3bbe82f45d8013a4631d43f81d829f592dda05667719aa0fc
 SHA512 
549f10d92a47edb2b3fdf20f7c4567315f5910f3cb66edc5ba3f61a25d1840778ff971f275511169f748bfbbe7f485214cb172faecbd572992e4ff645a8f35e5
+DIST rust-1.68.2-mips-unknown-linux-gnu.tar.xz 194817776 BLAKE2B 
23583f6a367951823c335e15df9655402cc75db4a04685ba398fee58d6bfda86ae8fbefc4af7adc363b6f2011a025086f200a9c0afe156c2fe508f717e0fbdbf
 SHA512 
6d981882a9e07c0d7662a442869c2961251db1ed8bf222ddf3e7079479af72c188dffb1418252230ab7f1b2a9e1e11a5aa6f8b9f59b2fb4ac9f71c163b8614d6
+DIST rust-1.68.2-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
9b57cdf81a81780f78ba6f3d13f917bacb35e01966c87cc07f08cd852a1473fec35d115c7951fd41367e465bd90ab90e7ca019e5edf61a92318d6bb2e9c76c2b
 SHA512 
f87a10c3f2e457f8776d51a3fb80aadbf32e95e169b4c5b494d6f6f28164d970c2a82750dd352a574376b827a8ba741705fc8891b25f24744bc9e0572be30f21
+DIST rust-1.68.2-mips64-unknown-linux-gnuabi64.tar.xz 193006892 BLAKE2B 
672f8ff8d8da0fd50565ca96263f97b9fa6fae754a35b8eec98ac82310fb5531f76f15ad141f8f78e6f8c94c96bd849b3f47983305386264aab87e724b3ff5d3
 SHA512 
c007dcaf7dafba7f927b717e140cb161dea7810aa358580b543db59066ff655b600177df211f120db34267444237d2cd7e56d666d813a06507638227f0278b7d
+DIST rust-1.68.2-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B 
f409f4a07a4c3d341a621433892c5d272896061d7b1dc585fcf3f81caec108164634720ebc40f53df82007ec3dbc7af695c34659c3f2c62241ccc12cd2fd732a
 SHA512 
a3edacb8f7daa8578cc9461eb443918477295a04e55845451a98645575132758b8f6232cfcd18d03421b84b9d2ebee4bf52c58339b47a1cbc02435d65462404d
+DIST rust-1.68.2-mipsel-unknown-linux-gnu.tar.xz 200273160 BLAKE2B 
49800150c3ef7dd8cabe97d0e2a6af2de45bab8d5e7f03791d1acae8caf066d6393c56344136e8cd7867ac0756606e82ab3a1390b25bba038ab940a4ba403c82
 SHA512 
73985bf7ff96bf13a29f84d8a1daf93e1547548697ef79a601808e5d10a31cf813d724b8e3d3872da5e719b35298563843fa1e7b69021655b898e732d95cfce5
+DIST rust-1.68.2-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
5090f375f6638eff5af4d2b8ed3ae4dc274378548aa8336ee0458383a8e28f566329eeb5e4b11ecb7c2b0bcd2bf974f0fb0c073712ba5dc6daec73a1f07181f2
 SHA512 
69089eefd8c20ccc508527225710b1b7122dc2dd887ed43d18ace4df888d0dcb7d2981eff89115d06eca5607593ce22246a4cace4139e88da0882b8d1d3b2e67
+DIST rust-1.68.2-powerpc-unknown-linux-gnu.tar.xz 220703376 BLAKE2B 
05e7d9bbd4359376a568b4f9cabae340edb002e96713f9c5bd6b4e12c42fd947e53c1ece1cf9dfcb004489aa4c3f72d3c8a689df3c137b8ab362e536d62f2bcd
 SHA512 
1fd9b3a58581a10dbbd01522cf3f5c1dedea91c283aacace3b1c2eab1460cd3141d1b817c8cf60e6488872777919b6723129315add84bd6e8b98d12e53a45419
+DIST rust-1.68.2-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
fee49ea534e0f48b4613ac4cb4d62687bdaf48261fbf9237a3ead0fcfbf144dd3c2f5c500465f31e1ff358494a8251fe45045ffd3305bb99e5eb7fb3da635350
 SHA512 
426d61a3655167de5639432ef635e69e551c514d4105df208ce10dfa27c9ac7f7bcba04302e540cbdfd8fc2953c2a9e5dd7e61c905a2c42a05382df36072afeb
+DIST rust-1.68.2-powerpc64-unknown-linux-gnu.tar.xz 219023868 BLAKE2B 
f81398dab67be593d968b3f9b1c3d3c3c96670e8e099d31d9d00662e966ed3269bca8fb84f4b2af6182d5ba74ab25a7adca38e11569600e91929fac381252ab8
 SHA512 
87db3e97fb20f72b24ef114ce79e22e600c2effd2f17b90d91a9b190203edf7c6c73f78f1eb6e6efb999b99ca2397bee1470bcfde7099c7eda6fed7fa2a93deb
+DIST rust-1.68.2-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
fc7ec509b4a6d3e607aa6e437a65e61956104b5206a1c452faee393f6dcec6d4823bdb9409918e86adec15132191d0541e5c39c72b49dc4423b58caec64b8b35
 SHA512 
0c4902853ea0036ad73a93d239b07f771060ea2fc0b38bd71e690551214b36e3fd903d8d57c435b7d1ae867aa78016012d4c04745c0f67c63c3d0b36e560f348
+DIST rust-1.68.2-powerpc64le-unknown-linux-gnu.tar.xz 231072852 BLAKE2B 
e989fbd54f97605ad33af295a458bab2eeb8866d367965102d2e66cf5dba5a38e9e8c4eae784dd738c70705fa8014561087e1e526508546e7aa393afd55c4307
 SHA512 
810dd24af733b5493fe37ebb0af59b0fd03587d862e4b63fe9357d0acbbfb8103430a2313d07a2bef7a2c2ffcf0a4f5cf8a8b2c4a1dd1212446ff49ba4fc2a70
+DIST rust-1.68.2-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
2e9becc108c2b85601530ceb07ef9103297e0fefc01c7a4302a5c23d083f679372cf7cf1328a429ab6f1b06a29fcb34eecbb33f7d8790ca5a515ecafa7672e74
 SHA512 
23499a386e87e6a7a9c64f2a00d36f4602fcbbc03b3561afcaa741b29bcb6ceb50a8d040dd012bd1cacec2d8899a5840419e70bee1840de5a027a5a111a64864
+DIST rust-1.68.2-riscv64gc-unknown-linux-gnu.tar.xz 207916672 BLAKE2B 
81c09e028d0e68730146daf4e1b50c4cad9a5df37ca5e5f50325a86ed97e6198773b94589e6fde2856d09aadab62aacc1c6362d869968ca3c261775b4958b9f8
 SHA512 
b532575e7aa7f1ee32109b5beb22f184e81346773edf362a44b24363b38ca10744d96052cee82d1a98c026edb39b6195332922847f184ca3dd8d25a8a5e03fd9
+DIST rust-1.68.2-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
31bb980aa2a6b45e7a51cba0f14ed86674617f2cf8ee0583765d01502bf754f59a0cd960ad50a1e21ea8f6898e83e307d39be1eecc2b3344f5681c1908cfb436
 SHA512 
66c8a3efd1c579784321f24edcb4113c184516912ad490c9088d2141ac527af85acc64b6c67454661d1a991a710758cbebbfaaac7ae086b463fbdae7d1c89bb0
+DIST rust-1.68.2-s390x-unknown-linux-gnu.tar.xz 234071260 BLAKE2B 
dbcd38a0503d3e131a7786e11874cf0e3dbca13c5ae7c9b605caec529aae5c498722d2685557be43387e2d2b855892720b6e84021765bebdfeea4a2dbe7502f1
 SHA512 
00614d53a4d34b4714febfc7c4eb2f92446ba928e8bfde0de537de51474704525456b628b60634f0220278c5d403da55c793a30d744362b181cacb1a9d8fac1b
+DIST rust-1.68.2-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
9eb99100e0e61ffa6f031b9f04fbcedccfbecd897e3232c8e192e52b3d5c103f8558de5e23e7eb19487eec890c0fef2c9be952edfdcd2f1a05b5b09d3a0fa82e
 SHA512 
4d36bab880a386e6e70d23682435e1a960be3c88387ffcd955a55ce451acd3d49085b0db05230f874519aef12192eebbbbc26627807a6fa7021c89ff5d82f814
+DIST rust-1.68.2-x86_64-unknown-linux-gnu.tar.xz 185953856 BLAKE2B 
11fc1f284c77261d69b2ba582843cbd15f3bde832cfa038764e68711de73c9a86f9e36f69a81606b4d5dcb0f9c0f413c88cb400e17511b980671a246ff63aa2a
 SHA512 
7f3344591be014b86e55c21fab27587b00756aa46a366cde2149fafa36b5dfae29e126f70511b40bfad131a1d4d27c8cf82add3474b69e2c498c7380961a23e5
+DIST rust-1.68.2-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 
06f3d90126dfe5dcfb8147c8529f333bf635c5c669cc0b5d45156fed85e87aaaa67d8d9c4b250f77e1f0998e77e5635d3f3056447a032eac07bf847fc532a383
 SHA512 
1d826f0f8ed896d54139b4ae78205aee5cee3ce6f5449d94b8edb8fc19ab589bde6720eb1644502fc45fe0bd452e2e5209de83c99f7c4285a896cfaacbfdad36
+DIST rust-1.68.2-x86_64-unknown-linux-musl.tar.xz 270073164 BLAKE2B 
7d69a578e1d4a8fa75cfea6e630265f1c73cca08ed86ddc7858e7770755431dbf13ddaadcf8035fc2b7d2d7b7144a08b3e3a9fa20afcb5cfed7a31d82098fe5e
 SHA512 
b0294141f1e51176664ae841ea55991826ccd15d0d36b03471831baa202ecb97434bf96479e167772bd62f05b80b49878f89a065a91e00026f0aabe7c02fe552
+DIST rust-1.68.2-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 
7de58f292729b349fe0694c724aa88ae5bec5a313952fbf7e62a361c7fba4cdedbd99238a4a826d7b627af30ddf4aca8646f6b061f44983a52dcf2ae8d52e56a
 SHA512 
867e0c20049352fb696b99de9d0d8c5df8da0f1ea8eb9a0446884c2d741df7434bf83303694de208e75e64cd73664b979cf117d02db804bff9b4d6de8ee43638
 DIST rustc-1.65.0-src.tar.xz 139674928 BLAKE2B 
a218263fb67e306b153f5a6dae95b5ec653acaa5eb4b833862d6f0fd4685a8cec097dadc1b8a934e1bf6055672c7a617f9a0ad4a7dbf2e78084297f10b7ada04
 SHA512 
3d0369ed3028209c4ecb9b9e7b5f5e3a20be8cc05199675df4f091d62a96c0734bc1dbd7630928fe162792392ec6d0daf9ceed10771531ce022200c7b631e3be
 DIST rustc-1.65.0-src.tar.xz.asc 801 BLAKE2B 
43ff92011cd6f7f34ce0495fa341379e5907d032ea90f91e533e5edaec6ad518aad50a9d8b2694074d6909ee96aa779403b16e95792e962e79c1b967542ae26f
 SHA512 
75b9be53363022c81333117876cbcc573bbd4733edf767cbb164218644efb1a9c4bfc2aa73aaa1e39f248a84f1adacb1930a94a6e63f60093ff760fb9ae02efc
 DIST rustc-1.66.1-src.tar.xz 141692940 BLAKE2B 
3fae45345998386fda1b11ec896fac4613b8e3f0092bc0df29c9685f4a4012c0bd1b600911c2d19bcfa8f5a84b8a3c39d4c9e062a62cd61925b59129e1cd72b9
 SHA512 
1944c024c603140d0a9236043a3bd1d0d211dd8d368d6d82a3a620f1ff43b29624755b0943f2b38b40a188c7eee77a840238ea757eaf435e2a3fa6a0e6b82832
@@ -136,3 +168,5 @@ DIST rustc-1.68.1-src.tar.xz 147834548 BLAKE2B 
98e02c1ff3ed37cd52d1f348331ffe007
 DIST rustc-1.68.1-src.tar.xz.asc 801 BLAKE2B 
5e0a2d95360fb5d8bed9e759111db225315b93d3042af19bb9fc9f239cabf9f32b85f2e616913ff3ce5fc8111deeb972bc184584ca473216b7a5320a255304a6
 SHA512 
5330405c09077070a63c04fc1c7059219d046fbaa24997861365199e48da98be4fe2a04fdc5c54a03166097bde58b4e51bdc8296ca89974d2dcec1da279bdab2
 DIST rustc-1.68.2-src.tar.xz 147835648 BLAKE2B 
4b6deab818d915afe67a96f4d32a758c15a832041a77d9da5d065a903ea2718e0e7ebbc0cd1baaa436b655bdb93a62e0fb76f9e37aed595c064e0857201bb091
 SHA512 
8b085d0351e19100e9abc24b10c44a0939a1d35ba23421da4ece345d7373f7dbad1dc6a2ae153c1259404dd96b41e2682e711cf2b0b63fd03a196760cddbcdd3
 DIST rustc-1.68.2-src.tar.xz.asc 801 BLAKE2B 
6ac2444950e5f919d09823ea3eef50364ad7b295126b090178872970f03c43ca9747779e0873138ca3a0b753eff79d2ef36d8b70c6a6050039ba9f9018571016
 SHA512 
86ccbb8ea89f820ba92ad9cbfb8f4bda3393e2c24d699355fd559a2339ff39bcce2a027ebd1b043f11de24b00cdac8c42d252915b36e711eb1d80f49a8007d47
+DIST rustc-1.69.0-src.tar.xz 127242864 BLAKE2B 
03f7f3784cb137bede0593dfc008347bb0bb25c982c058175ac2b0442c2593a5a7e2c4539c848ad4375d994c1b7900019120790f0fe12385b413eecc1647d70a
 SHA512 
724398fc208ec18adbd8ba81a445e23d1001b746990f36b869126be8a45f1cdfa75f5b9cbdd0abbab506f91a56d3736ab247677699ebd69525245558cfc01a60
+DIST rustc-1.69.0-src.tar.xz.asc 801 BLAKE2B 
2f9b95440c35403fe663f91531cc73681c1c5d5dcbaa10d53a36d542656c097eb4a4320fc12d8df228d5dfb57dd12eb9441c3bd0ba54b7d180e23ded3d2527bb
 SHA512 
8f4c7e6e246a676f53d77b331fe5153eedbd3d8e9f6d922fecc78c8c6fdbbef4610308c93e5af6d8e0d744e6b3ce4bf01b39e29813475a50a38240f679c25156

diff --git a/dev-lang/rust/rust-1.69.0.ebuild b/dev-lang/rust/rust-1.69.0.ebuild
new file mode 100644
index 000000000000..ee784a354649
--- /dev/null
+++ b/dev-lang/rust/rust-1.69.0.ebuild
@@ -0,0 +1,741 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing 
\
+       multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs 
verify-sig
+
+if [[ ${PV} = *beta* ]]; then
+       betaver=${PV//*beta}
+       BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
+       MY_P="rustc-beta"
+       SLOT="beta/${PV}"
+       SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz"
+else
+       ABI_VER="$(ver_cut 1-2)"
+       SLOT="stable/${ABI_VER}"
+       MY_P="rustc-${PV}"
+       SRC="${MY_P}-src.tar.xz"
+       KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+fi
+
+RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).2"
+
+DESCRIPTION="Systems programming language from Mozilla"
+HOMEPAGE="https://www.rust-lang.org/";
+
+SRC_URI="
+       https://static.rust-lang.org/dist/${SRC}
+       verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
+       !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
+"
+
+# keep in sync with llvm ebuild of the same version as bundled one.
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
+       NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
+
+LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA"
+
+IUSE="clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind miri nightly 
parallel-compiler profiler rustfmt rust-analyzer rust-src system-bootstrap 
system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
+
+# Please keep the LLVM dependency block separate. Since LLVM is slotted,
+# we need to *really* make sure we're not pulling more than one slot
+# simultaneously.
+
+# How to use it:
+# List all the working slots in LLVM_VALID_SLOTS, newest first.
+LLVM_VALID_SLOTS=( 15 )
+LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}"
+
+# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
+# (-) usedep needed because we may build with older llvm without that target
+LLVM_DEPEND="|| ( "
+for _s in ${LLVM_VALID_SLOTS[@]}; do
+       LLVM_DEPEND+=" ( "
+       for _x in ${ALL_LLVM_TARGETS[@]}; do
+               LLVM_DEPEND+="
+                       ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] )
+                       wasm? ( sys-devel/lld:${_s} )"
+       done
+       LLVM_DEPEND+=" )"
+done
+unset _s _x
+LLVM_DEPEND+=" )
+       <sys-devel/llvm-$(( LLVM_MAX_SLOT + 1 )):=
+"
+
+# to bootstrap we need at least exactly previous version, or same.
+# most of the time previous versions fail to bootstrap with newer
+# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
+# but it fails to bootstrap with 1.48.x
+# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
+RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
+RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
+BOOTSTRAP_DEPEND="||
+       (
+               =dev-lang/rust-"${RUST_DEP_PREV}"
+               =dev-lang/rust-bin-"${RUST_DEP_PREV}"
+               =dev-lang/rust-"${RUST_DEP_CURR}"
+               =dev-lang/rust-bin-"${RUST_DEP_CURR}"
+       )
+"
+
+BDEPEND="${PYTHON_DEPS}
+       app-eselect/eselect-rust
+       || (
+               >=sys-devel/gcc-4.7
+               >=sys-devel/clang-3.5
+       )
+       system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
+       !system-llvm? (
+               >=dev-util/cmake-3.13.4
+               dev-util/ninja
+       )
+       test? ( sys-devel/gdb )
+       verify-sig? ( sec-keys/openpgp-keys-rust )
+"
+
+DEPEND="
+       >=app-arch/xz-utils-5.2
+       net-misc/curl:=[http2,ssl]
+       sys-libs/zlib:=
+       dev-libs/openssl:0=
+       system-llvm? (
+               ${LLVM_DEPEND}
+               llvm-libunwind? ( sys-libs/llvm-libunwind:= )
+       )
+       !system-llvm? (
+               !llvm-libunwind? (
+                       elibc_musl? ( sys-libs/libunwind:= )
+               )
+       )
+"
+
+RDEPEND="${DEPEND}
+       app-eselect/eselect-rust
+       sys-apps/lsb-release
+"
+
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
+       miri? ( nightly )
+       parallel-compiler? ( nightly )
+       test? ( ${ALL_LLVM_TARGETS[*]} )
+       wasm? ( llvm_targets_WebAssembly )
+       x86? ( cpu_flags_x86_sse2 )
+"
+
+# we don't use cmake.eclass, but can get a warning
+CMAKE_WARN_UNUSED_CLI=no
+
+QA_FLAGS_IGNORED="
+       usr/lib/${PN}/${PV}/bin/.*
+       usr/lib/${PN}/${PV}/libexec/.*
+       usr/lib/${PN}/${PV}/lib/lib.*.so
+       usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/.*
+       usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
+"
+
+QA_SONAME="
+       usr/lib/${PN}/${PV}/lib/lib.*.so.*
+       usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
+"
+
+QA_PRESTRIPPED="
+       usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/rust-llvm-dwp
+       usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/self-contained/crtn.o
+"
+
+# An rmeta file is custom binary format that contains the metadata for the 
crate.
+# rmeta files do not support linking, since they do not contain compiled 
object files.
+# so we can safely silence the warning for this QA check.
+QA_EXECSTACK="usr/lib/${PN}/${PV}/lib/rustlib/*/lib*.rlib:lib.rmeta"
+
+# causes double bootstrap
+RESTRICT="test"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/rust.asc
+
+PATCHES=(
+       "${FILESDIR}"/1.68.0-ignore-broken-and-non-applicable-tests.patch
+       "${FILESDIR}"/1.62.1-musl-dynamic-linking.patch
+       "${FILESDIR}"/1.67.0-doc-wasm.patch
+)
+
+S="${WORKDIR}/${MY_P}-src"
+
+toml_usex() {
+       usex "${1}" true false
+}
+
+bootstrap_rust_version_check() {
+       # never call from pkg_pretend. eselect-rust may be not installed yet.
+       [[ ${MERGE_TYPE} == binary ]] && return
+       local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
+       local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
+       local rustc_version=( $(eselect --brief rust show 2>/dev/null) )
+       rustc_version=${rustc_version[0]#rust-bin-}
+       rustc_version=${rustc_version#rust-}
+
+       [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, 
check 'eselect rust' output"
+
+       if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
+               eerror "Rust >=${rustc_wanted} is required"
+               eerror "please run 'eselect rust' and set correct rust version"
+               die "selected rust version is too old"
+       elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
+               eerror "Rust <${rustc_toonew} is required"
+               eerror "please run 'eselect rust' and set correct rust version"
+               die "selected rust version is too new"
+       else
+               einfo "Using rust ${rustc_version} to build"
+       fi
+}
+
+pre_build_checks() {
+       local M=8192
+       # multiply requirements by 1.3 if we are doing x86-multilib
+       if use amd64; then
+               M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
+       fi
+       M=$(( $(usex clippy 128 0) + ${M} ))
+       M=$(( $(usex miri 128 0) + ${M} ))
+       M=$(( $(usex rustfmt 256 0) + ${M} ))
+       # add 2G if we compile llvm and 256M per llvm_target
+       if ! use system-llvm; then
+               M=$(( 2048 + ${M} ))
+               local ltarget
+               for ltarget in ${ALL_LLVM_TARGETS[@]}; do
+                       M=$(( $(usex ${ltarget} 256 0) + ${M} ))
+               done
+       fi
+       M=$(( $(usex wasm 256 0) + ${M} ))
+       M=$(( $(usex debug 2 1) * ${M} ))
+       eshopts_push -s extglob
+       if is-flagq '-g?(gdb)?([1-9])'; then
+               M=$(( 15 * ${M} / 10 ))
+       fi
+       eshopts_pop
+       M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
+       M=$(( $(usex doc 256 0) + ${M} ))
+       CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
+}
+
+llvm_check_deps() {
+       has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// 
/,}]"
+}
+
+# Is LLVM being linked against libc++?
+is_libcxx_linked() {
+       local code='#include <ciso646>
+#if defined(_LIBCPP_VERSION)
+       HAVE_LIBCXX
+#endif
+'
+       local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - 
<<<"${code}") || return 1
+       [[ ${out} == *HAVE_LIBCXX* ]]
+}
+
+pkg_pretend() {
+       pre_build_checks
+}
+
+pkg_setup() {
+       pre_build_checks
+       python-any-r1_pkg_setup
+
+       export LIBGIT2_NO_PKG_CONFIG=1 #749381
+
+       use system-bootstrap && bootstrap_rust_version_check
+
+       if use system-llvm; then
+               llvm_pkg_setup
+
+               local llvm_config="$(get_llvm_prefix 
"${LLVM_MAX_SLOT}")/bin/llvm-config"
+               export LLVM_LINK_SHARED=1
+               export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" 
--libdir)"
+       fi
+}
+
+esetup_unwind_hack() {
+       # https://bugs.gentoo.org/870280
+       # this is a hack needed to bootstrap with libgcc_s linked tarball on 
llvm-libunwind system.
+       # it should trigger for internal bootstrap or system-bootstrap with 
rust-bin.
+       # the whole idea is for stage0 to bootstrap with fake libgcc_s.
+       # final stage will receive -L${T}/lib but not -lgcc_s args, producing 
clean compiler.
+       local fakelib="${T}/fakelib"
+       mkdir -p "${fakelib}" || die
+       # we need both symlinks, one for cargo runtime, other for linker.
+       ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || 
die
+       ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
+       export LD_LIBRARY_PATH="${fakelib}"
+       export RUSTFLAGS+=" -L${fakelib}"
+       # this is a literally magic variable that gets through cargo cache, 
without it some
+       # crates ignore RUSTFLAGS.
+       # this variable can not contain leading space.
+       export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
+}
+
+src_prepare() {
+       if ! use system-bootstrap; then
+               has_version sys-devel/gcc || esetup_unwind_hack
+               local rust_stage0_root="${WORKDIR}"/rust-stage0
+               local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
+
+               "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
+                       --without=rust-docs-json-preview,rust-docs 
--destdir="${rust_stage0_root}" --prefix=/ || die
+       fi
+
+       default
+}
+
+src_configure() {
+       filter-flags '-flto*' # https://bugs.gentoo.org/862109 
https://bugs.gentoo.org/866231
+
+       local rust_target="" rust_targets="" arch_cflags
+
+       # Collect rust target names to compile standard libs for all ABIs.
+       for v in $(multilib_get_enabled_abi_pairs); do
+               rust_targets+=",\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
+       done
+       if use wasm; then
+               rust_targets+=",\"wasm32-unknown-unknown\""
+               if use system-llvm; then
+                       # un-hardcode rust-lld linker for this target
+                       # https://bugs.gentoo.org/715348
+                       sed -i '/linker:/ s/rust-lld/wasm-ld/' 
compiler/rustc_target/src/spec/wasm_base.rs || die
+               fi
+       fi
+       rust_targets="${rust_targets#,}"
+
+       local tools='"cargo"'
+       use clippy && tools+=',"clippy"'
+       use miri && tools+=',"miri"'
+       use profiler && tools+=',"rust-demangler"'
+       use rustfmt && tools+=',"rustfmt"'
+       use rust-analyzer && tools+=',"rust-analyzer","analysis"'
+       use rust-src && tools+=',"src"'
+
+       local rust_stage0_root
+       if use system-bootstrap; then
+               local printsysroot
+               printsysroot="$(rustc --print sysroot || die "Can't determine 
rust's sysroot")"
+               rust_stage0_root="${printsysroot}"
+       else
+               rust_stage0_root="${WORKDIR}"/rust-stage0
+       fi
+       # in case of prefix it will be already prefixed, as --print sysroot 
returns full path
+       [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a 
directory"
+
+       rust_target="$(rust_abi)"
+
+       local cm_btype="$(usex debug DEBUG RELEASE)"
+       cat <<- _EOF_ > "${S}"/config.toml
+               changelog-seen = 2
+               [llvm]
+               download-ci-llvm = false
+               optimize = $(toml_usex !debug)
+               release-debuginfo = $(toml_usex debug)
+               assertions = $(toml_usex debug)
+               ninja = true
+               targets = "${LLVM_TARGETS// /;}"
+               experimental-targets = ""
+               link-shared = $(toml_usex system-llvm)
+               $(if is_libcxx_linked; then
+                       # https://bugs.gentoo.org/732632
+                       echo "use-libcxx = true"
+                       echo "static-libstdcpp = false"
+               fi)
+               $(case "${rust_target}" in
+                       i586-*-linux-*)
+                               # https://github.com/rust-lang/rust/issues/93059
+                               echo 'cflags = "-fcf-protection=none"'
+                               echo 'cxxflags = "-fcf-protection=none"'
+                               echo 'ldflags = "-fcf-protection=none"'
+                               ;;
+                       *)
+                               ;;
+               esac)
+               [llvm.build-config]
+               CMAKE_VERBOSE_MAKEFILE = "ON"
+               CMAKE_C_FLAGS_${cm_btype} = "${CFLAGS}"
+               CMAKE_CXX_FLAGS_${cm_btype} = "${CXXFLAGS}"
+               CMAKE_EXE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}"
+               CMAKE_MODULE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}"
+               CMAKE_SHARED_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}"
+               CMAKE_STATIC_LINKER_FLAGS_${cm_btype} = "${ARFLAGS}"
+               [build]
+               build-stage = 2
+               test-stage = 2
+               build = "${rust_target}"
+               host = ["${rust_target}"]
+               target = [${rust_targets}]
+               cargo = "${rust_stage0_root}/bin/cargo"
+               rustc = "${rust_stage0_root}/bin/rustc"
+               rustfmt = "${rust_stage0_root}/bin/rustfmt"
+               docs = $(toml_usex doc)
+               compiler-docs = false
+               submodules = false
+               python = "${EPYTHON}"
+               locked-deps = true
+               vendor = true
+               extended = true
+               tools = [${tools}]
+               verbose = 2
+               sanitizers = false
+               profiler = $(toml_usex profiler)
+               cargo-native-static = false
+               [install]
+               prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
+               sysconfdir = "etc"
+               docdir = "share/doc/rust"
+               bindir = "bin"
+               libdir = "lib"
+               mandir = "share/man"
+               [rust]
+               # https://github.com/rust-lang/rust/issues/54872
+               codegen-units-std = 1
+               optimize = true
+               debug = $(toml_usex debug)
+               debug-assertions = $(toml_usex debug)
+               debug-assertions-std = $(toml_usex debug)
+               debuginfo-level = $(usex debug 2 0)
+               debuginfo-level-rustc = $(usex debug 2 0)
+               debuginfo-level-std = $(usex debug 2 0)
+               debuginfo-level-tools = $(usex debug 2 0)
+               debuginfo-level-tests = 0
+               backtrace = true
+               incremental = false
+               default-linker = "$(tc-getCC)"
+               parallel-compiler = $(toml_usex parallel-compiler)
+               channel = "$(usex nightly nightly stable)"
+               description = "gentoo"
+               rpath = false
+               verbose-tests = true
+               optimize-tests = $(toml_usex !debug)
+               codegen-tests = true
+               dist-src = false
+               remap-debuginfo = true
+               lld = $(usex system-llvm false $(toml_usex wasm))
+               # only deny warnings if doc+wasm are NOT requested, documenting 
stage0 wasm std fails without it
+               # https://github.com/rust-lang/rust/issues/74976
+               # https://github.com/rust-lang/rust/issues/76526
+               deny-warnings = $(usex wasm $(usex doc false true) true)
+               backtrace-on-ice = true
+               jemalloc = false
+               [dist]
+               src-tarball = false
+               compression-formats = ["xz"]
+       _EOF_
+
+       for v in $(multilib_get_enabled_abi_pairs); do
+               rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
+               arch_cflags="$(get_abi_CFLAGS ${v##*.})"
+
+               export CFLAGS_${rust_target//-/_}="${arch_cflags}"
+
+               cat <<- _EOF_ >> "${S}"/config.toml
+                       [target.${rust_target}]
+                       ar = "$(tc-getAR)"
+                       cc = "$(tc-getCC)"
+                       cxx = "$(tc-getCXX)"
+                       linker = "$(tc-getCC)"
+                       ranlib = "$(tc-getRANLIB)"
+                       llvm-libunwind = "$(usex llvm-libunwind $(usex 
system-llvm system in-tree) no)"
+               _EOF_
+               if use system-llvm; then
+                       cat <<- _EOF_ >> "${S}"/config.toml
+                               llvm-config = "$(get_llvm_prefix 
"${LLVM_MAX_SLOT}")/bin/llvm-config"
+                       _EOF_
+               fi
+               # by default librustc_target/spec/linux_musl_base.rs sets 
base.crt_static_default = true;
+               # but we patch it and set to false here as well
+               if use elibc_musl; then
+                       cat <<- _EOF_ >> "${S}"/config.toml
+                               crt-static = false
+                       _EOF_
+               fi
+       done
+       if use wasm; then
+               cat <<- _EOF_ >> "${S}"/config.toml
+                       [target.wasm32-unknown-unknown]
+                       linker = "$(usex system-llvm lld rust-lld)"
+                       # wasm target does not have profiler_builtins 
https://bugs.gentoo.org/848483
+                       profiler = false
+               _EOF_
+       fi
+
+       if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace 
intentionally shifted below
+       # experimental cross support
+       # discussion: https://bugs.gentoo.org/679878
+       # TODO: c*flags, clang, system-llvm, cargo.eclass target support
+       # it would be much better if we could split out stdlib
+       # complilation to separate ebuild and abuse CATEGORY to
+       # just install to /usr/lib/rustlib/<target>
+
+       # extra targets defined as a bash array
+       # spec format:  <LLVM target>:<rust-target>:<CTARGET>
+       # best place would be /etc/portage/env/dev-lang/rust
+       # Example:
+       # RUST_CROSS_TARGETS=(
+       #       "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
+       # )
+       # no extra hand holding is done, no target transformations, all
+       # values are passed as-is with just basic checks, so it's up to user to 
supply correct values
+       # valid rust targets can be obtained with
+       #       rustc --print target-list
+       # matching cross toolchain has to be installed
+       # matching LLVM_TARGET has to be enabled for both rust and llvm (if 
using system one)
+       # only gcc toolchains installed with crossdev are checked for now.
+
+       # BUG: we can't pass host flags to cross compiler, so just filter for 
now
+       # BUG: this should be more fine-grained.
+       filter-flags '-mcpu=*' '-march=*' '-mtune=*'
+
+       local cross_target_spec
+       for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
+               # extracts first element form <LLVM 
target>:<rust-target>:<CTARGET>
+               local cross_llvm_target="${cross_target_spec%%:*}"
+               # extracts toolchain triples, <rust-target>:<CTARGET>
+               local cross_triples="${cross_target_spec#*:}"
+               # extracts first element after before : separator
+               local cross_rust_target="${cross_triples%%:*}"
+               # extracts last element after : separator
+               local cross_toolchain="${cross_triples##*:}"
+               use llvm_targets_${cross_llvm_target} || die "need 
llvm_targets_${cross_llvm_target} target enabled"
+               command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need 
${cross_toolchain} cross toolchain"
+
+               cat <<- _EOF_ >> "${S}"/config.toml
+                       [target.${cross_rust_target}]
+                       ar = "${cross_toolchain}-ar"
+                       cc = "${cross_toolchain}-gcc"
+                       cxx = "${cross_toolchain}-g++"
+                       linker = "${cross_toolchain}-gcc"
+                       ranlib = "${cross_toolchain}-ranlib"
+               _EOF_
+               if use system-llvm; then
+                       cat <<- _EOF_ >> "${S}"/config.toml
+                               llvm-config = "$(get_llvm_prefix 
"${LLVM_MAX_SLOT}")/bin/llvm-config"
+                       _EOF_
+               fi
+               if [[ "${cross_toolchain}" == *-musl* ]]; then
+                       cat <<- _EOF_ >> "${S}"/config.toml
+                               musl-root = "$(${cross_toolchain}-gcc 
-print-sysroot)/usr"
+                       _EOF_
+               fi
+
+               # append cross target to "normal" target list
+               # example 'target = ["powerpc64le-unknown-linux-gnu"]'
+               # becomes 'target = 
["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
+
+               rust_targets="${rust_targets},\"${cross_rust_target}\""
+               sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" 
config.toml || die
+
+               ewarn
+               ewarn "Enabled ${cross_rust_target} rust target"
+               ewarn "Using ${cross_toolchain} cross toolchain"
+               ewarn
+               if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
+                       ewarn "'sys-devel/binutils[multitarget]' is not 
installed"
+                       ewarn "'strip' will be unable to strip cross libraries"
+                       ewarn "cross targets will be installed with full debug 
information"
+                       ewarn "enable 'multitarget' USE flag for binutils to be 
able to strip object files"
+                       ewarn
+                       ewarn "Alternatively llvm-strip can be used, it 
supports stripping any target"
+                       ewarn "define STRIP=\"llvm-strip\" to use it 
(experimental)"
+                       ewarn
+               fi
+       done
+       fi # I_KNOW_WHAT_I_AM_DOING_CROSS
+
+       einfo "Rust configured with the following flags:"
+       echo
+       echo RUSTFLAGS="\"${RUSTFLAGS}\""
+       echo RUSTFLAGS_BOOTSTRAP="\"${RUSTFLAGS_BOOTSTRAP}\""
+       echo RUSTFLAGS_NOT_BOOTSTRAP="\"${RUSTFLAGS_NOT_BOOTSTRAP}\""
+       echo MAGIC_EXTRA_RUSTFLAGS="\"${MAGIC_EXTRA_RUSTFLAGS}\""
+       env | grep "CARGO_TARGET_.*_RUSTFLAGS="
+       env | grep "CFLAGS_.*"
+       echo
+       einfo "config.toml contents:"
+       cat "${S}"/config.toml || die
+       echo
+}
+
+src_compile() {
+       RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -vv 
--config="${S}"/config.toml -j$(makeopts_jobs) || die
+}
+
+src_test() {
+       # https://rustc-dev-guide.rust-lang.org/tests/intro.html
+
+       # those are basic and codegen tests.
+       local tests=(
+               codegen
+               codegen-units
+               compile-fail
+               incremental
+               mir-opt
+               pretty
+               run-make
+       )
+
+       # fails if llvm is not built with ALL targets.
+       # and known to fail with system llvm sometimes.
+       use system-llvm || tests+=( assembly )
+
+       # fragile/expensive/less important tests
+       # or tests that require extra builds
+       # TODO: instead of skipping, just make some nonfatal.
+       if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
+               tests+=(
+                       rustdoc
+                       rustdoc-js
+                       rustdoc-js-std
+                       rustdoc-ui
+                       run-make-fulldeps
+                       ui
+                       ui-fulldeps
+               )
+       fi
+
+       local i failed=()
+       einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
+       for i in "${tests[@]}"; do
+               local t="src/test/${i}"
+               einfo "rust_src_test: running ${t}"
+               if ! RUST_BACKTRACE=1 "${EPYTHON}" ./x.py test -vv 
--config="${S}"/config.toml \
+                               -j$(makeopts_jobs) --no-doc --no-fail-fast 
"${t}"
+               then
+                               failed+=( "${t}" )
+                               eerror "rust_src_test: ${t} failed"
+               fi
+       done
+
+       if [[ ${#failed[@]} -ne 0 ]]; then
+               eerror "rust_src_test: failure summary: ${failed[@]}"
+               die "aborting due to test failures"
+       fi
+}
+
+src_install() {
+       DESTDIR="${D}" "${EPYTHON}" ./x.py install -vv 
--config="${S}"/config.toml -j$(makeopts_jobs) || die
+
+       # bug #689562, #689160
+       rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die
+       rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die
+       newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo
+
+       local symlinks=(
+               cargo
+               rustc
+               rustdoc
+               rust-gdb
+               rust-gdbgui
+               rust-lldb
+       )
+
+       use clippy && symlinks+=( clippy-driver cargo-clippy )
+       use miri && symlinks+=( miri cargo-miri )
+       use profiler && symlinks+=( rust-demangler )
+       use rustfmt && symlinks+=( rustfmt cargo-fmt )
+       use rust-analyzer && symlinks+=( rust-analyzer )
+
+       einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}"
+       local i
+       for i in "${symlinks[@]}"; do
+               # we need realpath on /usr/bin/* symlink return 
version-appended binary path.
+               # so /usr/bin/rustc should point to 
/usr/lib/rust/<ver>/bin/rustc-<ver>
+               # need to fix eselect-rust to remove this hack.
+               local ver_i="${i}-${PV}"
+               if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then
+                       einfo "Installing ${i} symlink"
+                       ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" 
"${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die
+               else
+                       ewarn "${i} symlink requested, but source file not 
found"
+                       ewarn "please report this"
+               fi
+               dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}"
+       done
+
+       # symlinks to switch components to active rust in eselect
+       dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}"
+       dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}"
+       dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}"
+       dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}"
+       dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
+
+       newenvd - "50${P}" <<-_EOF_
+               LDPATH="${EPREFIX}/usr/lib/rust/lib"
+               MANPATH="${EPREFIX}/usr/lib/rust/man"
+       _EOF_
+
+       rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die
+       rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die
+
+       # note: eselect-rust adds EROOT to all paths below
+       cat <<-_EOF_ > "${T}/provider-${P}"
+               /usr/bin/cargo
+               /usr/bin/rustdoc
+               /usr/bin/rust-gdb
+               /usr/bin/rust-gdbgui
+               /usr/bin/rust-lldb
+               /usr/lib/rustlib
+               /usr/lib/rust/lib
+               /usr/lib/rust/libexec
+               /usr/lib/rust/man
+               /usr/share/doc/rust
+       _EOF_
+
+       if use clippy; then
+               echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
+               echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
+       fi
+       if use miri; then
+               echo /usr/bin/miri >> "${T}/provider-${P}"
+               echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
+       fi
+       if use profiler; then
+               echo /usr/bin/rust-demangler >> "${T}/provider-${P}"
+       fi
+       if use rustfmt; then
+               echo /usr/bin/rustfmt >> "${T}/provider-${P}"
+               echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
+       fi
+       if use rust-analyzer; then
+               echo /usr/bin/rust-analyzer >> "${T}/provider-${P}"
+       fi
+
+       insinto /etc/env.d/rust
+       doins "${T}/provider-${P}"
+
+       if use dist; then
+               insinto "/usr/lib/${PN}/${PV}/dist"
+               doins -r "${S}/build/dist/."
+       fi
+}
+
+pkg_postinst() {
+       eselect rust update
+
+       if has_version sys-devel/gdb || has_version dev-util/lldb; then
+               elog "Rust installs a helper script for calling GDB and LLDB,"
+               elog "for your convenience it is installed under 
/usr/bin/rust-{gdb,lldb}-${PV}."
+       fi
+
+       if has_version app-editors/emacs; then
+               elog "install app-emacs/rust-mode to get emacs support for 
rust."
+       fi
+
+       if has_version app-editors/gvim || has_version app-editors/vim; then
+               elog "install app-vim/rust-vim to get vim support for rust."
+       fi
+}
+
+pkg_postrm() {
+       eselect rust cleanup
+}


Reply via email to