Repository: espanso/espanso (language: rust)

Issue:
Install Wayland DEB on Debian 12 error libwx_gtk3u_html-3.0.so.0
Just download latest version Espanso Wayland Debian v.2.2.1 from Github, and got error 

Steps to reproduce the behavior:
1. Download from Githut using espanso-debian-wayland-amd64.deb
2. sudo apt install ./espanso-debian-wayland-amd64.deb
3. call espanso from console
4. Got this error: 

```
espanso: error while loading shared libraries: libwx_gtk3u_html-3.0.so.0: cannot open shared object file: No such file or directory
```

- OS: Debian 12
- Version: v2.2.1 (latest version)

## Momentary fix

As devs continue to work on this, [this comment](https://github.com/espanso/espanso/issues/1793#issuecomment-1919055522) fixes the problem for the time being.



Discussion / hints:
I have the same bug with espanso-debian-x11-amd64.deb v.2.2.1 (OS: Debian 12)
Same here on Ubuntu 23.10/Mantic. 
Same here on X11 deb.

Used an AppImage version as a workaround for now. Works with no issues.
[Building from source](https://espanso.org/docs/install/linux/#wayland-compile) also seems to work OK (using `cargo-make` `v0.37.5` / Ubuntu 23.10)
Sadly, the first step of building from source is failing for me on Debian 12 Bookworm and Debian testing as `Unable to locate package libwxgtk3.0-gtk3-dev`.

Edit:

I can however install `libwxgtk3.2-gtk3-dev`, so I did!. Unfortunately, despite compiling again from source, it still fails when running `espanso --version`; with the following error:

```
espanso: error while loading shared libraries: libwx_gtk3u_html-3.0.so.0: cannot open shared object file: No such file or directory
```

Edit 2:

The compiled version appears to run fine (at least `./target/release/espanso --version` doesn't crash), until it is moved or copied to `/usr/local/bin/espanso` via `sudo mv target/release/espanso /usr/local/bin/espanso`. I don't know enough about Cargo to deduce what is actually happening.

Edit 3:

For those triaging, I was just having a look through the issues and noticed this one; https://github.com/espanso/espanso/issues/1739 which is outlines similar issues to this, but no solution either.
Same issue with espanso-debian-wayland-amd64.deb v2.2.1 on Debian 12 Bookworm.
@Rody-Oldenhuis Have you tested running it? I will compile it tomorrow if it works for you. Also on 23.10.
> For those triaging, I was just having a look through the issues and noticed this one; #1739 which is outlines similar issues to this, but no solution either.

I suspect the pre-built .deb cannot locate _libwx_gtk3u_html-3.0.so.0_ because of [this commit](https://github.com/espanso/espanso/commit/4a9739f98e062ec6aa29dcf53acd35010e29f7a9#diff-b9b872cf52f4e68169da8d1ec848cdabbd530d2043503963e75d366f2503b422R92) relaxing compilation, plus the package then being compiled with _libwxgtk3.0-gtk3-dev_. If Espanso is compatible with wxWidgets 3.2, then the issue should only be compilation. I will try tomorrow.
> @Rody-Oldenhuis Have you tested running it? I will compile it tomorrow if it works for you. Also on 23.10.

@yue-dongchen Yes I did; I could do text replacements just fine. Though, I ran it on my dev machine, which is not _quite_ a pristine environment..
I get this on the X11 version with Kubuntu 23.10.
I get this problem on Debian 12 with Wayland. 
The problem occurred on the versions v2.2.1 and v2.2.0. The installation of [v2.1.8](https://github.com/espanso/espanso/releases/tag/v2.1.8) solved the problem for me.
Tried your approach @ysz0507 on Debian testing, "just incase", sadly no dice;

```
$ sudo dpkg -i ~/Downloads/espanso-debian-wayland-amd64.deb 
Selecting previously unselected package espanso-wayland.
(Reading database ... 289203 files and directories currently installed.)
Preparing to unpack .../espanso-debian-wayland-amd64.deb ...
Unpacking espanso-wayland (2.1.8) ...
dpkg: dependency problems prevent configuration of espanso-wayland:
 espanso-wayland depends on libwxgtk3.0-gtk3-0v5; however:
  Package libwxgtk3.0-gtk3-0v5 is not installed.
 espanso-wayland depends on libwxgtk3.0-gtk3-0v5 (>= 3.0.4+dfsg); however:
  Package libwxgtk3.0-gtk3-0v5 is not installed.
 espanso-wayland depends on libwxbase3.0-0v5 (>= 3.0.4+dfsg); however:
  Package libwxbase3.0-0v5 is not installed.

dpkg: error processing package espanso-wayland (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 espanso-wayland
```

I can't install `libwxgtk3.0`, as it isn't available:

```
$ sudo apt search libwxgtk3
Sorting... Done
Full Text Search... Done
libwxgtk3.2-1/testing,now 3.2.4+dfsg-2 amd64 [installed,automatic]
  wxWidgets Cross-platform C++ GUI toolkit (GTK 3 runtime)

libwxgtk3.2-dev/testing,now 3.2.4+dfsg-2 amd64 [installed]
  wxWidgets Cross-platform C++ GUI toolkit (GTK 3 development)
```

Fix patch:
diff --git a/.github/scripts/ubuntu/build_deb.sh b/.github/scripts/ubuntu/build_deb.sh
index ebea2b97..1441e0fe 100755
--- a/.github/scripts/ubuntu/build_deb.sh
+++ b/.github/scripts/ubuntu/build_deb.sh
@@ -3,7 +3,7 @@
 set -e
 
 echo "Installing cargo-deb"
-cargo install cargo-deb --version 1.44.1
+cargo install cargo-deb
 
 cd espanso
 
diff --git a/espanso/Cargo.toml b/espanso/Cargo.toml
index 5748e550..b4ca3214 100644
--- a/espanso/Cargo.toml
+++ b/espanso/Cargo.toml
@@ -91,16 +91,13 @@ const_format = "0.2.14"
 regex.workspace = true
 
 [package.metadata.deb]
-maintainer = "Federico Terzi <federicoterzi96@gmail.com>"
-depends = "libc6 (>= 2.27), libdbus-1-3 (>= 1.9.14), libgcc1 (>= 1:4.2), libnotify-bin, libstdc++6 (>=6), libwxgtk3.0-gtk3-0v5 (>= 3.0.4+dfsg) | libwxgtk3.2-1, libx11-6, libxcb1, libxkbcommon0 (>= 0.5.0), libxtst6, systemd, xclip"
+maintainer = "Auca Coyan <aucacoyan@gmail.com>"
+depends = "$auto"
 section = "utility"
 license-file = ["../LICENSE", "1"]
 
 [package.metadata.deb.variants.wayland]
-depends = "libc6 (>= 2.27), libdbus-1-3 (>= 1.9.14), libgcc1 (>= 1:4.2), libnotify-bin, libstdc++6 (>= 5), libwxgtk3.0-gtk3-0v5 (>= 3.0.4+dfsg) | libwxgtk3.2-1, libxkbcommon0 (>= 0.5.0), systemd, wl-clipboard"
-# TODO: once this issue [1] is fixed, we should create a variant for
-# wayland to automatically run the setcap script.
-# [1]: https://github.com/mmstick/cargo-deb/issues/151
+depends = "$auto"
 
 [package.metadata.generate-rpm]
 assets = [


Test patch: