fix: switch to searching for the xml for deb based distros
Some checks are pending
/ cargo-fmtcheck (push) Waiting to run
/ cargo-clippy (push) Waiting to run
/ cargo-test (push) Waiting to run
/ appimage (push) Waiting to run

This commit is contained in:
Bones 2025-01-01 18:34:47 -05:00
commit 4767a4eb13
2 changed files with 8 additions and 2 deletions

View file

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

View file

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