hyprshell_hyprland_plugin/
lib.rs1mod build;
2mod configure;
3mod extract;
4mod test;
5
6use anyhow::Context;
7use tracing::{debug_span, trace};
8
9pub const PLUGIN_NAME: &str = env!("CARGO_PKG_NAME");
10pub const PLUGIN_AUTHOR: &str = env!("CARGO_PKG_AUTHORS");
11pub const PLUGIN_DESC: &str = env!("CARGO_PKG_DESCRIPTION");
12pub const PLUGIN_VERSION: &str = env!("CARGO_PKG_VERSION");
13pub const PLUGIN_OUTPUT_PATH: &str = "/tmp/hyprshell.so";
14
15static ASSET_ZIP_52: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/52/plugin.zip"));
16static ASSET_ZIP_54: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/54/plugin.zip"));
17
18pub use configure::PluginConfig;
19
20pub fn generate(config: &PluginConfig, version: &semver::Version) -> anyhow::Result<()> {
21 let _span = debug_span!("generate").entered();
22
23 trace!("extracting plugin from zip");
24 let dir = extract::extract_plugin(version).context("Failed to extract plugin")?;
25 trace!("configuring defs file");
26 configure::configure(&dir, config, version).context("unable to configure defs file")?;
27 trace!("building plugin");
28 build::build(&dir).context("Failed to build plugin")?;
29 Ok(())
30}