Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to install webkit #13

Open
hoyeunglee opened this issue Oct 5, 2015 · 11 comments
Open

failed to install webkit #13

hoyeunglee opened this issue Oct 5, 2015 · 11 comments

Comments

@hoyeunglee
Copy link

martin@ubuntu:~/mal$ cabal install webkit
Resolving dependencies...
[1 of 2] Compiling SetupWrapper ( /tmp/webkit-0.14.1.0-4509/webkit-0.14.1.0/SetupWrapper.hs, /tmp/webkit-0.14.1.0-4509/webkit-0.14.1.0/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /tmp/webkit-0.14.1.0-4509/webkit-0.14.1.0/dist/setup/setup.hs, /tmp/webkit-0.14.1.0-4509/webkit-0.14.1.0/dist/setup/Main.o )
Linking /tmp/webkit-0.14.1.0-4509/webkit-0.14.1.0/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring webkit-0.14.1.0...

setup: The pkg-config package 'webkit-1.0' version >=1.8 is required but it
could not be found.
Failed to install webkit-0.14.1.0
cabal: Error: some packages failed to install:
webkit-0.14.1.0 failed during the configure step. The exception was:
ExitFailure 1

@erikkaplun
Copy link

I have the same issue. @LovelyYanki have you been able to solve it so far?

@hamishmack
Copy link
Contributor

The pkg-config package 'webkit-1.0' version >=1.8 is required but it could not be found.

This normally means the required C libraries and header files have not been install.

On ubuntu you need to run sudo apt-get install libwebkitgtk-dev or for the webkitgtk3 cabal package first run sudo apt-get install libwebkitgtk-3.0-dev.

@erikkaplun
Copy link

any help on OS X though? it seems non-trivial to install Webkit on OS X — are there libraries to just "bind" it to e.g. Safari?

@hamishmack
Copy link
Contributor

Here is how I currently install webkitgtk on OS X. Safari is not webkitgtk based so I don't think you can bind to it.

@erikkaplun
Copy link

oh, thanks, that's very useful — hopefully it'll work nicely in an environment where Homebrew is normally used.

@erikkaplun
Copy link

Turns out the problem with the MacPorts based installation is that the webkit-gtk3 port there depends on a newer version of libiconv, which, if installed, will cause the rest of my Haskell project to fail to build. So I found myself in a constant need to port -f deactivate and port activate the port.

Then, I discovered that webkitgtk has appeared in Homebrew just some hours ago. So I installed it.

After realizing that it lacks a .pc file, I manually added one, according to what I saw in MacPorts and the webkitgtk-2.10.4 source tarball. So now I have:

$ cat /usr/local/lib/pkgconfig/webkitgtk-3.0.pc 
prefix=/usr/local/Cellar/webkitgtk/2.10.4
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: WebKit
Description: Web content engine for GTK+
Version: 2.10.4
Requires: glib-2.0 gtk+-3.0 libsoup-2.4 javascriptcoregtk-4.0
Libs: -L${libdir} -lwebkitgtk-3.0
Cflags: -I${includedir}/webkitgtk-3.0

also, pkg-config seems to find webkitgtk-3.0 just like it did with the MacPorts installed one:

$ pkg-config --cflags webkitgtk-3.0
-D_REENTRANT -I/usr/local/Cellar/webkitgtk/2.10.4/include/webkitgtk-3.0 -I/usr/local/Cellar/gtk+3/3.18.6/include/gtk-3.0 -I/usr/local/Cellar/glib/2.46.2/include/gio-unix-2.0/ -I/usr/local/Cellar/cairo/1.14.4/include/cairo -I/usr/local/Cellar/libepoxy/1.3.1/include -I/usr/local/Cellar/pango/1.38.1/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/1.1.2/include/harfbuzz -I/usr/local/Cellar/pango/1.38.1/include/pango-1.0 -I/usr/local/Cellar/atk/2.18.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.14.4/include/cairo -I/usr/local/Cellar/pixman/0.32.8/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.11.1/include -I/usr/local/Cellar/freetype/2.5.3_1/include/freetype2 -I/usr/local/Cellar/freetype/2.6_1/include/freetype2 -I/usr/local/Cellar/libpng/1.6.19/include/libpng16 -I/usr/local/Cellar/gdk-pixbuf/2.32.2/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libpng/1.6.19/include/libpng16 -I/usr/local/Cellar/libsoup/2.52.2/include/libsoup-2.4 -I/usr/local/Cellar/webkitgtk/2.10.4/include/webkitgtk-4.0 -I/usr/local/Cellar/glib/2.46.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/include/libxml2

however, when building my project, which depends on the webkitgtk3 Cabal package, I get:

