Installing svgcairo on windows - haskell

I have managed to install cairo, but when I run cabal install svgcairo I get the following error:
setup.exe: The pkg-config package librsvg-2.0 version >=2.16.0 is required but it could not be found.
I'm on windows 8 x64, with cabal version 1.16.02 and ghc 7.6.3.

You need to install librsvg in a location that ghc can find first. Check out http://librsvg.sourceforge.net/download/ for downloads, but you might have to build it from source yourself, which is beyond the scope of this answer. Then just make sure that wherever you've installed the library is on your path and that pkg-config can find it, and you should be good to go.

Related

Cant install glib on Windows when trying to install gtk3 using cabal

I have been trying to install gtk3 with cabal, following instructions on https://wiki.haskell.org/Gtk2Hs/Installation , with the exception I have replace gtk with gtk3, I downloaded the all in one bundle of gtk 3.6.4 (from: http://www.tarnyko.net/dl/gtk.htm) unzip it and added the location_of_files/bin to my path, running pkg-config --cflags gtk+-3.0 works ok, cabal install gtk2hs-buildtools correctly installs, but cabal install gtk3 stops with:
Resolving dependencies...
Configuring glib-0.13.4.1...
Failed to install glib-0.13.4.1
Build log ( C:\Users\User\AppData\Roaming\cabal\logs\glib-0.13.4.1.log ):
cabal: Entering directory 'C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1'
[1 of 1] Compiling Main ( C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1\dist\setup\setup.hs, C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1\dist\setup\Main.o )
Linking C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1\dist\setup\setup.exe ...
Configuring glib-0.13.4.1...
setup.exe: Missing dependency on a foreign library:
* Missing C library: intl
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.
cabal: Leaving directory 'C:\Users\User\AppData\Local\Temp\cabal-tmp-6472\glib-0.13.4.1'
And the gtk bundle I download have a libintl.h file in the include folder and a dll in the bin folder, I tried placing the files in almost every location I could think of but to no avail, i can’t think of anything else.
More details: I am running windows 7 x64 with haskell-platform 8.0.2 x64, and I really need this to work under windows for a project I am working.
I manage to install gtk by following the instruction in https://www.gtk.org/download/windows.php, installing MSYS2 and using pacman to install gtk library, ignoring only step 4. After installing the libraries I added to my path C:\msys64\mingw64\bin, and cabal finally compiled gtk3.
I did not like this solution cause it is one more mingw installation on my pc.

Haskell cabal install wx: missing C library wx_gtk2u_webview-3.0

I am trying to install wx by cabal install wx
Configuring wxc to build against wxWidgets 3.0
setup: Missing dependency on a foreign library:
* Missing C library: wx_gtk2u_webview-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.
cabal: Error: some packages failed to install :
wx-0.92.0.0 depends on wxc-0.92.0.0 which failed to install.
wxc-0.92.0.0 failed during the configure step. The exception was:
ExitFailure 1
wxcore-0.92.0.0 depends on wxc-0.92.0.0 which failed to install.
but I have following files in /usr/lib :
/usr/lib/libwx_gtk2u_webview-3.0.so
/usr/lib/libwx_gtk2u_webview-3.0.so.0
/usr/lib/libwx_gtk2u_webview-3.0.so.0.2.0
I have also tried cabal install --extra-lib-dirs=/usr/lib/ wx but to no avail.
I have also tried all the suggestions in cabal install wx Missing C library
I am on archlinux and I have both wxgtk-3.0 and wxgtk-2.8 multilib and normal versions. I also tried reinstalling them.
I just ran into the same problem on Arch; when I tried running cabal with --verbose=3, it looked like libwx_gtk2u_webview-3.0 was present, but it was complaining about libwebkitgtk-1.0 being missing. After I installed the webkitgtk2 package, which provides libwebkitgtk-1.0, wxHaskell installed with no problems.
Try "sudo apt-get install libwxgtk-webview3.0-dev". It worked for me.

Fedora - Reinstalling GMP with C++ support

