summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2022-12-19 22:34:01 -0800
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2022-12-19 23:08:00 -0800
commitd75fff827e2ad07258063fa52e9ac1cdb1512383 (patch)
tree8f635c65b8284529c3a7b650ede7178886956cee /dev-lang
parentdev-lang/rust-bin: add 1.66.0 (diff)
downloadgentoo-d75fff827e2ad07258063fa52e9ac1cdb1512383.tar.gz
gentoo-d75fff827e2ad07258063fa52e9ac1cdb1512383.tar.bz2
gentoo-d75fff827e2ad07258063fa52e9ac1cdb1512383.zip
dev-lang/rust: add 1.66.0
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/rust/Manifest34
-rw-r--r--dev-lang/rust/rust-1.66.0.ebuild754
2 files changed, 788 insertions, 0 deletions
diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
index 25e312b78085..57c836a06c7a 100644
--- a/dev-lang/rust/Manifest
+++ b/dev-lang/rust/Manifest
@@ -62,7 +62,41 @@ DIST rust-1.64.0-x86_64-unknown-linux-gnu.tar.xz 161922032 BLAKE2B e8a0d13deab59
DIST rust-1.64.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d13ab08a8ce4b9a92c60ab5b8c21087158b66d9a673b7a960103757a2b12216cab8e7713cda08753a5f5f921aa9c7d571da77a90166d6e7362549a49d6c1a501 SHA512 fda5b45652c0929fea19146dd2c5a895ae4c6db9a1bf448a7364899854ffa06a8eb52b35bfe28c8acdfb1633cd8afe6c5eabd622b7887ed267b1b72220ef4e6f
DIST rust-1.64.0-x86_64-unknown-linux-musl.tar.xz 265843112 BLAKE2B 2b267b5b9aae610734759a690e36600eeeedab7e0b679e651df269d7b71b147984c1d16cab4658076f05a8a854afc74d83e6e61dac3a8a6bf2b56660d3483285 SHA512 c722ddb6a7bfc5b8767e2a37e697f625b4e775582423720d1b01737ec3269c82e2212f7e5a672a062fa49c8c15c0d2d182ea14dd048cfd9e07704cbc04fd8ef0
DIST rust-1.64.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 783791aca41910e8074fd1c7f29e6fc1fdf51f80b1515bac99431305dbe6085574b2b2366c087675b6a9d98931a0cff1117cd864f634fdb4dd53792aab8ce5f9 SHA512 a6d0a72e9edbbc1e6caef7a9c0ec46518b95172afa4a33b2258286458d7b9afe72f9de8411a83567520a126b8377777e125cc639bac197a0495f17120fbcc1ad
+DIST rust-1.65.0-aarch64-unknown-linux-gnu.tar.xz 244905108 BLAKE2B 437213698ea99f4113f294ded23ae0e5dd27dec2715b37495a991deac462aecc36d34311014a822c8a94c50852abcab8f08d8df900509f2b29716c6ace939f16 SHA512 be706f4432a8ae3b8f9b6f41eb2dcb3bc5b8f648970d5324c0de4979f1d58b9d8d5f774628090fee8f8c59eff2c4a55ce96743d4b23ae209e1951fbbc486797b
+DIST rust-1.65.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 1f023c371059404fa8fdb4d558117a650d323acf99c6ebbf937b337fcddb195bc68d739a3d06b4b8647d245a6e4effaff0008aad357b65e1e50bb62345e39bd0 SHA512 80285639fb445ac8b1c0cd36a28b72930e8c0e9c761473c5e2ee4d3daccc669afd7d2eb5e2788e5a3394e215bb5cb705fb1fd0d25a79d863c62a5e8d31282257
+DIST rust-1.65.0-aarch64-unknown-linux-musl.tar.xz 226435448 BLAKE2B 01388644e9383e1b1638b121b3af3a75787a3c243d9675df1a3c6bd45b8b52900fd7178b6a46c22b31a0cf2a33fa177370eec43c75ce5d050d8c4c716c4c25ff SHA512 654f4684dc6f9ee38f509f9abcd0628644df894d47e9cb139a990124cd34124da960656596a05eacf78bb762edb42e5e7536975a37e777366666d6f381766068
+DIST rust-1.65.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 111c2cf8308cce95c764d7e4c852d0070060a64db263a7ebc7de339a5084d42d9fb735c051cfda05eca2dc0481d7bd684dbd2a71b2ad4b527699619b5b2cd002 SHA512 d45b95d327fd3e6ed93e177cec7a53895450fa6a3b6bd71d7581c135aa3d36d45cdaa1e63977d966f60318cfa193a5af01227fd19e5b0e6edf6d15f67f03f49d
+DIST rust-1.65.0-arm-unknown-linux-gnueabi.tar.xz 205884452 BLAKE2B 79d399452cc745bce3fd350059a0cfdbcf8eef590af1f3b6963461ce962e86739d51b948fd7a7fd8a7bbedd9744b9d6b7d141bb25539452db6449aef6e654a12 SHA512 160a7daf5720a4349154eaee83ce42c412efe98ecf1c5bcc406efd8271038ca5b64d39ef8b7113acc5f7e08d7d41d53cc2ff342df2022aeccdf75a18570b6d2d
+DIST rust-1.65.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 0cf153865d61e041d680d5c984f952464a26acdcfb1265b2e34857b4e9ce2f575db56fa477cdeb3a8ae7505cced6644a3ddfe5a537a1184e463cb0ccb5157a1b SHA512 ab7dfb3e9e17daebd9fc02103585ef388688e91d50f72600456702970b9092847e1f08d4679474a1656b809e459a63d73f2bd717e97d389c614cbcf1a0be6c86
+DIST rust-1.65.0-arm-unknown-linux-gnueabihf.tar.xz 206130456 BLAKE2B e7e1cf41d0f1bb14788664b40d343f6b971d4a4a402991f540e64070e41d1605cb9e747915f5cdad666699fae257481f3d8924d9349462caca8f878a50705447 SHA512 36b1f984248162e13a39f17ac601dd5946fe6684217523952a4096bba4799cbf50e339619e5cfba6f2c0968e3f1991ab3054c2dbe9ca14851115dcfcb437327e
+DIST rust-1.65.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 71266fec366ab842bc2f974ddab79226d7dcdd451b4728b80642a9deb7062f672e18ecfceb427bd5c6660f1ee3393d7e60db22bf71d8f433d5debf8a20221ce2 SHA512 2666e29e5c1a0722c5d94c9c7ed893aef09ef780bb54cc0eb486922e747b39a26cbc383313f67929cd94155a0527f165ebe3b4e6a9a1e166942e6c1c53fe8ae8
+DIST rust-1.65.0-armv7-unknown-linux-gnueabihf.tar.xz 211761236 BLAKE2B 1e53831405ebc8bf2a24020715207a9d1c283e78f3d7feebebbe1029aa6495f7549aacceed291b209adaec135f2ef782d9e6dc97e018e21cff605cdcc6d8669a SHA512 3a54dee8768a67a08ad81cc89925971ff7b2e1fd054cb387c4f0dc5319e2bacaa4cdcb32bfa78e296401d07e5f4152d74ab6dbb1d0af068b01523b66e4cc1e48
+DIST rust-1.65.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 0ee1b71d77b777c32037f348203893be76310ae7548c40461a457b293376ffe617c2952f0d8f3a0e7913bee8f2d737898a74eac4f8afaa56e27e4871347a772e SHA512 ccd3ab729c0c692a1f70009f358130f60b2ee751f041c90baa4d3483243b72048e307c1f95e9c9e4c88d4c585e8bf49d9b24f6029b9ebbaa1e26730eecf3ebeb
+DIST rust-1.65.0-i686-unknown-linux-gnu.tar.xz 232207860 BLAKE2B 4f16a150a6baf641ac4deb14c9bdcfa1e110584a5d0646c2d0c689a159c1a5b048b820213f991fb11884311352a7fbe5a2a6e5d681b12b4e98648e10e434f808 SHA512 ebf7c91f95add689fd01c613e3d42502c4582559e3467d529fb61fa130ffcbd4e41c867e0cab6bf89fb6d49971ba205608928d54a493c7baf89669e8f8fbab98
+DIST rust-1.65.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 325a28f4199613aee583f2aacecc01f938ebc3aceb338d21ee78ab10d9311dd86ca0c29fdf2ae86d33087a520bcba02bcbb6ec32c53947b3e6c6945f19f9940a SHA512 0e3eb96a3327bbb33536e4d9438fe5635ae4c094b4bf689a1cfeec87194d0965c0ef8f9cbe62034fdaf8afd4cb5c2e2376805f234a5f0793e8fa500201cc60d3
+DIST rust-1.65.0-mips-unknown-linux-gnu.tar.xz 172934452 BLAKE2B da7d02247e357235a13fbd330763431bd8f259ff3c4e0cd70b3baf6b05efc82dad1e561ad5ad65eda0d195b3f443d402450bde8328ebee320817d022827630e1 SHA512 5f843083096349a75f959c0d00009033413afdbf984c6e5df46e181d6001a05b64e428bc96c58330b7cc32d8fb6b71d400e592b1c7916c644a341d409222fac5
+DIST rust-1.65.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e5323fc58614bb2f61831d9a3bd4e3e17e61d7d876e8ccea0d7bcd90d515cdb09cf6112922260fa7d53ba9944b183918448b31c2de431cee8b2f13e6e82f66ea SHA512 b0544165a5b7b49ea7861ca7cea20d6667976667c2253816f942f9b1473306615df5e5e8c1d28028ae79d7cdfe8bfcecefa8df65648976240af40ac08a8ca458
+DIST rust-1.65.0-mips64-unknown-linux-gnuabi64.tar.xz 170733288 BLAKE2B 59211c452f921cc337762bcd50cf6cbe8b59b843c1f8afcb82705092ffd4465b663f3428c718b473235be5308cf13663bebc87a2ce93abc81b11192479261527 SHA512 75012281166d17805ae718b4ef55084f6b59c2ff10ef44ab03efd03e0a72539438ab953384e62f2c90042ed5b044478e17ce64d6e9ad85bf3d40ab55bfaa37fd
+DIST rust-1.65.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B 491ed32a0804f9b69cfe7622eed951aea8a88e6bb9d0cb90e7fb836807fbb0c02ca1d0f4ce54ec366fb5d314bab7702b2395218c8c6746f35b6a0654f079e8a2 SHA512 afad470d8ab02729ac1fba678a0459279e4b8bf687e7ae90bf51ddd5fab5b9f1d6e421ade260d101405387e793fda7fd6ed35df3a97875342fd93feb2e1598e9
+DIST rust-1.65.0-mipsel-unknown-linux-gnu.tar.xz 177698400 BLAKE2B eac9bbef703dd3d7a96dcb31ee0fd6f46d7046ec5d8e810605285a9b71248f0e97412f881d3ec77b4ce79057367523e36cde1a19733944d5a0fb56fc71e1d95f SHA512 2ae3976913b4d5f6a2bb7a778ffe7cad5bcfa643e37c217790605c5260cef44a2a98baaa5cc4fb70fbf63d5ae10c8d10ebd684d1f21a66c6915c5c58f488d7f0
+DIST rust-1.65.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 26b706e4c8a05a0e27050c8806d47dba83bf2e529ff10f622bd166aede62b2868a2be746c1b0c5d824df58658d5d125310004922bdd4a1224eb050368483b1df SHA512 49a35c5152d2cab469159b83b081f11897040e5b6ef641e4774a45bdf79b936860302812697469ea4429cfbfa90238958342d03bbca019a80fc7fcf666c571a1
+DIST rust-1.65.0-powerpc-unknown-linux-gnu.tar.xz 209510928 BLAKE2B ae05250069277c54f3658aa2474de6ce122de81f54a529cbed63b6e4c2354638904a018453a31dc2ecb364aa0c14bce23d97c4065cf8f7f0feb65e9107be78eb SHA512 a622011ac3c63b1b4f55a3fcf98fd1771af67b64a366473136b28f58e100635b823243e9a12f7694ee303e7338c40431e25554d5d72c16a72d0252c24c2cb7d1
+DIST rust-1.65.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 1cd4262dc17770b85290cd85599e2992d8797ad775b329865997ed1a70b21a02ca68d642aa5ac11c3a08e60870c5de2f720e2a34b05658870573e0688ee23613 SHA512 d4b7fbe1cd9cef0815521b756f7bf201f782ad240d1a23a25d5768726d35cc4ac49163688d731a8d8be38abc7f0da14c960f513ae153251d24a917b4234d578d
+DIST rust-1.65.0-powerpc64-unknown-linux-gnu.tar.xz 209586876 BLAKE2B b54fcaa7dece3cae687c02ee0dd89a54d764cfccef2a465bc2356ff8ab358473dfe7a72988cfa2f5abfbc5228b555aa8f92d84ca88d43b20ff9fada0f3c9a26c SHA512 2615aba626dac4795cc065bf04472a2884786ca306e2349f7b58819b25a1a34a711d5a9773507b815180c0c4d8c4ba94891fe3d0581a9e7e0ee8d230eb5404eb
+DIST rust-1.65.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7d01b6a884f467489c5c69bf11baef91224144440e7ebfd935a27a34abd1449d777113d87c9c886d5e0266ae8482105f83cd2b6acb28760436a3b350a9752bd5 SHA512 459ea4225bd26426b2c405be8ff95122597d4cc00d012675d7c4ddd7ce4c9ebebdb9d9b15bcc3b629f0c28ee66e4c9ae7dfebb2f6931e0393c7613fcf8d33f15
+DIST rust-1.65.0-powerpc64le-unknown-linux-gnu.tar.xz 221871252 BLAKE2B 95bf6f73e72b1473ebc81eb3a4dce9616b4c7e30c2ea19460318f20242492e5f25ac883d52cdcf1bca9d43dd40c95c0fc1dec04f20c092c17045456177f643f7 SHA512 8e532f28e3d3249001f4e6adc5cff3265e9bcbe9090ce5e250ba49b01a56dc10eb65fde1d0030bc953a2822738e1318b0119d6710d2b28735c22a2f0e2ca1513
+DIST rust-1.65.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c2f8ad615cbf2dfd88a93db429d394fd092eb0bcb5c46d481aa2f39542fac03be3d18b1690457a5bbd73ab06263e930d1cf44272f42a90d0f5e34c3d10713d47 SHA512 c2e8832df43c1579e7022a6798d71c751ffd15ab52c6c86c7b2514f5d26665e9b2305ae9dfbb97efed89e1884c18e92175e43650ccf794f167794eb158e04e5b
+DIST rust-1.65.0-riscv64gc-unknown-linux-gnu.tar.xz 189556248 BLAKE2B f64876cfb9fd985f6d6a49b052ed007761a97d5e9e6e6bb2b7b44ad4a6d5b75dfa4e067a1de2878679171fb3c4c194b404cb6074f39a634196e95e989f80fd8a SHA512 0e16f18478de557303971f65166c4abc799da4bd41dc3787a79ac850c8f00db9e0bd505d101f471b9c9d2753a766c41be65af2e320a8a31188e816a18ad316bb
+DIST rust-1.65.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 5026637766f3038cc096f6c1f6c214b2fcd91435cabd2687ec6005005cb746c08335ccbf667bd3a0da7c607b8c1f5f5bb1a084574780e0cc0d4d3827a753cd5f SHA512 7f2c209b7ed0a5b3af6506d3aba9f61c16e6026ea077e45fdd1efa668a4744234c5dc51de0f074d743b282ffec63de5ac13e559eee2c3bcf82b4d42fd8845837
+DIST rust-1.65.0-s390x-unknown-linux-gnu.tar.xz 226037296 BLAKE2B 8266773f4767aa44c764c938c89d2c7382b26aeec3a4947ff4d0b4bdfd8b97512599c28f6c8db5d3ef4c6ac23eca87735214352009167e7e22ddbfa979549646 SHA512 31728e9d3e2cf9659beeb3ee64e760ee98847262dd0807d33af720e5ecce4685a7963c559febcbc910ed47b686b258a9247f7d8f171a8c5883f5656282d19030
+DIST rust-1.65.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B efaaa539e4a89c6dc485d34ea8fc9ac4291b9dbbbfa67737e9ae438f45a010b398cf211a4b257cdb5a6ca3a8fdfd62e54f6a13987f09ed9825f3bc31be87b000 SHA512 8d7e65293a8ede819a023801341b5fb927586d1d98a8b4fa43b60501c08aacf2ff408024639778571e9a54527e2bc798b7e23e314188fc032b936dc3b14b82a6
+DIST rust-1.65.0-x86_64-unknown-linux-gnu.tar.xz 162028064 BLAKE2B 8c572cc304c165ac7d689ea4447498cebb3e91efa75c704833d34de46383038fb92b47fb568eb93ab9cc463616fef396c7a88b9019ec5c007748a22147069849 SHA512 255ad04109925684d201b89cf2462818a1b65fea503791dd83d5ef0802b1e80b5f6e4c444dcd516196836e8b41b039ddd4855c4e1440d28fe48e78e21e923c8a
+DIST rust-1.65.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7a9287b6125eab2c14a026d6b4d8a3e980b9fedac0436b75b1bf314b093b5e39de0d70045e183a2e823d729d24f43f6251a2fc28b072e3caa1950fbbddf149e6 SHA512 16abed6d7a17b9e5f3e399865ed5fee01272c8e6696ea2e784a6fb149df16da2c4123572dfb56c3c44d407d388033e52b552cd164600629cf61b33c011e4e415
+DIST rust-1.65.0-x86_64-unknown-linux-musl.tar.xz 266683288 BLAKE2B 4312a53bca3e33f6633fd5eed1b17754813e54d688185ff4cca6c5d6b24713994fb5fc424113ab08c121319cc79da3d7d89518d18dbb1b491bc8ba2ec831c12e SHA512 6c7ddc98da3227b23dd681615bb8f8ea883f3bdd9547e35733cf6acaf2a625301c53449b1a3ddf88dad9a5c940f8324c3e1bb31d871092fc848b863256c85935
+DIST rust-1.65.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 054f1b773518a9640f3d9226510cb0b00a7f8dc4a9046c325b82d038a50c699a8bd84f71ed62790e9b96b4d65ad12ea631f6a8bc18b3bafd66db3d21137cd378 SHA512 39aa000c2a1359cfd7d2eda2b22a9b10c0fe4aa024862b7ea67bd488e06fdee6f5cc4e98db7486b84ce53f1c299bbd5391f63e25df0358184533a5fdced4ce61
DIST rustc-1.64.0-src.tar.xz 137841332 BLAKE2B 8acd9e0a4632ba2114018a5cd3f2d544324c601c246658f60a9e0be513c40375434d0a416f0bfd4d24493eae3fec7c9f5bb52d008c88cde14de503a3b6873dd1 SHA512 919f40acd8c6eaaef399aa3248503bea19feb96697ab221aaede9ee789ce340b47cb899d1e0e41a31e5d7756653968a10d2faaa4aee83294c9f1243949b43516
DIST rustc-1.64.0-src.tar.xz.asc 801 BLAKE2B 69f7bd7600d99794859c6fad4b44f0e98868e4e16041d6fe81d9d09a8435c75abac67a735adb0b81a2d9f85651841d404bc1ef4cd64fccd75e8a25d6d95729d0 SHA512 a831e3941849add1082c5b47b619ea87405b875d6eeb90a35f42742a511d124c29503debd17dcc8c6aa9e03a754ab51c3a15e99192bdd0dd1b8a59af9b6eb0b8
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.0-src.tar.xz 141582844 BLAKE2B f07a71763158da3e1c4c328d5423a9353dc6b7d3fd167b6417bd1dd9ef32081d5f634be1bd946d2fabb75808759cbd67cddc75f768ba610a687a417342fff023 SHA512 df329bcabce309846e44d92a118758dfc65b63f06857226799c75568a2a018a96500fd07cd38c1927e3486d190a6f57340ee794c733bbbb69cf80a99855ced73
+DIST rustc-1.66.0-src.tar.xz.asc 801 BLAKE2B adffb348d20594e49364c14489c8479630e0d2b4431d6a63a4c5486e9d01c7994913f4fe09c21aa336d3f2b2d2f62c4504f6930b23fcad3e06e13058c15f1eb1 SHA512 c8a524e83a86bb0c3ab813f45687e92a3ef7bc57943a62c3a6ae211314d9889a8123272b1c0aa763262435f2a51fc39a98a731931727faea9d6e2a0da0facd2e
diff --git a/dev-lang/rust/rust-1.66.0.ebuild b/dev-lang/rust/rust-1.66.0.ebuild
new file mode 100644
index 000000000000..f6d845e03f07
--- /dev/null
+++ b/dev-lang/rust/rust-1.66.0.ebuild
@@ -0,0 +1,754 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..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)).0"
+
+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-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
+"
+
+# FIXME: https://bugs.gentoo.org/874885
+# rust-analyzer should work with wasm, but currently does not
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
+ miri? ( nightly )
+ parallel-compiler? ( nightly )
+ rust-analyzer? ( !wasm )
+ 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.65.0-ignore-broken-and-non-applicable-tests.patch
+ "${FILESDIR}"/1.62.1-musl-dynamic-linking.patch
+ "${FILESDIR}"/1.64.0-vendor-rustix-sparc-has-no-SIGSTKFLT.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() {
+ # this supidity is needed because patch is too large to be in filesdir
+ # and if we move it to devspace - it lacks checksum for sig verification
+ if [[ "${PV}" == 1.66.0 ]]; then
+ sed -i \
+ -e 's/516ba32a547b46a8e80ad20d4a17bf24a00bff0b69b74f56df119f770f3dfff6/fc7eb88c2f5104865379128b76767d36ce5b5fdb9f3483e683d150e514ebc3a3/' \
+ -e 's/fba10dc8ca9eaf4d481cb82bd1540cf5c05620533c44f917c09a22ea55ef408c/9cc4d1b4511a1f0d91231eb0f11c67ae5e8e38e4becd0bf5eb9e26d043796056/' \
+ vendor/rustix/.cargo-checksum.json || die
+ else
+ die "remove sed mr forgetful maintainer"
+ fi
+ 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 --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
+}