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