diff options
author | Georgy Yakovlev <gyakovlev@gentoo.org> | 2022-01-13 12:46:24 -0800 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2022-01-13 13:09:13 -0800 |
commit | 4703251f0845e6109fc9111c83da8e40c1642f9b (patch) | |
tree | b56b163c4ab06be0b80cb3abf8f7cf685c6b7668 /dev-lang/rust-bin | |
parent | rust-toolchain.eclass: support EAPI=8 (diff) | |
download | gentoo-4703251f0845e6109fc9111c83da8e40c1642f9b.tar.gz gentoo-4703251f0845e6109fc9111c83da8e40c1642f9b.tar.bz2 gentoo-4703251f0845e6109fc9111c83da8e40c1642f9b.zip |
dev-lang/rust-bin: add 1.58.0
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'dev-lang/rust-bin')
-rw-r--r-- | dev-lang/rust-bin/Manifest | 33 | ||||
-rw-r--r-- | dev-lang/rust-bin/rust-bin-1.58.0.ebuild | 214 |
2 files changed, 247 insertions, 0 deletions
diff --git a/dev-lang/rust-bin/Manifest b/dev-lang/rust-bin/Manifest index 5a034fe9670c..cb79b424baec 100644 --- a/dev-lang/rust-bin/Manifest +++ b/dev-lang/rust-bin/Manifest @@ -158,5 +158,38 @@ DIST rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz 151033748 BLAKE2B 61ecece6a8aa3 DIST rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B ea41b27fd25cc75efac73203688ee0882767fc76a2fe09b5e424c42467d3e332463c5560cc58f3b20f6e4b44289a25cfb0d36e38a7a9a7b3950ef875a59dc9ae SHA512 8b955bfce6c130e4b95054b98646f7f9b89e621256759ee1ff533df5f777312dd7adbb192ee0076c9b9baa6883a74a9def50ef598ba8c707762290d465c9a8b7 DIST rust-1.57.0-x86_64-unknown-linux-musl.tar.xz 260333980 BLAKE2B 75342ae8637355e714d5217d78604cfa6a601d3f9bc0ed4667ff0ca57c6521567b19b9bdb10f79761e2e5fd21ca10e12f3fae0c65791118fdb0c35f8f88349f4 SHA512 204ed493528757b8e3e8df13d062c9ae74c75c3e3adc1a2efc0dfc33d2525629168a558dd32653f44a4365191bf203a4415a77152276288a8e122e6bd587394a DIST rust-1.57.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 506400c3ea70469cbda0e492e85d41b7f94fba790ec19d1c3491bf4a00d283f97c8fb37319ad6c4a43b22a2195c21d1b9e3c16a5b2a9a82833ff61ad49bdc793 SHA512 793369dc7a854c48a72d81446a0c8eb9d83a071af77758e0bcbb8e4d518fb87c5a23c085202b9b427a02bdd772ad9c82724b34295b851f26f384c3e801bf9a04 +DIST rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz 229969508 BLAKE2B e7ba73742c6fbf5cff8593434167ddc8e981f473b292960ddf25bd6cdf5980776ddc0234dc711d6a341474ac1da8f33a788bda0d6d83f8e353e4e35eab95f635 SHA512 6ab276db164b400953b540f2c0f5884e44a16cb847a157dec1103e09b22e379f77d8561bf360c05f0bf2d085d4b3670b51675ae80aac05732310621bb2d9b597 +DIST rust-1.58.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 5ae37b9acce2bb0f1c8963e6581d09832290f4ffcbd26807f21ee5cee45a89ad279c22361f932feb72753a25092eb02431777dadbc8643d45905178c00504848 SHA512 ee6d99b1604b1e9efb470dfec00a9fc71f9603723ed292f20736d8c40de73660e23868d68b142e70d75216ed312534e364f2f5a092529e3276cdeee99c7d71af +DIST rust-1.58.0-aarch64-unknown-linux-musl.tar.xz 226177016 BLAKE2B 0f4336d5df797515e4e82c716a3c2ec614b04f862c056992ced14f9263a977920e5544b5738d4588979b29e37de0a8348a6f28986bcbc8e41d301b1cd134172f SHA512 2a4d7225713516f1f6d4f1d32b998a73769636b39e74d791b2a2337a25069ba929b56b37c24b6f7c4287efdcbd56c993fd3a288fefb7d1e34bcfadafe53cc07a +DIST rust-1.58.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B c26ad8bfb35539a26f8cd155755b5534bbb7eb5b92868195108ec9467242151aaa6e31db0f7e536836a20661a77e11955d21b2d61a4ff17c5db92d6e5305fd29 SHA512 fb85bcd3516cee414763b2a48e8021071cac113fb03cf980bbdc3520092b9c6cdaddf13ac30d75804e970a34a9a7ef697924a73a06df3a8b40d453b335ce15fe +DIST rust-1.58.0-arm-unknown-linux-gnueabi.tar.xz 206375000 BLAKE2B 7d32aa903d631a2a27ff1982897a9235cdcad9cf02e98274c597986d7052f0fd6dbeab00a42bcc1fbe6a12c4461f5887a914e5ac9444541ded28450e50f48a49 SHA512 f4268ce45bb09ec26d67931278eae6b2eb5738aee6b8bffdda86a71d2cf23e3755ad3499d74184758581f7d5e2df6eac4f063ea77f988c59ba88b409360061a8 +DIST rust-1.58.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B ae562b09bf350d72977ce024044d84a3b328fa27f98b7bd12381b31b3964fd018da4d491cbe8cb558014e7ec8235d99cd45362de7f412cffc104b73ddcbcf271 SHA512 2ccfd4e669df977283421f46f162416d5de43cc29bf67e91b3b29c94876a24a82d6af1a35225c0cb74599fc11bc2a8180cbe600d8eef91fdcbafdbba6a2fb135 +DIST rust-1.58.0-arm-unknown-linux-gnueabihf.tar.xz 206325408 BLAKE2B ec1f3ab5c37ce06ee16c10f10071a8795ab601b9ee147dca98d6c94555a278b87cd04c93b7623fbc7c3b09f3847f41479eec02259c5fcff25a8f337d39ca02cc SHA512 b31c067c459aba84f8a34ca39298f42c09a0530a02d033562338f822e55e5b0e837f15983e233dd0401a9082a9f6b0def081dd9f870dd654607c654488986b24 +DIST rust-1.58.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 3f4d43a6dd2a45b44d48fc4d51a39ca2ace84f432c89f20703176c0b947c4b30bd7f3d7e17dd5ee8fbcffccedbe7f177150c68ee1c05164206478384152d09e8 SHA512 94fd5b0142016df3ad5cdaf40df3f1f68866cd68256da6127b36f70aa7d363466929227f1534972dfb6c458a9febbe8c7c8344aee0f26d48f1aa1a3f262750b4 +DIST rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz 212531868 BLAKE2B 2a57a5f31504795086d6a0ecf2f29513c513d1840227c25832ce80264efbf3ab3392f369aa4d93f5f95d46f20fb8e074acf5925c0f6d1b5465ca6a8efa5c82e2 SHA512 c676cc1518e38fc36e62519bb9d4d356be689f9fcdeb56d5722bd3437879dfe9a30340c053ec75bd5b709d83b98faa647c46720df36a00daef1fd7680f4c900f +DIST rust-1.58.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B d62fe00537a4a75f8f561f66e585f25d13e6ccabc2ef4ea964616b733caef4b56aec62e873059fb84200a47f3530aec8e0e4c20b9eb32f533b8bcf019b73a078 SHA512 9cdb5fa100aced4e0d3b64821251031aba0f05ea1e27f8fcf53a3ea32010fe04bab306462af7b10f1d3bebaaa76747b5aa564af5bc3383bf62f4da7bd74d7033 +DIST rust-1.58.0-i686-unknown-linux-gnu.tar.xz 224691416 BLAKE2B 8d1cff8ad5289de0b5787d958814b5f7517a6d4a9667be014b4103b95ccaebc7976aa3f969955732c9755561967fbe9bac2702531ed15effe3461dd3d8f019ab SHA512 23dd0c0a7700acee233e93d779733bb94788edff4a64df62b8e4ac55b58bc640ed72b0cfd9e1b8cfa5190e429ced6b2a6b0a75676c51e72351edb96b44b00e59 +DIST rust-1.58.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B db0615a16099bcbedd5e4e218be66147e6d659656565e8cd26fd89fe620abb6a72aa74bb077b826792c1e82ee87ac750c85fd171148a5bae0296765113377364 SHA512 ff0c4089106a08437618392f7d02ae3140dab4fe045eac47eae5b5c1d98355326f62ae24b52ec2cb7c8e0085028dca797f70f8c14c48fdbae5505f4e45b6c058 +DIST rust-1.58.0-mips-unknown-linux-gnu.tar.xz 164753920 BLAKE2B 1562131b76d2fc7a7bde61b88e025079fb54448bcd8c793ae8887916c480a2813adad15630904a512d5a7341c727dc14af7aaec8c0b7b5264c39f2878c05bbad SHA512 76f91a43a673045a824509f0211c635869ae8ff7ae45253ef6d6dc15c36487ddd6638968a07697cd047296b51821f4df484500c135d5342121e32b6940f3fa21 +DIST rust-1.58.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e1614bbf7ef74a777dfa9dd7af473552b3356b984ad13ee0627c3ca691d21f4479ee5182751e54f01d0f084a83c10f55213f12417d64de158dcfde4251e497da SHA512 5db14bb832c854a8fe2802afe8154772e090adc9852d11c71a87b418d79dc27e942419b654bf69ce767a0a3ff474ef4e252832b2c3d6cb9458e7d574a7940dee +DIST rust-1.58.0-mips64-unknown-linux-gnuabi64.tar.xz 169679760 BLAKE2B d3a474609b1eaabd7a6475810a41220899fef78b41e256c0c747397cc4fc5c5f75e02eba2b5db43b34f80de95033fee10882cfd2451e66f61158e04de2853aa3 SHA512 f078f5d0b444ab82ea369d4ade450168cde7ac0aad2936a9ec95ad02d7a0480bb31a4e691a68922a57d608301dec050100f71996360d4827795eea4cd951f323 +DIST rust-1.58.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B a6e8f4c24ebf7f71cfe783498e8cde70edcb5530a920b408d3c861cbcd2ee2df1aa0692ffcbf5ee3d6e2f7468ea3708c03eda67e514c98e4a9b5437373b408e9 SHA512 f97f2519860f588319b5b708adc6c2998e975692092185257d8f08f2356769b567e35d2e2d7098e81d6e2c936b054c025c42d0d1ac0837794c56c3211d1a7c7f +DIST rust-1.58.0-mipsel-unknown-linux-gnu.tar.xz 168271536 BLAKE2B f3f6c5b4be89ad95a5e8a3a3eef80829558a2cd28f566e2c541f136b1dc49e14de66c8c4eaf02c54076ecc6d9ee78c0899481b9371683b705506212b2bc3bd4a SHA512 b166492159314c0a16362afc88f352ec556333f541dcaab42b342c9ccad77036894412d775687b8e2b5726a33339718872108b166bbc3acafbe158dddc0666f5 +DIST rust-1.58.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B f3ca5c1c1950248bb5bc0cf5cf09eafd65acc7693b0d000f554b5a848455e6c9f396cf7fb7a8ed6e7f31d3bf6428766e84f883efa6f372b46663217ce25e1cb3 SHA512 9f62b47144068865009ec7665151653d2bbea0bab008eba3c0f693e425cb77c022189c7396287d03f9294afae4b76aa84deb7a1eb05a9ad4619e71c310fe2816 +DIST rust-1.58.0-powerpc-unknown-linux-gnu.tar.xz 183629256 BLAKE2B 7b24752fb58e79c87ed18d2bd7f79d869daeb186efa17985bb6f9e1eee998e9ef0fdf597597cbcfbf57b263d53bfb0f416fd14bd68da00b9252d8e43687e7669 SHA512 8b282efd6508ac52b603331c6c148388ffb843463a8e725407c676bc9e332ff99dbb16c869721dc0535787809dd9f03005b1833f0b8a7f17a4aef88aaa19b9a4 +DIST rust-1.58.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 331e8f732d1ff9243694f5baf10159ef674fa5ba57adfdb4b1f14f7e3f56443276c4405adee0383dd5b224bab7655ef503ac1a5c51c2d054ffe140ffc7ce1717 SHA512 a94407fa249441edf0aab56a76bcaa9ee8fb892e94c2255897200ee03594e6a887f488a93ccedcf1c2e90dadc9af17102b60e5b6dd8754509f82672efc6834d5 +DIST rust-1.58.0-powerpc64-unknown-linux-gnu.tar.xz 194135676 BLAKE2B 0c5e7e67a9a6df26c418ac94dac16401b126b367555a1d4e4306d803836dcd38538bc94f3fe170d8ad9339984a3af4a6beae9fdde47af82d7b57a1bd1441137d SHA512 ae195cc9c622a25ae23669e913bc73a1d31490bfcc3f69632a02cd050af22ac52cd46af6f8c1eb9514949a75ac2aa283b3dd52ddcfe506438eee23c75f995243 +DIST rust-1.58.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B a5db4ca38e9468f863be3e7a29a54f34364a37ad88b5073d6911e15592ff12c5f3af2b5a4c2df8d83a407d866c3cfef83495fad3b6b8f8dd1ed8be72fe06ccc8 SHA512 d2ddda9c2ec1023e93194427554bb7282bf3b6908f6410afe05b8ee9beeba236080ef8521a26f4f3efc46f79965e581157f973ec7bef300057e6cfa0098bc80c +DIST rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz 202604020 BLAKE2B db290d9c1c1a5d55b869b6c9ca6cbedf571da8b3289d5a2829bdf094788ee4fc028cd66ae9c287b3e680cbf35ebdee482f5c6576d5445d125cee2a090ae505ef SHA512 bd87ed72427102a1ce08e61d74ad8d34fcbde93e30b2597f9db29e49d53337c1d2e9794f2ce0209273b59c6c8be743870657a2da5eb1dc4d238adf2b548d0ce7 +DIST rust-1.58.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B fbc7d0aaf8e903edd42be16a561b0af79e064a2c5713a17b9d79eeeb33796a00321f1c1eac4ecbb8e48708db8f0a8eec57bb2d6d7304750d34b53d57003f6db6 SHA512 3d69abb8db74637327f18e4d54f8e175421a8348e6b0382793f0d4bc0a76cdfd60fa39b28a29bdada9ee29e7d5dd2d5b3a567d29d64b97722788f8264db4ae3f +DIST rust-1.58.0-riscv64gc-unknown-linux-gnu.tar.xz 197456696 BLAKE2B 8f393de36ca9b8c8df43b1725cc0deafa1211917ac6c6aefed329daefc19f04563d8b886aac2c8917a047d918175fc04075a13cf3c197b30b2a7bec44fa4cd48 SHA512 f2739b42ad5fa444623f7c7818297361b2df4db4d12546f262feba246a8804da6f3d982eff1c558f15882d9b580ceaf39acfc54749924bd9eb8a383a5154893d +DIST rust-1.58.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d23d62938b8a7832724c73d17253b3fd078bf1a6646a9d92298a297b8297ad93372be28e651b1001a273af9efb877c444e3af6b19217cbab4fffd4b437099a6b SHA512 73513a0323c2c5519a4311aacc98f400fc44c0c48223460939c485d4526736de26603da85dec341472dcab4c62a4e15927da8eeb89be04152969d97e542eef4a +DIST rust-1.58.0-s390x-unknown-linux-gnu.tar.xz 198300224 BLAKE2B c31a5ac34d31e1080459aaf594a9ae373f6aed90096b6f6e7cf34cbc6672bde3d01f5d945d956010921c1b0db0bd32292dd71a8d2aa43a83a4e51ad7d6444919 SHA512 2bee2fed7d13d9fd5f10bb071ea8b91bff650d223b5e78fa8068fd841e3f757a4358befc26298c5477c2f9a4fe9e2e77c8f5911ed2630f8ff311491fb842fba3 +DIST rust-1.58.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c86889d2592e951dd68e244e1e813086f2a253adbb3a68fa4fbfaf054f599072d9ec2a527885febf9f07fe22c9f4377d5e9e4304d13e2b00a2d9ffc294abd011 SHA512 e19bafd80078f1cc669a8998544f0bfbe976acbd010c3c2a078511ff4cce79c784db4a2c293af5fae04efc5551a05a30770665414622fed1a493a069cfc2e73d +DIST rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz 150248636 BLAKE2B 79dd4f08d65c1832e56629dadf8a0fab0105a2025d637053ba38a0f5a5b595866f97fdb67a728d036d4154a52e15b464d3d511b8f693ee2deebd10eedbd4bae0 SHA512 382a1b3ac5874a9e3f162ba06196074df703b0422dac70c9c38dd0770e86b7fbfbf0380ee1b520a6ef92d3f52c865e901d106f5beaf966fa036fba88f7912da9 +DIST rust-1.58.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 232a8e931fb5ba56cb4f5209650abf517748ce2112abb6d6b9c34437ae90813e5fa2e056cf7ae46795bda805a326416d4f7fee0bdeb7568b81b5d553ce795433 SHA512 4cdbef971b7afc1560ecc461c4da317ca831f2f3c04f806e5819ae38d2baa1815422ca569d724eb6ca5b8c1858a4e17e7791b1ca722e41f5ffafe105ce9da3c8 +DIST rust-1.58.0-x86_64-unknown-linux-musl.tar.xz 262715336 BLAKE2B 6a4d5202cae8ba404259f6c012faa801e3e6930a0d8851cc1fc6c35948dab5f74d196914c2b8b4344309a40c8c6324690a6920b61a2d545d945796f9149701ef SHA512 d97fd1b308c3f73ddbd8b10054062a37a05b445e2a2a91ad01844b9b7fd43d9e9dff00b8715fa2748ca1da9fb883eff14075b463bd808ee9a81b94fc85d9394f +DIST rust-1.58.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 368cc50c5ffe74c790cdf18ea66694905b0fdde575854765279fe41cc529dd7efc60ca2493c1749dded7da2f1fe67d8a06ec0d4de4a75791352452c57ba78947 SHA512 7273afc1c371c70f0e44cc796f9dc7b25137d7afd5fa1323e98d512924353117ff0b3521aaf2a2af29336ca210fa891d4f2a8d9cd2f626b09912ba8eea36326f DIST rust-src-1.56.1.tar.xz 2456408 BLAKE2B 19cd9ac0c0c57d077e2a62e6ef202cf8f349582870d0acf28b105278da611e3e3884b1db59cb43c1a13c8f0ff546f83f8ac30783e46f99233a0a81df04dfd359 SHA512 6ebcb7e641031b269af244f0a14ef23c5a6c324d8c9f8f9ffe3b1802fb2aad522b10544f6c29789950dd2a9fe7cbbdb6587f793ec8f53881e707734bbaf3a3d6 DIST rust-src-1.57.0.tar.xz 2536924 BLAKE2B bdc8bfcf6ee3fbd0be3b9bf1ea8faa34bb45247d35bad5a7c5684f74ce061de3399d05209cabd18d01c7f73703c5e11cc49765fd7a0230e95484922e96e187de SHA512 24d86a7e1f8cd63b9571003604374cc251c575ce351253cf5ce676f34fa8aff574bc9e305de0d62b42a0d699e792fc072867981908ceebcd75b2bd6aa71a0867 +DIST rust-src-1.58.0.tar.xz 2822920 BLAKE2B 8703fb119092473ce9bf822a35e3b6b2dc1644fad502140061d2787dca0bfd90878d8b2394e5b43522ba5b51a41d181f83e3025978633047460e80e5d6983de7 SHA512 9d2456d0c0f5649ab3bd4e3ae4540cf9f382ab43020306699657cf2dd0671c423f82ea17f66a07d8eb88845598e928106bc40de29a674625fa630f3be6ea47a1 diff --git a/dev-lang/rust-bin/rust-bin-1.58.0.ebuild b/dev-lang/rust-bin/rust-bin-1.58.0.ebuild new file mode 100644 index 000000000000..9c28c049ad03 --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.58.0.ebuild @@ -0,0 +1,214 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal + +MY_P="rust-${PV}" +# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src" +MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2022-01-13/rust-src-${PV}.tar.xz" + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" +SRC_URI="$(rust_all_arch_uris ${MY_P}) + rust-src? ( ${MY_SRC_URI} ) +" + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" +SLOT="stable" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86" +IUSE="clippy cpu_flags_x86_sse2 doc prefix rls rust-src rustfmt" + +DEPEND="" +RDEPEND=">=app-eselect/eselect-rust-20190311" +BDEPEND=" + prefix? ( dev-util/patchelf ) + verify-sig? ( sec-keys/openpgp-keys-rust ) +" + +REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )" + +QA_PREBUILT=" + opt/${P}/bin/.* + opt/${P}/lib/.*.so + opt/${P}/libexec/.* + opt/${P}/lib/rustlib/.*/bin/.* + opt/${P}/lib/rustlib/.*/lib/.* +" + +# 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="opt/${P}/lib/rustlib/*/lib*.rlib:lib.rmeta" + +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/rust.asc" + +pkg_pretend() { + if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then + die "${CHOST} is not supported by upstream Rust. You must use a hard float version." + fi +} + +src_unpack() { + # sadly rust-src tarball does not have corresponding .asc file + # so do partial verification + if use verify-sig; then + for f in ${A}; do + if [[ -f ${DISTDIR}/${f}.asc ]]; then + verify-sig_verify_detached "${DISTDIR}/${f}" "${DISTDIR}/${f}.asc" + fi + done + fi + + default_src_unpack + + mv "${WORKDIR}/${MY_P}-$(rust_abi)" "${S}" || die +} + +patchelf_for_bin() { + local filetype=$(file -b ${1}) + if [[ ${filetype} == *ELF*interpreter* ]]; then + einfo "${1}'s interpreter changed" + patchelf ${1} --set-interpreter ${2} || die + elif [[ ${filetype} == *script* ]]; then + hprefixify ${1} + fi +} + +multilib_src_install() { + if multilib_is_native_abi; then + + # start native abi install + pushd "${S}" >/dev/null || die + local analysis std + analysis="$(grep 'analysis' ./components)" + std="$(grep 'std' ./components)" + local components="rustc,cargo,${std}" + use doc && components="${components},rust-docs" + use clippy && components="${components},clippy-preview" + use rls && components="${components},rls-preview,${analysis}" + use rustfmt && components="${components},rustfmt-preview" + # Rust component 'rust-src' is extracted from separate archive + if use rust-src; then + einfo "Combining rust and rust-src installers" + mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die + echo rust-src >> ./components || die + components="${components},rust-src" + fi + ./install.sh \ + --components="${components}" \ + --disable-verify \ + --prefix="${ED}/opt/${P}" \ + --mandir="${ED}/opt/${P}/man" \ + --disable-ldconfig \ + || die + + if use prefix; then + local interpreter=$(patchelf --print-interpreter ${EPREFIX}/bin/bash) + ebegin "Changing interpreter to ${interpreter} for Gentoo prefix at ${ED}/opt/${P}/bin" + find "${ED}/opt/${P}/bin" -type f -print0 | \ + while IFS= read -r -d '' filename; do + patchelf_for_bin ${filename} ${interpreter} \; || die + done + eend $? + fi + + local symlinks=( + cargo + rustc + rustdoc + rust-gdb + rust-gdbgui + rust-lldb + ) + + use clippy && symlinks+=( clippy-driver cargo-clippy ) + use rls && symlinks+=( rls ) + use rustfmt && symlinks+=( rustfmt cargo-fmt ) + + einfo "installing eselect-rust symlinks and paths" + 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 /opt/rust-bin-<ver>/bin/rustc-<ver> + local ver_i="${i}-bin-${PV}" + ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}" + dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}" + done + + # symlinks to switch components to active rust in eselect + dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}" + dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}" + dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}" + dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}" + + # musl logic can be improved a bit, but fine as is for now + cat <<-_EOF_ > "${T}/50${P}" + LDPATH="${EPREFIX}/usr/lib/rust/lib" + MANPATH="${EPREFIX}/usr/lib/rust/man" + $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '') + $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '') + _EOF_ + doenvd "${T}/50${P}" + + # 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/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 rls; then + echo /usr/bin/rls >> "${T}/provider-${P}" + fi + if use rustfmt; then + echo /usr/bin/rustfmt >> "${T}/provider-${P}" + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" + fi + + insinto /etc/env.d/rust + doins "${T}/provider-${P}" + popd >/dev/null || die + #end native abi install + + else + local rust_target + rust_target="$(rust_abi $(get_abi_CHOST ${v##*.}))" + dodir "/opt/${P}/lib/rustlib" + cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\ + "${ED}/opt/${P}/lib/rustlib" || die + fi + + # BUG: installs x86_64 binary on other arches + rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die +} + +pkg_postinst() { + eselect rust update + + elog "Rust installs a helper script for calling GDB now," + elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}." + + 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 +} |