diff --git a/dev-lang/rust/patches/cargo-0.17.0.patchset b/dev-lang/rust/patches/cargo-0.17.0.patchset new file mode 100644 index 000000000..02a06d642 --- /dev/null +++ b/dev-lang/rust/patches/cargo-0.17.0.patchset @@ -0,0 +1,175 @@ +From 34ba38e6435e94312f7f83b0fb1eb67f8c743dcd Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Sun, 8 Oct 2017 08:09:26 +0000 +Subject: [PATCH 1/4] Update dependencies to packages with Haiku support + +* num_cpus from 1.1.0 to 1.4.0 +* fs2 from 0.3.0 to 0.4.2 +--- + Cargo.lock | 12 ++++++------ + Cargo.toml | 2 +- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index 679ed04..4c23ac6 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -12,7 +12,7 @@ dependencies = [ + "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +- "fs2 0.3.0 (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.3 (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)", +@@ -22,7 +22,7 @@ dependencies = [ + "libgit2-sys 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +- "num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -181,7 +181,7 @@ dependencies = [ + + [[package]] + name = "fs2" +-version = "0.3.0" ++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)", +@@ -435,7 +435,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "num_cpus" +-version = "1.1.0" ++version = "1.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -660,7 +660,7 @@ dependencies = [ + "checksum error-chain 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "318cb3c71ee4cdea69fdc9e15c173b245ed6063e1709029e8fd32525a881120f" + "checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922" + "checksum flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "3eeb481e957304178d2e782f2da1257f1434dfecbae883bafb61ada2a9fea3bb" +-"checksum fs2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "640001e1bd865c7c32806292822445af576a6866175b5225aa2087ca5e3de551" ++"checksum fs2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ab76cfd2aaa59b7bf6688ad9ba15bbae64bff97f04ea02144cfd3443e5c2866" + "checksum gcc 0.3.39 (registry+https://github.com/rust-lang/crates.io-index)" = "771e4a97ff6f237cf0f7d5f5102f6e28bb9743814b6198d684da5c58b76c11e0" + "checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" + "checksum git2 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0534ca86640c6a3a0687cc6bee9ec4032509a0d112d97e8241fa6b7e075f6119" +@@ -688,7 +688,7 @@ dependencies = [ + "checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c" + "checksum num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "54ff603b8334a72fbb27fe66948aac0abaaa40231b3cecd189e76162f6f38aaf" + "checksum num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a16a42856a256b39c6d3484f097f6713e14feacd9bfb02290917904fae46c81c" +-"checksum num_cpus 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8890e6084723d57d0df8d2720b0d60c6ee67d6c93e7169630e4371e88765dcad" ++"checksum num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca313f1862c7ec3e0dfe8ace9fa91b1d9cb5c84ace3d00f5ec4216238e93c167" + "checksum openssl 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0c00da69323449142e00a5410f0e022b39e8bbb7dc569cee8fc6af279279483c" + "checksum openssl-probe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "756d49c8424483a3df3b5d735112b4da22109ced9a8294f1f5cdf80fb3810919" + "checksum openssl-sys 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b1482f9a06f56c906007e17ea14d73d102210b5d27bc948bf5e175f493f3f7c3" +diff --git a/Cargo.toml b/Cargo.toml +index 54ca093..ea6c16a 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -24,7 +24,7 @@ docopt = "0.6" + env_logger = "0.3" + filetime = "0.1" + flate2 = "0.2" +-fs2 = "0.3" ++fs2 = "0.4.2" + git2 = "0.6" + git2-curl = "0.7" + glob = "0.2" +-- +2.7.0 + + +From 3757cd1452455ebeef36e6e7b91edf8f6e23824f Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Sun, 8 Oct 2017 08:10:10 +0000 +Subject: [PATCH 2/4] Haiku: libc does not define SIGSYS. Use the constant + instead. + +To be fixed in future versions of liblibc +--- + src/cargo/util/errors.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cargo/util/errors.rs b/src/cargo/util/errors.rs +index c54199f..f821085 100644 +--- a/src/cargo/util/errors.rs ++++ b/src/cargo/util/errors.rs +@@ -429,7 +429,7 @@ pub fn process_error(msg: &str, + libc::SIGSEGV => ", SIGSEGV: invalid memory reference", + libc::SIGTERM => ", SIGTERM: termination signal", + libc::SIGBUS => ", SIGBUS: access to undefined memory", +- libc::SIGSYS => ", SIGSYS: bad system call", ++ 25 => ", SIGSYS: bad system call", + libc::SIGTRAP => ", SIGTRAP: trace/breakpoint trap", + _ => "", + }; +-- +2.7.0 + + +From ee129f92b11a54d127c33ae7498c6ceecb54d654 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Sun, 8 Oct 2017 11:30:02 +0000 +Subject: [PATCH 3/4] Haiku: properly process the SYSCONFDIR for Haiku + packaging + +--- + configure | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure b/configure +index 55e9bb0..ea47e82 100755 +--- a/configure ++++ b/configure +@@ -379,6 +379,7 @@ CFG_INFODIR=${CFG_INFODIR#${CFG_PREFIX}} + CFG_DOCDIR=${CFG_DOCDIR#${CFG_PREFIX}} + CFG_MANDIR=${CFG_MANDIR#${CFG_PREFIX}} + CFG_LIBDIR=${CFG_LIBDIR#${CFG_PREFIX}} ++CFG_SYSCONFDIR=${CFG_SYSCONFDIR#${CFG_PREFIX}} + + # copy host-triples to target-triples so that hosts are a subset of targets + V_TEMP="" +@@ -407,6 +408,7 @@ putvar CFG_DOCDIR + putvar CFG_INFODIR + putvar CFG_MANDIR + putvar CFG_LIBDIR ++putvar CFG_SYSCONFDIR + putvar CFG_RUSTC + putvar CFG_RUSTDOC + putvar CFG_CARGO +-- +2.7.0 + + +From cadf34e1936325e1ddd2c79f22f97359ef5b931f Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Sun, 8 Oct 2017 17:54:43 +0000 +Subject: [PATCH 4/4] Haiku: rename() gives an error when the filenames are the + same. Backport of future fix + +--- + src/cargo/ops/cargo_rustc/mod.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cargo/ops/cargo_rustc/mod.rs b/src/cargo/ops/cargo_rustc/mod.rs +index fd8c379..d004b73 100644 +--- a/src/cargo/ops/cargo_rustc/mod.rs ++++ b/src/cargo/ops/cargo_rustc/mod.rs +@@ -373,7 +373,7 @@ fn rustc(cx: &mut Context, unit: &Unit, exec: Arc) -> CargoResult +Date: Sun, 8 Oct 2017 08:09:26 +0000 +Subject: [PATCH 1/4] Update dependencies to packages with Haiku support + +* num_cpus from 1.3.0 to 1.4.0 +* fs2 from 0.4.1 to 0.4.2 +--- + Cargo.lock | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index 44c3a43..ef6d222 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -13,7 +13,7 @@ dependencies = [ + "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", +- "fs2 0.4.1 (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.4 (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)", +@@ -23,7 +23,7 @@ dependencies = [ + "libgit2-sys 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.7 (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.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -211,7 +211,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "fs2" +-version = "0.4.1" ++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)", +@@ -468,7 +468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "num_cpus" +-version = "1.3.0" ++version = "1.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -833,7 +833,7 @@ dependencies = [ + "checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922" + "checksum flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "d4e4d0c15ef829cbc1b7cda651746be19cceeb238be7b1049227b14891df9e25" + "checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" +-"checksum fs2 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "34edaee07555859dc13ca387e6ae05686bb4d0364c95d649b6dab959511f4baf" ++"checksum fs2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ab76cfd2aaa59b7bf6688ad9ba15bbae64bff97f04ea02144cfd3443e5c2866" + "checksum gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "40899336fb50db0c78710f53e87afc54d8c7266fb76262fecc78ca1a7f09deae" + "checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" + "checksum git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "046ae03385257040b2a35e56d9669d950dd911ba2bf48202fbef73ee6aab27b2" +@@ -862,7 +862,7 @@ dependencies = [ + "checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" + "checksum num-rational 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "c2dc5ea04020a8f18318ae485c751f8cfa1c0e69dcf465c29ddaaa64a313cc44" + "checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99" +-"checksum num_cpus 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a18c392466409c50b87369414a2680c93e739aedeb498eb2bff7d7eb569744e2" ++"checksum num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca313f1862c7ec3e0dfe8ace9fa91b1d9cb5c84ace3d00f5ec4216238e93c167" + "checksum openssl 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8aa0eb7aad44f0da6f7dda13ddb4559d91a0f40cfab150b1f76ad5b39ec523f" + "checksum openssl-probe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "756d49c8424483a3df3b5d735112b4da22109ced9a8294f1f5cdf80fb3810919" + "checksum openssl-sys 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "14f5bfd12054d764510b887152d564ba11d99ae24ea7d740781778f646620576" +-- +2.7.0 + + +From c8a25f5dc277550dbd18fbe530337c92464fbf18 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Sun, 8 Oct 2017 08:10:10 +0000 +Subject: [PATCH 2/4] Haiku: libc does not define SIGSYS. Use the constant + instead. + +To be fixed in future versions of liblibc +--- + src/cargo/util/errors.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cargo/util/errors.rs b/src/cargo/util/errors.rs +index 80a2540..2ccfc2b 100644 +--- a/src/cargo/util/errors.rs ++++ b/src/cargo/util/errors.rs +@@ -431,7 +431,7 @@ pub fn process_error(msg: &str, + libc::SIGSEGV => ", SIGSEGV: invalid memory reference", + libc::SIGTERM => ", SIGTERM: termination signal", + libc::SIGBUS => ", SIGBUS: access to undefined memory", +- libc::SIGSYS => ", SIGSYS: bad system call", ++ 25 => ", SIGSYS: bad system call", + libc::SIGTRAP => ", SIGTRAP: trace/breakpoint trap", + _ => "", + }; +-- +2.7.0 + + +From 69d9620d86d523874414ab26dc4f2a1589ca2b19 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Sun, 8 Oct 2017 11:30:02 +0000 +Subject: [PATCH 3/4] Haiku: properly process the SYSCONFDIR for Haiku + packaging + +--- + configure | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure b/configure +index 55e9bb0..ea47e82 100755 +--- a/configure ++++ b/configure +@@ -379,6 +379,7 @@ CFG_INFODIR=${CFG_INFODIR#${CFG_PREFIX}} + CFG_DOCDIR=${CFG_DOCDIR#${CFG_PREFIX}} + CFG_MANDIR=${CFG_MANDIR#${CFG_PREFIX}} + CFG_LIBDIR=${CFG_LIBDIR#${CFG_PREFIX}} ++CFG_SYSCONFDIR=${CFG_SYSCONFDIR#${CFG_PREFIX}} + + # copy host-triples to target-triples so that hosts are a subset of targets + V_TEMP="" +@@ -407,6 +408,7 @@ putvar CFG_DOCDIR + putvar CFG_INFODIR + putvar CFG_MANDIR + putvar CFG_LIBDIR ++putvar CFG_SYSCONFDIR + putvar CFG_RUSTC + putvar CFG_RUSTDOC + putvar CFG_CARGO +-- +2.7.0 + + +From 0351ea70283314d9b88fd9af529a864b07028877 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Sun, 8 Oct 2017 17:54:43 +0000 +Subject: [PATCH 4/4] Haiku: rename() gives an error when the filenames are the + same. Backport of future fix + +--- + src/cargo/ops/cargo_rustc/mod.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cargo/ops/cargo_rustc/mod.rs b/src/cargo/ops/cargo_rustc/mod.rs +index 14ebcc2..4b029c9 100644 +--- a/src/cargo/ops/cargo_rustc/mod.rs ++++ b/src/cargo/ops/cargo_rustc/mod.rs +@@ -364,7 +364,7 @@ fn rustc(cx: &mut Context, unit: &Unit, exec: Arc) -> CargoResult +Date: Mon, 16 Oct 2017 06:42:09 +0000 +Subject: [PATCH] Haiku: fix dependencies + +--- + Cargo.lock | 26 +++++++++++++------------- + Cargo.toml | 2 +- + 2 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index fd03cdd..40ae3ca 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1,8 +1,8 @@ + [root] + name = "cargo-vendor" +-version = "0.1.5" ++version = "0.1.6" + dependencies = [ +- "cargo 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cargo 0.17.0 (git+https://github.com/nielx/cargo?branch=cargo-haiku-0.17.0)", + "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -40,17 +40,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] + name = "cargo" + version = "0.17.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" ++source = "git+https://github.com/nielx/cargo?branch=cargo-haiku-0.17.0#ee129f92b11a54d127c33ae7498c6ceecb54d654" + dependencies = [ + "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +- "crates-io 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "crates-io 0.6.0 (git+https://github.com/nielx/cargo?branch=cargo-haiku-0.17.0)", + "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.6.86 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", +- "fs2 0.3.0 (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.4 (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)", +@@ -59,7 +59,7 @@ dependencies = [ + "libgit2-sys 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +- "num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -90,7 +90,7 @@ dependencies = [ + [[package]] + name = "crates-io" + version = "0.6.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" ++source = "git+https://github.com/nielx/cargo?branch=cargo-haiku-0.17.0#ee129f92b11a54d127c33ae7498c6ceecb54d654" + dependencies = [ + "curl 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -180,7 +180,7 @@ dependencies = [ + + [[package]] + name = "fs2" +-version = "0.3.0" ++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)", +@@ -367,7 +367,7 @@ dependencies = [ + + [[package]] + name = "num_cpus" +-version = "1.2.1" ++version = "1.4.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -635,10 +635,10 @@ dependencies = [ + "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" + "checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" + "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" +-"checksum cargo 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d743b5e0ae7ef24e1053780bce3dc5ac47a923dfafe5759244980607716571a" ++"checksum cargo 0.17.0 (git+https://github.com/nielx/cargo?branch=cargo-haiku-0.17.0)" = "" + "checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" + "checksum cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "a3a6805df695087e7c1bcd9a82e03ad6fb864c8e67ac41b1348229ce5b7f0407" +-"checksum crates-io 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "14982f07738e88d42b575b67b8a902da50473efdcb30b9c43a27e08f399a1943" ++"checksum crates-io 0.6.0 (git+https://github.com/nielx/cargo?branch=cargo-haiku-0.17.0)" = "" + "checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97" + "checksum curl 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "52f97f136f098f09c5d377e150afde7b29f43690cd1d80edb71409fda11c904e" + "checksum curl-sys 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ec50c305e9de46198e8911556355f4aea46f2002cb25d2388d421404e91b60d9" +@@ -648,7 +648,7 @@ dependencies = [ + "checksum error-chain 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "318cb3c71ee4cdea69fdc9e15c173b245ed6063e1709029e8fd32525a881120f" + "checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922" + "checksum flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "d4e4d0c15ef829cbc1b7cda651746be19cceeb238be7b1049227b14891df9e25" +-"checksum fs2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "640001e1bd865c7c32806292822445af576a6866175b5225aa2087ca5e3de551" ++"checksum fs2 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ab76cfd2aaa59b7bf6688ad9ba15bbae64bff97f04ea02144cfd3443e5c2866" + "checksum gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)" = "c07c758b972368e703a562686adb39125707cc1ef3399da8c019fc6c2498a75d" + "checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" + "checksum git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "046ae03385257040b2a35e56d9669d950dd911ba2bf48202fbef73ee6aab27b2" +@@ -669,7 +669,7 @@ dependencies = [ + "checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" + "checksum miow 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3e690c5df6b2f60acd45d56378981e827ff8295562fc8d34f573deb267a59cd1" + "checksum net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "5edf9cb6be97212423aed9413dd4729d62b370b5e1c571750e882cebbbc1e3e2" +-"checksum num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a225d1e2717567599c24f88e49f00856c6e825a12125181ee42c4257e3688d39" ++"checksum num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca313f1862c7ec3e0dfe8ace9fa91b1d9cb5c84ace3d00f5ec4216238e93c167" + "checksum openssl 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0c00da69323449142e00a5410f0e022b39e8bbb7dc569cee8fc6af279279483c" + "checksum openssl-probe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "756d49c8424483a3df3b5d735112b4da22109ced9a8294f1f5cdf80fb3810919" + "checksum openssl-sys 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b1482f9a06f56c906007e17ea14d73d102210b5d27bc948bf5e175f493f3f7c3" +diff --git a/Cargo.toml b/Cargo.toml +index d9f2992..8afd80a 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -12,6 +12,6 @@ filesystem. + """ + + [dependencies] +-cargo = "0.17" ++cargo = { git = "https://github.com/nielx/cargo", branch = "cargo-haiku-0.17.0" } + rustc-serialize = "0.3" + env_logger = "0.4" +-- +2.7.0 + diff --git a/dev-lang/rust/patches/rust-1.16.0.patchset b/dev-lang/rust/patches/rust-1.16.0.patchset new file mode 100644 index 000000000..ffea9bb7d --- /dev/null +++ b/dev-lang/rust/patches/rust-1.16.0.patchset @@ -0,0 +1,116 @@ +From 7262f52ac892f442bfaf5af959ec053724529071 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 20 Sep 2017 07:25:06 +0000 +Subject: [PATCH 1/4] Haiku: remove -Werror from compiler-rt build commands + +--- + mk/cfg/i686-unknown-haiku.mk | 2 +- + mk/cfg/x86_64-unknown-haiku.mk | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/mk/cfg/i686-unknown-haiku.mk b/mk/cfg/i686-unknown-haiku.mk +index cbacbff..d1bcc7a 100644 +--- a/mk/cfg/i686-unknown-haiku.mk ++++ b/mk/cfg/i686-unknown-haiku.mk +@@ -9,7 +9,7 @@ CFG_STATIC_LIB_NAME_i686-unknown-haiku=lib$(1).a + CFG_LIB_GLOB_i686-unknown-haiku=lib$(1)-*.so + CFG_LIB_DSYM_GLOB_i686-unknown-haiku=lib$(1)-*.dylib.dSYM + CFG_CFLAGS_i686-unknown-haiku := -m32 $(CFLAGS) +-CFG_GCCISH_CFLAGS_i686-unknown-haiku := -Wall -Werror -g -fPIC -m32 $(CFLAGS) ++CFG_GCCISH_CFLAGS_i686-unknown-haiku := -Wall -g -fPIC -m32 $(CFLAGS) + CFG_GCCISH_CXXFLAGS_i686-unknown-haiku := -fno-rtti $(CXXFLAGS) + CFG_GCCISH_LINK_FLAGS_i686-unknown-haiku := -shared -fPIC -ldl -pthread -lrt -g -m32 + CFG_GCCISH_PRE_LIB_FLAGS_i686-unknown-haiku := -Wl,-whole-archive +diff --git a/mk/cfg/x86_64-unknown-haiku.mk b/mk/cfg/x86_64-unknown-haiku.mk +index 4c2d888..476327a 100644 +--- a/mk/cfg/x86_64-unknown-haiku.mk ++++ b/mk/cfg/x86_64-unknown-haiku.mk +@@ -9,7 +9,7 @@ CFG_STATIC_LIB_NAME_x86_64-unknown-haiku=lib$(1).a + CFG_LIB_GLOB_x86_64-unknown-haiku=lib$(1)-*.so + CFG_LIB_DSYM_GLOB_x86_64-unknown-haiku=lib$(1)-*.dylib.dSYM + CFG_CFLAGS_x86_64-unknown-haiku := -m64 $(CFLAGS) +-CFG_GCCISH_CFLAGS_x86_64-unknown-haiku := -Wall -Werror -g -fPIC -m64 $(CFLAGS) ++CFG_GCCISH_CFLAGS_x86_64-unknown-haiku := -Wall -g -fPIC -m64 $(CFLAGS) + CFG_GCCISH_CXXFLAGS_x86_64-unknown-haiku := -fno-rtti $(CXXFLAGS) + CFG_GCCISH_LINK_FLAGS_x86_64-unknown-haiku := -shared -fPIC -ldl -pthread -lrt -g -m64 + CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-haiku := -Wl,-whole-archive +-- +2.7.0 + + +From 1856aaed09c3618697d338c506bb659beb971662 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 20 Sep 2017 07:26:48 +0000 +Subject: [PATCH 2/4] Haiku: disable rpath as standard option on the compiler + +--- + src/librustc_back/target/haiku_base.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/librustc_back/target/haiku_base.rs b/src/librustc_back/target/haiku_base.rs +index bfdc9fa..3fd0389 100644 +--- a/src/librustc_back/target/haiku_base.rs ++++ b/src/librustc_back/target/haiku_base.rs +@@ -16,7 +16,7 @@ pub fn opts() -> TargetOptions { + linker: "cc".to_string(), + dynamic_linking: true, + executables: true, +- has_rpath: true, ++ has_rpath: false, + target_family: Some("unix".to_string()), + linker_is_gnu: true, + .. Default::default() +-- +2.7.0 + + +From e7702e1341d602923a5a4fe898750d36b7cbb287 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 20 Sep 2017 07:27:38 +0000 +Subject: [PATCH 3/4] Haiku: add missing F_RDLCK constant + +--- + src/librustc_data_structures/flock.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/librustc_data_structures/flock.rs b/src/librustc_data_structures/flock.rs +index 33d71ba..2211854 100644 +--- a/src/librustc_data_structures/flock.rs ++++ b/src/librustc_data_structures/flock.rs +@@ -113,6 +113,7 @@ mod imp { + pub l_sysid: libc::c_int, + } + ++ pub const F_RDLCK: libc::c_short = 0x0040; + pub const F_UNLCK: libc::c_short = 0x0200; + pub const F_WRLCK: libc::c_short = 0x0400; + pub const F_SETLK: libc::c_int = 0x0080; +-- +2.7.0 + + +From 147fba7e207e3d66853fba32e3ba916905e18e5c Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 20 Sep 2017 17:36:59 +0000 +Subject: [PATCH 4/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 503ef4c..d7df8af 100644 +--- a/src/librustdoc/lib.rs ++++ b/src/librustdoc/lib.rs +@@ -98,7 +98,7 @@ struct Output { + } + + pub fn main() { +- const STACK_SIZE: usize = 32_000_000; // 32MB ++ const STACK_SIZE: usize = 16_000_000; // 16MB on Haiku + let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || { + let s = env::args().collect::>(); + main_args(&s) +-- +2.7.0 + diff --git a/dev-lang/rust/patches/rust-1.17.0.patchset b/dev-lang/rust/patches/rust-1.17.0.patchset new file mode 100644 index 000000000..ddc488713 --- /dev/null +++ b/dev-lang/rust/patches/rust-1.17.0.patchset @@ -0,0 +1,228 @@ +From 29a293b243ccc2af78b471af767176713a3c8468 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 20 Sep 2017 07:26:48 +0000 +Subject: [PATCH 1/6] Haiku: disable rpath as standard option on the compiler + +--- + src/librustc_back/target/haiku_base.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/librustc_back/target/haiku_base.rs b/src/librustc_back/target/haiku_base.rs +index bfdc9fa..3fd0389 100644 +--- a/src/librustc_back/target/haiku_base.rs ++++ b/src/librustc_back/target/haiku_base.rs +@@ -16,7 +16,7 @@ pub fn opts() -> TargetOptions { + linker: "cc".to_string(), + dynamic_linking: true, + executables: true, +- has_rpath: true, ++ has_rpath: false, + target_family: Some("unix".to_string()), + linker_is_gnu: true, + .. Default::default() +-- +2.7.0 + + +From 3f4cea9e6f171322f04e28b0057cda30c916c46d Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 20 Sep 2017 07:27:38 +0000 +Subject: [PATCH 2/6] Haiku: add missing F_RDLCK constant + +--- + src/librustc_data_structures/flock.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/librustc_data_structures/flock.rs b/src/librustc_data_structures/flock.rs +index 26417e3..32f0fd4 100644 +--- a/src/librustc_data_structures/flock.rs ++++ b/src/librustc_data_structures/flock.rs +@@ -113,6 +113,7 @@ mod imp { + pub l_sysid: libc::c_int, + } + ++ pub const F_RDLCK: libc::c_short = 0x0040; + pub const F_UNLCK: libc::c_short = 0x0200; + pub const F_WRLCK: libc::c_short = 0x0400; + pub const F_SETLK: libc::c_int = 0x0080; +-- +2.7.0 + + +From 1270fb2a678dbe246d6ed0135687b09aa3fe0ae3 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Wed, 20 Sep 2017 17:36:59 +0000 +Subject: [PATCH 3/6] 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 84f69cd..8c31464 100644 +--- a/src/librustdoc/lib.rs ++++ b/src/librustdoc/lib.rs +@@ -98,7 +98,7 @@ struct Output { + } + + pub fn main() { +- const STACK_SIZE: usize = 32_000_000; // 32MB ++ const STACK_SIZE: usize = 16_000_000; // 16MB on Haiku + let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || { + let s = env::args().collect::>(); + main_args(&s) +-- +2.7.0 + + +From 9181d72c5d6199534714df0f4dc76d6961af7e16 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Mon, 9 Oct 2017 21:31:02 +0000 +Subject: [PATCH 4/6] Haiku: link libunwind to libgcc_s + +--- + src/libunwind/build.rs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs +index ed3d521..d2d895a 100644 +--- a/src/libunwind/build.rs ++++ b/src/libunwind/build.rs +@@ -38,5 +38,7 @@ fn main() { + println!("cargo:rustc-link-lib=gcc_eh"); + } else if target.contains("fuchsia") { + println!("cargo:rustc-link-lib=unwind"); ++ } else if target.contains("haiku") { ++ println!("cargo:rustc-link-lib=gcc_s"); + } + } +-- +2.7.0 + + +From c237d65e40d80bdd4f1a55e7dc2571bb2cc724bd Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Tue, 10 Oct 2017 06:32:35 +0000 +Subject: [PATCH 5/6] Haiku: depend on a num_cpus package with Haiku support + +--- + src/Cargo.lock | 6 +++--- + src/bootstrap/Cargo.toml | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/Cargo.lock b/src/Cargo.lock +index b34007d..50a22f1 100644 +--- a/src/Cargo.lock ++++ b/src/Cargo.lock +@@ -68,7 +68,7 @@ dependencies = [ + "gcc 0.3.43 (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.21 (registry+https://github.com/rust-lang/crates.io-index)", +- "num_cpus 0.2.13 (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.22 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + ] +@@ -301,7 +301,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "num_cpus" +-version = "0.2.13" ++version = "1.6.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", +@@ -980,7 +980,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" + "checksum mdbook 0.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "06a68e8738e42b38a02755d3ce5fa12d559e17acb238e4326cbc3cc056e65280" + "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" + "checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99" +-"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" ++"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584" + "checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842" + "checksum pest 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a6dda33d67c26f0aac90d324ab2eb7239c819fc7b2552fe9faa4fe88441edc8" + "checksum pulldown-cmark 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1058d7bb927ca067656537eec4e02c2b4b70eaaa129664c5b90c111e20326f41" +diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml +index 1eda160..6bcb4e6 100644 +--- a/src/bootstrap/Cargo.toml ++++ b/src/bootstrap/Cargo.toml +@@ -27,7 +27,7 @@ test = false + build_helper = { path = "../build_helper" } + cmake = "0.1.17" + filetime = "0.1" +-num_cpus = "0.2" ++num_cpus = "1.4" + toml = "0.1" + getopts = "0.2" + rustc-serialize = "0.3" +-- +2.7.0 + + +From 7aeb3052d02f83dd85eb75f21306e2aa8c765077 Mon Sep 17 00:00:00 2001 +From: Jessica Hamilton +Date: Mon, 24 Apr 2017 14:21:36 +0000 +Subject: [PATCH 6/6] Haiku: add missing cases of using LIBRARY_PATH + +--- + src/bootstrap/bootstrap.py | 3 +++ + src/bootstrap/util.rs | 2 ++ + src/librustc_back/dynamic_lib.rs | 2 ++ + src/tools/compiletest/src/procsrv.rs | 2 ++ + 4 files changed, 9 insertions(+) + +diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py +index b326f95..1e9e2d4 100644 +--- a/src/bootstrap/bootstrap.py ++++ b/src/bootstrap/bootstrap.py +@@ -364,6 +364,9 @@ class RustBuild(object): + env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ + (os.pathsep + env["DYLD_LIBRARY_PATH"]) \ + if "DYLD_LIBRARY_PATH" in env else "" ++ env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ ++ (os.pathsep + env["LIBRARY_PATH"]) \ ++ if "LIBRARY_PATH" in env else "" + env["PATH"] = os.path.join(self.bin_root(), "bin") + \ + os.pathsep + env["PATH"] + if not os.path.isfile(self.cargo()): +diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs +index dab20f4..e01c06b 100644 +--- a/src/bootstrap/util.rs ++++ b/src/bootstrap/util.rs +@@ -139,6 +139,8 @@ pub fn dylib_path_var() -> &'static str { + "PATH" + } else if cfg!(target_os = "macos") { + "DYLD_LIBRARY_PATH" ++ } else if cfg!(target_os = "haiku") { ++ "LIBRARY_PATH" + } else { + "LD_LIBRARY_PATH" + } +diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs +index 38e6006..e6f305c 100644 +--- a/src/librustc_back/dynamic_lib.rs ++++ b/src/librustc_back/dynamic_lib.rs +@@ -68,6 +68,8 @@ impl DynamicLibrary { + "PATH" + } else if cfg!(target_os = "macos") { + "DYLD_LIBRARY_PATH" ++ } else if cfg!(target_os = "haiku") { ++ "LIBRARY_PATH" + } else { + "LD_LIBRARY_PATH" + } +diff --git a/src/tools/compiletest/src/procsrv.rs b/src/tools/compiletest/src/procsrv.rs +index 7e4f40a..20933ad 100644 +--- a/src/tools/compiletest/src/procsrv.rs ++++ b/src/tools/compiletest/src/procsrv.rs +@@ -20,6 +20,8 @@ pub fn dylib_env_var() -> &'static str { + "PATH" + } else if cfg!(target_os = "macos") { + "DYLD_LIBRARY_PATH" ++ } else if cfg!(target_os = "haiku") { ++ "LIBRARY_PATH" + } else { + "LD_LIBRARY_PATH" + } +-- +2.7.0 + diff --git a/dev-lang/rust/patches/rust-installer-1.16.0.patchset b/dev-lang/rust/patches/rust-installer-1.16.0.patchset new file mode 100644 index 000000000..a21c5853a --- /dev/null +++ b/dev-lang/rust/patches/rust-installer-1.16.0.patchset @@ -0,0 +1,27 @@ +From fa075bf6c5642960985621370954817e34be8f83 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Mon, 9 Mar 2015 22:27:02 +0100 +Subject: [PATCH] Haiku: detect OS + +--- + install-template.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/install-template.sh b/install-template.sh +index dcc1ee0..90afec2 100644 +--- a/install-template.sh ++++ b/install-template.sh +@@ -364,6 +364,10 @@ get_host_triple() { + _ostype=pc-windows-gnu + ;; + ++ Haiku*) ++ _ostype=unknown-haiku ++ ;; ++ + *) + err "unknown value from uname -s: $_uname_value" + ;; +-- +2.7.0 + diff --git a/dev-lang/rust/patches/rust-installer-1.17.0.patchset b/dev-lang/rust/patches/rust-installer-1.17.0.patchset new file mode 100644 index 000000000..a21c5853a --- /dev/null +++ b/dev-lang/rust/patches/rust-installer-1.17.0.patchset @@ -0,0 +1,27 @@ +From fa075bf6c5642960985621370954817e34be8f83 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Mon, 9 Mar 2015 22:27:02 +0100 +Subject: [PATCH] Haiku: detect OS + +--- + install-template.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/install-template.sh b/install-template.sh +index dcc1ee0..90afec2 100644 +--- a/install-template.sh ++++ b/install-template.sh +@@ -364,6 +364,10 @@ get_host_triple() { + _ostype=pc-windows-gnu + ;; + ++ Haiku*) ++ _ostype=unknown-haiku ++ ;; ++ + *) + err "unknown value from uname -s: $_uname_value" + ;; +-- +2.7.0 + diff --git a/dev-lang/rust/patches/rust-libc-1.16.0.patchset b/dev-lang/rust/patches/rust-libc-1.16.0.patchset new file mode 100644 index 000000000..6761e3025 --- /dev/null +++ b/dev-lang/rust/patches/rust-libc-1.16.0.patchset @@ -0,0 +1,30 @@ +From 823a13164679f0e0431f7ec3fc102e1348d4ee03 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Sat, 23 Sep 2017 13:37:05 +0000 +Subject: [PATCH] Haiku: add constants from wait.h + +--- + src/unix/haiku/mod.rs | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs +index ab53e6c..a40483d 100644 +--- a/src/unix/haiku/mod.rs ++++ b/src/unix/haiku/mod.rs +@@ -576,6 +576,13 @@ pub const SA_NOCLDSTOP: ::c_int = 0x01; + + pub const FD_SETSIZE: usize = 1024; + ++pub const WNOHANG: ::c_int = 0x01; ++pub const WUNTRACED: ::c_int = 0x02; ++pub const WCONTINUED: ::c_int = 0x04; ++pub const WEXITED: ::c_int = 0x08; ++pub const WSTOPPED: ::c_int = 0x10; ++pub const WNOWAIT: ::c_int = 0x20; ++ + pub const RTLD_NOW: ::c_int = 0x1; + pub const RTLD_DEFAULT: *mut ::c_void = 0isize as *mut ::c_void; + +-- +2.7.0 + diff --git a/dev-lang/rust/rust-1.16.0.recipe b/dev-lang/rust/rust-1.16.0.recipe new file mode 100644 index 000000000..9300c6be9 --- /dev/null +++ b/dev-lang/rust/rust-1.16.0.recipe @@ -0,0 +1,170 @@ +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.16.0" +srcGitRev2="a8fc4c169fac43a5dc204d4fd56ddb1739f8c178" +srcGitRev3="4f994850808a572e2cc8d43f968893c8e942e9bf" +srcGitRev4="a3736a0a1907cbc8bf619708738815a5fd789c80" +srcGitRev5="7d57bdcdbb56540f37afe5a934ce12d33a6ca7fc" +srcGitRev6="ceb177eeefa7d67ca29230d2e7e8584f97d4fdad" +cargoVersion="0.17.0" +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_FILENAME="rust-$srcGitRev.tar.gz" +CHECKSUM_SHA256="b7ec2d24d41ef2c27b1883d54f44a3c0a2eeecaf8c7abc1855f3171f3e0392cb" +CHECKSUM_SHA256_2="7d143e0025eb634de5dd2c4ceff22f632cfa065ebbf213068ccacff124732034" +CHECKSUM_SHA256_3="dc7240d60a869fa24a68c8734fb7c810c27cca0a6dad52df6279865e4e8e7fae" +CHECKSUM_SHA256_4="29da85607df523a165c1b01a378f929a0b37b75969119b6ec373d95576978b13" +CHECKSUM_SHA256_5="669d4db37e59ea83449e9ddb8bcccda7c22050763602a7e6d818986f345457b7" +CHECKSUM_SHA256_6="0414d14ba98eb1659180a00e78d002b50a6494e6b596145d6fb4262cbb76019b" +CHECKSUM_SHA256_7="fc689ca7a09f1e6a1c31e69f0e2616a93576a68e0e1d7f0ae4c0d3301ff21ff8" +SOURCE_DIR="rust-$srcGitRev" +PATCHES="rust-$portVersion.patchset" +PATCHES_3="rust-installer-$portVersion.patchset" +PATCHES_5="rust-libc-$portVersion.patchset" +PATCHES_7="cargo-$cargoVersion.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:cargo$secondaryArchSuffix = $cargoVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libcurl$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + binutils${secondaryArchSuffix} == 2.26.1_2016_07_22 # version 2.28.1 will crash when building llvm + devel:libcurl$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cargo$secondaryArchSuffix == 0.16.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.15.1 + cmd:sed + cmd:tar + cmd:which + cmd:xargs + " + +BUILD() +{ + rm -rf src/compiler-rt src/llvm src/rust-installer src/liblibc src/rt/hoedown + ln -sf /sources-2/compiler-rt-$srcGitRev2 src/compiler-rt + ln -sf /sources-3/rust-installer-$srcGitRev3 src/rust-installer + ln -sf /sources-4/hoedown-$srcGitRev4 src/rt/hoedown + ln -sf /sources-5/libc-$srcGitRev5 src/liblibc + ln -sf /sources-6/llvm-$srcGitRev6 src/llvm + # Do not use runConfigure: it generates too much noise, and it creates a totally impossible directory structure + #runConfigure --omit-dirs "docDir libExecDir dataRootDir includeDir sharedStateDir sbinDir binDir oldIncludeDir" ./configure --disable-jemalloc --build=i686-unknown-haiku --host=i686-unknown-haiku --target=i686-unknown-haiku + ./configure --prefix=$prefix --mandir=$manDir --disable-jemalloc \ + --enable-local-rust --local-rust-root=/boot/system/ \ + --disable-rustbuild --release-channel=stable + + make + + # Build cargo + # This requires some manual interventions. From 1.17.0 the cargo source can be + # built from inside the tree. In this version we will still have to do it as a + # separate step. We use the just-generated rustc binary to compile the new + # version. + if [ $effectiveTargetArchitecture = x86 ]; then + architecture="i686-unknown-haiku" + fi + if [ $effectiveTargetArchitecture = x86_64 ]; then + architecture="x86_64-unknown-haiku" + fi + + cd /sources-7/cargo-$cargoVersion + rm -rf src/rust-installer + ln -sf /sources-3/rust-installer-$srcGitRev3 src/rust-installer + LIBRARY_PATH=/sources/rust-$portVersion/$architecture/stage2/lib:$LIBRARY_PATH \ + ./configure --prefix=$prefix --datadir=$dataDir --mandir=$manDir \ + --docdir=$docDir --sysconfdir=$dataDir \ + --rustc=/sources/rust-$portVersion/$architecture/stage2/bin/rustc \ + --release-channel=stable + LIBRARY_PATH=/sources/rust-$portVersion/$architecture/stage2/lib:$LIBRARY_PATH make +} + +INSTALL() +{ + make install + + # move documentation to the proper place + mkdir -p $developDocDir + mv $prefix/share/doc/rust/* $developDocDir + rm -rf $prefix/share + + if [ -n "$secondaryArchSuffix" ]; then + # move the libs to the x86 subdir + mkdir -p $libDir + mv $prefix/lib/*.so $libDir + fi + + # 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 + mkdir -p $developLibDir + mv $prefix/lib/rustlib $developLibDir + cd $prefix/lib + ln -s ../$relativeDevelopLibDir/rustlib rustlib + + # install cargo + if [ $effectiveTargetArchitecture = x86 ]; then + architecture="i686-unknown-haiku" + fi + if [ $effectiveTargetArchitecture = x86_64 ]; then + architecture="x86_64-unknown-haiku" + fi + + cd /sources-7/cargo-$cargoVersion + LIBRARY_PATH=/sources/rust-$portVersion/$architecture/stage2/lib:$LIBRARY_PATH make install + + # move the cargo binary (in case of a secondary arch) + if [ -n "$secondaryArchSuffix" ]; then + mkdir -p $binDir + mv $prefix/bin/cargo $binDir/cargo + fi + + # 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-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() +{ + make check +} diff --git a/dev-lang/rust/rust-1.17.0.recipe b/dev-lang/rust/rust-1.17.0.recipe new file mode 100644 index 000000000..67949198d --- /dev/null +++ b/dev-lang/rust/rust-1.17.0.recipe @@ -0,0 +1,199 @@ +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.17.0" +srcGitRev2="d812b1641f798e38de9fa372476d42cdb6908c01" +srcGitRev3="4f994850808a572e2cc8d43f968893c8e942e9bf" +srcGitRev4="da282f1bb7277b4d30fa1599ee29ad8eb4dd2a92" +srcGitRev5="64d954c6a76e896fbf7ed5c17e77c40e388abe84" +srcGitRev6="2e951c3ae354bcbd2e50b30798e232949a926b75" +cargoVersion="0.18.0" +srcGitRev8="d08fe97d12b41c1ed8cc7701e545864132783941" +srcGitRev9="2d23ea601f017c106a2303094ee1c57ba856d246" +srcGitRev10="0.1.6" +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/alexcrichton/cargo-vendor/archive/$srcGitRev10.tar.gz" +SOURCE_FILENAME="rust-$srcGitRev.tar.gz" +CHECKSUM_SHA256="91c59dfc727dd56114b11badf60ada8338d6afd2a5fb797b1e1886ef60dd3fbe" +CHECKSUM_SHA256_2="a1d7a2c248c01499518f54735038030651c62fe8f0d580987ac52be20a13e93b" +CHECKSUM_SHA256_3="dc7240d60a869fa24a68c8734fb7c810c27cca0a6dad52df6279865e4e8e7fae" +CHECKSUM_SHA256_4="623889a326754e93a4a7a8a3487699ea786f4ca9b118f7468c12f8b9966905e6" +CHECKSUM_SHA256_5="62f91d74cffe78b9e18707fd8b02dbd8dca731486d6f5cd9ceca92034d1149a3" +CHECKSUM_SHA256_6="a85cc4847370573d194af95d6794304479d1024863c754d9b4e2499478c41393" +CHECKSUM_SHA256_7="19b5c142c194fc2f940d93b4679850980ed077db0ff7c558122c7ef865e24983" +CHECKSUM_SHA256_8="39060572afca31c02f2f5eafc5d94c7b1930af7d3c8b4d8b81bd904d640dc37a" +CHECKSUM_SHA256_9="8acfa0b31fa2e0780d4de5ec1ba76154f16db8f02e3d23c04d34dcecae6189a7" +CHECKSUM_SHA256_10="927f6b782f0be32c6027335bbd49fb40cffa922095ffacc9a0aca78e45023f1a" +SOURCE_DIR="rust-$srcGitRev" +PATCHES="rust-$portVersion.patchset" +PATCHES_3="rust-installer-$portVersion.patchset" +PATCHES_7="cargo-$cargoVersion.patchset" +PATCHES_10="cargo-vendor-$srcGitRev10.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.17.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.16.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 cargo src/compiler-rt src/llvm src/rust-installer \ + src/liblibc src/rt/hoedown src/doc/nomicon src/doc/reference + cp -r /sources-2/compiler-rt-$srcGitRev2 src/compiler-rt + cp -r /sources-3/rust-installer-$srcGitRev3 src/rust-installer + cp -r /sources-4/hoedown-$srcGitRev4 src/rt/hoedown + cp -r /sources-5/libc-$srcGitRev5 src/liblibc + cp -r /sources-6/llvm-$srcGitRev6 src/llvm + cp -r /sources-7/cargo-$cargoVersion cargo + cp -r /sources-8/nomicon-$srcGitRev8 src/doc/nomicon + cp -r /sources-9/reference-$srcGitRev9 src/doc/reference + + # 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" + + [rust] + channel = "stable" + use-jemalloc = false + rpath = false +EOL + + # the install step of rust depends on the cargo vendor command + # build it separately here + cd /sources-10/cargo-vendor-$srcGitRev10 + cargo install --force + + # now build rust and cargo + cd /sources/rust-$srcGitRev + ./x.py dist --verbose +} + +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 /sources/rust-$srcGitRev/build/tmp/dist/ + for module in "rust-docs-$srcGitRev-$architecture" \ + "rust-std-$srcGitRev-$architecture" \ + "rustc-$srcGitRev-$architecture" \ + "cargo-$cargoVersion-$architecture" + do + ./$module/install.sh \ + --prefix=$prefix \ + --docdir=$developDocDir \ + --libdir=$libDir \ + --mandir=$manDir \ + --disable-ldconfig + done + + # move the cargo binary (in case of a secondary arch) + if [ -n "$secondaryArchSuffix" ]; then + mkdir -p $binDir + mv $prefix/bin/cargo $binDir/cargo + fi + + # move other cargo artifacts + mkdir -p $dataDir + mv $prefix/share/zsh $dataDir + mv $prefix/etc/bash_completions.d $dataDir + rm -rf $prefix/share $prefix/etc + + # 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-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() +{ + make check +}