Only use syntex on modules that need it.

Also updated dependencies.

Fixes #133 and #138
This commit is contained in:
Paul Lietar 2016-12-31 12:51:44 +01:00
parent 7fd8503f45
commit 8544faf75d
6 changed files with 399 additions and 430 deletions

704
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -21,32 +21,31 @@ path = "src/main.rs"
path = "protocol"
[dependencies]
bit-set = "~0.4.0"
byteorder = "~0.5.1"
eventual = "~0.1.6"
getopts = "~0.2.14"
bit-set = "0.4.0"
byteorder = "1.0"
ctrlc = { version = "2.0", features = ["termination"] }
env_logger = "0.3.2"
eventual = "0.1.6"
getopts = "0.2.14"
hyper = { version = "0.9.1", default-features = false }
#json_macros = "~0.3.0"
lazy_static = "~0.2.0"
lazy_static = "0.2.0"
linear-map = "1.0"
lmdb-rs = "0.7.2"
num = "~0.1.30"
protobuf = "~1.0.15"
rand = "~0.3.13"
rpassword = "~0.2.2"
rust-crypto = "~0.2.34"
rustc-serialize = "~0.3.16"
serde = "0.7"
serde_json = "0.7"
serde_macros = { version = "0.7", optional = true }
tempfile = "~2.1.3"
url = "~0.5.0"
log = "0.3.5"
env_logger = "0.3.2"
num = "0.1.30"
protobuf = "1.0.15"
rand = "0.3.13"
rpassword = "0.3.0"
rust-crypto = "0.2.34"
rustc-serialize = "0.3.16"
serde = "0.8"
serde_json = "0.8"
serde_macros = { version = "0.8", optional = true }
shannon = { git = "https://github.com/plietar/rust-shannon" }
simple-signal = "1.0.6"
tempfile = "2.1"
url = "0.5.0"
vorbis = "~0.0.14"
vorbis = "0.1.0"
tremor = { git = "https://github.com/plietar/rust-tremor", optional = true }
alsa = { git = "https://github.com/plietar/rust-alsa", optional = true }
@ -56,17 +55,15 @@ libpulse-sys = { git = "https://github.com/astro/libpulse-sys", optional = tr
json_macros = { git = "https://github.com/plietar/json_macros" }
protobuf_macros = { git = "https://github.com/plietar/rust-protobuf-macros" }
clippy = { version = "*", optional = true }
openssl = { version = "0.7", optional = true }
mdns = { git = "https://github.com/plietar/rust-mdns" }
[build-dependencies]
vergen = "~0.1.0"
vergen = "0.1.0"
protobuf_macros = { git = "https://github.com/plietar/rust-protobuf-macros" }
json_macros = { git = "https://github.com/plietar/json_macros" }
serde_codegen = { version = "0.7", optional = true }
serde_codegen = { version = "0.8", optional = true }
[features]
with-syntex = ["serde_codegen", "protobuf_macros/with-syntex", "json_macros/with-syntex"]

View file

@ -1,23 +1,5 @@
#[macro_use] pub mod util;
mod album_cover;
pub mod apresolve;
mod audio_decrypt;
mod audio_file;
mod audio_key;
pub mod audio_backend;
pub mod authentication;
pub mod cache;
mod connection;
mod diffie_hellman;
pub mod mercury;
pub mod metadata;
pub mod player;
pub mod session;
pub mod spirc;
pub mod link;
pub mod stream;
pub mod main_helper;
mod audio_file2;
#[cfg(feature = "facebook")]
pub mod spotilocal;

View file

@ -8,8 +8,8 @@
#![cfg_attr(feature="clippy", feature(plugin))]
#![cfg_attr(feature="clippy", plugin(clippy))]
#[macro_use]
extern crate lazy_static;
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate log;
extern crate bit_set;
extern crate byteorder;
@ -22,18 +22,15 @@ extern crate lmdb_rs;
extern crate mdns;
extern crate num;
extern crate protobuf;
extern crate shannon;
extern crate rand;
extern crate rpassword;
extern crate rustc_serialize;
extern crate serde;
extern crate serde_json;
extern crate shannon;
extern crate tempfile;
extern crate url;
#[macro_use]
extern crate log;
#[cfg(not(feature = "with-tremor"))]
extern crate vorbis;
#[cfg(feature = "with-tremor")]
@ -53,17 +50,25 @@ extern crate libpulse_sys;
extern crate librespot_protocol as protocol;
// include!/include_bytes! don't play nice with syntex, so place these here
pub mod version {
include!(concat!(env!("OUT_DIR"), "/version.rs"));
pub mod album_cover;
pub mod audio_backend;
pub mod audio_decrypt;
pub mod audio_file2;
pub mod audio_file;
pub mod audio_key;
pub mod cache;
pub mod connection;
pub mod diffie_hellman;
pub mod link;
pub mod main_helper;
pub mod metadata;
pub mod player;
pub mod stream;
pub mod util;
pub mod version;
pub fn version_string() -> String {
format!("librespot-{}", short_sha())
}
}
#[cfg(feature = "facebook")]
pub mod spotilocal;
#[cfg(feature = "with-syntex")]
include!(concat!(env!("OUT_DIR"), "/lib.rs"));
#[cfg(not(feature = "with-syntex"))]
include!("lib.in.rs");
#[cfg(feature = "with-syntex")] include!(concat!(env!("OUT_DIR"), "/lib.rs"));
#[cfg(not(feature = "with-syntex"))] include!("lib.in.rs");

View file

@ -3,7 +3,7 @@ extern crate librespot;
extern crate env_logger;
#[macro_use]
extern crate log;
extern crate simple_signal;
extern crate ctrlc;
use std::process::exit;
use std::thread;
@ -12,8 +12,6 @@ use std::env;
use librespot::spirc::SpircManager;
use librespot::main_helper;
use simple_signal::{Signal, Signals};
fn usage(program: &str, opts: &getopts::Options) -> String {
let brief = format!("Usage: {} [options]", program);
format!("{}", opts.usage(&brief))
@ -50,13 +48,11 @@ fn main() {
let spirc = SpircManager::new(session.clone(), player);
let spirc_signal = spirc.clone();
thread::spawn(move || spirc.run());
Signals::set_handler(&[Signal::Int, Signal::Term],
move |signals| {
println!("Signal received: {:?}. Say goodbye and exit.", signals);
ctrlc::set_handler(move || {
spirc_signal.send_goodbye();
exit(0);
}
);
});
loop {
session.poll();

5
src/version.rs Normal file
View file

@ -0,0 +1,5 @@
include!(concat!(env!("OUT_DIR"), "/version.rs"));
pub fn version_string() -> String {
format!("librespot-{}", short_sha())
}