From d3e36ba5f374cbea6db92b32b0710fee4ab75cdc Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Fri, 27 Sep 2013 16:57:18 -0600 Subject: [PATCH 1/3] Convert to rustpkg. --- alert.rc => lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) rename alert.rc => lib.rs (92%) diff --git a/alert.rc b/lib.rs similarity index 92% rename from alert.rc rename to lib.rs index aefa4e7..4e2e824 100644 --- a/alert.rc +++ b/lib.rs @@ -7,11 +7,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[link(name="alert", vers="0.1")]; -#[crate_type="lib"]; - #[cfg(target_os="macos")] -extern mod core_foundation; +extern mod core_foundation = "rust-core-foundation"; #[cfg(target_os="macos")] extern mod cocoa; From 266cf970ae7604b236486ea16493c76dca63ee62 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 6 Nov 2013 15:11:14 -0800 Subject: [PATCH 2/3] Fix up test program for rustpkg and new Rust This isn't an automated test harness but rustpkg will build it simply because of the name test.rs. --- test.rs | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/test.rs b/test.rs index 43a7d06..52650fa 100644 --- a/test.rs +++ b/test.rs @@ -9,28 +9,35 @@ //! This is not a typical test harness, because alerts require user input. -use Alert; -use AlertMethods; - -use cocoa::appkit; -use core::task::PlatformThread; -use core::task; - -#[main] -pub fn main() { - let mut builder = task::task(); - builder.sched_mode(PlatformThread); - do builder.spawn { - init(); - - let mut alert: Alert = AlertMethods::new("All units destroyed."); - alert.add_prompt(); - alert.run() +extern mod alert = "rust-alert"; + +#[cfg(target_os="macos")] +extern mod cocoa; + +use alert::Alert; +use alert::AlertMethods; + +#[start] +fn start(argc: int, argv: **u8) -> int { + do std::rt::start_on_main_thread(argc, argv) { + main() } } +fn main() { + init(); + + let mut alert: Alert = AlertMethods::new("All units destroyed."); + alert.add_prompt(); + alert.run() +} + #[cfg(target_os="macos")] fn init() { + use cocoa::appkit; let _ = appkit::NSApp(); } +#[cfg(not(target_os="macos"))] +fn init() { +} From 88adc2b221aef6fe6e792cdaf4f46f44d5a17edc Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 6 Nov 2013 17:50:03 -0800 Subject: [PATCH 3/3] Remove old build system --- Makefile.in | 31 ------------------------------- configure | 5 ----- 2 files changed, 36 deletions(-) delete mode 100644 Makefile.in delete mode 100644 configure diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 1e1f397..0000000 --- a/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -VPATH=%VPATH% - -CC ?= gcc -CXX ?= g++ -CXXFLAGS ?= -AR ?= ar -RUSTC ?= rustc -RUSTFLAGS ?= - -RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs') - -.PHONY: all -all: librustalert.dummy - -%.o: %.c - $(CC) $< -o $@ -c $(CFLAGS) - -librustalert.dummy: alert.rc $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< --out-dir . - touch $@ - -alert-test: alert.rc $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< -o $@ --test - -check: alert-test - ./alert-test - -.PHONY: clean -clean: - rm -f *.o *.a *.so *.dylib *.dll *.dummy *-test - diff --git a/configure b/configure deleted file mode 100644 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 -