Open benitogf opened 2 months ago
I had a quick peek and as you say, the packages for libwebkit2gtk-4.0 are unavailable for Ubuntu 24.04. Also, packages for libwebkit2gtk-4.1 are unavailable for Ubuntu 20.04.
If we change this line in webview.go
:
-#cgo linux openbsd freebsd netbsd pkg-config: gtk+-3.0 webkit2gtk-4.0
+#cgo linux openbsd freebsd netbsd pkg-config: gtk+-3.0 webkit2gtk-4.1
Then the Go package can't work on Ubuntu 20.04.
So it seems like we need to do this:
-#cgo linux openbsd freebsd netbsd pkg-config: gtk+-3.0 webkit2gtk-4.0
+#cgo linux openbsd freebsd netbsd pkg-config: gtk+-3.0
Or remove the whole line.
But that would break the normal Go workflow.
We would need to inform users on how to make this work by setting variables for "cgo" (CGO_CFLAGS
, CGO_CXXFLAGS
, CGO_LDFLAGS
, CGO_ENABLED
), or I imagine we would need to dynamically choose which webkit2gtk library to use.
If there's another, better way then I would love to learn more about it. Otherwise, I'm not sure how to make this work seamlessly for Go.
Maybe it isn't possible to make it seamless but I would love to be proven wrong.
Ideas as more than welcome.
I don't have an issue setting env vars, how would that work?
20.04 eol is april 2025, maybe we can make a branch with this change to support 24.04 until then?
webkit2gtk-4.1 is available for 20.04 LTS is as well. One option is to specify webkit2gtk-4.1 as a dependency through the installer of the application (example: https://www.debian.org/doc/debian-policy/ch-relationships.html )
@nimeshnsat Can you please explain how you determined that webkit2gtk-4.1 is available for Ubuntu 20.04?
My bad 😢 . Apperently, I've upgraded my 20.04 LTS to 22.04 LTS sometime back. So technically I'm on 22.04.1 now.
Today I've created a VM with 20.04 and tested from the scratch. I can confirm it doesn't support 4.1
Trace from my 22.04 (seems like it is available under security updates)
# uname -a
Linux ubuntu-20 6.5.0-28-generic #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 4 14:39:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
# sudo apt search libwebkit2gtk-4.1
Sorting... Done
Full Text Search... Done
libwebkit2gtk-4.1-0/jammy-updates,jammy-security,now 2.44.0-0ubuntu0.22.04.1 amd64 [installed]
Web content engine library for GTK
libwebkit2gtk-4.1-dev/jammy-updates,jammy-security,now 2.44.0-0ubuntu0.22.04.1 amd64 [installed]
Web content engine library for GTK - development files
All right, thanks!
I tried running on ubuntu 24.04 and the binary fails to find the libraries
think 24.04 uses a different version