Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out separate sys package #16

Merged
merged 1 commit into from
Nov 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
/target/
/*.lock
*.rs.bk
/lz4-sys/target/
/lz4-sys/*.lock
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "liblz4"]
path = liblz4
path = lz4-sys/liblz4
url = https://github.com/Cyan4973/lz4.git
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "lz4"
license = "MIT"
version = "1.19.173"
authors = [ "Artem V. Navrotskiy <bozaro@buzzsoft.ru>" ]
build = "src/build.rs"
build = "build.rs"
description = "Rust LZ4 bindings library."
repository = "https://github.com/bozaro/lz4-rs"
documentation = "https://bozaro.github.io/lz4-rs/lz4/"
Expand All @@ -15,6 +15,7 @@ doc = false

[dependencies]
libc = "0.2.17"
lz4-sys = { path = "lz4-sys", version = "1.19.173" }

[dev-dependencies]
rand = "0.3.14"
Expand Down
5 changes: 5 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extern crate skeptic;

fn main() {
skeptic::generate_doc_tests(&["README.md"]);
}
15 changes: 15 additions & 0 deletions lz4-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "lz4-sys"
license = "MIT"
links = "lz4"
version = "1.19.173"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could chose to have a version number here that's independent from the sys crate.

authors = [ "Artem V. Navrotskiy <bozaro@buzzsoft.ru>" ]
build = "build.rs"
description = "Rust LZ4 sys package."
repository = "https://github.com/bozaro/lz4-rs"

[dependencies]
libc = "0.2.17"

[build-dependencies]
gcc = "0.3.38"
3 changes: 0 additions & 3 deletions src/build.rs → lz4-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
extern crate gcc;
extern crate skeptic;

use std::env;

Expand All @@ -21,6 +20,4 @@ fn main() {
_ => {}
}
compiler.compile("liblz4.a");

skeptic::generate_doc_tests(&["README.md"]);
}
2 changes: 2 additions & 0 deletions src/liblz4.rs → lz4-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern crate libc;

use std::fmt::Display;
use std::fmt::Formatter;
use std::io::Error;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern crate libc;

pub mod liblz4;
extern crate lz4_sys as liblz4;

mod decoder;
mod encoder;
Expand Down