简体   繁体   中英

Problems installing the cairo backend for ghc haskell using cabal

I have had some problems installing the cairo backend for ghc using cabal on my mac running os x 10.9. It seems like the cairo-pdf package is missing from pkg-config. I have tried reinstalling pkg-config using homebrew but it does not seem to change anything. The output from cabal is as follows:

andylawrence$ cabal install Cairo
Resolving dependencies...
[1 of 2] Compiling SetupWrapper     ( /var/folders/cb/1j0fjp2n4x12b8tfg2cz64vm0000gn/T/cairo-0.12.4-98407/cairo-0.12.4/SetupWrapper.hs, /var/folders/cb/1j0fjp2n4x12b8tfg2cz64vm0000gn/T/cairo-0.12.4-98407/cairo-0.12.4/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main             ( /var/folders/cb/1j0fjp2n4x12b8tfg2cz64vm0000gn/T/cairo-0.12.4-98407/cairo-0.12.4/Setup.hs, /var/folders/cb/1j0fjp2n4x12b8tfg2cz64vm0000gn/T/cairo-0.12.4-98407/cairo-0.12.4/dist/setup/Main.o )
Linking /var/folders/cb/1j0fjp2n4x12b8tfg2cz64vm0000gn/T/cairo-0.12.4-98407/cairo-0.12.4/dist/setup/setup ...

Gtk2HsSetup.hs:107:59:
     warning: missing terminating ' character [-Winvalid-pp-token]
        -- If there are several .dll files matching the one we're after then we
                                                              ^

Gtk2HsSetup.hs:145:50:
     warning: missing terminating ' character [-Winvalid-pp-token]
             -> RegisterFlags -- ^Install in the user's database?; verbose
                                                     ^

Gtk2HsSetup.hs:210:41:
     warning: missing terminating ' character [-Winvalid-pp-token]
      -- have the header file name if we don't have the precompiled header yet
                                            ^

Gtk2HsSetup.hs:249:40:
     warning: missing terminating ' character [-Winvalid-pp-token]
      mFiles <- mapM (findFileWithExtension' ["chi"] [buildDir lbi] . toFilePath)
                                           ^

Gtk2HsSetup.hs:293:28:
     warning: missing terminating ' character [-Winvalid-pp-token]
                     , let name' = filter isAlpha (display name)
                               ^

Gtk2HsSetup.hs:294:31:
     warning: missing terminating ' character [-Winvalid-pp-token]
                     , tag <- name'
                                  ^

Gtk2HsSetup.hs:295:33:
     warning: missing terminating ' character [-Winvalid-pp-token]
                            : [ name' ++ "-" ++ show major ++ "." ++ show digit
                                    ^
7 warnings generated.
[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 cairo-0.12.4...

/var/folders/cb/1j0fjp2n4x12b8tfg2cz64vm0000gn/T/98471.c:1:12:
     warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
           ^
1 warning generated.
setup: The pkg-config package cairo-pdf is required but it could not be found.
Failed to install cairo-0.12.4
cabal: Error: some packages failed to install:
cairo-0.12.4 failed during the configure step. The exception was:
ExitFailure 1

Any help would be greatly appreciated.

pkg-config is just a tool which tells you if a native (ie non-Haskell) package is installed (and what its configuration is, for compilation purposes). You need to install cairo-pdf (which may be a separate package, or it may be an option that needs to be enabled when building the native cairo, I'm not sure. Or it may simply be that you don't have the native cairo installed at all).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM