Fenrir
8 years ago
18 changed files with 66 additions and 78 deletions
@ -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); |
|
||||||
} |
|
||||||
} |
|
@ -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`. |
||||||
|
@ -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. |
@ -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 |
Loading…
Reference in new issue