aboutsummaryrefslogtreecommitdiff
path: root/lang/rust
diff options
context:
space:
mode:
authorVanilla I. Shu <vanilla@FreeBSD.org>2012-10-18 07:03:50 +0000
committerVanilla I. Shu <vanilla@FreeBSD.org>2012-10-18 07:03:50 +0000
commitff96836264c085389eb8ca6b70baf36dd474f890 (patch)
treead76ad7a7548da50028bfeada4a395729d8fe19d /lang/rust
parent261f79ac46c156272cfea5011bf3c643a3937e24 (diff)
downloadports-ff96836264c085389eb8ca6b70baf36dd474f890.tar.gz
ports-ff96836264c085389eb8ca6b70baf36dd474f890.zip
Notes
Diffstat (limited to 'lang/rust')
-rw-r--r--lang/rust/Makefile15
-rw-r--r--lang/rust/distinfo8
-rw-r--r--lang/rust/files/log2.patch48
-rw-r--r--lang/rust/files/patch-configure19
-rw-r--r--lang/rust/files/patch-src_libcore_cmath.rs10
-rw-r--r--lang/rust/files/patch-src_libcore_f32.rs22
-rw-r--r--lang/rust/files/tgammaf.patch32
-rw-r--r--lang/rust/pkg-plist16
8 files changed, 121 insertions, 49 deletions
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 0ae844fe8ca1..f4c17a852b0a 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= rust
-PORTVERSION= 0.3
+PORTVERSION= 0.4
CATEGORIES= lang
MASTER_SITES= http://dl.rust-lang.org/dist/:src \
http://dl.rust-lang.org/stage0-snapshots/:boot
@@ -19,7 +19,7 @@ COMMENT= A language with a focus on memory safety and concurrency
RUST_SOURCE= ${DISTNAME}${EXTRACT_SUFX}
RUST_BOOT= rust-stage0-${RUST_BOOT_SIG}.tar.bz2
-RUST_BOOT_SIG= 2012-07-06-b5f5676-freebsd-x86_64-926e17746576397c10af9796d30af6a730329f71
+RUST_BOOT_SIG= 2012-10-09-cd6f24f-freebsd-x86_64-a2b5e9dddfa8f21cc8a068b77a47ba5425bfdcc6
RUST_TARGET= x86_64-unknown-freebsd
ONLY_FOR_ARCHS= amd64
@@ -38,6 +38,14 @@ OPTIONS_DEFAULT= CARGO
.include <bsd.port.pre.mk>
+.if ${OSVERSION} < 900044
+EXTRA_PATCHES+= ${FILESDIR}/log2.patch
+.endif
+
+.if ${OSVERSION} < 801000
+EXTRA_PATCHES+= ${FILESDIR}/tgammaf.patch
+.endif
+
.if ${OSVERSION} >= 900044
LIB_DEPENDS+= unwind:${PORTSDIR}/devel/libunwind
CC= clang
@@ -69,9 +77,6 @@ post-extract:
post-patch:
${REINPLACE_CMD} \
- -e '/probe_need CFG_CURL/d' \
- ${WRKSRC}/configure
- ${REINPLACE_CMD} \
-e 's|subprocess.call(\["curl"|subprocess.call(["fetch"|' \
${WRKSRC}/src/etc/snapshot.py
${REINPLACE_CMD} \
diff --git a/lang/rust/distinfo b/lang/rust/distinfo
index c54251c477ae..31a7f2d87b83 100644
--- a/lang/rust/distinfo
+++ b/lang/rust/distinfo
@@ -1,4 +1,4 @@
-SHA256 (rust-0.3.tar.gz) = b34c895b9596abb6942d1688e6a5189b08b92e2507234779779c1af91e9ae84e
-SIZE (rust-0.3.tar.gz) = 22310335
-SHA256 (rust-stage0-2012-07-06-b5f5676-freebsd-x86_64-926e17746576397c10af9796d30af6a730329f71.tar.bz2) = b991df3cd68568e549241eab5d8b5e9f9dfacb7edaaebca1dd0176c91d0047e2
-SIZE (rust-stage0-2012-07-06-b5f5676-freebsd-x86_64-926e17746576397c10af9796d30af6a730329f71.tar.bz2) = 10308861
+SHA256 (rust-0.4.tar.gz) = 150685f07e4d605cadf9fba25b05e9cc1b009364dd744131cf4230d64981d093
+SIZE (rust-0.4.tar.gz) = 24104527
+SHA256 (rust-stage0-2012-10-09-cd6f24f-freebsd-x86_64-a2b5e9dddfa8f21cc8a068b77a47ba5425bfdcc6.tar.bz2) = 6ef8e6af1af853ed391ff90063deeae3593954b271724d78104e6f31ebb8a470
+SIZE (rust-stage0-2012-10-09-cd6f24f-freebsd-x86_64-a2b5e9dddfa8f21cc8a068b77a47ba5425bfdcc6.tar.bz2) = 13084348
diff --git a/lang/rust/files/log2.patch b/lang/rust/files/log2.patch
new file mode 100644
index 000000000000..ed0b307f6a66
--- /dev/null
+++ b/lang/rust/files/log2.patch
@@ -0,0 +1,48 @@
+--- src/libcore/cmath.rs.orig 2012-10-16 21:22:12.704922039 +0800
++++ src/libcore/cmath.rs 2012-10-16 21:23:23.023337237 +0800
+@@ -56,7 +56,6 @@
+ // renamed: to be consitent with log as ln
+ #[link_name="log1p"] pure fn ln1p(n: c_double) -> c_double;
+ pure fn log10(n: c_double) -> c_double;
+- pure fn log2(n: c_double) -> c_double;
+ #[link_name="ilogb"] pure fn ilog_radix(n: c_double) -> c_int;
+ pure fn modf(n: c_double, iptr: &mut c_double) -> c_double;
+ pure fn pow(n: c_double, e: c_double) -> c_double;
+@@ -131,7 +130,6 @@
+ #[link_name="logf"] pure fn ln(n: c_float) -> c_float;
+ #[link_name="logbf"] pure fn log_radix(n: c_float) -> c_float;
+ #[link_name="log1pf"] pure fn ln1p(n: c_float) -> c_float;
+- #[link_name="log2f"] pure fn log2(n: c_float) -> c_float;
+ #[link_name="log10f"] pure fn log10(n: c_float) -> c_float;
+ #[link_name="ilogbf"] pure fn ilog_radix(n: c_float) -> c_int;
+ #[link_name="modff"] pure fn modf(n: c_float,
+--- src/libcore/f32.rs.orig 2012-10-16 21:22:27.909922315 +0800
++++ src/libcore/f32.rs 2012-10-16 21:24:32.932336957 +0800
+@@ -135,7 +135,11 @@
+ }
+
+ pub pure fn logarithm(n: f32, b: f32) -> f32 {
+- return log2(n) / log2(b);
++ return ln(n) / ln(b);
++}
++
++pub pure fn log2(n: f32) -> f32 {
++ return ln(n) / consts::ln_2;
+ }
+
+ impl f32: num::Num {
+--- src/libcore/f64.rs.orig 2012-10-16 21:22:34.895921647 +0800
++++ src/libcore/f64.rs 2012-10-16 21:25:30.466586496 +0800
+@@ -154,7 +154,11 @@
+ }
+
+ pub pure fn logarithm(n: f64, b: f64) -> f64 {
+- return log2(n) / log2(b);
++ return ln(n) / ln(b);
++}
++
++pub pure fn log2(n: f64) -> f64 {
++ return ln(n) / consts::ln_2;
+ }
+
+ impl f64: num::Num {
diff --git a/lang/rust/files/patch-configure b/lang/rust/files/patch-configure
new file mode 100644
index 000000000000..d106116a908d
--- /dev/null
+++ b/lang/rust/files/patch-configure
@@ -0,0 +1,19 @@
+--- configure.orig 2012-10-16 22:28:10.833921513 +0800
++++ configure 2012-10-16 22:30:18.122921502 +0800
+@@ -312,7 +312,6 @@
+ step_msg "looking for build programs"
+
+ probe_need CFG_PERL perl
+-probe_need CFG_CURL curl
+ probe_need CFG_PYTHON python2.7 python2.6 python2 python
+
+ python_version=$($CFG_PYTHON -V 2>&1)
+@@ -451,7 +450,7 @@
+ | cut -d ' ' -f 2)
+
+ case $CFG_CLANG_VERSION in
+- (3.0svn | 3.0 | 3.1 | 4.0 | 4.1)
++ (3.0svn | 3.0 | 3.1 | 3.2 | 4.0 | 4.1)
+ step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
+ CFG_C_COMPILER="clang"
+ ;;
diff --git a/lang/rust/files/patch-src_libcore_cmath.rs b/lang/rust/files/patch-src_libcore_cmath.rs
deleted file mode 100644
index 801bd79e0b00..000000000000
--- a/lang/rust/files/patch-src_libcore_cmath.rs
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/libcore/cmath.rs.orig 2012-04-01 10:40:10.385607179 +0800
-+++ src/libcore/cmath.rs 2012-04-01 10:40:34.370606102 +0800
-@@ -164,7 +164,6 @@
- #[link_name="sqrtf"] pure fn sqrt(n: c_float) -> c_float;
- #[link_name="tanf"] pure fn tan(n: c_float) -> c_float;
- #[link_name="tanhf"] pure fn tanh(n: c_float) -> c_float;
-- #[link_name="tgammaf"] pure fn tgamma(n: c_float) -> c_float;
- #[link_name="truncf"] pure fn trunc(n: c_float) -> c_float;
- }
-
diff --git a/lang/rust/files/patch-src_libcore_f32.rs b/lang/rust/files/patch-src_libcore_f32.rs
deleted file mode 100644
index e9d1f7799b67..000000000000
--- a/lang/rust/files/patch-src_libcore_f32.rs
+++ /dev/null
@@ -1,22 +0,0 @@
---- src/libcore/f32.rs.orig 2012-07-16 17:14:25.444144084 +0800
-+++ src/libcore/f32.rs 2012-07-16 17:15:29.799514797 +0800
-@@ -5,6 +5,8 @@
- import cmath::c_float::*;
- import cmath::c_float_targ_consts::*;
-
-+import cmath::c_double;
-+
- export add, sub, mul, div, rem, lt, le, gt, eq, ne;
- export is_positive, is_negative, is_nonpositive, is_nonnegative;
- export is_zero, is_infinite, is_finite;
-@@ -179,6 +181,10 @@
- fn from_int(n: int) -> f32 { ret n as f32; }
- }
-
-+pure fn tgamma(n: f32) -> f32 {
-+ ret c_double::tgamma(n as f64) as f32;
-+}
-+
- //
- // Local Variables:
- // mode: rust
diff --git a/lang/rust/files/tgammaf.patch b/lang/rust/files/tgammaf.patch
new file mode 100644
index 000000000000..a548e804bcdd
--- /dev/null
+++ b/lang/rust/files/tgammaf.patch
@@ -0,0 +1,32 @@
+--- src/libcore/cmath.rs.orig 2012-10-16 21:27:43.459921547 +0800
++++ src/libcore/cmath.rs 2012-10-16 21:27:59.451920798 +0800
+@@ -145,7 +145,6 @@
+ #[link_name="sqrtf"] pure fn sqrt(n: c_float) -> c_float;
+ #[link_name="tanf"] pure fn tan(n: c_float) -> c_float;
+ #[link_name="tanhf"] pure fn tanh(n: c_float) -> c_float;
+- #[link_name="tgammaf"] pure fn tgamma(n: c_float) -> c_float;
+ #[link_name="truncf"] pure fn trunc(n: c_float) -> c_float;
+ }
+
+--- src/libcore/f32.rs.orig 2012-10-16 21:27:50.924920698 +0800
++++ src/libcore/f32.rs 2012-10-16 21:30:50.177658387 +0800
+@@ -7,6 +7,8 @@
+ pub use cmath::c_float::*;
+ pub use cmath::c_float_targ_consts::*;
+
++priv use cmath::c_double;
++
+ // These are not defined inside consts:: for consistency with
+ // the integer types
+
+@@ -130,6 +132,10 @@
+ pub const ln_10: f32 = 2.30258509299404568401799145468436421_f32;
+ }
+
++pub pure fn tgamma(n: f32) -> f32 {
++ return c_double::tgamma(n as f64) as f32;
++}
++
+ pub pure fn signbit(x: f32) -> int {
+ if is_negative(x) { return 1; } else { return 0; }
+ }
diff --git a/lang/rust/pkg-plist b/lang/rust/pkg-plist
index 8ac2dc3dd1ef..0e6a68283a7d 100644
--- a/lang/rust/pkg-plist
+++ b/lang/rust/pkg-plist
@@ -1,18 +1,18 @@
%%CARGO%%bin/cargo
bin/rustc
bin/rustdoc
-lib/libcore-d27e4777a53c3e50-0.3.so
-lib/librustc-73389320c1332876-0.3.so
+lib/libcore-c3ca5d77d81b46c1-0.4.so
+lib/librustc-c84825241471686d-0.4.so
lib/librustllvm.so
lib/librustrt.so
-lib/libstd-d399da1ab6f5bec0-0.3.so
-lib/libsyntax-b45cc7d0b085bc34-0.3.so
-lib/rustc/x86_64-unknown-freebsd/lib/libcore-d27e4777a53c3e50-0.3.so
+lib/libstd-4782a756585a81-0.4.so
+lib/libsyntax-84efebcb12c867a2-0.4.so
+lib/rustc/x86_64-unknown-freebsd/lib/libcore-c3ca5d77d81b46c1-0.4.so
lib/rustc/x86_64-unknown-freebsd/lib/libmorestack.a
-lib/rustc/x86_64-unknown-freebsd/lib/librustc-73389320c1332876-0.3.so
+lib/rustc/x86_64-unknown-freebsd/lib/librustc-c84825241471686d-0.4.so
lib/rustc/x86_64-unknown-freebsd/lib/librustrt.so
-lib/rustc/x86_64-unknown-freebsd/lib/libstd-d399da1ab6f5bec0-0.3.so
-lib/rustc/x86_64-unknown-freebsd/lib/libsyntax-b45cc7d0b085bc34-0.3.so
+lib/rustc/x86_64-unknown-freebsd/lib/libstd-4782a756585a81-0.4.so
+lib/rustc/x86_64-unknown-freebsd/lib/libsyntax-84efebcb12c867a2-0.4.so
@dirrm lib/rustc/x86_64-unknown-freebsd/lib
@dirrm lib/rustc/x86_64-unknown-freebsd
@dirrm lib/rustc