George
George

Reputation: 2801

Weird haskell stack build exit failure: cairo requires cairo?

While experimenting with Haskell using the Stack Tool to build a gtk+ gui by enhancing the Main.hs code from the new-template as follows:

module Lib
    ( someFunc
    ) where

import Control.Monad
import Control.Monad.IO.Class
import Data.IORef
import Graphics.UI.Gtk hiding (Action, backspace)

someFunc :: IO ()
someFunc = do
    void initGUI
    window <- windowNew

    widgetShowAll window
    mainGUI

I am encountering the following weird error in which the target seems to be searching for a later version of itself:

>stack build

glib-0.13.6.0: configure
cairo-0.13.5.0: configure
Progress 2/6

--  While building package cairo-0.13.5.0 using:
      /tmp/stack3691/cairo-0.13.5.0/.stack-work/dist/x86_64-linux/Cabal-2.2.0.1/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-2.2.0.1 configure --with-ghc=/home/gd/.stack/programs/x86_64-linux/ghc-8.4.4/bin/ghc --with-ghc-pkg=/home/gd/.stack/programs/x86_64-linux/ghc-8.4.4/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/pkgdb --libdir=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/lib --bindir=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/bin --datadir=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/share --libexecdir=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/libexec --sysconfdir=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/etc --docdir=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/doc/cairo-0.13.5.0 --htmldir=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/doc/cairo-0.13.5.0 --haddockdir=/home/gd/.stack/snapshots/x86_64-linux/lts-12.19/8.4.4/doc/cairo-0.13.5.0 --dependency=Cabal=Cabal-2.2.0.1 --dependency=array=array-0.5.2.0 --dependency=base=base-4.11.1.0 --dependency=bytestring=bytestring-0.10.8.2 --dependency=gtk2hs-buildtools=gtk2hs-buildtools-0.13.4.0-DsVNfQpDbxJKtQSA2HZlGY --dependency=mtl=mtl-2.2.2 --dependency=text=text-1.2.3.1 --dependency=utf8-string=utf8-string-1.0.1.1-LRSjvSC6FZkKPp48Qszoj8
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/gd/Projects/hgtk/.stack-work/logs/cairo-0.13.5.0.log

    [1 of 2] Compiling Main             ( /tmp/stack3691/cairo-0.13.5.0/Setup.hs, /tmp/stack3691/cairo-0.13.5.0/.stack-work/dist/x86_64-linux/Cabal-2.2.0.1/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /home/gd/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack3691/cairo-0.13.5.0/.stack-work/dist/x86_64-linux/Cabal-2.2.0.1/setup/StackSetupShim.o )
    Linking /tmp/stack3691/cairo-0.13.5.0/.stack-work/dist/x86_64-linux/Cabal-2.2.0.1/setup/setup ...
    Configuring cairo-0.13.5.0...
    setup: The pkg-config package 'cairo' version >=1.2.0 is required but it could
    not be found.

Thanks in advance for any assistance.

Upvotes: 0

Views: 160

Answers (1)

Uli Schlachter
Uli Schlachter

Reputation: 9867

cairo-0.13.5.0 seems to be the haskell bindings to the cairo C library (just a guess). The cairo C library's current version is 1.16 and it is "beyond 1.0" for years already. So yes, indeed, cairo requires cairo. But this is "haskell cairo bindings requires cairo C library".

Upvotes: 1

Related Questions