build: upgrade build deps and fix try! warnings

- upgrade num_cpus from 1.0 to 1.11
- upgrade regex from 0.2 to 1.3
- replace 3 instances of try! with ? in build.rs
This commit is contained in:
Daniel Dulaney
2023-05-24 21:49:22 +02:00
committed by Till Höppner
parent c79443e0be
commit 7369918a62
2 changed files with 11 additions and 15 deletions
+3 -3
View File
@@ -15,11 +15,11 @@ keywords = ["audio", "video"]
libc = "0.2"
[build-dependencies]
num_cpus = "1.0"
cc = "1.0"
num_cpus = "1.11"
cc = "1.0"
pkg-config = "0.3"
bindgen = "0.51.1"
regex = "0.2"
regex = "1.3"
[features]
default = ["avcodec", "avdevice", "avfilter", "avformat", "swresample", "swscale"]
+8 -12
View File
@@ -117,16 +117,14 @@ fn search() -> PathBuf {
}
fn fetch() -> io::Result<()> {
let status = try!(
Command::new("git")
let status = Command::new("git")
.current_dir(&output())
.arg("clone")
.arg("-b")
.arg(format!("release/{}", version()))
.arg("https://github.com/FFmpeg/FFmpeg")
.arg(format!("ffmpeg-{}", version()))
.status()
);
.status()?;
if status.success() {
Ok(())
@@ -281,24 +279,22 @@ fn build() -> io::Result<()> {
}
// run make
if !try!(
Command::new("make")
if !Command::new("make")
.arg("-j")
.arg(num_cpus::get().to_string())
.current_dir(&source())
.status()
).success()
.status()?
.success()
{
return Err(io::Error::new(io::ErrorKind::Other, "make failed"));
}
// run make install
if !try!(
Command::new("make")
if !Command::new("make")
.current_dir(&source())
.arg("install")
.status()
).success()
.status()?
.success()
{
return Err(io::Error::new(io::ErrorKind::Other, "make install failed"));
}