希望主机资源占用比较小,节约点RMB,所以在Ubuntu上进行了测试。(我使用了一个精简的Ubuntu,最终还是成功的运行)
按照wails doctor的提示安装npm,pkg-config,libgtk-3-dev,但卡在了libwebkit。注意:在中文文档中并没有如下提示:
Linux requires the standard gcc build tools plus libgtk3 and libwebkit. Rather than list a ton of commands for different distros, Wails can try to determine what the installation commands are for your specific distribution. Run wails doctor after installation to be shown how to install the dependencies. If your distro/package manager is not supported, please consult the Add Linux Distro guide.
Note:
If you are using latest Linux version (example: Ubuntu 24.04) and it is not supporting libwebkit2gtk-4.0-dev, then you might encounter an issue in wails doctor: libwebkit not found. To resolve this issue you can install libwebkit2gtk-4.1-dev and during your build use the tag -tags webkit2_41.
主要是Note后面的:如果使用最新版linux,不支持libwebkit2gtk-4.0-dev,则可以安装libwebkit2gtk-4.1-dev,并且在 wails dev 时使用 -tags webkit2_41
反复安装webkit未果,解决办法其实官方还是说到了。
这件事说明:看文档还是要看原版的。(居然中文文档就直接舍去了一些有价值的东西)