I'm trying to install a library that uses gmp and am running the ./configure on it.
So far, I've gotten past several snags, such as requiring gcc, g++, and m4 by using:
yum install gcc
yum install gcc-g++
yum install m4
Now I'm getting this error:
checking for the GMP library version 4.1.3 or above... no
configure: error: Cannot find GMP version 4.1.3 or higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++ interface:
add --enable-cxx to the configuration options.
As such, I tried both installing and updating gmp using yum:
yum install gmp
yum update gmp
Install tells me it's already installed and is v. 5.1.2
Updating says there's nothing to update.
I went to the gmp site and it is currently v. 6.0.0
I downloaded it and ran configure (using --enable-cxx), make, and make install.
Yet, nothing has changed. It still says I have v. 5.1.2 and the configure for the library still says it can't find 4.1.3 and above / try enabling c++.
The gmp files (such as gmp.h) are being placed in /usr/local/lib and /include
I've been at this for hours without any progress. I'm rather new to linux so I imagine there's something I just don't know about.
Am I not installing 6.0.0 correctly to overwrite the already installed one?
Or is there a way to reinstall the original with the c++ option?
Any help would be appreciated. Thanks.
dnf install gmp-devel resolved this for me on rhel
When you manually install something, as you have, it doesn't get installed in the normal /usr/lib directory and therefore it doesn't overwrite it. This is a good thing. In general, you shouldn't mess with files installed by the package manager. (Except in the case that they are config files that are meant to be edited.)
When you install manually, it is installed to /usr/local/lib. Fortunately, GCC and other compilers don't care which directory something is installed in, they will find it (when it's in standard places like /usr/* or /usr/local/*).
Just include the C++ header and add the correct -l library flag.
I figured it out.
Under the --help section of the ./configure for the library I was trying to install, there was actually a feature just for this:
--with-gmp-include=DIR
--with-gmp-lib=DIR
Using these, I was able to get it to install.
Thanks for the help.
I think I was too focused on trying to update the system install of gmp.

Cabal can't determine GHC version

I am currently trying to update Cabal (1.14.0, cabal-install at version 0.14.0) by doing
cabal install cabal-install
However, this gives me an ExitFailure1 with the error
setup: The program ghc version >=6.4 is required but the
version of /usr/bin/ghc could not be determined.
But I'm definitely running a version of GHC that is greater than that.
$ /usr/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2
It might be important that I'm on OSX 10.8 and that I installed Haskell through the Haskell Platform download for Mac.
Does anyone have advice on how to fix or work around this issue? I haven't been able to find any documentation on this problem.
Since you're on a Mac, why not try installing the excellent Homebrew package manager? Add /usr/local/bin to your PATH, and then it's just brew install cabal-install.
You can even brew install ghc haskell-platform.
To upgrade the package list, use brew upgrade, then you can see what needs updating with brew outdated and update them with brew update.
Of course, you can name individual packages to update also, and specify versions of packages. Homebrew keeps the "recipes" (Ruby scripts) for package management in its own git repository (by default in /usr/local).
Then you can get on with what you really wanted to do in the first place...write some code! (or build, in your case)

How to upgrade gtk2hsC2hs?

I am trying cabal install glib-0.12.3 under my Ubuntu 11.10 using cabal-install 0.10.2. However, it shows the following error messages:
setup: The program gtk2hsC2hs version >=0.13.5 is required but the version
found at /usr/bin/gtk2hsC2hs is version 0.13.4
cabal: Error: some packages failed to install:
glib-0.12.3 failed during the configure step. The exception was:
ExitFailure 1
After half an hour's search, I cannot find where this gtk2hsC2hs is. I dug into places like http://code.haskell.org/gtk2hs/tools/c2hs/, but could not seem to find the right version.
How could I upgrade my gtk2hsC2hs? Thanks!
It's part of the gtk2hs-buildtools package.
$ cabal install gtk2hs-buildtools
(maybe with the --global flag, depends on how you want to install packages in general) should provide you with the newest version that should be able to build the latest gtk2hs packages.
Since the old gtk2hsC2hs is in /usr/bin, make sure that the new one is either installed there (replacing the old) or in a directory appearing before /usr/bin in your $PATH. A default cabal install installs executables (on Linux) in $HOME/.cabal/bin, so it would be a good idea to have that the first directory in the $PATH.

Resources