diff options
author | Georgy Yakovlev <gyakovlev@gentoo.org> | 2022-05-24 11:22:29 -0700 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2022-05-24 12:43:57 -0700 |
commit | 29796b4678e396117a32e2d9d468d79c2895c15d (patch) | |
tree | f55febd6f3bf39167f494dd04b2680f4b52ec663 /dev-lang/rust-bin | |
parent | www-client/chromium: promote M102 to stable channel (diff) | |
download | gentoo-29796b4678e396117a32e2d9d468d79c2895c15d.tar.gz gentoo-29796b4678e396117a32e2d9d468d79c2895c15d.tar.bz2 gentoo-29796b4678e396117a32e2d9d468d79c2895c15d.zip |
dev-lang/rust-bin: add 1.61.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.61.0.ebuild | 219 |
2 files changed, 252 insertions, 0 deletions
diff --git a/dev-lang/rust-bin/Manifest b/dev-lang/rust-bin/Manifest index 9e3088fd7611..463a2372f307 100644 --- a/dev-lang/rust-bin/Manifest +++ b/dev-lang/rust-bin/Manifest @@ -62,5 +62,38 @@ DIST rust-1.60.0-x86_64-unknown-linux-gnu.tar.xz 154271340 BLAKE2B 7ee48c165e6ec DIST rust-1.60.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7454407a16e2b6c89226252c7e706086c9bb8016183df1180c54e88ec0d6622a0829d4acda959a093702bb1d95d4f2678976ced69fcc219afb42ab631e459d40 SHA512 eb3550e27e361860075a22d9b4821c6d078d7e4c82ad688a64e813adbce9922b9ab2dc64d1fd4d74d20be9af122ff05819d521677a43ad1c1092bd498d325a8a DIST rust-1.60.0-x86_64-unknown-linux-musl.tar.xz 258420992 BLAKE2B 6b446c06fd8d511910110eccfd55c1116f3468ffe87274d6b90c7a2a1ccd298471f62d1bfb807ddab2f66fbac58995e903414455c76fe2b14c9659f00e8413a0 SHA512 6f5a53968f44bf7be563d32eaddea439d8f388858db3d3b58a89b22cc2252e195b56b0e8895f4254c40274035e221657504958c8f1e331befca012d480118f3b DIST rust-1.60.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 680e7267a188a5286938d9c3284968121a7783cba196bf863affd6b927344e1a88cf7b97016d53c74560179439fc7fe9dd700a295c7c00b139472320323861cb SHA512 071efcfad0074a03de454835c512e98b466662b27bef2fb31def0bb82531b4048eba59a529621fda515800e19c4f3c62a33a364ecca8cecbaa09fae842b894b6 +DIST rust-1.61.0-aarch64-unknown-linux-gnu.tar.xz 226403096 BLAKE2B b9927e6d364fe791bef49cea5f0904629a2f01e6a71325c1769c67b845725ae6f54a1a8c0530fa5048591dd0ecfd50a40224243f935b38ad269e35ce2e1c59d9 SHA512 1c00830f67b75eaf23ab759e8218fca48e424cad0ede02e737e341d105f6f8b8113e4d4181cde1b43f9369af9c2f238fbdcac27ccad3dd02db878e2f4e6ba35b +DIST rust-1.61.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 697df0294d01a19eca2f9b7597df3826e79ea790766c5c5a7b73f5a04919cf64f1489f34c9d2c397523432243e7f3f29f42440ba9aee127753868529196810cf SHA512 78cbc7eeb552965a1b6c4cfc9c8404017fe195acefbda1aa203d1c2ba969b3ac28388930bb4f3ca5dda7ecac5e61163ae0a5d06967eab9f0a7cada87c6b2dc58 +DIST rust-1.61.0-aarch64-unknown-linux-musl.tar.xz 220966060 BLAKE2B e03c6418fed773d1028363979726648d1ffa0e04d6879688efefc15f95fbeff3ff9c0dc7c16a53fedb18c4e0b16e060cee9f3566b0f96027e5dc68820fda149f SHA512 e806f78ecc9edd12bb991533c6bfc95da30c8eaacbfc54f0f4dbf3a95a011da82fca13cf3ef23594a9d1d9d8c79c8186fe98b60658a2cd5c0ed2c6e3984468d0 +DIST rust-1.61.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 426c4c8dac07269d184f61bf2447957cdbdacafdf27fac5ab5a0eea958e15fb3eeed0753dadb1d1bb157322ca5e8c6b7c10d946c4bd3a089ccd8275d0a310014 SHA512 b231afc0c3604aba64277c4f018f1f4b30417bd2fd113919b8b584d5482523b961071a50394a4906d8ba8536685fcff4710b51fee7832a7a041dcb902f1c5ff1 +DIST rust-1.61.0-arm-unknown-linux-gnueabi.tar.xz 200226676 BLAKE2B c55c36524249eaf9ab1e040b6742e1ada46b32bf0511338d23536663050b46103b1765aeb2a145be9cdc0b602d83526fe902fc431e0793d1a307ab0d4b61a356 SHA512 3a9f52b9f4f2a972477a48b629b8345f151d32d491be0cbf3692b76f05ddbd3319de1da7b10959d37fffc08e12b3196a6f4462cc2476ad80d2f9750e0b189cad +DIST rust-1.61.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 34f251ee19ace45c411f161b383dcda35b8dea62e135cdeceddd73ca029920b0f0ea0484fb79c9680d9b4403c5c01d76d4fd2fb47fd65a2fbcb0375e56a1586b SHA512 641ce73107609d55f98ae00a03a9efd58985539e46a834ceffe5af79822309a40a4eac59e5cec3b1654da733f463f3bca438f42ecbaf5fce5d276466317a7e54 +DIST rust-1.61.0-arm-unknown-linux-gnueabihf.tar.xz 200078864 BLAKE2B 02403c024bf02b9ec42fd0baf52856fbcce2a10477d19e68e4ad06110aaabb90496543fc3de5f385428396979fbb80cdb27f28b4cef8af9266c18fa87a995c30 SHA512 155b2f0c341280bfb7db066b639dc50580a07b21ad6f9f6255a8645d5d944d58fbaff505f1de0c3f51ed92ca0d4dc75d9b92e2aab7e8b64f8c42d3af0a714fe6 +DIST rust-1.61.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 6b4875ac242f11f47518f17a0a039539e56cf3cef78f1e3cb4bc2174e60d6d0f0d444b4c0cfa007643202b5ce92a4cb979e92b5f6f559eb90fd78fdd5f870e57 SHA512 f2618ba9f076c10d0ddd23129e6e8e7050fd1126d7767c8b74c53be209ca87f9bebbc09069f6aed55e14de64b1478fd93b370be7e60858b5226fcfc1e8ed87c0 +DIST rust-1.61.0-armv7-unknown-linux-gnueabihf.tar.xz 206757912 BLAKE2B c702e17e225becc681713a3e819cc38c727377d280a1963efd4e6b1d27e0dbbb71ad0bec4d7add8319417846cf54bb7b5901af0f633b180ca9a5f169c709e43a SHA512 88dbb7a35a8424e5b197566515c21122c1da71df146abb304d7dbb50380b4771a741910abefc9d79831146b28b657ffe53cae07f0392e83a7279a7795aadf0e6 +DIST rust-1.61.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B f4b93feba557d81638ead6c3ad72f2e5c321c1103b473096e312d8a3191e98aac65aff0ebcb6f2c23701de17f2602ba18a6462c24a678c2bc2a13e1003189271 SHA512 72d8152d206c1ca9d69ed4704b8638c32b5f136ad985fd4790961935f1b44f08df0960e03066de2dd1cc9f7a140e8070f0a6e671f59c751506847d9e247c5ecd +DIST rust-1.61.0-i686-unknown-linux-gnu.tar.xz 218220208 BLAKE2B da47b131676258747e27704e2a1abb844567e2ac9ccffdd1c87edaa677e04b1fe73227f7b6afa437d8fe2f2690352623343b8318906038206b5b684fa8eafcc7 SHA512 f19e1a5253c57d250d4de7f0f54b70a296d92bba2e22d8b842bcbb311e393e3bf24c28621f490584497c586c6fdbc41f5af55d86a074b93efaa62d313121cc4a +DIST rust-1.61.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 3b154ab9d414ec6d7dea13c6b2d2def9613544b3d8f6464385fa390bb6228d73826032ed6e536a9a2dd379499ec500788b149c838d5ad1a50f545a47b19a2cbd SHA512 f06ab7e865bf56c153586e146438079ff3ee3de86c610e463cd0ce67c090349b9dd4fa587d9eab0dea4b908770bca0dab955f797ebcc5aee2617a981ff23eb23 +DIST rust-1.61.0-mips-unknown-linux-gnu.tar.xz 157918296 BLAKE2B 0551ab0898491129828be9cd7d6fd22a56c329f85ae9767c8ca216cac16ae3f93d30913c50c8cea8daa2f98878147e2f15f587e38e9e0fca7c8c4b6d3ead6870 SHA512 02cf5d1ed8c28bd52b7c27ba696de30ee23322ddd1e2ef953cd95a6d0b31c63ea66071bfb22c4d11a780243e62e21407d7ada2592b08caac67d7d79e7d9ee0f2 +DIST rust-1.61.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 2d050374431b8d48b6a0a3e171d4d2f62cfd8a2df70ddbf0d374bb9351e684d15d3ade7f6717e6abba1de47c4899f0f7575a4ca537d1a39a57e03ea4b0ae281e SHA512 6e2d01d3b8218cae46008328226286abe3f4323891ab41129f9af94b4526d5b21700fa84c880b4efe38d39c57b2a0946eb82e3ac58950761b20f4def1d8b82f2 +DIST rust-1.61.0-mips64-unknown-linux-gnuabi64.tar.xz 162321252 BLAKE2B d49ec8d3a5eec2085a26b4da22a31e5631e3665333a030e4683446cfe3f71e86e466b827942d6a62d32f469ff7fe9208aa51ba9d47822a54d40d89bef45636e5 SHA512 1e6003127963b836c343ae06586b152b1f227529d05b555aefa0bd7d4b92124215cfa1038aba1236c0c42ecd8e429253db4faa13ed388c16a8659e71b0008fe7 +DIST rust-1.61.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B b031019589b12cdf45f0a938c7479ad219c257643b88108d0c524088530df783338d64c1b356055e34a38df8908653c25fc286949826bb7e3539d63c78c36a66 SHA512 ee9178251f5a79803871fa76a22395e4b43958582930f92cf1f5e76970c1583f9b0403da7c05bd8a7cdd83839b319a6640adcaaa5475e9ab5bffb43146116b09 +DIST rust-1.61.0-mipsel-unknown-linux-gnu.tar.xz 162148648 BLAKE2B 492e0c811c9fae9d0052fcdfffe6d96d43674e1775edaf31d63024e56763d44c02763fd70e768ac0987d260665b86d78aa55a0652f5acbf097a3e9a472aa4d9f SHA512 637b081d8357d46030ca206c8feb54a38d9696a0bdbbad9a892ee4a472f29976c82b814f14cc987ad9e473e70d22347e7e01e81f0f59e82dbaad62153c1ec32f +DIST rust-1.61.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 9323f7488fdf603e81018c4b6afa11da952eb6051e9480fee027326ebccd15befed97c75c981f621d7eda3daf2d082c5fb12af426e48cb4c0c733ab55c46af6e SHA512 9d1e6062c4a7714aa754ea586f9bbe3a988e5e6d1e6309316bde89fa83ccddb837e96a8de13fbd4b932c8fc37be89de06802f12f689e17b1ae6cd97b5e2db561 +DIST rust-1.61.0-powerpc-unknown-linux-gnu.tar.xz 180802408 BLAKE2B 41ecab76e35d9ee2b9658730f46ece4191e706714b3b90b6021b4bd9ed2c4f0d563e0c0b39bdc7e633237d55c5375379565d7932e7ffb4896851831f64f61559 SHA512 ed19698f32c1af73ba8c402395b6ee30381d1fff6026d2c94e45ad89ef197cffc1529dc21402e2b463deb47aba0ed4d63d69c62908cdc099da463835757f3fe3 +DIST rust-1.61.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 438143b3474d0cb9e1a19b93de28544f02672e245bba7855da286fb15c58db93021e44d432fbe4a0949592b57cb23b373abd5c0a3f960f6975a0cf433352462e SHA512 7a570c64a79adf78c8c28342d9ab39e8ed953cd44b8038e03beb888b5611625bae95e88220c9c88236ff1672f20ad61976d116da7689cf29f53112deb9b75858 +DIST rust-1.61.0-powerpc64-unknown-linux-gnu.tar.xz 187335836 BLAKE2B 6feca68e47f7e19355ba623cda1d1cd15351017d388d94e2b9d6821493b8a77a09c95148a8fcf7124e3b0c9a9ee205c9f5c14af04172e2d02ea239355755b364 SHA512 b8afcb47653877dd47a808b4aecd95bca715a96311652e0616125e75bc5a457364b0caba2918e2e3e8df2d1fe0afb6fb384bbfa44fde25ebe0dd368414984acb +DIST rust-1.61.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 20bc76dea5484d2a6bf60ffdacc1dacb8d3f7abdb428fee3b1d3e6e19d499f18afbe667a5de96a28005661bd0b4f5e4c8429df917a31b86d72b9aaa9ec56c7e0 SHA512 cf10c0f1ca50894deba5f02a4e3491fe61ea8def4b0f76fe790eb52ff66295d2570ae50acea66a51e710822d6109a2ab3c8f1e703388ae0ee19fcfc5657d4f38 +DIST rust-1.61.0-powerpc64le-unknown-linux-gnu.tar.xz 196945316 BLAKE2B 23ac372f7bbeac3eb757adcb6ca93187ad01492992327533452ab348ec899cb97f5ac9335b32039a62ccf4c34125de3c4b6c1d7829839c95f638b6531be59c57 SHA512 6cf969cef60d2b70db17902ceb71d2616de0df1ff4fda15578347372bf5a349fc8f4377eb1d003abb84a93a122ab0e54aac52c95568813148d3c0113d663a07f +DIST rust-1.61.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 6b4bdcba7c5b681512b98b39f8035788f612ee1c8f44d98d58f8a29bc71e470d57ae587a6ea2e02a22263d40bb452054d03483a3922db6c131d3947e65da23bb SHA512 cd102d958ad3ca62f534033473664e867892dce0ca8a2f96271ecfabe34e0afbd63d8281086c5cd692fdb961894313e7430ce2e1d14c3a686b40d8a514c124e3 +DIST rust-1.61.0-riscv64gc-unknown-linux-gnu.tar.xz 190408604 BLAKE2B 1f37d88201f0e3517194d810f99ce3167fa132c72f8580704750b926b838956157b1ccd303ccf5de15615733383d1009cc135ede7dd8dc7c1e39b4246a8ed604 SHA512 8f6f469484ff9c10af2b1a822a8193f313ac244783921c68dc1feee4d6897e7083cfb90d19384a266d41b97aeb845ef073ed955fb7beaf7e1810d682185c2d42 +DIST rust-1.61.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c413b2f55e3d45dbfccf193f5cb9f6866abf895d23c850e3744a0bd897c2c812f57457211efaab7416c0d8fc079cc4feaa35de879ad76356a961e704e711be46 SHA512 0155b4e0ba86cc190b85f2f82e8ee75c14825e52e05ab3446283512f0b42f113d85ef89d72e0929382637dc0a44ef72f06552957285463c2edd7f83d9c8234ff +DIST rust-1.61.0-s390x-unknown-linux-gnu.tar.xz 214196912 BLAKE2B 31eeaabdbca2fa837610179eafd0cb6cde2ce8d4feb57e86cd1fc8962e1f8b84bf067d7782414380616d5b56fef5db19c91c54c89f5dd935debf6ed2d3841466 SHA512 7de0ea08c4834e60d12098d92d4366689c0b959f58667bc68e35ad3c976011e8d9375566cebd9260933e13bd74105d297dabf40a0d09b34f83905d4cb9995f7f +DIST rust-1.61.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 617bfd93b883cc36c8504ac326813511bee205a508489be168060863d967efe9a2e8276c3834d872f419317047ba83624c996be9d6f913be58f9feab66f292b2 SHA512 933689de3c1fabc31dd1910844479b3505e1a8b8474fdaeb4936df118a6da4f9597c45f0a0056d5c1efc33ae8ffb2910f5aa07b91afbd231ad7c20f0c79ceeb4 +DIST rust-1.61.0-x86_64-unknown-linux-gnu.tar.xz 157592468 BLAKE2B 0877c0794280a5ab7e74553c02cebad67e36148a3f34a709973310d89d7ea65dc8ecfa8b9c461e4f96939ed2ff09b7bacbef0b4fcf409758a0429bc431f87ebe SHA512 365191453f37775cf8bed66e12224294d4d99f3bacc635c3c13f05bf8585838a04b602c2fef7964f26a6cc35ab432a5c0a9745e9ffad0a83b0c761ec02de3484 +DIST rust-1.61.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 5296a8df210a4cf2fd7dffcba1ae6bd8cda9e408ff4c55d997199c2890b9faab9e8d6d22a3c0961786bb80231836047929621edf9043d474b352fe28bd9192e8 SHA512 cb97e84cd793aa8676c41297d8da14125855c008815e65d8191868eb88241ccb408c6f9ae85b7ba8de1a02ea8923f5e042f4fea662fa593e5ec03505b41ee52d +DIST rust-1.61.0-x86_64-unknown-linux-musl.tar.xz 259724324 BLAKE2B d005bd2794d196136c42842fbb7bc64d827898b5713f768cf0e88be5a40e3906139027ee58571cfccd8d2c864f672d1986da28c72f0d1c4a7f78d18efe14385e SHA512 96d09ac3a48bb2956dd6bf219e605c68327a94d09e72290ee74781c4886dce93b217163fb08dac0ce69bfaa2e3ab8cccd4a26d10b9df4c3162822a38e355bdb6 +DIST rust-1.61.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B e1c8061c80cd5445f7df9c44044ccb47731704b93d4e86cf95bd3b1b08a3c3cdb61e21349088cd0127632c63a0f7c22f0fa209809450dd81607bf7353d61a7b4 SHA512 587f487a3c8159a4b102f15a484a0ffa4f32c2abd2fb4ca078c27d36f6ff365c95015a99494e852631e9f92bfc9f33a0266c5f62b7edfce823c34993ff6a836b DIST rust-src-1.59.0.tar.xz 2861676 BLAKE2B 83c7c9f222cdc5de787243154aec1b62914badbd65c8defd7c0e48dad9018806d7befb0e419204c5a782d83e386609071c11a6e445df80ab593917b58f7712e5 SHA512 006cb2b29e0db69f4f241a6b44b1491f840503d953919722da5924eba4fbc13d09f8f20d35614e4069bc745facecfb20ef771ddc95560c94b5745b66047c5a0e DIST rust-src-1.60.0.tar.xz 2898184 BLAKE2B 5810f14110398bc41342ec620a77da34c805b8c2bfb6c45c869c8d41a464b83825936a596f286c9c3f69a7453afd2542eb2971b768c923afdd24444a62359061 SHA512 42a45093bdcfe6ca5fde7701cd17e15438c8f064ac87c5606527b2196258a9285dbd195137ad41c43d77afade34e30061ad36ce58db783fa61037ec146f0e501 +DIST rust-src-1.61.0.tar.xz 2353184 BLAKE2B 6f5671173b89eddc4e1a36e58e5937b832ab6952c2601b16427c614c5e7bc7ab60b28d54f33e9c2578ce2d5b3db641097ddbf912ba0145c4f77a1d14115ed703 SHA512 8eb1462896cfd0c731de4f4be6fe68127bb4faa443c53289a34b92ff7778ee8711281cfe29b2c1367c0b3fdb9f6b7dba21dfbd40b968aebaaa51eb219357b4a3 diff --git a/dev-lang/rust-bin/rust-bin-1.61.0.ebuild b/dev-lang/rust-bin/rust-bin-1.61.0.ebuild new file mode 100644 index 000000000000..a745ac2ec2f7 --- /dev/null +++ b/dev-lang/rust-bin/rust-bin-1.61.0.ebuild @@ -0,0 +1,219 @@ +# 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-05-19/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 ~s390 ~x86" +IUSE="clippy cpu_flags_x86_sse2 doc prefix rls rust-src rustfmt" + +DEPEND="" + +RDEPEND=" + >=app-eselect/eselect-rust-20190311 + sys-apps/lsb-release +" + +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 +} |