pop-os / cosmic-app-template

Project template for creating applications for the COSMIC™ desktop
37 stars 5 forks source link

Unable to compile new project #5

Closed majster-pl closed 1 week ago

majster-pl commented 1 week ago

Hi there,

I'm new here, I've followed all steps from readme page (planning to create simple applet for cosmic) but I got stuck on error for smithay-client-toolkit. I did some googling and I've already installed cmake and openssl but still no luck. I'm running this on fresh Pop OS 24.04 Cosmic alpha release (might not be a best idea?)

Any help would be appreciated :+1:

Console output:

cargo build --release
   Compiling serde_derive v1.0.210
   Compiling bytemuck_derive v1.7.1
   Compiling thiserror-impl v1.0.63
   Compiling wayland-backend v0.3.7
   Compiling tracing-attributes v0.1.27
   Compiling wayland-scanner v0.31.5
   Compiling memmap2 v0.9.4
   Compiling zerocopy-derive v0.7.35
   Compiling getrandom v0.2.15
   Compiling parking_lot_core v0.9.10
   Compiling displaydoc v0.2.5
   Compiling memmap2 v0.8.0
   Compiling smithay-client-toolkit v0.19.2
error: failed to run custom build command for `smithay-client-toolkit v0.19.2`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/home/szymon/cosmic/cosmic-system-monitor-applet/target/release/build/smithay-client-toolkit-1405fe858037dea9/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=XKBCOMMON_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=XKBCOMMON_STATIC
  cargo:rerun-if-env-changed=XKBCOMMON_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at /home/szymon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smithay-client-toolkit-0.19.2/build.rs:3:49:
  called `Result::unwrap()` on an `Err` value: "\npkg-config exited with status code 1\n> PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags xkbcommon\n\nThe system library `xkbcommon` required by crate `smithay-client-toolkit` was not found.\nThe file `xkbcommon.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.\nThe PKG_CONFIG_PATH environment variable is not set.\n\nHINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `xkbcommon.pc`.\n"
  stack backtrace:
     0: rust_begin_unwind
     1: core::panicking::panic_fmt
     2: core::result::unwrap_failed
     3: build_script_build::main
     4: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
error: Recipe `build-debug` failed on line 38 with exit code 101
mmstick commented 1 week ago

See the pkg-config error

The system library xkbcommon required by crate smithay-client-toolkit was not found

Make sure to install the the development package for xkbcommon

sudo apt install libxkbcommon-dev

See recommended dependencies for libcosmic: https://github.com/pop-os/libcosmic/?tab=readme-ov-file#dependencies

majster-pl commented 1 week ago

Installing all dependencies solved the issue, thank you for prompt response :rocket:

sudo apt install cargo cmake just libexpat1-dev libfontconfig-dev libfreetype-dev libxkbcommon-dev pkgconf