naqvis / webview

Crystal bindings to Webview library
MIT License
94 stars 8 forks source link

Failed postinstall of webview on make #3

Closed paulocoghi closed 2 years ago

paulocoghi commented 2 years ago

When running shards install, this error is being returned:

Failed postinstall of webview on make:
g++ -c -o ext/webview.o -DWEBVIEW_GTK=1 `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -std=c++11 ext/webview.cc
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'webkit2gtk-4.0' found
In file included from ext/webview.cc:2:
ext/webview.h:418:10: fatal error: JavaScriptCore/JavaScript.h: No such file or directory
  418 | #include <JavaScriptCore/JavaScript.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:23: ext/webview.o] Error 1

Details Crystal 1.2.2 [6529d725a] (2021-11-10) Ubuntu 20.04 64bit libwebkit2gtk-4.0-37 (which provides webkit2gtk 2.34.1) installed

Edit libjavascriptcoregtk-4.0-18 is also installed, from the beginning

Important On Ubuntu 20.04, the package libwebkit2gtk-4.0 doesn't exists anymore, and was replaced by libwebkit2gtk-4.0-37

paulocoghi commented 2 years ago

Update

After installing libgtk-3-dev, the error is now smaller, but shards install still failing:

 Resolving dependencies
Fetching https://github.com/naqvis/webview.git
Installing webview (0.1.4)
Postinstall of webview: make
Failed postinstall of webview on make:
g++ -c -o ext/webview.o -DWEBVIEW_GTK=1 `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -std=c++11 ext/webview.cc
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'webkit2gtk-4.0' found
In file included from ext/webview.cc:2:
ext/webview.h:418:10: fatal error: JavaScriptCore/JavaScript.h: No such file or directory
  418 | #include <JavaScriptCore/JavaScript.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:23: ext/webview.o] Error 1
naqvis commented 2 years ago

in the output it shows No package 'webkit2gtk-4.0' found . So please ensure that you have webkit2gtk package is installed and pkg-config is able to find it.

paulocoghi commented 2 years ago

I though installing the latest non-dev version of webkit2gtk-4.0 (libwebkit2gtk-4.0-37 in my case) was enough, but it wasn't.

After installing libwebkit2gtk-4.0-dev everything goes fine.

Sorry for my mistakes.