From 3582a04140758c928435204b0b1b129a60e4c11d Mon Sep 17 00:00:00 2001 From: Niels Sascha Reedijk Date: Wed, 16 May 2018 19:15:51 +0000 Subject: [PATCH] Rust: add recipe for Rust 1.20.0 This recipe stops building the src tarball, which means that our dependency on cargo-vendor is not necessary anymore. --- dev-lang/rust/patches/rust-1.20.0.patchset | 529 ++++++++++++++++++ .../rust/patches/rust-libc-1.20.0.patchset | 26 + dev-lang/rust/rust-1.20.0.recipe | 212 +++++++ 3 files changed, 767 insertions(+) create mode 100644 dev-lang/rust/patches/rust-1.20.0.patchset create mode 100644 dev-lang/rust/patches/rust-libc-1.20.0.patchset create mode 100644 dev-lang/rust/rust-1.20.0.recipe diff --git a/dev-lang/rust/patches/rust-1.20.0.patchset b/dev-lang/rust/patches/rust-1.20.0.patchset new file mode 100644 index 000000000..b52a88037 --- /dev/null +++ b/dev-lang/rust/patches/rust-1.20.0.patchset @@ -0,0 +1,529 @@ +From 271dd253327d535048ce75580e9082e28e20ccac Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 20 Sep 2017 17:36:59 +0000 +Subject: [PATCH 1/4] Haiku: reduce stack memory to 16MB (max on Haiku) + +--- + src/librustdoc/lib.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs +index 6c092d01a0..2ff3e96fb6 100644 +--- a/src/librustdoc/lib.rs ++++ b/src/librustdoc/lib.rs +@@ -100,7 +100,7 @@ struct Output { + } + + pub fn main() { +- const STACK_SIZE: usize = 32_000_000; // 32MB ++ const STACK_SIZE: usize = 16_000_000; // 16MB on Haiku + env_logger::init().unwrap(); + let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || { + get_args().map(|args| main_args(&args)).unwrap_or(1) +-- +2.16.2 + + +From bb87ff71f29b95dcaba8419fe585fc1934407658 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 9 May 2018 17:31:41 +0000 +Subject: [PATCH 2/4] Haiku: there is no setpriority on this platform. + +--- + src/bootstrap/lib.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs +index 032231582e..c9450e503c 100644 +--- a/src/bootstrap/lib.rs ++++ b/src/bootstrap/lib.rs +@@ -112,7 +112,7 @@ pub mod util; + #[cfg(windows)] + mod job; + +-#[cfg(unix)] ++#[cfg(all(unix, not(target_os = "haiku")))] + mod job { + use libc; + +@@ -123,7 +123,7 @@ mod job { + } + } + +-#[cfg(not(any(unix, windows)))] ++#[cfg(any(target_os = "haiku", not(any(unix, windows))))] + mod job { + pub unsafe fn setup(_build: &mut ::Build) { + } +-- +2.16.2 + + +From a112651ec39a992e7e801f6b3488158f195766f6 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Fri, 25 Aug 2017 17:12:20 -0500 +Subject: [PATCH 3/4] haiku/librustc_back: Remove incorrect no_integrated_as + +* Makes rust bootstrap incorrectly search for xxx.s vs xxx.0.s +* Not needed or incorrect fix for another issue. +--- + src/librustc_back/target/haiku_base.rs | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/librustc_back/target/haiku_base.rs b/src/librustc_back/target/haiku_base.rs +index 8e7f463563..3fd0389104 100644 +--- a/src/librustc_back/target/haiku_base.rs ++++ b/src/librustc_back/target/haiku_base.rs +@@ -19,7 +19,6 @@ pub fn opts() -> TargetOptions { + has_rpath: false, + target_family: Some("unix".to_string()), + linker_is_gnu: true, +- no_integrated_as: true, + .. Default::default() + } + } +-- +2.16.2 + + +From ba1a536cce7fec231f8df12302ed8ca0153486c9 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Tue, 8 May 2018 12:33:03 +0000 +Subject: [PATCH 4/4] Haiku: update various Cargo dependencies to versions that + build on Haiku * (external) liblibc, from 0.2.26 to 0.2.31 * backtrace, to + a customized backtrace that contains fixes for Haiku * libgit2-sys to + version 0.6.18 (includes a fix for a bug that causes cargo to exit on a + crash) * git2 to version 0.6.10 * socket2 to version 0.2.3 + +--- + src/Cargo.lock | 115 ++++++++++++++++++++++++++++++++------------------------- + src/Cargo.toml | 4 ++ + 2 files changed, 68 insertions(+), 51 deletions(-) + +diff --git a/src/Cargo.lock b/src/Cargo.lock +index bcec823403..cd76389b99 100644 +--- a/src/Cargo.lock ++++ b/src/Cargo.lock +@@ -75,31 +75,37 @@ version = "0.2.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] + name = "backtrace" + version = "0.3.2" +-source = "registry+https://github.com/rust-lang/crates.io-index" ++source = "git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.2#e5abec2fdb6023facae1819558dd55a80419a881" + dependencies = [ +- "backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ++ "backtrace-sys 0.1.10 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.2)", + "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +-name = "backtrace-sys" +-version = "0.1.11" ++name = "backtrace" ++version = "0.3.2" + source = "registry+https://github.com/rust-lang/crates.io-index" ++replace = "backtrace 0.3.2 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.2)" ++ ++[[package]] ++name = "backtrace-sys" ++version = "0.1.10" ++source = "git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.2#e5abec2fdb6023facae1819558dd55a80419a881" + dependencies = [ + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -121,7 +127,7 @@ dependencies = [ + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", + "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -164,15 +170,15 @@ dependencies = [ + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "fs2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "git2 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ++ "git2 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "git2-curl 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jobserver 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", +- "libgit2-sys 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libgit2-sys 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -201,11 +207,11 @@ dependencies = [ + "cargo 0.21.0", + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", +- "git2 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ++ "git2 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -219,6 +225,11 @@ dependencies = [ + name = "cargotest2" + version = "0.1.0" + ++[[package]] ++name = "cc" ++version = "1.0.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ + [[package]] + name = "cfg-if" + version = "0.1.2" +@@ -273,7 +284,7 @@ dependencies = [ + "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -308,10 +319,10 @@ version = "0.4.7" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "curl-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", +- "socket2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "socket2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -321,7 +332,7 @@ version = "0.3.14" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -394,7 +405,7 @@ name = "filetime" + version = "0.1.10" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -402,7 +413,7 @@ name = "flate2" + version = "0.2.19" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -421,7 +432,7 @@ version = "0.4.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -437,12 +448,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "git2" +-version = "0.6.6" ++version = "0.6.10" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", +- "libgit2-sys 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libgit2-sys 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -454,7 +465,7 @@ version = "0.7.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "curl 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +- "git2 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ++ "git2 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -531,7 +542,7 @@ name = "jobserver" + version = "0.1.6" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -558,18 +569,18 @@ dependencies = [ + + [[package]] + name = "libc" +-version = "0.2.26" ++version = "0.2.31" + source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "libgit2-sys" +-version = "0.6.12" ++version = "0.6.18" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ ++ "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "libssh2-sys 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -582,7 +593,7 @@ version = "0.2.6" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -594,7 +605,7 @@ version = "1.0.16" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -615,7 +626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -645,7 +656,7 @@ name = "memchr" + version = "0.1.11" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -653,7 +664,7 @@ name = "memchr" + version = "1.0.1" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -662,7 +673,7 @@ version = "0.1.9" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -683,7 +694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -759,7 +770,7 @@ name = "num_cpus" + version = "1.6.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -775,7 +786,7 @@ dependencies = [ + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -790,7 +801,7 @@ version = "0.9.15" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -891,7 +902,7 @@ name = "rand" + version = "0.3.15" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -1434,12 +1445,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "socket2" +-version = "0.2.1" ++version = "0.2.3" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -1542,7 +1553,7 @@ version = "0.4.13" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "xattr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -1564,7 +1575,7 @@ version = "0.3.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + ] + +@@ -1599,7 +1610,7 @@ version = "2.0.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -1760,7 +1771,7 @@ name = "xattr" + version = "0.1.11" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ +- "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] +@@ -1782,11 +1793,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + "checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" + "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" + "checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159" ++"checksum backtrace 0.3.2 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.2)" = "" + "checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" +-"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" ++"checksum backtrace-sys 0.1.10 (git+https://github.com/nielx/backtrace-rs?branch=haiku-0.3.2)" = "" + "checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" + "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" + "checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32" ++"checksum cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0ebb87d1116151416c0cf66a0e3fb6430cccd120fd6300794b4dfaa050ac40ba" + "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" + "checksum clap 2.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = "867a885995b4184be051b70a592d4d70e32d7a188db6e8dff626af286a962771" + "checksum cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ebbb35d3dc9cd09497168f33de1acb79b265d350ab0ac34133b98f8509af1f" +@@ -1806,7 +1819,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + "checksum fs2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ab76cfd2aaa59b7bf6688ad9ba15bbae64bff97f04ea02144cfd3443e5c2866" + "checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" + "checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" +-"checksum git2 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa01936ac96555c083c0e8553f672616274408d9d3fc5b8696603fbf63ff43ee" ++"checksum git2 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "40a111aecd59985496012976beca164b4f6c930d507a099831e06b07f19d54f1" + "checksum git2-curl 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "68676bc784bf0bef83278898929bf64a251e87c0340723d0b93fa096c9c5bf8e" + "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" + "checksum hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bf088f042a467089e9baa4972f57f9247e42a0cc549ba264c7a04fbb8ecb89d4" +@@ -1817,8 +1830,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + "checksum jobserver 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "443ae8bc0af6c106e6e8b77e04684faecc1a5ce94e058f4c2b0a037b0ea1b133" + "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" + "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" +-"checksum libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "30885bcb161cf67054244d10d4a7f4835ffd58773bc72e07d35fecf472295503" +-"checksum libgit2-sys 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "df18a822100352d9863b302faf6f8f25c0e77f0e60feb40e5dbe1238b7f13b1d" ++"checksum libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d1419b2939a0bc44b77feb34661583c7546b532b192feab36249ab584b86856c" ++"checksum libgit2-sys 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "82fc20bd8beefe7c9f98aae2d3cff78e57f544cdd83d58fe181ec37a5fbe0c77" + "checksum libssh2-sys 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0db4ec23611747ef772db1c4d650f8bd762f07b461727ec998f953c614024b75" + "checksum libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdd64ef8ee652185674455c1d450b83cbc8ad895625d543b5324d923f82e4d8" + "checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b" +@@ -1869,7 +1882,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + "checksum serde_ignored 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c10e798e4405d7dcec3658989e35ee6706f730a9ed7c1184d5ebd84317e82f46" + "checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" + "checksum shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "dd5cc96481d54583947bfe88bf30c23d53f883c6cd0145368b69989d97b84ef8" +-"checksum socket2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12cdbddbaa27bf94cc194b8e37f5811db6fe83cea96cf99cf1f8e92b65a41371" ++"checksum socket2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9e76b159741052c7deaa9fd0b5ca6b5f79cecf525ed665abfe5002086c6b2791" + "checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" + "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" + "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" +diff --git a/src/Cargo.toml b/src/Cargo.toml +index dd775280f4..eee06b8599 100644 +--- a/src/Cargo.toml ++++ b/src/Cargo.toml +@@ -34,3 +34,7 @@ debug-assertions = false + [profile.test] + debug = false + debug-assertions = false ++ ++[replace] ++"backtrace:0.3.2" = { git = "https://github.com/nielx/backtrace-rs", branch = "haiku-0.3.2" } ++ +-- +2.16.2 + diff --git a/dev-lang/rust/patches/rust-libc-1.20.0.patchset b/dev-lang/rust/patches/rust-libc-1.20.0.patchset new file mode 100644 index 000000000..db0a71e1e --- /dev/null +++ b/dev-lang/rust/patches/rust-libc-1.20.0.patchset @@ -0,0 +1,26 @@ +From 2c01fea34a8198ce97b7341681bc5401f65f45fb Mon Sep 17 00:00:00 2001 +From: Jessica Hamilton +Date: Sat, 2 Sep 2017 06:50:49 -0500 +Subject: [PATCH] haiku: res_init link name is __res_init. + +--- + src/unix/mod.rs | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/unix/mod.rs b/src/unix/mod.rs +index 14bf9c53..53db19e2 100644 +--- a/src/unix/mod.rs ++++ b/src/unix/mod.rs +@@ -716,7 +716,8 @@ extern { + #[cfg_attr(any( + all(target_os = "linux", not(target_env = "musl")), + target_os = "freebsd", +- target_os = "dragonfly"), ++ target_os = "dragonfly", ++ target_os = "haiku"), + link_name = "__res_init")] + #[cfg_attr(any(target_os = "macos", target_os = "ios"), + link_name = "res_9_init")] +-- +2.16.2 + diff --git a/dev-lang/rust/rust-1.20.0.recipe b/dev-lang/rust/rust-1.20.0.recipe new file mode 100644 index 000000000..2b85d4d6b --- /dev/null +++ b/dev-lang/rust/rust-1.20.0.recipe @@ -0,0 +1,212 @@ +SUMMARY="Modern and safe systems programming language" +DESCRIPTION="Rust is a systems programming language that runs blazingly fast, prevents almost all crashes*, and eliminates data races." +HOMEPAGE="http://www.rust-lang.org/" +LICENSE="MIT" +COPYRIGHT="2017, The Rust Project Developers" +srcGitRev="1.20.0" +srcGitRev2="c8a8767c56ad3d3f4eb45c87b95026936fb9aa35" +srcGitRev3="b4ff403041f17957f735ad750c3241a3a428b9b7" +srcGitRev4="da282f1bb7277b4d30fa1599ee29ad8eb4dd2a92" +srcGitRev5="2015cf17a6a2a2280e93d9c57214ba92dbbaf42f" +srcGitRev6="a5ef0696d7c103006d3cb1f4263bad0ca13adca8" +cargoVersion="0.21.0" +srcGitRev8="81134a4dff811403b3b2f349b0c59a819f0fe0c1" +srcGitRev9="1abfbaa70313fdf527cf799ffd9b9a096a62105c" +srcGitRev10="4ee596df22f8ecaa9a0b2ddc0624b0104540dbf7" +srcGitRev11="618f802f0dcebc9f23a527afd3cd228c1fa468f8" +srcGitRev12="5e49856003f33aa5781a0edca148be21025e18e7" +SOURCE_URI="https://github.com/rust-lang/rust/archive/$srcGitRev.tar.gz" +SOURCE_URI_2="https://github.com/rust-lang/compiler-rt/archive/$srcGitRev2.tar.gz" +SOURCE_URI_3="https://github.com/rust-lang/rust-installer/archive/$srcGitRev3.tar.gz" +SOURCE_URI_4="https://github.com/rust-lang/hoedown/archive/$srcGitRev4.tar.gz" +SOURCE_URI_5="https://github.com/rust-lang/libc/archive/$srcGitRev5.tar.gz" +SOURCE_URI_6="https://github.com/rust-lang/llvm/archive/$srcGitRev6.tar.gz" +SOURCE_URI_7="https://github.com/rust-lang/cargo/archive/$cargoVersion.tar.gz" +SOURCE_URI_8="https://github.com/rust-lang-nursery/nomicon/archive/$srcGitRev8.tar.gz" +SOURCE_URI_9="https://github.com/rust-lang-nursery/reference/archive/$srcGitRev9.tar.gz" +SOURCE_URI_10="https://github.com/rust-lang/book/archive/$srcGitRev10.tar.gz" +SOURCE_URI_11="https://github.com/rust-lang-nursery/rls/archive/$srcGitRev11.tar.gz" +SOURCE_URI_12="https://github.com/rust-lang-nursery/compiler-builtins/archive/$srcGitRev12.tar.gz" +SOURCE_FILENAME="rust-$srcGitRev.tar.gz" +CHECKSUM_SHA256="ca9307bf18a422029a1fca19ae1fa6c22e3047ff066fb041f9d0a9c886937860" +CHECKSUM_SHA256_2="ac595c03dd5dcd3ad66eee76bec2e95770259e4aa4db5df875c2bbcf7781a441" +CHECKSUM_SHA256_3="dfcce5a555e0aff5f7ba7681968b77529c806c3109ede78eb1b45a0c4455db4b" +CHECKSUM_SHA256_4="623889a326754e93a4a7a8a3487699ea786f4ca9b118f7468c12f8b9966905e6" +CHECKSUM_SHA256_5="a68699c8947466360bf10a5687c7155eb295de6da4a43b7613dcca29a40db53e" +CHECKSUM_SHA256_6="9c05c8ba8feb45940b9d646dff26b479add03ec6852edd522e75f0e517155375" +CHECKSUM_SHA256_7="7c36cfb515c37959f06f9e6e7de28fd40eac70b53079f8abdd55eba6ae49bbff" +CHECKSUM_SHA256_8="eaa5028dfb4cb6c1722da244d054e2e2bbae3d7463264262b40fe735705799dc" +CHECKSUM_SHA256_9="0651328ad6f837370a0b7fb1eee49093f41936e0f0bcfbc4dec596f71280015d" +CHECKSUM_SHA256_10="75fe86002ce362a9a405be58ee4a30a487f7c4a0bdca5c40804e8bcabc50f3d2" +CHECKSUM_SHA256_11="6f82ceee79379efb37a2623b7a360ab65a894db9848f57643d1342c36dfac2ac" +CHECKSUM_SHA256_12="025e3944bc30161a5d26cb77fddfe6827d1c5e14941bdf9531c11c29bca3e1f4" +SOURCE_DIR="rust-$srcGitRev" +PATCHES="rust-$portVersion.patchset" +PATCHES_5="rust-libc-$portVersion.patchset" +REVISION="1" +ARCHITECTURES="!x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + rust$secondaryArchSuffix = $portVersion + cmd:rustc = $portVersion + cmd:rustdoc = $portVersion + cmd:rust_gdb = $portVersion + cmd:rust_lldb = $portVersion + cmd:cargo$secondaryArchSuffix = $cargoVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libcurl$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libcurl$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cargo$secondaryArchSuffix == 0.20.0 + cmd:cmake + cmd:cmp + cmd:file + cmd:find + cmd:git + cmd:gcc$secondaryArchSuffix + cmd:grep + cmd:ld$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:python + cmd:rustc == 1.19.0 + cmd:sed + cmd:tar + cmd:which + cmd:xargs + " + +BUILD() +{ + # With the new build system, Rust always makes a tarball with the source + # In older recipes we symlinked the other git submodules, now we have to + # copy them + rm -rf src/tools/cargo src/libcompiler_builtins src/llvm \ + src/tools/rust-installer src/liblibc src/rt/hoedown \ + src/doc/nomicon src/doc/reference src/doc/book \ + src/tools/rls + cp -r $sourceDir3/rust-installer-$srcGitRev3 src/tools/rust-installer + cp -r $sourceDir4/hoedown-$srcGitRev4 src/rt/hoedown + cp -r $sourceDir5/libc-$srcGitRev5 src/liblibc + cp -r $sourceDir6/llvm-$srcGitRev6 src/llvm + cp -r $sourceDir7/cargo-$cargoVersion src/tools/cargo + cp -r $sourceDir8/nomicon-$srcGitRev8 src/doc/nomicon + cp -r $sourceDir9/reference-$srcGitRev9 src/doc/reference + cp -r $sourceDir10/book-$srcGitRev10 src/doc/book + cp -r $sourceDir11/rls-$srcGitRev11 src/tools/rls + cp -r $sourceDir12/compiler-builtins-$srcGitRev12 src/libcompiler_builtins + rm -rf src/libcompiler_builtins/compiler-rt + cp -r $sourceDir2/compiler-rt-$srcGitRev2 src/libcompiler_builtins/compiler-rt + + # write the build configuration + cat >config.toml <<- EOL + [llvm] + targets = "X86" + + [build] + cargo = "/$relativeBinDir/cargo" + rustc = "/boot/system/bin/rustc" + submodules = false + extended = true + + [install] + prefix = "$prefix" + libdir = "$relativeLibDir" + mandir = "$relativeManDir" + docdir = "$relativeDevelopDocDir" + sysconfdir = "$relativeDataDir" + + [rust] + channel = "stable" + use-jemalloc = false + rpath = false + + [dist] + src-tarball = false +EOL + # Disable ASLR: compiling stage 1 rustc requires a lot of RAM (about 1.5 + # GB). Haiku has a per-process limit of 2GB on 32 bit systems. ASLR makes + # the available space even smaller. Disabling it will give us the space to + # compile Rust + export DISABLE_ASLR=1 + + # now build rust and cargo + ./x.py dist +} + +INSTALL() +{ + # we will manually invoke the install scripts + if [ $effectiveTargetArchitecture = x86 ]; then + architecture="i686-unknown-haiku" + fi + if [ $effectiveTargetArchitecture = x86_64 ]; then + architecture="x86_64-unknown-haiku" + fi + + # let's install the packages one by one + cd $sourceDir/build/tmp/dist/ + for module in "rust-docs-$srcGitRev-$architecture" \ + "rust-std-$srcGitRev-$architecture" \ + "rustc-$srcGitRev-$architecture" \ + "rust-analysis-$srcGitRev-$architecture" \ + "cargo-$cargoVersion-$architecture" + do + ./$module/install.sh \ + --prefix=$prefix \ + --docdir=$developDocDir \ + --libdir=$libDir \ + --mandir=$manDir \ + --sysconfdir=$dataDir \ + --disable-ldconfig + done + + # move the cargo and binaries (in case of a secondary arch) + if [ -n "$secondaryArchSuffix" ]; then + mkdir -p $binDir + mv $prefix/bin/cargo $binDir/cargo + fi + + # remove zsh data, it is not used on Haiku anyway + rm -rf $prefix/share + + # move the `rustlib` folder to the developLibDirs (as it is a framework of sorts) + # do create a link in $prefix/lib as that is where rustc expects things to live + # Note; this actually seems to be a bug in the Rust build system. The path + # to rustlib is hardcoded in the rustc binary, but it does allow it to be + # set to libdir_relative (see config.rs in the bootstrap tool). This variable + # is only set when the configure script is used to generate the config, not + # with config.toml + mkdir -p $developLibDir + mv $libDir/rustlib $developLibDir + cd $prefix/lib + ln -s $developLibDir/rustlib rustlib + + # clean out unneccesary files created by the rust installer + rm $developLibDir/rustlib/components + rm $developLibDir/rustlib/install.log + rm $developLibDir/rustlib/manifest-cargo + rm $developLibDir/rustlib/manifest-rust-analysis-*haiku + rm $developLibDir/rustlib/manifest-rust-docs + rm $developLibDir/rustlib/manifest-rust-std-*-haiku + rm $developLibDir/rustlib/manifest-rustc + rm $developLibDir/rustlib/rust-installer-version + rm $developLibDir/rustlib/uninstall.sh +} + +TEST() +{ + ./x.py test +}