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