Rustpkg is a revamp of Cargo that brings awesome new features such as a build system described in build scripts.
It's a purely functional package manager that has no central sources of any kind,
but rather installs via URLs. It's similar to how Go's go get
tool works, except
Rustpkg requires a central metadata file (pkg.rs
) in the repository, archive or folder
in order to figure out how to build the package. This is a side effect of Rustpkg
allowing multiple crates to be defined in a single package (i.e. a package is defined
as a set of crates rather than a package being exactly the same as one crate).
There's a plan to make it so the pkg.rs
is not needed for single-crate packages,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nohud | |
set nosmoothscroll | |
set noautofocus | |
set typelinkhints | |
let barposition = "bottom" | |
let scrollstep = 100 | |
let vimcommand = "nvim-qt" | |
let qmark T = ["http://todoist.com"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[pkg(id = "com.bjz.gl", | |
vers = "0.1.0")]; | |
#[pkg_crate(file = "src/gl.rc")]; | |
use run; | |
#[pkg_do(build)] // ran before declarative crates (i.e. this will run and then the crate defined above will) | |
fn build() { | |
run::run_program(~"lua", ~[~"LoadGen.lua". ~"-style=pointer_rust", | |
~"-spec=gl", ~"-version=3.3", ~"-profile=core", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: failed to resolve imports | |
src/sdl.rc:19:8: 19:17 error: unresolved import | |
src/sdl.rc:19 pub use event::*; | |
^~~~~~~~~ | |
src/event.rs:1:4: 1:16 error: unresolved import | |
src/event.rs:1 use libc::c_int; | |
^~~~~~~~~~~~ | |
src/cd.rs:1:4: 1:16 error: unresolved import | |
src/cd.rs:1 use libc::c_int; | |
^~~~~~~~~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is a horrible way to do it, but it would work | |
#[pkg(id = "com.frozencow.some_binding", | |
vers = "0.1.1")]; | |
#[pkg_crate(file = "src/some_binding.rc")]; // the binding has FFI stuff that links to -lsome_lib | |
// this would be wrapped by default.. | |
fn cc(path: &Path) { | |
run::run_program(~"cc", ~[~"-shared", ~"-o", rustpkg::build_dir().push(~"lib").push(~"some_lib.so").to_str(), path.to_str()]); | |
} |
- Purely functional
- Different versions of packages can coexist
- Each package must have a UUID, so packages with conflicting names can coexist
- Build logic
- Each package's metadata and build logic is written in a central Rust source file,
package.rs
- Each package's metadata and build logic is written in a central Rust source file,
- Dependencies are declared in the package file and will be fetched and installed before
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// each argument is randomized (error if the argument is not a primitive type or string) | |
#[quickcheck(tries = 1000)] | |
fn even(number: int) { | |
return number % 2 == 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfg: shell host triple i686-unknown-linux-gnu | |
cfg: enabling more debugging (CFG_ENABLE_DEBUG) | |
cfg: host for i686-unknown-linux-gnu is i386 | |
cfg: unix-y environment | |
cfg: using gcc | |
cfg: no llnextgen found, omitting grammar-verification | |
cfg: including dist rules | |
cfg: including test rules | |
run rpass-full: i686-unknown-linux-gnu/stage2/bin/compiletest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum key { | |
key_a, | |
key_b | |
} | |
enum event { | |
quit, | |
key(key) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Module: net | |
*/ | |
import core::{vec, uint, str}; | |
/* Section: Types */ | |
/* | |
Tag: ip_addr |
NewerOlder