Progress: 115/125
--  While building package webkitgtk3-0.14.1.0 using:
      /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack73207/webkitgtk3-0.14.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0 configure --with-ghc=/usr/local/bin/ghc --with-ghc-pkg=/usr/local/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/Users/erik/.stack/snapshots/x86_64-osx/ghc-7.10.2/7.10.2/pkgdb --package-db=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/pkgdb --libdir=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/lib --bindir=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/bin --datadir=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/share --libexecdir=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/libexec --sysconfdir=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/etc --docdir=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/doc/webkitgtk3-0.14.1.0 --htmldir=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/doc/webkitgtk3-0.14.1.0 --haddockdir=/Users/erik/code/haskell/Foo/.stack-work/install/x86_64-osx/ghc-7.10.2/7.10.2/doc/webkitgtk3-0.14.1.0 --dependency=base=base-4.8.1.0-075aa0db10075facc5aaa59a7991ca2f --dependency=bytestring=bytestring-0.10.6.0-6e8453cb70b477776f26900f41a5e17a --dependency=cairo=cairo-0.13.1.0-dc5db72a34e2ccac2380d11072c69331 --dependency=glib=glib-0.13.2.1-13eec5eff085ca8806ecd926832e1d5a --dependency=gtk3=gtk3-0.14.1-0d239c2f6de9f0cac2da5654aa671d4e --dependency=mtl=mtl-2.2.1-5cf332b11edb88a6040af20fd6a58acb --dependency=pango=pango-0.13.1.0-61ed32c7f0e8d6401239b24558127655 --dependency=text=text-1.2.1.3-2395ef415c1b20175aae83b50060e389 --dependency=transformers=transformers-0.4.2.0-21dcbf13c43f5d8cf6a1f54dee6c5bff
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/erik/code/haskell/Foo/.stack-work/logs/webkitgtk3-0.14.1.0.log

    [1 of 2] Compiling SetupWrapper     ( SetupWrapper.hs, /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack73207/webkitgtk3-0.14.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup/SetupWrapper.o )
    [2 of 2] Compiling Main             ( /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack73207/webkitgtk3-0.14.1.0/Setup.hs, /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack73207/webkitgtk3-0.14.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup/Main.o )
    Linking /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack73207/webkitgtk3-0.14.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup/setup ...
    [1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
    [2 of 2] Compiling Main             ( SetupMain.hs, dist/setup-wrapper/Main.o )
    Linking dist/setup-wrapper/setup ...
    Configuring webkitgtk3-0.14.1.0...
    setup: Missing dependency on a foreign library:
    * Missing C library: webkitgtk-3.0
    This problem can usually be solved by installing the system package that
    provides this library (you may need the "-dev" version). If the library is
    already installed but in a non-standard location then you can use the flags
    --extra-include-dirs= and --extra-lib-dirs= to specify where it is.

Any ideas whatsoever? Does the homebrew formula actually not build a suitable webkitgtk-3.0 library? It appears the versions in the 2.10.4 Homebrew formula are newer than the in the 2.4.9 MacPorts port — might that make a difference?

@erikkaplun
Copy link

OK, so turns out the webkitgtk-3.0.pc file I placed there needed to be updated to contain this instead:

...
Libs: -L${libdir} -lwebkit2gtk-4.0
Cflags: -I${includedir}/webkitgtk-4.0

...which is according to the webkitgtk*.pc.in file in the webkitgtk source tarball. However — I now get this:

--  While building package webkitgtk3-0.14.1.0 using:
      /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack90352/webkitgtk3-0.14.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/erik/code/haskell/Foo/.stack-work/logs/webkitgtk3-0.14.1.0.log

    [1 of 2] Compiling SetupWrapper     ( SetupWrapper.hs, /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack90352/webkitgtk3-0.14.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup/SetupWrapper.o )
    [2 of 2] Compiling Main             ( /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack90352/webkitgtk3-0.14.1.0/Setup.hs, /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack90352/webkitgtk3-0.14.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup/Main.o )
    Linking /private/var/folders/6t/1w8bgc395xz4k1n_85r2wjz00000gn/T/stack90352/webkitgtk3-0.14.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup/setup ...
    [1 of 2] Compiling Gtk2HsSetup      ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
    [2 of 2] Compiling Main             ( SetupMain.hs, dist/setup-wrapper/Main.o )
    Linking dist/setup-wrapper/setup ...
    Configuring webkitgtk3-0.14.1.0...
    Building webkitgtk3-0.14.1.0...
    Preprocessing library webkitgtk3-0.14.1.0...
    ./hswebkit.h:34:10: fatal error: 'webkit/webkitdom.h' file not found
    #include <webkit/webkitdom.h>
             ^
    1 error generated.
    gtk2hsC2hs: Error during preprocessing

— and on closer inspection, it's true htat webkit/webkitdom.h is not found because there's only this one:

/usr/local/Cellar/webkitgtk/2.10.4/include/webkitgtk-4.0/webkitdom/webkitdom.h

Again, any ideas? If we could fix this, webkitgtk3 be installed on OS X without any ugly package hackery.

@erikkaplun
Copy link

If I symlink the webkitdom directory to webkit, the webkitdom.h file is found, but as I suspected, the incompatibility goes deeper (probably because 4.0 is just too different from the 3.0 webkitgtk3 is expecting — right?):

    Preprocessing library webkitgtk3-0.14.1.0...
    In file included from ./hswebkit.h:37:
    cbits/events.h:2:10: fatal error: 'webkit/webkitversion.h' file not found
    #include <webkit/webkitversion.h>
             ^
    1 error generated.
    gtk2hsC2hs: Error during preprocessing

— does ths mean the webkitgtk version (2.10.4) in Homebrew is too new for this Cabal package?

@erikkaplun
Copy link

I checked and it seems webkitgtk-2.4.9 is the last ever version to contain any reference whatsoever to webkitversion.h — does this mean anything > 2.4.* is not suitable for cabal install webkitgtk3?

@erikkaplun
Copy link

There is now an open pull request for adding the webkitgtk-2.4.9 formula in homebrew/versions, if anyone is interested.

It compiles functionally equivalently to the MacPorts port it was based on.

https://github.com/Homebrew/homebrew-versions/pull/1077

I would also love it if anyone more deeply involved with how webkitgtk works, to take a look at the formula and perhaps offer some constructive criticism in the form of GitHub commit review, or even new commits!

Also, regarding #7 — if someone could offer some insight into how to migrate the webkitgtk3 Cabal package to webkitgtk-2.10.4 (or anything newer than 2.4.9), I'd be very curious.

@rodneyrod
Copy link

Getting this issue in Arch Linux too, is there any workaround to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants