mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 19:47:43 +01:00
chore: fix build for linux (#143)
* chore: fix build for linux * chore: fix build for linux
This commit is contained in:
@@ -36,9 +36,6 @@ tauri-plugin-updater = "2"
|
|||||||
tauri-plugin-process = "2"
|
tauri-plugin-process = "2"
|
||||||
tauri-plugin-drag = "2"
|
tauri-plugin-drag = "2"
|
||||||
|
|
||||||
[target."cfg(target_os = \"macos\")".dependencies]
|
|
||||||
tauri-nspanel = { git = "https://github.com/ahkohd/tauri-nspanel", branch = "v2" }
|
|
||||||
|
|
||||||
reqwest = "0.12.12"
|
reqwest = "0.12.12"
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
ordered-float = { version = "4.6.0", default-features = false }
|
ordered-float = { version = "4.6.0", default-features = false }
|
||||||
@@ -56,6 +53,9 @@ base64 = "0.13"
|
|||||||
walkdir = "2"
|
walkdir = "2"
|
||||||
fuzzy_prefix_search = "0.2"
|
fuzzy_prefix_search = "0.2"
|
||||||
|
|
||||||
|
[target."cfg(target_os = \"macos\")".dependencies]
|
||||||
|
tauri-nspanel = { git = "https://github.com/ahkohd/tauri-nspanel", branch = "v2" }
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
incremental = true # Compile your binary in smaller steps.
|
incremental = true # Compile your binary in smaller steps.
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,7 @@ use reqwest::Client;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use tauri::ActivationPolicy;
|
use tauri::ActivationPolicy;
|
||||||
use tauri::{
|
use tauri::{AppHandle, Emitter, Listener, Manager, PhysicalPosition, Runtime, State, WebviewWindow, Window, WindowEvent};
|
||||||
AppHandle, Emitter, Listener, Manager, PhysicalPosition, Runtime, WebviewWindow, Window,
|
|
||||||
WindowEvent,
|
|
||||||
};
|
|
||||||
use tauri_plugin_autostart::MacosLauncher;
|
use tauri_plugin_autostart::MacosLauncher;
|
||||||
use tauri_plugin_deep_link::DeepLinkExt;
|
use tauri_plugin_deep_link::DeepLinkExt;
|
||||||
use tokio::runtime::Runtime as RT;
|
use tokio::runtime::Runtime as RT;
|
||||||
@@ -53,8 +50,8 @@ struct Payload {
|
|||||||
pub fn run() {
|
pub fn run() {
|
||||||
let mut ctx = tauri::generate_context!();
|
let mut ctx = tauri::generate_context!();
|
||||||
|
|
||||||
let app = tauri::Builder::default()
|
let mut app_builder = tauri::Builder::default()
|
||||||
.plugin(tauri_nspanel::init())
|
// .plugin(tauri_nspanel::init())
|
||||||
.plugin(tauri_plugin_http::init())
|
.plugin(tauri_plugin_http::init())
|
||||||
.plugin(tauri_plugin_shell::init())
|
.plugin(tauri_plugin_shell::init())
|
||||||
.plugin(tauri_plugin_autostart::init(
|
.plugin(tauri_plugin_autostart::init(
|
||||||
@@ -68,6 +65,14 @@ pub fn run() {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}))
|
}))
|
||||||
.plugin(tauri_plugin_store::Builder::default().build())
|
.plugin(tauri_plugin_store::Builder::default().build())
|
||||||
|
|
||||||
|
// Conditional compilation for macOS
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
{
|
||||||
|
app_builder = app_builder.plugin(tauri_nspanel::init());
|
||||||
|
}
|
||||||
|
|
||||||
|
let app = app_builder
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![
|
||||||
change_window_height,
|
change_window_height,
|
||||||
shortcut::change_shortcut,
|
shortcut::change_shortcut,
|
||||||
@@ -182,7 +187,7 @@ pub async fn init<R: Runtime>(app_handle: &AppHandle<R>) {
|
|||||||
let coco_servers = server::servers::get_all_servers();
|
let coco_servers = server::servers::get_all_servers();
|
||||||
|
|
||||||
// Get the registry from Tauri's state
|
// Get the registry from Tauri's state
|
||||||
let registry = app_handle.state::<SearchSourceRegistry>();
|
let registry:State<SearchSourceRegistry> = app_handle.state::<SearchSourceRegistry>();
|
||||||
|
|
||||||
for server in coco_servers {
|
for server in coco_servers {
|
||||||
let source = CocoSearchSource::new(server.clone(), Client::new());
|
let source = CocoSearchSource::new(server.clone(), Client::new());
|
||||||
|
|||||||
@@ -3,19 +3,17 @@ use tauri::{App, WebviewWindow};
|
|||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
mod mac;
|
mod mac;
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
mod win;
|
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
mod linux;
|
mod linux;
|
||||||
mod linux;
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
mod windows;
|
mod windows;
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub use mac::*;
|
pub use mac::*;
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub use win::*;
|
pub use windows::*;
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
pub use linux::*;
|
pub use linux::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user