From 8568efda7fd75c0bf75efc50d4a9dc3a29cb10f5 Mon Sep 17 00:00:00 2001 From: reya Date: Tue, 30 Jul 2024 03:15:39 +0000 Subject: [PATCH] fix: build on linux --- src-tauri/Cargo.lock | 35 ++++++++++++++++++++++++++++++++++- src-tauri/Cargo.toml | 2 +- src-tauri/src/main.rs | 4 ++-- src/{App.css => global.css} | 0 src/main.tsx | 2 +- 5 files changed, 38 insertions(+), 5 deletions(-) rename src/{App.css => global.css} (100%) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index e27570c..fe9cee9 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1096,6 +1096,30 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "dbus" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" +dependencies = [ + "libc", + "libdbus-sys", + "winapi", +] + +[[package]] +name = "dbus-secret-service" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1caa0c241c01ad8d99a78d553567d38f873dd3ac16eca33a5370d650ab25584e" +dependencies = [ + "dbus", + "futures-util", + "num", + "once_cell", + "rand 0.8.5", +] + [[package]] name = "deranged" version = "0.3.11" @@ -2495,7 +2519,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c118b1bc529b034aad851808f41f49a69a337d10e112039e7f342e5fd514635b" dependencies = [ "byteorder", - "linux-keyutils", + "dbus-secret-service", "security-framework", "windows-sys 0.52.0", ] @@ -2564,6 +2588,15 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +[[package]] +name = "libdbus-sys" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" +dependencies = [ + "pkg-config", +] + [[package]] name = "libloading" version = "0.7.4" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index c2346df..be77dc9 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -34,7 +34,7 @@ serde_json = "1" keyring = { version = "3", features = [ "apple-native", "windows-native", - "linux-native", + "sync-secret-service", ] } keyring-search = "1.2.0" itertools = "0.13.0" diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 3e57c5c..3342812 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,10 +1,12 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +#[cfg(not(target_os = "linux"))] use border::WebviewWindowExt as WebviewWindowExtAlt; use nostr_sdk::prelude::*; use std::{collections::HashMap, fs, time::Duration}; use tauri::{async_runtime::Mutex, Manager}; +#[cfg(not(target_os = "linux"))] use tauri_plugin_decorum::WebviewWindowExt; use commands::{account::*, chat::*}; @@ -51,8 +53,6 @@ fn main() { builder .setup(|app| { let handle = app.handle(); - - #[cfg(not(target_os = "linux"))] let main_window = app.get_webview_window("main").unwrap(); // Open devtools diff --git a/src/App.css b/src/global.css similarity index 100% rename from src/App.css rename to src/global.css diff --git a/src/main.tsx b/src/main.tsx index 0cfdfbd..e7c71d3 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -5,7 +5,7 @@ import { RouterProvider, createRouter } from "@tanstack/react-router"; import { type } from "@tauri-apps/plugin-os"; import { StrictMode } from "react"; import ReactDOM from "react-dom/client"; -import "./app.css"; +import "./global.css"; // Import the generated route tree import { routeTree } from "./routes.gen";