Skip to content

Commit 995d560

Browse files
demo: More fixes to meson-less builds
1 parent ffae6ee commit 995d560

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

demo/client/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ anyhow = "1.0"
1111
ashpd = {path = "../../client", version = "0.13", default-features = false, features = ["tokio", "gtk4", "tracing", "pipewire"]}
1212
async-channel = "2.3"
1313
chrono = {version = "0.4", default-features = false, features = ["clock"]}
14-
futures-util = { workspace = true }
14+
futures-util = "0.3"
1515
gettext-rs = {version = "0.7", features = ["gettext-system"]}
1616
gst = {package = "gstreamer", version = "0.24"}
1717
gst4gtk = {package = "gst-plugin-gtk4", version = "0.14", features = ["wayland", "x11egl", "x11glx", "gtk_v4_14"]}
1818
gtk = {package = "gtk4", version = "0.10", features = ["v4_14"]}
1919
gvdb-macros = "0.1"
2020
rusb = "0.9.4"
21-
serde = { workspace = true }
21+
serde = { version = "1.0", features = ["derive"] }
2222
shumate = {version = "0.7", package = "libshumate"}
23-
tokio = { workspace = true, features = ["io-util", "net", "time", "rt-multi-thread", "macros"] }
24-
tracing = { workspace = true }
25-
tracing-subscriber = { workspace = true, features = ["fmt"] }
23+
tokio = { version = "1.48", default-features = false, features = ["io-util", "net", "time", "rt-multi-thread", "macros"] }
24+
tracing = "0.1"
25+
tracing-subscriber = { version = "0.3", features = ["fmt"] }
2626
url = {version = "2.3", features = ["serde"]}

demo/client/build-aux/com.belmoussaoui.ashpd.demo.Devel.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@
6262
{
6363
"name": "ashpd-demo",
6464
"buildsystem": "meson",
65+
"subdir": "demo/client",
6566
"run-tests": true,
6667
"config-opts": [
6768
"-Dprofile=development"
6869
],
6970
"sources": [
7071
{
71-
"type": "dir",
72-
"path": ".."
72+
"type": "git",
73+
"url": "file://../../..",
74+
"branch": "HEAD"
7375
}
7476
]
7577
}

demo/client/build.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
fn main() {
22
println!("cargo::rustc-check-cfg=cfg(cargo_build)");
3+
println!("cargo::rustc-check-cfg=cfg(workspace_build)");
34

45
// Poor man's attempt to check if the current build is started by meson
56
let meson_build = std::path::Path::new("src/config.rs").exists();
@@ -8,18 +9,14 @@ fn main() {
89
println!("cargo:rustc-cfg=cargo_build");
910
}
1011

11-
let mut gresource_path = "data/resources.gresource.xml";
12-
1312
// Detect if we're building from workspace root
1413
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
1514
if let Some(workspace_root) = std::path::Path::new(&manifest_dir)
1615
.parent()
1716
.and_then(|p| p.parent())
17+
&& workspace_root.join("Cargo.toml").exists()
18+
&& workspace_root.join("client").exists()
1819
{
19-
if workspace_root.join("Cargo.toml").exists() && workspace_root.join("client").exists() {
20-
gresource_path = "demo/client/data/resources.gresource.xml";
21-
}
20+
println!("cargo:rustc-cfg=workspace_build");
2221
}
23-
24-
println!("cargo:rustc-env=GRESOURCE_PATH={}", gresource_path);
2522
}

demo/client/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ use gvdb_macros::include_gresource_from_xml;
2020

2121
use crate::portals::spawn_tokio_blocking;
2222

23+
#[cfg(workspace_build)]
2324
static GRESOURCE_BYTES: &[u8] =
2425
include_gresource_from_xml!("demo/client/data/resources.gresource.xml");
2526

27+
#[cfg(not(workspace_build))]
28+
static GRESOURCE_BYTES: &[u8] = include_gresource_from_xml!("data/resources.gresource.xml");
29+
2630
fn main() -> glib::ExitCode {
2731
// Initialize logger, debug is carried out via debug!, info!, and warn!.
2832
tracing_subscriber::fmt::init();

0 commit comments

Comments
 (0)