fix: build on linux

This commit is contained in:
2024-07-30 03:15:39 +00:00
parent b3ca859256
commit 8568efda7f
5 changed files with 38 additions and 5 deletions

35
src-tauri/Cargo.lock generated
View File

@@ -1096,6 +1096,30 @@ version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" 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]] [[package]]
name = "deranged" name = "deranged"
version = "0.3.11" version = "0.3.11"
@@ -2495,7 +2519,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c118b1bc529b034aad851808f41f49a69a337d10e112039e7f342e5fd514635b" checksum = "c118b1bc529b034aad851808f41f49a69a337d10e112039e7f342e5fd514635b"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"linux-keyutils", "dbus-secret-service",
"security-framework", "security-framework",
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
@@ -2564,6 +2588,15 @@ version = "0.2.155"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 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]] [[package]]
name = "libloading" name = "libloading"
version = "0.7.4" version = "0.7.4"

View File

@@ -34,7 +34,7 @@ serde_json = "1"
keyring = { version = "3", features = [ keyring = { version = "3", features = [
"apple-native", "apple-native",
"windows-native", "windows-native",
"linux-native", "sync-secret-service",
] } ] }
keyring-search = "1.2.0" keyring-search = "1.2.0"
itertools = "0.13.0" itertools = "0.13.0"

View File

@@ -1,10 +1,12 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!! // Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
#[cfg(not(target_os = "linux"))]
use border::WebviewWindowExt as WebviewWindowExtAlt; use border::WebviewWindowExt as WebviewWindowExtAlt;
use nostr_sdk::prelude::*; use nostr_sdk::prelude::*;
use std::{collections::HashMap, fs, time::Duration}; use std::{collections::HashMap, fs, time::Duration};
use tauri::{async_runtime::Mutex, Manager}; use tauri::{async_runtime::Mutex, Manager};
#[cfg(not(target_os = "linux"))]
use tauri_plugin_decorum::WebviewWindowExt; use tauri_plugin_decorum::WebviewWindowExt;
use commands::{account::*, chat::*}; use commands::{account::*, chat::*};
@@ -51,8 +53,6 @@ fn main() {
builder builder
.setup(|app| { .setup(|app| {
let handle = app.handle(); let handle = app.handle();
#[cfg(not(target_os = "linux"))]
let main_window = app.get_webview_window("main").unwrap(); let main_window = app.get_webview_window("main").unwrap();
// Open devtools // Open devtools

View File

@@ -5,7 +5,7 @@ import { RouterProvider, createRouter } from "@tanstack/react-router";
import { type } from "@tauri-apps/plugin-os"; import { type } from "@tauri-apps/plugin-os";
import { StrictMode } from "react"; import { StrictMode } from "react";
import ReactDOM from "react-dom/client"; import ReactDOM from "react-dom/client";
import "./app.css"; import "./global.css";
// Import the generated route tree // Import the generated route tree
import { routeTree } from "./routes.gen"; import { routeTree } from "./routes.gen";