Bug 1391523 - P2: Remove cubeb build steps. r=kinetik draft
authorDan Glastonbury <dan.glastonbury@gmail.com>
Wed, 09 Aug 2017 17:34:41 +1000
changeset 652725 03eb89b3a61c45d8d62934d3cf137e6687c66792
parent 652724 a8bfef2cff55bb34fa757d0083d24e3d191dd7ad
child 652726 dc4b466664b65fbd485eefd2647ff651a5923b20
push id76138
push userbmo:dglastonbury@mozilla.com
push dateFri, 25 Aug 2017 06:15:19 +0000
reviewerskinetik
bugs1391523
milestone57.0a1
Bug 1391523 - P2: Remove cubeb build steps. r=kinetik MozReview-Commit-ID: Dt9eV5ONGlI
media/cubeb-rs/cubeb-api/libcubeb-sys/Cargo.toml
media/cubeb-rs/cubeb-api/libcubeb-sys/build.rs
--- a/media/cubeb-rs/cubeb-api/libcubeb-sys/Cargo.toml
+++ b/media/cubeb-rs/cubeb-api/libcubeb-sys/Cargo.toml
@@ -1,22 +1,14 @@
 [package]
 name = "libcubeb-sys"
 version = "0.1.0"
 authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
 repository = "https://github.com/djg/cubeb-rs"
 license = "ISC"
 description = "Native bindings to the cubeb library"
 
-links = "cubeb"
-build = "build.rs"
-
 [lib]
 name = "libcubeb_sys"
 path = "lib.rs"
 
 [dependencies]
-cubeb-core = { path = "../../cubeb-core" }
-
-[build-dependencies]
-pkg-config = "0.3"
-cmake = "0.1.2"
-gcc = "0.3"
+cubeb-core = { path = "../../cubeb-core" }
\ No newline at end of file
deleted file mode 100644
--- a/media/cubeb-rs/cubeb-api/libcubeb-sys/build.rs
+++ /dev/null
@@ -1,67 +0,0 @@
-extern crate cmake;
-extern crate gcc;
-extern crate pkg_config;
-
-use std::env;
-use std::fs;
-use std::path::Path;
-use std::process::Command;
-
-macro_rules! t {
-    ($e:expr) => (match $e {
-        Ok(e) => e,
-        Err(e) => panic!("{} failed with {}", stringify!($e), e),
-    })
-}
-
-fn main() {
-    if env::var("LIBCUBEB_SYS_USE_PKG_CONFIG").is_ok() {
-        if pkg_config::find_library("libcubeb").is_ok() {
-            return;
-        }
-    }
-
-    if !Path::new("libcubeb/.git").exists() {
-        let _ = Command::new("git")
-            .args(&["submodule", "update", "--init", "--recursive"])
-            .status();
-    }
-
-    let target = env::var("TARGET").unwrap();
-    //    let host = env::var("HOST").unwrap();
-    let windows = target.contains("windows");
-    let darwin = target.contains("darwin");
-    let mut cfg = cmake::Config::new("libcubeb");
-
-    let _ = fs::remove_dir_all(env::var("OUT_DIR").unwrap());
-    t!(fs::create_dir_all(env::var("OUT_DIR").unwrap()));
-
-    env::remove_var("DESTDIR");
-    let dst = cfg.define("BUILD_SHARED_LIBS", "OFF")
-        .define("BUILD_TESTS", "OFF")
-        .build();
-
-    if windows {
-        println!("cargo:rustc-link-lib=static=cubeb");
-        println!("cargo:rustc-link-search=native={}", dst.display());
-        println!("cargo:rustc-link-lib=dylib=avrt");
-        println!("cargo:rustc-link-lib=dylib=ole32");
-        println!("cargo:rustc-link-lib=dylib=user32");
-        println!("cargo:rustc-link-lib=dylib=winmm");
-    } else if darwin {
-        println!("cargo:rustc-link-lib=static=cubeb");
-        println!("cargo:rustc-link-lib=framework=AudioUnit");
-        println!("cargo:rustc-link-lib=framework=CoreAudio");
-        println!("cargo:rustc-link-lib=framework=CoreServices");
-        println!("cargo:rustc-link-lib=dylib=c++");
-        println!("cargo:rustc-link-search=native={}", dst.display());
-    } else {
-        println!("cargo:rustc-link-lib=static=cubeb");
-        println!("cargo:rustc-link-lib=dylib=stdc++");
-        println!("cargo:rustc-link-search=native={}", dst.display());
-
-        pkg_config::find_library("alsa").unwrap();
-        pkg_config::find_library("libpulse").unwrap();
-        pkg_config::find_library("jack").unwrap();
-    }
-}