Browse Source

Bring in all the crates

pull/10/head
Fenrir 8 years ago
parent
commit
dffce57257
  1. 42
      README.md
  2. 36
      build.rs
  3. 4
      ctr-std/Cargo.toml
  4. 4
      ctr-std/README.md
  5. 2
      ctru-rs/3ds.json
  6. 4
      ctru-rs/Cargo.toml
  7. 44
      ctru-rs/README.md
  8. 8
      ctru-rs/Xargo.toml
  9. 0
      ctru-rs/src/console.rs
  10. 0
      ctru-rs/src/gfx.rs
  11. 0
      ctru-rs/src/lib.rs
  12. 0
      ctru-rs/src/sdmc.rs
  13. 0
      ctru-rs/src/services/apt.rs
  14. 0
      ctru-rs/src/services/fs.rs
  15. 0
      ctru-rs/src/services/gspgpu.rs
  16. 0
      ctru-rs/src/services/hid.rs
  17. 0
      ctru-rs/src/services/mod.rs
  18. 0
      ctru-rs/src/srv.rs

42
README.md

@ -1,41 +1,16 @@
# ctru-rs # ctru-rs
A Rust wrapper library for smealum's A Rust wrapper library for smealum's [ctrulib](https://github.com/smealum/ctrulib).
[ctrulib](https://github.com/smealum/ctrulib). Intended for use only when
targeting CTR.
## How to build See the [3DS project template](https://github.com/rust3ds/rust3ds-template) for instructions on how to use this library.
1. Install the devkitARM toolchain for your system. Make sure `DEVKITPRO` is ## Structure
set in your environment.
2. Modify ~/.cargo/config and add the following lines:
```toml This repository is organized as follows:
[target.3ds] * `ctru-rs`: Safe, idiomatic wrapper around `ctru-sys`.
ar = "/path/to/arm-none-eabi-ar" * `ctru-sys`: Low-level, unsafe bindings to ctrulib
``` * `ctr-std`: A partial implementation of the Rust standard library for the 3DS.
* `ctr-libc`: C types and functions used by ctru-sys and ctr-std.
3. Build with `cargo build --target 3ds.json`.
4. A dkA linkable .rlib (static library) will be generated. Read below for
instructions on using.
## How to use
You can build your homebrew projects through Cargo just as easily as any other
platform. Add this to your `Cargo.toml`:
```toml
[dependencies.ctru-rs]
git="https://github.com/rust3ds/ctru-rs"
```
**It is highly recommended to use the [template
project.](https://github.com/rust3ds/rust3ds-template)**
## Contributing
PR's are welcome. Organization of rust specific features and wrapper
functionality has not been decided on yet.
## License ## License
@ -66,3 +41,4 @@ applies to every file in the tree, unless otherwise noted.
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses. Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See [LICENSE-APACHE](https://github.com/rust-lang/rust/blob/master/LICENSE-APACHE), [LICENSE-MIT](https://github.com/rust-lang/rust/blob/master/LICENSE-MIT), and [COPYRIGHT](https://github.com/rust-lang/rust/blob/master/COPYRIGHT) for details. See [LICENSE-APACHE](https://github.com/rust-lang/rust/blob/master/LICENSE-APACHE), [LICENSE-MIT](https://github.com/rust-lang/rust/blob/master/LICENSE-MIT), and [COPYRIGHT](https://github.com/rust-lang/rust/blob/master/COPYRIGHT) for details.

36
build.rs

@ -1,36 +0,0 @@
use std::env;
use std::path::PathBuf;
use std::fs;
use std::option::Option::{self, Some, None};
const ENV_DKP: &'static str = "DEVKITPRO";
fn find_libctru() -> Option<PathBuf> {
if let Ok(value) = env::var(ENV_DKP) {
let mut path = PathBuf::from(value);
path.push("libctru/lib");
// metadata returns Err if the dir does not exist
if let Ok(metadata) = fs::metadata(path.as_path()) {
if metadata.is_dir() {
return Some(path);
}
}
}
return None;
}
fn main() {
if let Some(path) = find_libctru() {
if let Some(s) = path.to_str() {
println!("cargo:rustc-link-lib=static=ctru");
println!("cargo:rustc-link-search=native={}", s);
} else {
println!("path is not a valid string");
std::process::exit(1);
}
} else {
println!("could not find libctru");
std::process::exit(1);
}
}

4
ctr-std/Cargo.toml

@ -6,6 +6,10 @@ license = "MIT/Apache 2.0"
[dependencies.compiler_builtins] [dependencies.compiler_builtins]
git = "https://github.com/rust-lang-nursery/compiler-builtins" git = "https://github.com/rust-lang-nursery/compiler-builtins"
[dependencies.ctr-libc]
path = "../ctr-libc"
default-features = false
[dependencies.alloc_system] [dependencies.alloc_system]
version = "0.1.1" version = "0.1.1"

4
ctr-std/README.md

@ -1 +1,5 @@
A work-in-progress port of the Rust Standard Library for the Nintendo 3DS, based on [ctrulib](https://github.com/smealum/ctrulib/) and the [devkitARM](http://devkitPro.org) toolchain. A work-in-progress port of the Rust Standard Library for the Nintendo 3DS, based on [ctrulib](https://github.com/smealum/ctrulib/) and the [devkitARM](http://devkitPro.org) toolchain.
## Structure
This library aims to mimick the Rust standard library's public interface as closely as possible, exposing functionality that is common between the 3DS and other platforms. System-specific functionality such as control input, save file management, GPU features, and so forth are implemented in `ctru-rs`.

2
3ds.json → ctru-rs/3ds.json

@ -26,8 +26,6 @@
"-lc", "-lc",
"-lm", "-lm",
"-lsysbase", "-lsysbase",
"-lc",
"-lgcc",
"-lc" "-lc"
] ]
} }

4
Cargo.toml → ctru-rs/Cargo.toml

@ -1,9 +1,7 @@
[package] [package]
authors = ["Ronald Kinard <furyhunter600@gmail.com>"] authors = ["Ronald Kinard <furyhunter600@gmail.com>"]
build = "build.rs"
description = "A safe wrapper around smealum's ctrulib." description = "A safe wrapper around smealum's ctrulib."
license = "https://en.wikipedia.org/wiki/Zlib_License" license = "https://en.wikipedia.org/wiki/Zlib_License"
links = "ctru"
name = "ctru-rs" name = "ctru-rs"
version = "0.5.0" version = "0.5.0"
@ -18,4 +16,4 @@ path = "../ctru-sys"
version = "0.7.0" version = "0.7.0"
[dependencies.widestring] [dependencies.widestring]
widestring = "0.2.2" version = "0.2.2"

44
ctru-rs/README.md

@ -0,0 +1,44 @@
# ctru-rs
A Rust wrapper library for smealum's
[ctrulib](https://github.com/smealum/ctrulib).
See the [3DS project template](https://github.com/rust3ds/rust3ds-template) for instructions on how to use this library.
## Structure
This library is meant to expose 3DS-specific functionality. Common functionality is implemented in `ctr-std` when possible.
## Contributing
PR's are welcome. Organization of rust specific features and wrapper functionality are still being decided on.
## License
Copyright (C) Rust 3DS Project authors, 2015-2016
See AUTHORS.md.
As with the original ctrulib, this library is licensed under zlib. This
applies to every file in the tree, unless otherwise noted.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See [LICENSE-APACHE](https://github.com/rust-lang/rust/blob/master/LICENSE-APACHE), [LICENSE-MIT](https://github.com/rust-lang/rust/blob/master/LICENSE-MIT), and [COPYRIGHT](https://github.com/rust-lang/rust/blob/master/COPYRIGHT) for details.

8
Xargo.toml → ctru-rs/Xargo.toml

@ -1,10 +1,10 @@
[dependencies.collections] [dependencies.collections]
[dependencies.ctr-libc] [dependencies.ctr-libc]
path = "ctr-libc" path = "../ctr-libc"
default-features = false default-features = false
stage = 0 stage = 1
[dependencies.std] [dependencies.std]
path = "ctr-std" path = "../ctr-std"
stage = 1 stage = 2

0
src/console.rs → ctru-rs/src/console.rs

0
src/gfx.rs → ctru-rs/src/gfx.rs

0
src/lib.rs → ctru-rs/src/lib.rs

0
src/sdmc.rs → ctru-rs/src/sdmc.rs

0
src/services/apt.rs → ctru-rs/src/services/apt.rs

0
src/services/fs.rs → ctru-rs/src/services/fs.rs

0
src/services/gspgpu.rs → ctru-rs/src/services/gspgpu.rs

0
src/services/hid.rs → ctru-rs/src/services/hid.rs

0
src/services/mod.rs → ctru-rs/src/services/mod.rs

0
src/srv.rs → ctru-rs/src/srv.rs

Loading…
Cancel
Save