From 6639d4a5779810fecabdbd3bd1f349c0b7b2f331 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 2 Sep 2017 00:54:32 +0200 Subject: [PATCH] Build with latest libs --- Cargo.toml | 102 ++++++++++++++++++++------------------ src/audio/alsa/backend.rs | 2 +- src/support/alsa.rs | 2 +- src/support/cmd.rs | 5 +- 4 files changed, 58 insertions(+), 53 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fbdbc1f47..c95488711 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,68 +1,74 @@ [package] +authors = ["Julian Ospald "] name = "pnmixer-rs" version = "0.1.0" -authors = ["Julian Ospald "] - -[lib] -name = "pnmixerlib" -path = "src/lib.rs" -doc = true [[bin]] +doc = false name = "pnmixer-rs" path = "src/bin.rs" -doc = false [dependencies] -alsa = "^0.1.8" +alsa = "^0.1.10" alsa-sys = "^0.1.1" -error-chain = { git = "https://github.com/hasufell/error-chain.git", branch = "PR-from-error" } +error-chain = "^0.10.0" ffi = "^0.0.2" -flexi_logger = "^0.5.1" -gdk-pixbuf = { git = "https://github.com/gtk-rs/gdk-pixbuf.git" } -gdk-pixbuf-sys = { git = "https://github.com/gtk-rs/sys" } -gdk-sys = { git = "https://github.com/gtk-rs/sys" } -gio = { git = "https://github.com/gtk-rs/gio.git" } -glib = { git = "https://github.com/gtk-rs/glib.git" } -glib-sys = { git = "https://github.com/gtk-rs/sys" } -gobject-sys = { git = "https://github.com/gtk-rs/sys" } -gtk-sys = { git = "https://github.com/gtk-rs/sys" } -libc = "^0.2.23" -log = "^0.3.8" -serde = "^1.0.9" -serde_derive = "^1.0.9" -toml = "^0.4.2" -which = "*" -xdg = "*" -libnotify = { git = "https://github.com/hasufell/rust-libnotify.git", branch = "git-deps", optional = true } -png = "^0.9.0" +flexi_logger = "^0.6.8" +gdk-pixbuf = "^0.2.0" +gdk-pixbuf-sys = "^0.4.0" +gdk-sys = "^0.4.0" +gio = "^0.2.0" +glib = "^0.3.1" +glib-sys = "^0.4.0" +gobject-sys = "^0.4.0" +gtk-sys = "^0.4.0" lazy_static = "^0.2.8" +libc = "^0.2.30" +libnotify = { version = "^1.0.1", optional = true } +log = "^0.3.8" +png = "^0.9.0" +serde = "^1.0.11" +serde_derive = "^1.0.11" +toml = "^0.4.5" w_result = "^0.1.2" - - -[dependencies.x11] -version = "^2.14.0" -features = ["xlib", "xtst"] - -[dependencies.gtk] -git = "https://github.com/gtk-rs/gtk.git" -features = [ "v3_10", "v3_12", "v3_22" ] +which = "^1.0.2" +xdg = "^2.1.0" [dependencies.gdk] -git = "https://github.com/gtk-rs/gdk.git" -features = [ "v3_10", "v3_12", "v3_22" ] +features = [ + "v3_10", + "v3_12", + "v3_22", +] +version = "^0.6.0" -[profile.dev] -opt-level = 0 # controls the `--opt-level` the compiler builds with -debug = true # controls whether the compiler passes `-C debuginfo` - # a value of `true` is equivalent to `2` -rpath = false # controls whether the compiler passes `-C rpath` -lto = false # controls `-C lto` for binaries and staticlibs -debug-assertions = false # controls whether debug assertions are enabled -codegen-units = 1 # controls whether the compiler passes `-C codegen-units` - # `codegen-units` is ignored when `lto = true` -panic = 'unwind' # panic strategy (`-C panic=...`), can also be 'abort' +[dependencies.gtk] +features = [ + "v3_10", + "v3_12", + "v3_22", +] +version = "^0.2.0" +[dependencies.x11] +features = [ + "xlib", + "xtst", +] +version = "^2.15.0" [features] notify = ["libnotify"] + +[lib] +doc = true +name = "pnmixerlib" +path = "src/lib.rs" +[profile.dev] +codegen-units = 1 +debug = true +debug-assertions = false +lto = false +opt-level = 0 +panic = "unwind" +rpath = false diff --git a/src/audio/alsa/backend.rs b/src/audio/alsa/backend.rs index ec741411c..29318f1c1 100644 --- a/src/audio/alsa/backend.rs +++ b/src/audio/alsa/backend.rs @@ -126,7 +126,7 @@ impl AudioFrontend for AlsaBackend { } fn card_name(&self) -> Result { - return self.acard.borrow().card.get_name().from_err(); + return Ok(self.acard.borrow().card.get_name()?); } fn chan_name(&self) -> Result { diff --git a/src/support/alsa.rs b/src/support/alsa.rs index 86c0b9e25..ca4636d0a 100644 --- a/src/support/alsa.rs +++ b/src/support/alsa.rs @@ -95,7 +95,7 @@ pub fn alsa_card_has_playable_selem(card: &Card) -> bool { /// Get the `Mixer` for the given alsa card. pub fn get_mixer(card: &Card) -> Result { - return Mixer::new(&format!("hw:{}", card.get_index()), false).from_err(); + return Ok(Mixer::new(&format!("hw:{}", card.get_index()), false)?); } diff --git a/src/support/cmd.rs b/src/support/cmd.rs index 1679c79f9..e5da49e68 100644 --- a/src/support/cmd.rs +++ b/src/support/cmd.rs @@ -24,9 +24,8 @@ pub fn execute_vol_control_command(prefs: &Prefs) -> Result<()> { /// Try to execute the given command asynchronously via gtk. pub fn execute_command(cmd: &str) -> Result<()> { - return glib::spawn_command_line_async(cmd) + return Ok(glib::spawn_command_line_async(cmd) .map_err(|e| { std::io::Error::new(std::io::ErrorKind::Other, e.description()) - }) - .from_err(); + })?); }