fix: support libasound2t64 on newer Ubuntu versions (#112)
* fix: support libasound2t64 on newer Ubuntu versions Updates the install logic to check if `libasound2t64` is available using `apt-cache` before falling back to `libasound2`. This fixes installation on Ubuntu 24.04 and other systems affected by the 64-bit time_t transition. * Update cli/src/install.rs Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
vercel[bot]
google-labs-jules[bot]
parent
59baf97e51
commit
a9fcef4579
+18
-1
@@ -9,6 +9,12 @@ pub fn run_install(with_deps: bool) {
|
|||||||
println!("{}", color::cyan("Installing system dependencies..."));
|
println!("{}", color::cyan("Installing system dependencies..."));
|
||||||
|
|
||||||
let (pkg_mgr, deps) = if which_exists("apt-get") {
|
let (pkg_mgr, deps) = if which_exists("apt-get") {
|
||||||
|
let libasound = if package_exists_apt("libasound2t64") {
|
||||||
|
"libasound2t64"
|
||||||
|
} else {
|
||||||
|
"libasound2"
|
||||||
|
};
|
||||||
|
|
||||||
(
|
(
|
||||||
"apt-get",
|
"apt-get",
|
||||||
vec![
|
vec![
|
||||||
@@ -31,7 +37,7 @@ pub fn run_install(with_deps: bool) {
|
|||||||
"libcairo2",
|
"libcairo2",
|
||||||
"libgdk-pixbuf-2.0-0",
|
"libgdk-pixbuf-2.0-0",
|
||||||
"libxrender1",
|
"libxrender1",
|
||||||
"libasound2",
|
libasound,
|
||||||
"libfreetype6",
|
"libfreetype6",
|
||||||
"libfontconfig1",
|
"libfontconfig1",
|
||||||
"libdbus-1-3",
|
"libdbus-1-3",
|
||||||
@@ -191,3 +197,14 @@ fn which_exists(cmd: &str) -> bool {
|
|||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn package_exists_apt(pkg: &str) -> bool {
|
||||||
|
Command::new("apt-cache")
|
||||||
|
.arg("show")
|
||||||
|
.arg(pkg)
|
||||||
|
.stdout(Stdio::null())
|
||||||
|
.stderr(Stdio::null())
|
||||||
|
.status()
|
||||||
|
.map(|s| s.success())
|
||||||
|
.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user