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/Dockerfile b/.github/scripts/Dockerfile
similarity index 91%
rename from .github/scripts/ubuntu/Dockerfile
rename to .github/scripts/Dockerfile
index 68f283f3..bf6a5c80 100644
--- a/.github/scripts/ubuntu/Dockerfile
+++ b/.github/scripts/Dockerfile
@@ -1,9 +1,10 @@
-FROM ubuntu:18.04
+FROM ubuntu:24.04
 
 RUN apt-get update \
-    && apt-get install -y libssl-dev \
-    libxdo-dev libxtst-dev libx11-dev \
-    libxkbcommon-dev libwxgtk3.0-gtk3-dev libdbus-1-dev \
+    && apt-get install -y \
+    libx11-dev libxtst-dev libxkbcommon-dev libdbus-1-dev libwxgtk3.2-dev \
+    libssl-dev \
+    libxdo-dev \
     wget git file build-essential pkg-config
 
 ENV RUSTUP_HOME=/usr/local/rustup \
diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml
index 322de872..c95b608d 100644
--- a/.github/workflows/dev-release.yml
+++ b/.github/workflows/dev-release.yml
@@ -83,10 +83,10 @@ jobs:
           echo Using version ${{ needs.extract-version.outputs.espanso_version }}
       - name: Build docker image
         run: |
-          sudo docker build -t espanso-ubuntu . -f .github/scripts/ubuntu/Dockerfile
+          sudo docker build -t espanso-ubuntu . -f .github/scripts/Dockerfile
       - name: Build AppImage
         run: |
-          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/ubuntu/build_appimage.sh
+          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/build_appimage.sh
       - uses: actions/upload-artifact@v4
         name: "Upload artifacts"
         with:
@@ -106,10 +106,10 @@ jobs:
           echo Using version ${{ needs.extract-version.outputs.espanso_version }}
       - name: Build docker image
         run: |
-          sudo docker build -t espanso-ubuntu . -f .github/scripts/ubuntu/Dockerfile
+          sudo docker build -t espanso-ubuntu . -f .github/scripts/Dockerfile
       - name: Build Deb packages
         run: |
-          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/ubuntu/build_deb.sh
+          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/build_deb.sh
       - uses: actions/upload-artifact@v4
         name: "Upload artifacts"
         with:
diff --git a/.github/workflows/prod-release.yml b/.github/workflows/prod-release.yml
index 64ab923a..7e638f57 100644
--- a/.github/workflows/prod-release.yml
+++ b/.github/workflows/prod-release.yml
@@ -120,10 +120,10 @@ jobs:
           echo Using version ${{ needs.extract-version.outputs.espanso_version }}
       - name: Build docker image
         run: |
-          sudo docker build -t espanso-ubuntu . -f .github/scripts/ubuntu/Dockerfile
+          sudo docker build -t espanso-ubuntu . -f .github/scripts/Dockerfile
       - name: Build AppImage
         run: |
-          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/ubuntu/build_appimage.sh
+          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/build_appimage.sh
       - uses: actions/upload-artifact@v4
         name: "Upload artifacts"
         with:
@@ -148,10 +148,10 @@ jobs:
           echo Using version ${{ needs.extract-version.outputs.espanso_version }}
       - name: Build docker image
         run: |
-          sudo docker build -t espanso-ubuntu . -f .github/scripts/ubuntu/Dockerfile
+          sudo docker build -t espanso-ubuntu . -f .github/scripts/Dockerfile
       - name: Build Deb packages
         run: |
-          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/ubuntu/build_deb.sh
+          sudo docker run --rm -v "$(pwd):/shared" espanso-ubuntu espanso/.github/scripts/build_deb.sh
       - uses: actions/upload-artifact@v4
         name: "Upload artifacts"
         with:


Test patch: