[package]
name = "nebulus"
version = "0.1.38"
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Low-latency native OpenIPC FPV ground station built with egui"
publish = true
readme = "README.md"
default-run = "nebulus"
exclude = ["assets/*.h264", "assets/*.h265"]

[features]
default = []
web-decode-worker = []

[lib]
name = "nebulus_app"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "nebulus"
path = "src/main.rs"

[[bin]]
name = "nebulus-decode-worker"
path = "src/bin/nebulus-decode-worker/main.rs"
required-features = ["web-decode-worker"]

[dependencies]
catppuccin-egui = { version = "5.7.0", default-features = false, features = ["egui33"] }
eframe = { version = "0.35", default-features = false, features = ["default_fonts", "persistence"] }
egui_plot = "0.36"
nusb.workspace = true
openipc-core = { version = "0.1.38", path = "../../crates/openipc-core" }
openipc-rtl88xx = { version = "0.1.38", path = "../../crates/openipc-rtl88xx" }
openipc-uplink = { version = "0.1.38", path = "../../crates/openipc-uplink" }
openipc-video = { version = "0.1.38", path = "../../crates/openipc-video" }
muxide = "0.2.5"
log.workspace = true
mavlink = { version = "0.18.0", default-features = false, features = ["std", "dialect-common", "mav2-message-extensions", "mav2-message-signing"] }
ropus = "0.12.18"
semver = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.10.9"
url = "2"
web-time = "1.1"
zip = { version = "4.6.1", default-features = false, features = ["deflate"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cpal = { version = "0.18.1", features = ["realtime"] }
socket2 = "0.6.4"
tokio = { version = "1", features = ["rt", "time"] }
tun = { version = "0.8", features = ["async", "verify_binary_signature"] }

[target.'cfg(all(unix, not(target_arch = "wasm32")))'.dependencies]
libc = "0.2"

[target.'cfg(all(not(target_arch = "wasm32"), not(target_os = "android")))'.dependencies]
dirs = "6"
reqwest = { version = "0.13.4", default-features = false, features = ["blocking", "rustls"] }
rfd = { version = "0.17.2", default-features = false, features = ["xdg-portal"] }

[target.'cfg(target_os = "linux")'.dependencies]
eframe = { version = "0.35", default-features = false, features = ["wgpu", "wayland", "x11"] }

[target.'cfg(target_os = "macos")'.dependencies]
eframe = { version = "0.35", default-features = false, features = ["wgpu"] }
objc2-core-foundation = { version = "0.3.2", default-features = false, features = ["std"] }
objc2-core-video = { version = "0.3.2", default-features = false, features = ["std", "CVBase", "CVBuffer", "CVImageBuffer", "CVMetalTexture", "CVMetalTextureCache", "CVPixelBuffer", "CVReturn", "objc2", "objc2-metal"] }
objc2-metal = { version = "0.3.2", default-features = false, features = ["std", "MTLDevice", "MTLPixelFormat", "MTLTexture"] }

[target.'cfg(target_os = "windows")'.dependencies]
eframe = { version = "0.35", default-features = false, features = ["wgpu"] }
windows = { version = "0.62.2", features = ["Win32_Foundation", "Win32_System_Threading"] }

[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
tray-icon = "0.24.1"

[target.'cfg(target_os = "android")'.dependencies]
android-activity = { version = "0.6", features = ["native-activity"] }
eframe = { version = "0.35", default-features = false, features = ["glow"] }
egui_glow = "0.35"
jni = "0.22.4"
libc = "0.2"
log = "0.4"
ndk = { version = "0.9", default-features = false, features = ["nativewindow", "api-level-26"] }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
console_error_panic_hook = "0.1"
eframe = { version = "0.35", default-features = false, features = ["glow"] }
egui_glow = "0.35"
futures-util = "0.3"
futures-channel = "0.3"
js-sys = "0.3"
rfd = { version = "0.17.2", default-features = false }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
    "AudioBuffer",
    "AudioBufferSourceNode",
    "AudioContext",
    "AudioContextState",
    "AudioDestinationNode",
    "AudioNode",
    "AudioParam",
    "AudioScheduledSourceNode",
    "BaseAudioContext",
    "Blob",
    "BlobPropertyBag",
    "Document",
    "DedicatedWorkerGlobalScope",
    "Element",
    "ErrorEvent",
    "EventTarget",
    "GainNode",
    "Headers",
    "HtmlAnchorElement",
    "HtmlCanvasElement",
    "HtmlElement",
    "Navigator",
    "Node",
    "Request",
    "RequestInit",
    "RequestRedirect",
    "Response",
    "MessageEvent",
    "MessageChannel",
    "MessagePort",
    "Usb",
    "UsbDevice",
    "UsbDeviceFilter",
    "UsbDeviceRequestOptions",
    "Url",
    "VideoFrame",
    "Window",
    "Worker",
    "WorkerGlobalScope",
    "WorkerOptions",
    "WorkerType",
    "console",
] }

[dev-dependencies]
crypto_box = "0.9"

[package.metadata.android]
package = "dev.neels.openipc.nebulus"
apk_name = "Nebulus"
java_sources = "android/java"
build_targets = [
    "aarch64-linux-android",
    "armv7-linux-androideabi",
    "x86_64-linux-android",
    "i686-linux-android",
]

[package.metadata.android.sdk]
min_sdk_version = 26
target_sdk_version = 36

[package.metadata.android.application]
theme = "@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"
label = "Nebulus"

[[package.metadata.android.application.activity]]
name = "dev.neels.openipc.nebulus.NebulusActivity"
exported = true

[[package.metadata.android.application.activity.meta_data]]
name = "android.app.lib_name"
value = "nebulus_app"

[[package.metadata.android.application.activity.intent_filter]]
actions = ["android.intent.action.MAIN"]
categories = ["android.intent.category.LAUNCHER"]

[[package.metadata.android.application.service]]
name = "dev.neels.openipc.nebulus.NebulusVpnService"
enabled = true
exported = false
permission = "android.permission.BIND_VPN_SERVICE"

[[package.metadata.android.application.service.intent_filter]]
actions = ["android.net.VpnService"]

[[package.metadata.android.uses_feature]]
name = "android.hardware.usb.host"
required = true

[[package.metadata.android.uses_permission]]
name = "android.permission.INTERNET"
