From 2219846414b8fd051f10ed2ffe783ab5661f81db Mon Sep 17 00:00:00 2001 From: V3n3RiX <venerix@redcorelinux.org> Date: Tue, 15 Oct 2019 22:52:05 +0100 Subject: dev-lang/rust : version bump --- dev-lang/rust/Manifest | 4 +- ...Add-additional-headers-only-if-they-exist.patch | 41 --- dev-lang/rust/files/1.34.2-fix-custom-libdir.patch | 36 --- ...commits-triggering-multiple-llvm-rebuilds.patch | 117 --------- dev-lang/rust/files/1.36.0-libressl3.patch | 72 ------ dev-lang/rust/files/1.38.0-fix-custom-libdir.patch | 90 +++++++ .../files/1.38.0-fix-multiple-llvm-rebuilds.patch | 75 ++++++ dev-lang/rust/rust-1.37.0-r314.ebuild | 285 --------------------- dev-lang/rust/rust-1.38.0-r314.ebuild | 284 ++++++++++++++++++++ 9 files changed, 451 insertions(+), 553 deletions(-) delete mode 100644 dev-lang/rust/files/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch delete mode 100644 dev-lang/rust/files/1.34.2-fix-custom-libdir.patch delete mode 100644 dev-lang/rust/files/1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch delete mode 100644 dev-lang/rust/files/1.36.0-libressl3.patch create mode 100644 dev-lang/rust/files/1.38.0-fix-custom-libdir.patch create mode 100644 dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch delete mode 100644 dev-lang/rust/rust-1.37.0-r314.ebuild create mode 100644 dev-lang/rust/rust-1.38.0-r314.ebuild (limited to 'dev-lang') diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest index e535c2b3..a27e34e8 100644 --- a/dev-lang/rust/Manifest +++ b/dev-lang/rust/Manifest @@ -1,2 +1,2 @@ -DIST rust-1.36.0-x86_64-unknown-linux-gnu.tar.xz 169600936 BLAKE2B 8bf075f2b5624e4716e3058512b85b70e72ec6f0c8ce8fc38857612b02aa5702a1bb447f13f882a1b96b1f32330d0a8f7f1f1db81827b51cb7429195e070a5a3 SHA512 3f14dda1e09ef8c8168600f4d70ba60cb2a1086ad9edb5eed708d0ffc16fdb9c582ce350a93afcd64b78f87737e37d4f099703835a1ec9837a5721c2335e17c7 -DIST rustc-1.37.0-src.tar.xz 98654252 BLAKE2B ddee92c7959a0e1ee11ffe5ded6017703cfac7bbf2a00dc46c37ed28f1cd1d31e1d5b62cc1a5ae2d55d64f8705d0cb282f4968deddf36c3152e5e0cfdfbea67d SHA512 bfee43f578e6d44ead950b870b9fd31087e1bd3f917611f5dce7ad56504b83185edf43e297e8d1304e9e97b9a580d1e6adf6608ab8ed6dee0dc8c5153cdbc5d4 +DIST rust-1.37.0-x86_64-unknown-linux-gnu.tar.xz 165034364 BLAKE2B 3047fff28da00e01179d3a648cb4e5636fa15ac7f4cb9ddc14e1df86d045b69ff3e41691b4a6ef4227c4cb58137524c5e029ba21a2c3a3a171fdb6f46b44f4ff SHA512 c4d48aa12cb929d6600f9cce81bb612c504aa1b3b3f8e76352af3a76b737dcbe0d31e8d139c17884b11aef9f12a55c4908fb8f3ff63dfa92533e4bd0a729914f +DIST rustc-1.38.0-src.tar.xz 96163304 BLAKE2B 1e900b44db64727477ccf8e58e0ebb9ec209bbeb349816b5f7937e58c165db8befae33c5667732e5aaaa677c5a6c1e0229d9969ab8967fda9b8d7a593e6c5eb6 SHA512 b756d29a7a222bc7b5c7f42ff397346ab840f78e559f93e6e36b65e76eea525cf429899fe4de9fb8966623a2225b552feef9fa831bee50f9e25c976fa2af8c0a diff --git a/dev-lang/rust/files/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch b/dev-lang/rust/files/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch deleted file mode 100644 index b33311c0..00000000 --- a/dev-lang/rust/files/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 1f68002cb725c6a8fb5ca8425c1c86495a053f4f Mon Sep 17 00:00:00 2001 -From: Michal Gorny <mgorny@gentoo.org> -Date: Thu, 4 Apr 2019 14:21:38 +0000 -Subject: [PATCH] [llvm] [cmake] Add additional headers only if they exist - -Modify the add_header_files_for_glob() function to only add files -that do exist, rather than all matches of the glob. This fixes CMake -error when one of the include directories (which happen to include -/usr/include) contain broken symlinks. - -Differential Revision: https://reviews.llvm.org/D59632 - -llvm-svn: 357701 ---- - llvm/cmake/modules/LLVMProcessSources.cmake | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/cmake/modules/LLVMProcessSources.cmake b/cmake/modules/LLVMProcessSources.cmake -index 7cbd2863500..d0be0e8b3ba 100644 ---- a/src/llvm-project/llvm/cmake/modules/LLVMProcessSources.cmake -+++ b/src/llvm-project/llvm/cmake/modules/LLVMProcessSources.cmake -@@ -30,7 +30,15 @@ endmacro(add_td_sources) - - function(add_header_files_for_glob hdrs_out glob) - file(GLOB hds ${glob}) -- set(${hdrs_out} ${hds} PARENT_SCOPE) -+ set(filtered) -+ foreach(file ${hds}) -+ # Explicit existence check is necessary to filter dangling symlinks -+ # out. See https://bugs.gentoo.org/674662. -+ if(EXISTS ${file}) -+ list(APPEND filtered ${file}) -+ endif() -+ endforeach() -+ set(${hdrs_out} ${filtered} PARENT_SCOPE) - endfunction(add_header_files_for_glob) - - function(find_all_header_files hdrs_out additional_headerdirs) --- -2.21.0 - diff --git a/dev-lang/rust/files/1.34.2-fix-custom-libdir.patch b/dev-lang/rust/files/1.34.2-fix-custom-libdir.patch deleted file mode 100644 index 2856d98c..00000000 --- a/dev-lang/rust/files/1.34.2-fix-custom-libdir.patch +++ /dev/null @@ -1,36 +0,0 @@ -From c1aa2a464ed1a0fa2430a1e604fe6a3b9d785048 Mon Sep 17 00:00:00 2001 -From: O01eg <o01eg@yandex.ru> -Date: Mon, 8 Jul 2019 22:49:24 +0300 -Subject: [PATCH] Fix double resolving custom libdir - ---- - src/bootstrap/dist.rs | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs -index 45bc77ec97d4..5ddd1c3da949 100644 ---- a/src/bootstrap/dist.rs -+++ b/src/bootstrap/dist.rs -@@ -485,7 +485,9 @@ impl Step for Rustc { - let name = entry.file_name(); - if let Some(s) = name.to_str() { - if is_dylib(s) { -- builder.install(&entry.path(), &image.join(&libdir_relative), 0o644); -+ // Don't use custom libdir here because ^lib/ will be resolved again -+ // with installer -+ builder.install(&entry.path(), &image.join("lib"), 0o644); - } - } - } -@@ -493,8 +495,9 @@ impl Step for Rustc { - - // Copy over the codegen backends - let backends_src = builder.sysroot_codegen_backends(compiler); -- let backends_rel = backends_src.strip_prefix(&src).unwrap(); -- let backends_dst = image.join(&backends_rel); -+ let backends_rel = backends_src.strip_prefix(&libdir).unwrap(); -+ // Don't use custom libdir here because ^lib/ will be resolved again with installer -+ let backends_dst = image.join("lib").join(&backends_rel); - t!(fs::create_dir_all(&backends_dst)); - builder.cp_r(&backends_src, &backends_dst); - diff --git a/dev-lang/rust/files/1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch b/dev-lang/rust/files/1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch deleted file mode 100644 index 1c6c8ca4..00000000 --- a/dev-lang/rust/files/1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch +++ /dev/null @@ -1,117 +0,0 @@ -From d6bd0a479ceaf6abdd696c3b955a56f66275c562 Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev <gyakovlev@gentoo.org> -Date: Sat, 25 May 2019 22:21:16 -0700 -Subject: [PATCH] revert commits triggering multiple llvm rebuilds - -this reverts the following commits -https://github.com/rust-lang/rust/commit/105692c3ad281c63bf0f75a26a66bb9cff5b4553 -https://github.com/rust-lang/rust/commit/975ba58f42b34ff07cd7c2bd73350daed2057186 -https://github.com/rust-lang/rust/commit/e1daa36ba7df88788c2684bbe5ff6eb37f1cda69 ---- - src/bootstrap/llvm-rebuild-trigger | 4 +++ - src/bootstrap/native.rs | 46 +++++++++++++----------------- - 2 files changed, 24 insertions(+), 26 deletions(-) - create mode 100644 src/bootstrap/llvm-rebuild-trigger - -diff --git a/src/bootstrap/llvm-rebuild-trigger b/src/bootstrap/llvm-rebuild-trigger -new file mode 100644 -index 0000000000..0f18c6a4ac ---- /dev/null -+++ b/src/rustllvm/llvm-rebuild-trigger -@@ -0,0 +1,4 @@ -+# If this file is modified, then llvm will be (optionally) cleaned and then rebuilt. -+# The actual contents of this file do not matter, but to trigger a change on the -+# build bots then the contents should be changed so git updates the mtime. -+2019-03-18 -diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs -index fde40b0d1b..3babbc9e10 100644 ---- a/src/bootstrap/native.rs -+++ b/src/bootstrap/native.rs -@@ -67,40 +67,30 @@ impl Step for Llvm { - } - } - -- let (llvm_info, root, out_dir, llvm_config_ret_dir) = if emscripten { -- let info = &builder.emscripten_llvm_info; -+ let rebuild_trigger = builder.src.join("src/rustllvm/llvm-rebuild-trigger"); -+ let rebuild_trigger_contents = t!(fs::read_to_string(&rebuild_trigger)); -+ -+ let (out_dir, llvm_config_ret_dir) = if emscripten { - let dir = builder.emscripten_llvm_out(target); - let config_dir = dir.join("bin"); -- (info, "src/llvm-emscripten", dir, config_dir) -+ (dir, config_dir) - } else { -- let info = &builder.in_tree_llvm_info; - let mut dir = builder.llvm_out(builder.config.build); - if !builder.config.build.contains("msvc") || builder.config.ninja { - dir.push("build"); - } -- (info, "src/llvm-project/llvm", builder.llvm_out(target), dir.join("bin")) -+ (builder.llvm_out(target), dir.join("bin")) - }; -- -- if !llvm_info.is_git() { -- println!( -- "git could not determine the LLVM submodule commit hash. \ -- Assuming that an LLVM build is necessary.", -- ); -- } -- -+ let done_stamp = out_dir.join("llvm-finished-building"); - let build_llvm_config = llvm_config_ret_dir - .join(exe("llvm-config", &*builder.config.build)); -- let done_stamp = out_dir.join("llvm-finished-building"); -- -- if let Some(llvm_commit) = llvm_info.sha() { -- if done_stamp.exists() { -- let done_contents = t!(fs::read(&done_stamp)); -+ if done_stamp.exists() { -+ let done_contents = t!(fs::read_to_string(&done_stamp)); - -- // If LLVM was already built previously and the submodule's commit didn't change -- // from the previous build, then no action is required. -- if done_contents == llvm_commit.as_bytes() { -- return build_llvm_config -- } -+ // If LLVM was already built previously and contents of the rebuild-trigger file -+ // didn't change from the previous build, then no action is required. -+ if done_contents == rebuild_trigger_contents { -+ return build_llvm_config - } - } - -@@ -111,6 +101,7 @@ impl Step for Llvm { - t!(fs::create_dir_all(&out_dir)); - - // http://llvm.org/docs/CMake.html -+ let root = if self.emscripten { "src/llvm-emscripten" } else { "src/llvm-project/llvm" }; - let mut cfg = cmake::Config::new(builder.src.join(root)); - - let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) { -@@ -251,6 +242,11 @@ impl Step for Llvm { - channel::CFG_RELEASE_NUM, - builder.config.channel, - ); -+ let llvm_info = if self.emscripten { -+ &builder.emscripten_llvm_info -+ } else { -+ &builder.in_tree_llvm_info -+ }; - if let Some(sha) = llvm_info.sha_short() { - default_suffix.push_str("-"); - default_suffix.push_str(sha); -@@ -283,9 +279,7 @@ impl Step for Llvm { - - cfg.build(); - -- if let Some(llvm_commit) = llvm_info.sha() { -- t!(fs::write(&done_stamp, llvm_commit)); -- } -+ t!(fs::write(&done_stamp, &rebuild_trigger_contents)); - - build_llvm_config - } --- -2.21.0 - diff --git a/dev-lang/rust/files/1.36.0-libressl3.patch b/dev-lang/rust/files/1.36.0-libressl3.patch deleted file mode 100644 index ec3cc10f..00000000 --- a/dev-lang/rust/files/1.36.0-libressl3.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 4ab0354f7432abcf0b598b475f4616b6aa5d36d4 Mon Sep 17 00:00:00 2001 -From: Steven Fackler <sfackler@gmail.com> -Date: Thu, 15 Aug 2019 23:30:58 -0500 -Subject: [PATCH] Support LibreSSL 3.0.0 - -Signed-off-by: Jory Pratt <anarchy@gentoo.org> ---- - vendor/openssl-sys/.cargo-checksum.json | 2 +- - vendor/openssl-sys/build/main.rs | 34 +++++++++++++------------ - 2 files changed, 19 insertions(+), 17 deletions(-) - -diff --git a/vendor/openssl-sys/.cargo-checksum.json b/vendor/openssl-sys/.cargo-checksum.json -index 8430a26c5..69d8b9a0b 100644 ---- a/vendor/openssl-sys/.cargo-checksum.json -+++ b/vendor/openssl-sys/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"CHANGELOG.md":"a3e7e4750fe6130a93e9423d5b1b68c659dd29246602f71583c7a101c4d647be","Cargo.toml":"5fdba4ce7cf40abec303651694e79a5ae551f040a7bbaad134ed9ab54d26a613","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"96a414be6e7e061a21a9e39a61449039f6791225264032641dd044a1a9b88111","build/cfgs.rs":"61b741c4fe9612f5a70b19bec53d3ab7ec2d7038b163c35b54f0664caa104a31","build/expando.c":"c4fa8a4424b2321f1857edfc5ce1ac1f03eda54440367d3142310c0eb5553004","build/find_normal.rs":"0a2dc417eace7fc72c27b9046ebaf53c75e418b27baa877434925a81fe6c23ed","build/find_vendored.rs":"d88c47f4cf851aa67c0e3dec679910c5c7ba239bc5a1aa89e507a875b4c4ca0f","build/main.rs":"cae729f449030ee86fc8e97215a2639c03f87a44d2399c84be8d41c1a6b624f3","src/aes.rs":"660efd70f809cb2f5dbbf527be8f9592911776bab7dafa1fc4cc72dd9a576b67","src/asn1.rs":"f72d6871d38865d9e7378882135cdc6f1acd66c48a4fc846502b7f488dbbf111","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"95a0803286d1efbe709a3668443b5001f5cce6f9db216165b1e08950972e0bfd","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"f6e8a116940755b2b53e3d0d49d1b451fc6e4269831fd1cfcee9d6ed404cf487","src/dh.rs":"7cc334e86d16b3eae165dfa3a6c8e488bc0fe590c17beda38893d2e9d784d5a6","src/dsa.rs":"ae79baf231681900ea76304285b3ffacf5298c90b8c04d371269cf4adbb5b9fa","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"5341787b108f4e9acb12428fbf993aa507e9d77b97284912f7eab414ec6aeff9","src/err.rs":"f6641be5df397086a9db80667e191fb1d92972c29151e617df86672c1a16d3ad","src/evp.rs":"300007bcf00eaff03cb1d113547a79c9495b498ede9e1b2f709a9e6e1ba42ac1","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"e8931dd7e59a56a247823201f52828ec15d0b8dbd15ba297cacd3dcb3ca747cf","src/macros.rs":"638fb9098f6024e82b331eeee50c64cefdb58456dba28ee42560be655a0c2bf6","src/obj_mac.rs":"9c20609db7115c9edb99185375426169cb5b7caee839d892b556e92285e65309","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"fc7366e75c78707650c8667593ed183eca6a8ce8dd6b911e342f644d1bcf98bd","src/pem.rs":"83bb7745615a99fe2a8d5f8f51addba2024c7e6be847ab6c9244bfd04388c4f9","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"469601b4fbb56d4dbf5cf5d7bb8483e3bde411edea18601e7d1ed6ef27180fd3","src/rsa.rs":"0e8c1f0bc37620a9208175542143bfd411ae88188974d2d5b37a2b8b77d0e2c8","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"05044d221d8d205010a4e3760c0b5c0e2e923e165db0d65f9a8c9bcedaad9961","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"18c0c0c5ef02329be90fd279968da61d3e1a6b3a3aec102d6fefd99021d1822a","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"60ca3dea1bbfda645bde563b4a878dac129c3f760e3ad572381000fc7a8ef522","src/x509.rs":"20e221731587221aab00aef21b4e4bebb7635603d265d424f3dd3c60d4c511e2","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"30c58ce7d80670cc597d041e0f59862c1100e38743fc9dde2aec6dc811a4a558"},"package":"33c86834957dd5b915623e94f2f4ab2c70dd8f6b70679824155d5ae21dbd495d"} -\ No newline at end of file -+{"files":{"CHANGELOG.md":"a3e7e4750fe6130a93e9423d5b1b68c659dd29246602f71583c7a101c4d647be","Cargo.toml":"5fdba4ce7cf40abec303651694e79a5ae551f040a7bbaad134ed9ab54d26a613","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"96a414be6e7e061a21a9e39a61449039f6791225264032641dd044a1a9b88111","build/cfgs.rs":"61b741c4fe9612f5a70b19bec53d3ab7ec2d7038b163c35b54f0664caa104a31","build/expando.c":"c4fa8a4424b2321f1857edfc5ce1ac1f03eda54440367d3142310c0eb5553004","build/find_normal.rs":"0a2dc417eace7fc72c27b9046ebaf53c75e418b27baa877434925a81fe6c23ed","build/find_vendored.rs":"d88c47f4cf851aa67c0e3dec679910c5c7ba239bc5a1aa89e507a875b4c4ca0f","build/main.rs":"a13d5b9a16af1f75f82ec4be15d2c60d39a3a56bca058aeba1fab35156c9ea38","src/aes.rs":"660efd70f809cb2f5dbbf527be8f9592911776bab7dafa1fc4cc72dd9a576b67","src/asn1.rs":"f72d6871d38865d9e7378882135cdc6f1acd66c48a4fc846502b7f488dbbf111","src/bio.rs":"5c6f394a78f258af3babb68330fa3571610476c4c3ba3404359db928f2f706ee","src/bn.rs":"c71b9c79f704a94a889d27bf75e7e5b1f9f10b0df0aeb485aef509cf05d7467f","src/cms.rs":"95a0803286d1efbe709a3668443b5001f5cce6f9db216165b1e08950972e0bfd","src/conf.rs":"511e008c18039f54d856d70b80009426fc7f4ce34fe4304e2c58ebf465031de0","src/crypto.rs":"f6e8a116940755b2b53e3d0d49d1b451fc6e4269831fd1cfcee9d6ed404cf487","src/dh.rs":"7cc334e86d16b3eae165dfa3a6c8e488bc0fe590c17beda38893d2e9d784d5a6","src/dsa.rs":"ae79baf231681900ea76304285b3ffacf5298c90b8c04d371269cf4adbb5b9fa","src/dtls1.rs":"45e1dbf94a42d587fd948d553dc30187aa6aa2b5b82d554cf725ff36df768aa0","src/ec.rs":"5341787b108f4e9acb12428fbf993aa507e9d77b97284912f7eab414ec6aeff9","src/err.rs":"f6641be5df397086a9db80667e191fb1d92972c29151e617df86672c1a16d3ad","src/evp.rs":"300007bcf00eaff03cb1d113547a79c9495b498ede9e1b2f709a9e6e1ba42ac1","src/hmac.rs":"fa3976d94a1383f300bdec228270afb8b47c97bb019d727c7d59ba783be3c42e","src/lib.rs":"e8931dd7e59a56a247823201f52828ec15d0b8dbd15ba297cacd3dcb3ca747cf","src/macros.rs":"638fb9098f6024e82b331eeee50c64cefdb58456dba28ee42560be655a0c2bf6","src/obj_mac.rs":"9c20609db7115c9edb99185375426169cb5b7caee839d892b556e92285e65309","src/object.rs":"7539eb2164c3fe2162a339ef5b45f1c835010a1522307803815779a01825eed7","src/ocsp.rs":"1db59566d2f072f7ae981f0c07e1604fcdf60e66845afe0689d588f8e4272115","src/ossl_typ.rs":"fc7366e75c78707650c8667593ed183eca6a8ce8dd6b911e342f644d1bcf98bd","src/pem.rs":"83bb7745615a99fe2a8d5f8f51addba2024c7e6be847ab6c9244bfd04388c4f9","src/pkcs12.rs":"93aab2820008ad90dc346a7dcc02f9201d94bff0bb7d1d71031c097850287c50","src/pkcs7.rs":"5370c8d4bfbf1502fa33aff635cb730e7c87814580f1df9bdb1412a492377813","src/rand.rs":"469601b4fbb56d4dbf5cf5d7bb8483e3bde411edea18601e7d1ed6ef27180fd3","src/rsa.rs":"0e8c1f0bc37620a9208175542143bfd411ae88188974d2d5b37a2b8b77d0e2c8","src/safestack.rs":"6c39e28565d34efad707d77561d4caa99e3f028fcac3a2ef6fd403a78de1190c","src/sha.rs":"05044d221d8d205010a4e3760c0b5c0e2e923e165db0d65f9a8c9bcedaad9961","src/srtp.rs":"306047f3f31828fe7d15de154b375f071ae07012a94c0b5c909f5fe57962a11b","src/ssl.rs":"18c0c0c5ef02329be90fd279968da61d3e1a6b3a3aec102d6fefd99021d1822a","src/ssl3.rs":"9336c816e00847d552dea22587d4ac72ff3cbd469fa5ff750423a19ea11e68eb","src/stack.rs":"1a509907283e5a2bf88cf193ce607f49ce7d2d95547c2ce2abc0fd4567aad334","src/tls1.rs":"60ca3dea1bbfda645bde563b4a878dac129c3f760e3ad572381000fc7a8ef522","src/x509.rs":"20e221731587221aab00aef21b4e4bebb7635603d265d424f3dd3c60d4c511e2","src/x509_vfy.rs":"5609f6300ab37a4d4755c81f7af1e6bb93a2f1a6f333c6e42f1e73ebf83ddc05","src/x509v3.rs":"30c58ce7d80670cc597d041e0f59862c1100e38743fc9dde2aec6dc811a4a558"},"package":"33c86834957dd5b915623e94f2f4ab2c70dd8f6b70679824155d5ae21dbd495d"} -diff --git a/vendor/openssl-sys/build/main.rs b/vendor/openssl-sys/build/main.rs -index 0b8c96dcc..0d9443551 100644 ---- a/vendor/openssl-sys/build/main.rs -+++ b/vendor/openssl-sys/build/main.rs -@@ -183,28 +183,30 @@ See rust-openssl README for more information: - if let Some(libressl_version) = libressl_version { - println!("cargo:libressl_version_number={:x}", libressl_version); - -+ let major = (libressl_version >> 28) as u8; - let minor = (libressl_version >> 20) as u8; - let fix = (libressl_version >> 12) as u8; -- let (minor, fix) = match (minor, fix) { -- (5, 0) => ('5', '0'), -- (5, 1) => ('5', '1'), -- (5, 2) => ('5', '2'), -- (5, _) => ('5', 'x'), -- (6, 0) => ('6', '0'), -- (6, 1) => ('6', '1'), -- (6, 2) => ('6', '2'), -- (6, _) => ('6', 'x'), -- (7, _) => ('7', 'x'), -- (8, 0) => ('8', '0'), -- (8, 1) => ('8', '1'), -- (8, _) => ('8', 'x'), -- (9, 0) => ('9', '0'), -- (9, _) => ('9', 'x'), -+ let (major, minor, fix) = match (major, minor, fix) { -+ (2, 5, 0) => ('2', '5', '0'), -+ (2, 5, 1) => ('2', '5', '1'), -+ (2, 5, 2) => ('2', '5', '2'), -+ (2, 5, _) => ('2', '5', 'x'), -+ (2, 6, 0) => ('2', '6', '0'), -+ (2, 6, 1) => ('2', '6', '1'), -+ (2, 6, 2) => ('2', '6', '2'), -+ (2, 6, _) => ('2', '6', 'x'), -+ (2, 7, _) => ('2', '7', 'x'), -+ (2, 8, 0) => ('2', '8', '0'), -+ (2, 8, 1) => ('2', '8', '1'), -+ (2, 8, _) => ('2', '8', 'x'), -+ (2, 9, 0) => ('2', '9', '0'), -+ (2, 9, _) => ('2', '9', 'x'), -+ (3, 0, 0) => ('3', '0', '0'), - _ => version_error(), - }; - - println!("cargo:libressl=true"); -- println!("cargo:libressl_version=2{}{}", minor, fix); -+ println!("cargo:libressl_version={}{}{}", major, minor, fix); - println!("cargo:version=101"); - Version::Libressl - } else { --- -2.22.1 diff --git a/dev-lang/rust/files/1.38.0-fix-custom-libdir.patch b/dev-lang/rust/files/1.38.0-fix-custom-libdir.patch new file mode 100644 index 00000000..b2b14876 --- /dev/null +++ b/dev-lang/rust/files/1.38.0-fix-custom-libdir.patch @@ -0,0 +1,90 @@ +From 8553cc0681db7fb6b58b25bb3fbd520604a0cc3a Mon Sep 17 00:00:00 2001 +From: O01eg <o01eg@yandex.ru> +Date: Wed, 7 Aug 2019 23:37:55 +0300 +Subject: [PATCH] Fix double resolving custom libdir + +--- + src/bootstrap/builder.rs | 20 +++++++++++++------- + src/bootstrap/dist.rs | 13 +++++++++---- + 2 files changed, 22 insertions(+), 11 deletions(-) + +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index 5a75497173eb..06ccdd8e7f0f 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -627,13 +627,7 @@ impl<'a> Builder<'a> { + } + + fn run(self, builder: &Builder<'_>) -> Interned<PathBuf> { +- let compiler = self.compiler; +- let config = &builder.build.config; +- let lib = if compiler.stage >= 1 && config.libdir_relative().is_some() { +- builder.build.config.libdir_relative().unwrap() +- } else { +- Path::new("lib") +- }; ++ let lib = builder.sysroot_libdir_relative(self.compiler); + let sysroot = builder + .sysroot(self.compiler) + .join(lib) +@@ -687,6 +681,18 @@ impl<'a> Builder<'a> { + } + } + ++ /// Returns the compiler's relative libdir where the standard library and other artifacts are ++ /// found for a compiler's sysroot. ++ /// ++ /// For example this returns `lib` on Unix and Windows. ++ pub fn sysroot_libdir_relative(&self, compiler: Compiler) -> &Path { ++ match self.config.libdir_relative() { ++ Some(relative_libdir) if compiler.stage >= 1 ++ => relative_libdir, ++ _ => Path::new("lib") ++ } ++ } ++ + /// Adds the compiler's directory of dynamic libraries to `cmd`'s dynamic + /// library lookup path. + pub fn add_rustc_lib_path(&self, compiler: Compiler, cmd: &mut Command) { +diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs +index bd012a887c26..213ceb194a81 100644 +--- a/src/bootstrap/dist.rs ++++ b/src/bootstrap/dist.rs +@@ -469,7 +469,6 @@ impl Step for Rustc { + fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) { + let host = compiler.host; + let src = builder.sysroot(compiler); +- let libdir = builder.rustc_libdir(compiler); + + // Copy rustc/rustdoc binaries + t!(fs::create_dir_all(image.join("bin"))); +@@ -481,11 +480,14 @@ impl Step for Rustc { + + // Copy runtime DLLs needed by the compiler + if libdir_relative.to_str() != Some("bin") { ++ let libdir = builder.rustc_libdir(compiler); + for entry in builder.read_dir(&libdir) { + let name = entry.file_name(); + if let Some(s) = name.to_str() { + if is_dylib(s) { +- builder.install(&entry.path(), &image.join(&libdir_relative), 0o644); ++ // Don't use custom libdir here because ^lib/ will be resolved again ++ // with installer ++ builder.install(&entry.path(), &image.join("lib"), 0o644); + } + } + } +@@ -493,8 +495,11 @@ impl Step for Rustc { + + // Copy over the codegen backends + let backends_src = builder.sysroot_codegen_backends(compiler); +- let backends_rel = backends_src.strip_prefix(&src).unwrap(); +- let backends_dst = image.join(&backends_rel); ++ let backends_rel = backends_src.strip_prefix(&src).unwrap() ++ .strip_prefix(builder.sysroot_libdir_relative(compiler)).unwrap(); ++ // Don't use custom libdir here because ^lib/ will be resolved again with installer ++ let backends_dst = image.join("lib").join(&backends_rel); ++ + t!(fs::create_dir_all(&backends_dst)); + builder.cp_r(&backends_src, &backends_dst); + diff --git a/dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch b/dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch new file mode 100644 index 00000000..235b9562 --- /dev/null +++ b/dev-lang/rust/files/1.38.0-fix-multiple-llvm-rebuilds.patch @@ -0,0 +1,75 @@ +From 53fe76479aab03b1fbe5b7184f45484886f769b1 Mon Sep 17 00:00:00 2001 +From: Josh Stone <jistone@redhat.com> +Date: Wed, 4 Sep 2019 16:02:31 -0700 +Subject: [PATCH] Assume non-git LLVM is fresh if the stamp file exists + +Rustbuild usually writes the LLVM submodule commit in a stamp file, so +we can avoid rebuilding it unnecessarily. However, for builds from a +source tarball (non-git), we were assuming a rebuild is always needed. +This can cause a lot of extra work if any environment like `CFLAGS` +changed between steps like build and install, which are often separate +in distro builds. + +Now we also write an empty stamp file if the git commit is unknown, and +its presence is trusted to indicate that no rebuild is needed. An info +message reports that this is happening, along with the stamp file path +that can be deleted to force a rebuild anyway. +--- + src/bootstrap/native.rs | 27 ++++++++++++++------------- + 1 file changed, 14 insertions(+), 13 deletions(-) + +diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs +index f02def3e1b05..7bf9ea2688f4 100644 +--- a/src/bootstrap/native.rs ++++ b/src/bootstrap/native.rs +@@ -81,26 +81,29 @@ impl Step for Llvm { + (info, "src/llvm-project/llvm", builder.llvm_out(target), dir.join("bin")) + }; + +- if !llvm_info.is_git() { +- println!( +- "git could not determine the LLVM submodule commit hash. \ +- Assuming that an LLVM build is necessary.", +- ); +- } +- + let build_llvm_config = llvm_config_ret_dir + .join(exe("llvm-config", &*builder.config.build)); + let done_stamp = out_dir.join("llvm-finished-building"); + +- if let Some(llvm_commit) = llvm_info.sha() { +- if done_stamp.exists() { ++ if done_stamp.exists() { ++ if let Some(llvm_commit) = llvm_info.sha() { + let done_contents = t!(fs::read(&done_stamp)); + + // If LLVM was already built previously and the submodule's commit didn't change + // from the previous build, then no action is required. + if done_contents == llvm_commit.as_bytes() { +- return build_llvm_config ++ return build_llvm_config; + } ++ } else { ++ builder.info( ++ "Could not determine the LLVM submodule commit hash. \ ++ Assuming that an LLVM rebuild is not necessary.", ++ ); ++ builder.info(&format!( ++ "To force LLVM to rebuild, remove the file `{}`", ++ done_stamp.display() ++ )); ++ return build_llvm_config; + } + } + +@@ -303,9 +306,7 @@ impl Step for Llvm { + + cfg.build(); + +- if let Some(llvm_commit) = llvm_info.sha() { +- t!(fs::write(&done_stamp, llvm_commit)); +- } ++ t!(fs::write(&done_stamp, llvm_info.sha().unwrap_or(""))); + + build_llvm_config + } diff --git a/dev-lang/rust/rust-1.37.0-r314.ebuild b/dev-lang/rust/rust-1.37.0-r314.ebuild deleted file mode 100644 index b1738d00..00000000 --- a/dev-lang/rust/rust-1.37.0-r314.ebuild +++ /dev/null @@ -1,285 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy ) - -inherit check-reqs estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs - -if [[ ${PV} = *beta* ]]; then - betaver=${PV//*beta} - BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" - MY_P="rustc-beta" - SLOT="beta/${PV}" - SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz" -else - ABI_VER="1.37" - SLOT="stable/${ABI_VER}" - MY_P="rustc-${PV}" - SRC="${MY_P}-src.tar.xz" - KEYWORDS="~amd64" -fi - -RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0" - -DESCRIPTION="Systems programming language from Mozilla" -HOMEPAGE="https://www.rust-lang.org/" - -SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz - $(rust_arch_uri x86_64-unknown-linux-gnu rust-${RUST_STAGE0_VERSION})" - -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 - NVPTX PowerPC Sparc SystemZ WebAssembly X86 XCore ) -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) -LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} - -LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" - -IUSE="clippy cpu_flags_x86_sse2 debug doc libressl rls rustfmt system-llvm wasm ${ALL_LLVM_TARGETS[*]}" - -# Please keep the LLVM dependency block separate. Since LLVM is slotted, -# we need to *really* make sure we're not pulling one than more slot -# simultaneously. - -# How to use it: -# 1. List all the working slots (with min versions) in ||, newest first. -# 2. Update the := to specify *max* version, e.g. < 9. -# 3. Specify LLVM_MAX_SLOT, e.g. 8. -LLVM_DEPEND=" - || ( - sys-devel/llvm:8[llvm_targets_WebAssembly?] - wasm? ( =sys-devel/lld-8* ) - ) - <sys-devel/llvm-9:= -" -LLVM_MAX_SLOT=8 - -COMMON_DEPEND=" - sys-libs/zlib - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:0= ) - net-libs/libssh2 - net-libs/http-parser:= - net-misc/curl[ssl] - system-llvm? ( - ${LLVM_DEPEND} - ) -" - -DEPEND="${COMMON_DEPEND} - ${PYTHON_DEPS} - || ( - >=sys-devel/gcc-4.7 - >=sys-devel/clang-3.5 - ) - dev-util/cmake -" - -RDEPEND="${COMMON_DEPEND} - !dev-util/cargo - rustfmt? ( !dev-util/rustfmt ) -" - -REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) - wasm? ( llvm_targets_WebAssembly ) - x86? ( cpu_flags_x86_sse2 ) -" - -PATCHES=( - "${FILESDIR}"/0001-llvm-cmake-Add-additional-headers-only-if-they-exist.patch - "${FILESDIR}"/1.34.2-fix-custom-libdir.patch - "${FILESDIR}"/1.35.0-revert-commits-triggering-multiple-llvm-rebuilds.patch - "${FILESDIR}"/1.36.0-libressl.patch - "${FILESDIR}"/1.36.0-libressl3.patch -) - -S="${WORKDIR}/${MY_P}-src" - -toml_usex() { - usex "$1" true false -} - -pre_build_checks() { - CHECKREQS_DISK_BUILD="7G" - eshopts_push -s extglob - if is-flagq '-g?(gdb)?([1-9])'; then - CHECKREQS_DISK_BUILD="10G" - fi - eshopts_pop - check-reqs_pkg_setup -} - -pkg_pretend() { - pre_build_checks -} - -pkg_setup() { - pre_build_checks - python-any-r1_pkg_setup - use system-llvm && llvm_pkg_setup -} - -src_prepare() { - local rust_stage0_root="${WORKDIR}"/rust-stage0 - - local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)" - - "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die - - default -} - -src_configure() { - local rust_target="" rust_targets="" arch_cflags - - # Collect rust target names to compile standard libs for all ABIs. - for v in $(multilib_get_enabled_abi_pairs); do - rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\"" - done - if use wasm; then - rust_targets="${rust_targets},\"wasm32-unknown-unknown\"" - fi - rust_targets="${rust_targets#,}" - - local extended="true" tools="\"cargo\"," - if use clippy; then - tools="\"clippy\",$tools" - fi - if use rls; then - tools="\"rls\",\"analysis\",\"src\",$tools" - fi - if use rustfmt; then - tools="\"rustfmt\",$tools" - fi - - local rust_stage0_root="${WORKDIR}"/rust-stage0 - - rust_target="$(rust_abi)" - - cat <<- EOF > "${S}"/config.toml - [llvm] - optimize = $(toml_usex !debug) - release-debuginfo = $(toml_usex debug) - assertions = $(toml_usex debug) - targets = "${LLVM_TARGETS// /;}" - experimental-targets = "" - link-shared = $(toml_usex system-llvm) - [build] - build = "${rust_target}" - host = ["${rust_target}"] - target = [${rust_targets}] - cargo = "${rust_stage0_root}/bin/cargo" - rustc = "${rust_stage0_root}/bin/rustc" - docs = $(toml_usex doc) - submodules = false - python = "${EPYTHON}" - locked-deps = true - vendor = true - extended = ${extended} - tools = [${tools}] - verbose = 2 - [install] - prefix = "${EPREFIX}/usr" - libdir = "$(get_libdir)/${P}" - docdir = "share/doc/${P}" - mandir = "share/${P}/man" - [rust] - optimize = $(toml_usex !debug) - debug = $(toml_usex debug) - debug-assertions = $(toml_usex debug) - default-linker = "$(tc-getCC)" - channel = "stable" - rpath = false - lld = $(usex system-llvm false $(toml_usex wasm)) - EOF - - for v in $(multilib_get_enabled_abi_pairs); do - rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) - arch_cflags="$(get_abi_CFLAGS ${v##*.})" - - cat <<- EOF >> "${S}"/config.env - CFLAGS_${rust_target}=${arch_cflags} - EOF - - cat <<- EOF >> "${S}"/config.toml - [target.${rust_target}] - cc = "$(tc-getBUILD_CC)" - cxx = "$(tc-getBUILD_CXX)" - linker = "$(tc-getCC)" - ar = "$(tc-getAR)" - EOF - if use system-llvm; then - cat <<- EOF >> "${S}"/config.toml - llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" - EOF - fi - done - - if use wasm; then - cat <<- EOF >> "${S}"/config.toml - [target.wasm32-unknown-unknown] - linker = "$(usex system-llvm lld rust-lld)" - EOF - fi -} - -src_compile() { - env $(cat "${S}"/config.env)\ - "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \ - --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305 -} - -src_install() { - local rust_target abi_libdir - - env DESTDIR="${D}" "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml \ - --exclude src/tools/miri || die - - # Copy shared library versions of standard libraries for all targets - # into the system's abi-dependent lib directories because the rust - # installer only does so for the native ABI. - for v in $(multilib_get_enabled_abi_pairs); do - if [ ${v##*.} = ${DEFAULT_ABI} ]; then - continue - fi - abi_libdir=$(get_abi_LIBDIR ${v##*.}) - rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) - mkdir -p "${ED}/usr/${abi_libdir}/${P}" - cp "${ED}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \ - "${ED}/usr/${abi_libdir}/${P}" || die - done - - dodoc COPYRIGHT - - # FIXME: - # Really not sure if that env is needed, specailly LDPATH - cat <<-EOF > "${T}"/50${P} - LDPATH="${EPREFIX}/usr/$(get_libdir)/${P}" - MANPATH="${EPREFIX}/usr/share/${P}/man" - EOF - doenvd "${T}"/50${P} -} - -pkg_postinst() { - eselect rust update --if-unset - - elog "Rust installs a helper script for calling GDB and LLDB," - elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." - - ewarn "cargo is now installed from dev-lang/rust{,-bin} instead of dev-util/cargo." - ewarn "This might have resulted in a dangling symlink for /usr/bin/cargo on some" - ewarn "systems. This can be resolved by calling 'sudo eselect rust set ${P}'." - - if has_version app-editors/emacs || has_version app-editors/emacs-vcs; 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 -} diff --git a/dev-lang/rust/rust-1.38.0-r314.ebuild b/dev-lang/rust/rust-1.38.0-r314.ebuild new file mode 100644 index 00000000..c289b01b --- /dev/null +++ b/dev-lang/rust/rust-1.38.0-r314.ebuild @@ -0,0 +1,284 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy ) + +inherit check-reqs estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs + +if [[ ${PV} = *beta* ]]; then + betaver=${PV//*beta} + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" + MY_P="rustc-beta" + SLOT="beta/${PV}" + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz" +else + ABI_VER="1,38" + SLOT="stable/${ABI_VER}" + MY_P="rustc-${PV}" + SRC="${MY_P}-src.tar.xz" + KEYWORDS="~amd64" +fi + +RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0" + +DESCRIPTION="Systems programming language from Mozilla" +HOMEPAGE="https://www.rust-lang.org/" + +SRC_URI="https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz + $(rust_arch_uri x86_64-unknown-linux-gnu rust-${RUST_STAGE0_VERSION})" + +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 + NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore ) +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} + +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" + +IUSE="clippy cpu_flags_x86_sse2 debug doc libressl rls rustfmt system-llvm wasm ${ALL_LLVM_TARGETS[*]}" + +# Please keep the LLVM dependency block separate. Since LLVM is slotted, +# we need to *really* make sure we're not pulling more than one slot +# simultaneously. + +# How to use it: +# 1. List all the working slots (with min versions) in ||, newest first. +# 2. Update the := to specify *max* version, e.g. < 9. +# 3. Specify LLVM_MAX_SLOT, e.g. 8. +LLVM_DEPEND=" + || ( + sys-devel/llvm:9[llvm_targets_WebAssembly?] + wasm? ( =sys-devel/lld-9* ) + ) + <sys-devel/llvm-10:= +" +LLVM_MAX_SLOT=9 + +COMMON_DEPEND=" + sys-libs/zlib + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + net-libs/libssh2 + net-libs/http-parser:= + net-misc/curl[ssl] + system-llvm? ( + ${LLVM_DEPEND} + ) +" + +DEPEND="${COMMON_DEPEND} + ${PYTHON_DEPS} + || ( + >=sys-devel/gcc-4.7 + >=sys-devel/clang-3.5 + ) + dev-util/cmake +" + +RDEPEND="${COMMON_DEPEND} + !dev-util/cargo + rustfmt? ( !dev-util/rustfmt ) +" + +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) + wasm? ( llvm_targets_WebAssembly ) + x86? ( cpu_flags_x86_sse2 ) +" +QA_FLAGS_IGNORED="usr/bin/* usr/lib*/${P}" + +PATCHES=( + "${FILESDIR}"/1.38.0-fix-custom-libdir.patch + "${FILESDIR}"/1.38.0-fix-multiple-llvm-rebuilds.patch + "${FILESDIR}"/1.36.0-libressl.patch +) + +S="${WORKDIR}/${MY_P}-src" + +toml_usex() { + usex "$1" true false +} + +pre_build_checks() { + CHECKREQS_DISK_BUILD="9G" + eshopts_push -s extglob + if is-flagq '-g?(gdb)?([1-9])'; then + CHECKREQS_DISK_BUILD="14G" + fi + eshopts_pop + check-reqs_pkg_setup +} + +pkg_pretend() { + pre_build_checks +} + +pkg_setup() { + pre_build_checks + python-any-r1_pkg_setup + use system-llvm && llvm_pkg_setup +} + +src_prepare() { + local rust_stage0_root="${WORKDIR}"/rust-stage0 + + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)" + + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig --destdir="${rust_stage0_root}" --prefix=/ || die + + default +} + +src_configure() { + local rust_target="" rust_targets="" arch_cflags + + # Collect rust target names to compile standard libs for all ABIs. + for v in $(multilib_get_enabled_abi_pairs); do + rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\"" + done + if use wasm; then + rust_targets="${rust_targets},\"wasm32-unknown-unknown\"" + fi + rust_targets="${rust_targets#,}" + + local extended="true" tools="\"cargo\"," + if use clippy; then + tools="\"clippy\",$tools" + fi + if use rls; then + tools="\"rls\",\"analysis\",\"src\",$tools" + fi + if use rustfmt; then + tools="\"rustfmt\",$tools" + fi + + local rust_stage0_root="${WORKDIR}"/rust-stage0 + + rust_target="$(rust_abi)" + + cat <<- EOF > "${S}"/config.toml + [llvm] + optimize = $(toml_usex !debug) + release-debuginfo = $(toml_usex debug) + assertions = $(toml_usex debug) + targets = "${LLVM_TARGETS// /;}" + experimental-targets = "" + link-shared = $(toml_usex system-llvm) + [build] + build = "${rust_target}" + host = ["${rust_target}"] + target = [${rust_targets}] + cargo = "${rust_stage0_root}/bin/cargo" + rustc = "${rust_stage0_root}/bin/rustc" + docs = $(toml_usex doc) + submodules = false + python = "${EPYTHON}" + locked-deps = true + vendor = true + extended = ${extended} + tools = [${tools}] + verbose = 2 + [install] + prefix = "${EPREFIX}/usr" + libdir = "$(get_libdir)/${P}" + docdir = "share/doc/${P}" + mandir = "share/${P}/man" + [rust] + optimize = $(toml_usex !debug) + debug = $(toml_usex debug) + debug-assertions = $(toml_usex debug) + default-linker = "$(tc-getCC)" + channel = "stable" + rpath = false + lld = $(usex system-llvm false $(toml_usex wasm)) + EOF + + for v in $(multilib_get_enabled_abi_pairs); do + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) + arch_cflags="$(get_abi_CFLAGS ${v##*.})" + + cat <<- EOF >> "${S}"/config.env + CFLAGS_${rust_target}=${arch_cflags} + EOF + + cat <<- EOF >> "${S}"/config.toml + [target.${rust_target}] + cc = "$(tc-getBUILD_CC)" + cxx = "$(tc-getBUILD_CXX)" + linker = "$(tc-getCC)" + ar = "$(tc-getAR)" + EOF + if use system-llvm; then + cat <<- EOF >> "${S}"/config.toml + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" + EOF + fi + done + + if use wasm; then + cat <<- EOF >> "${S}"/config.toml + [target.wasm32-unknown-unknown] + linker = "$(usex system-llvm lld rust-lld)" + EOF + fi +} + +src_compile() { + env $(cat "${S}"/config.env)\ + "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \ + --exclude src/tools/miri || die # https://github.com/rust-lang/rust/issues/52305 +} + +src_install() { + local rust_target abi_libdir + + env DESTDIR="${D}" "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml \ + --exclude src/tools/miri || die + + # Copy shared library versions of standard libraries for all targets + # into the system's abi-dependent lib directories because the rust + # installer only does so for the native ABI. + for v in $(multilib_get_enabled_abi_pairs); do + if [ ${v##*.} = ${DEFAULT_ABI} ]; then + continue + fi + abi_libdir=$(get_abi_LIBDIR ${v##*.}) + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) + mkdir -p "${ED}/usr/${abi_libdir}/${P}" + cp "${ED}/usr/$(get_libdir)/${P}/rustlib/${rust_target}/lib"/*.so \ + "${ED}/usr/${abi_libdir}/${P}" || die + done + + dodoc COPYRIGHT + + # FIXME: + # Really not sure if that env is needed, specailly LDPATH + cat <<-EOF > "${T}"/50${P} + LDPATH="${EPREFIX}/usr/$(get_libdir)/${P}" + MANPATH="${EPREFIX}/usr/share/${P}/man" + EOF + doenvd "${T}"/50${P} +} + +pkg_postinst() { + eselect rust update --if-unset + + elog "Rust installs a helper script for calling GDB and LLDB," + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." + + ewarn "cargo is now installed from dev-lang/rust{,-bin} instead of dev-util/cargo." + ewarn "This might have resulted in a dangling symlink for /usr/bin/cargo on some" + ewarn "systems. This can be resolved by calling 'sudo eselect rust set ${P}'." + + if has_version app-editors/emacs || has_version app-editors/emacs-vcs; 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 +} -- cgit v1.2.3