From 8aab601a46fcbd29c216202416ae4d3f0340b271 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Mon, 16 Sep 2013 12:44:04 -0600 Subject: [PATCH 1/2] Convert to rustpkg format. --- Makefile.in | 6 +++--- core_foundation.rc | 25 ----------------------- lib.rs | 49 ++++++++++++++++++++++++++++++++++++++++++++++ test.rs | 33 ------------------------------- 4 files changed, 52 insertions(+), 61 deletions(-) delete mode 100644 core_foundation.rc create mode 100644 lib.rs delete mode 100644 test.rs diff --git a/Makefile.in b/Makefile.in index 3d6fbfa..e41ccfb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -8,11 +8,11 @@ RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs') .PHONY: all clean all: librustcorefoundation.dummy -librustcorefoundation.dummy: core_foundation.rc $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< --out-dir . +librustcorefoundation.dummy: lib.rs $(RUST_SRC) + $(RUSTC) $(RUSTFLAGS) $< --lib --out-dir . touch $@ -rustcorefoundation-test: core_foundation.rc $(RUST_SRC) +rustcorefoundation-test: lib.rs $(RUST_SRC) $(RUSTC) $(RUSTFLAGS) $< -o $@ --test check: rustcorefoundation-test diff --git a/core_foundation.rc b/core_foundation.rc deleted file mode 100644 index 97b4e3f..0000000 --- a/core_foundation.rc +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2013 The Servo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[link(name = "core_foundation", - vers = "0.1")]; -#[crate_type = "lib"]; - -extern mod std; - -pub mod array; -pub mod base; -pub mod boolean; -pub mod data; -pub mod dictionary; -pub mod number; -pub mod set; -pub mod string; -pub mod test; -pub mod url; diff --git a/lib.rs b/lib.rs new file mode 100644 index 0000000..7e0c556 --- /dev/null +++ b/lib.rs @@ -0,0 +1,49 @@ +// Copyright 2013 The Servo Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern mod std; + +pub mod array; +pub mod base; +pub mod boolean; +pub mod data; +pub mod dictionary; +pub mod number; +pub mod set; +pub mod string; +pub mod url; + +#[cfg(test)] +pub mod test { + #[test] + fn test_stuff() { + use boolean::CFBoolean; + use number::CFNumber; + use dictionary::CFDictionary; + use string::CFString; + + /*let n = CFNumber::new_number(42 as i32); + io::println(format!("%d", (&n).retain_count() as int)); + (&n).show();*/ + + let bar = CFString::new_static("Bar"); + let baz = CFString::new_static("Baz"); + let boo = CFString::new_static("Boo"); + let foo = CFString::new_static("Foo"); + let tru = CFBoolean::true_value(); + let n42 = CFNumber::new(42 as i32); + + let d = CFDictionary::new([ + (*bar.contents.borrow_ref(), *boo.contents.borrow_type_ref()), + (*baz.contents.borrow_ref(), *tru.contents.borrow_type_ref()), + (*foo.contents.borrow_ref(), *n42.contents.borrow_type_ref()), + ]); + d.contents.show(); + } +} diff --git a/test.rs b/test.rs deleted file mode 100644 index 566d0fe..0000000 --- a/test.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013 The Servo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use boolean::CFBoolean; -use number::CFNumber; -use dictionary::CFDictionary; -use string::CFString; - -fn main() { - /*let n = CFNumber::new_number(42 as i32); - io::println(format!("{:d}", (&n).retain_count() as int)); - (&n).show();*/ - - let bar = CFString::new_static("Bar"); - let baz = CFString::new_static("Baz"); - let boo = CFString::new_static("Boo"); - let foo = CFString::new_static("Foo"); - let tru = CFBoolean::true_value(); - let n42 = CFNumber::new(42 as i32); - - let d = CFDictionary::new([ - (*bar.contents.borrow_ref(), *boo.contents.borrow_type_ref()), - (*baz.contents.borrow_ref(), *tru.contents.borrow_type_ref()), - (*foo.contents.borrow_ref(), *n42.contents.borrow_type_ref()), - ]); - d.contents.show(); -} From 329e5165e84abe319580a4286e7713c4b6eb3f60 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 6 Nov 2013 17:49:18 -0800 Subject: [PATCH 2/2] Remove old build system --- Makefile.in | 23 ----------------------- configure | 5 ----- 2 files changed, 28 deletions(-) delete mode 100644 Makefile.in delete mode 100755 configure diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index e41ccfb..0000000 --- a/Makefile.in +++ /dev/null @@ -1,23 +0,0 @@ -VPATH=%VPATH% - -RUSTC ?= rustc -RUSTFLAGS ?= - -RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs') - -.PHONY: all clean -all: librustcorefoundation.dummy - -librustcorefoundation.dummy: lib.rs $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< --lib --out-dir . - touch $@ - -rustcorefoundation-test: lib.rs $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< -o $@ --test - -check: rustcorefoundation-test - ./rustcorefoundation-test - -clean: - rm -f *.o *.a *.so *.dylib *.dll *.dummy rustcorefoundation-test - diff --git a/configure b/configure deleted file mode 100755 index ed6c06e..0000000 --- a/configure +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -SRCDIR="$(cd $(dirname $0) && pwd)" -sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile -