terhechte / Ebou

A cross platform Mastodon Client written in Rust
https://terhech.de/ebou/
GNU General Public License v3.0
537 stars 32 forks source link

[Linux] failed compilation of dependency: javascriptcore-rs #18

Open Houkime opened 1 year ago

Houkime commented 1 year ago

OS: Arch Linux (6.4.1 kernel) /usr/lib/libjavascriptcoregtk-4.0.so is present as a part of webkit2gtk (btw, list it as a dep maybe) but it misses a pkg-config file so the compilation fails because it depends on it.

Tried: cargo build --release

output:

warning: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.1" "javascriptcoregtk-4.1 >= 2.24"` did not exit successfully: exit status: 1

error: failed to run custom build command for `javascriptcore-rs-sys v0.5.1`

Caused by:
  process didn't exit successfully: `/home/user/Ebou/target/release/build/javascriptcore-rs-sys-e2aec79b2d46c4e2/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=JAVASCRIPTCOREGTK_4.1_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=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
  cargo:warning=`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.1" "javascriptcoregtk-4.1 >= 2.24"` did not exit successfully: exit status: 1
  error: could not find system library 'javascriptcoregtk-4.1' required by the 'javascriptcore-rs-sys' crate

  --- stderr
  Package javascriptcoregtk-4.1 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `javascriptcoregtk-4.1.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'javascriptcoregtk-4.1', required by 'virtual:world', not found
  Package 'javascriptcoregtk-4.1', required by 'virtual:world', not found
StandingPadAnimations commented 1 year ago

Can you try and see if the AUR package works? The dependency in question is webkit2gtk-4.1 (webkit2gtk is a different package on Arch Linux)

Houkime commented 1 year ago

AUR package works (there is a different bug on login, but it compiles and runs)

terhechte commented 1 year ago

@Houkime did you get it to work? I was able to run it without issues on PopOS

Freyert commented 11 months ago

pacman -S pacman -S extra/webkit2gtk-4.1 solves that issue, but then we run into some import errors in navicula.

error[E0432]: unresolved import `dioxus_desktop::EvalResult`
 --> /home/fbyrne/.cargo/git/checkouts/navicula-66e4e16cd8702a1c/b7eb3d0/src/types.rs:5:50
  |
5 | use dioxus_desktop::{use_window, DesktopContext, EvalResult};
  |                                                  ^^^^^^^^^^ no `EvalResult` in the root

error[E0425]: cannot find function `use_eval` in crate `dioxus_desktop`
   --> /home/fbyrne/.cargo/git/checkouts/navicula-66e4e16cd8702a1c/b7eb3d0/src/logic.rs:384:32
    |
384 |     let eval = dioxus_desktop::use_eval(cx);
    |                                ^^^^^^^^ not found in `dioxus_desktop`
    |
help: consider importing one of these items
    |
1   + use crate::logic::dioxus_elements::prelude::use_eval;
    |
1   + use dioxus::prelude::use_eval;
    |
help: if you import `use_eval`, refer to it directly
    |
384 -     let eval = dioxus_desktop::use_eval(cx);
384 +     let eval = use_eval(cx);
    |

error[E0599]: no method named `eval` found for reference `&'a Rc<DesktopService>` in the current scope
  --> /home/fbyrne/.cargo/git/checkouts/navicula-66e4e16cd8702a1c/b7eb3d0/src/types.rs:20:21
   |
20 |         self.window.eval(code)
   |                     ^^^^ method not found in `&Rc<DesktopService>`
Freyert commented 11 months ago

Following the AUR building with cargo build --release makes it progress much further. You might also need to set the C compiler using CC.

And finally if the ld command says it can't find xdo you're missing the xdotool.