Merge branch 'wayland-proto-fix3' into 'main'

fix: switch to searching for the xml for deb based distros

See merge request gabmus/envision!105
This commit is contained in:
Bones 2025-01-02 00:16:01 +00:00
commit f8f4db805f
2 changed files with 8 additions and 2 deletions

View file

@ -16,6 +16,7 @@ pub enum DepType {
Executable,
Include,
UdevRule,
Share,
}
#[derive(Debug, Clone, PartialEq, Eq)]
@ -49,6 +50,7 @@ impl Dependency {
.collect(),
DepType::Include => include_paths(),
DepType::UdevRule => udev_rules_paths(),
DepType::Share => share_paths(),
} {
let path_s = &format!("{dir}/{fname}", dir = dir, fname = self.filename);
let path = Path::new(&path_s);
@ -145,6 +147,10 @@ fn udev_rules_paths() -> Vec<String> {
vec!["/usr/lib/udev/rules.d".into()]
}
fn share_paths() -> Vec<String> {
vec!["/usr/share".into()]
}
#[cfg(test)]
mod tests {
use super::{DepType, Dependency};

View file

@ -32,8 +32,8 @@ fn monado_deps() -> Vec<Dependency> {
},
Dependency {
name: "wayland-protocols".into(),
dep_type: DepType::Include,
filename: "wayland-protocols/drm-lease-v1-enum.h".into(),
dep_type: DepType::Share,
filename: "wayland-protocols/staging/drm-lease/drm-lease-v1.xml".into(),
packages: HashMap::from([
(LinuxDistro::Arch, "wayland-protocols".into()),
(LinuxDistro::Debian, "wayland-protocols".into()),