cabal

Is there any way to define flags for cabal dependencies?

Deadly 提交于 2019-11-29 16:02:48
问题 I recently ran into a Cabal issue that I only managed to solve by manually installing transformers-compat with the -f transformers3 flag in my cabal sandbox before running cabal install for my project. Is there any way to indicate in my application's .cabal file that I depend on a library so that it is built with the specific build flag? 回答1: One way to do this is to use Stack. Edit your stack.yaml to include flags: transformers-compat: transformers3: true See also the section on flags. 回答2:

Installing Haskell on Windows, cabal config

孤者浪人 提交于 2019-11-29 15:23:13
I'm installing Haskell on Windows based on the instructions at https://www.haskell.org/platform/ and looking at step 3, it says, Modify your cabal config file (you can verify the location by running "cabal user-config init") to contain the following lines: extra-prog-path: C:\Program Files\Haskell Platform\8.0.2\msys\usr\bin extra-lib-dirs: C:\Program Files\Haskell Platform\8.0.2\mingw\lib extra-include-dirs: C:\Program Files\Haskell Platform\8.0.2\mingw\include But the auto generated config file contains e.g. extra-prog-path: C:\Users\w\AppData\Roaming\cabal\bin So that's a different value

Cabal error: invalid preprocessing directive #-}

♀尐吖头ヾ 提交于 2019-11-29 14:36:43
$ cabal install arithmoi-0.4.0.3 results in multiple errors like: Math/NumberTheory/Moduli.hs:489:4: error: invalid preprocessing directive #-} ^ My System: OSX Mavericks Cabal version = 1.18.1.1 GHCI version = 7.6.3 Thanks in advance! Possible workaround here . xCode 5 comes with clang as c/c++/obj-c compiler. Haskell Platform is not ready for that. The next ghc release will fix that. Also see here . 来源: https://stackoverflow.com/questions/19597324/cabal-error-invalid-preprocessing-directive

Mountain Lion X11 libraries can't ./configure

六月ゝ 毕业季﹏ 提交于 2019-11-29 10:37:01
I'm trying to build xmonad in Mountain Lion to run with Xquartz 2.7.2, tutorial found here . I'm using cabal to get required X11 libraries cabal install X11-1.5.0.1 . That didn't work, so I got the tar and tried building it with ghc, same error. It won't configure: Resolving dependencies... Configuring X11-1.5.0.1... configure: WARNING: unrecognized options: --with-compiler, --with-gcc checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... no

What's the reason behind cabal (dependency) hell?

[亡魂溺海] 提交于 2019-11-29 10:06:48
How does dependency hell happen in Cabal-install? I read the following at Cabal/Survival - HaskellWiki : 1. What is the difficulty caused by Cabal-install? The main difficulty with Cabal is otherwise known as 'dependency hell', in which the cabal-install does not manage to install a desired package for a reason or another, leading to large amount of manual work. As an example of this difficulty, consider a case where the user wishes to install packages A and B. Both of these work with package C, but not with the same version of C. I understand why this would make sense generally, but not with

Using cabal with multiple GHC versions

南笙酒味 提交于 2019-11-29 09:14:06
I got both ghc6 and ghc7 on my desktop. To install new packages (for the specific ghc version), I use cabal with the flag --with-compiler=<ghc-dir> to specify for which ghc i want the package installed. I do cabal update before installing any new package. But how to I specify for which ghc I want the update? I mean, there is no --with-compiler flag as with cabal install . I would think that just like I use ghc-pkg7 for ghc7, there would be cabal7 . Apart from the cabal install command which I know to which ghc version it is applying, I don't know which ghc is affected with the other cabal

Can't install cairo with cabal on Windows - how to get pkg-config on win?

我的未来我决定 提交于 2019-11-29 07:22:01
Configuring cairo-0.12.0... setup.exe: The program pkg-config version >=0.9.0 is required but it could not be found. cabal: Error: some packages failed to install: cairo-0.12.0 failed during the configure step. The exception was: ExitFailure 1 so how can I get pkg-config on windows or how to install cairo then ? Do you have the cairo development files installed? Recall this isn't the same as having a cairo dll! See the Windows section of their download page for binaries . Also, you can run cabal install -v for more verbosity in the error (which you should post if you're still stuck). you need

How to install/use a local version of package using Stack?

瘦欲@ 提交于 2019-11-29 04:59:00
问题 The situation is, I am trying to install Netwire using Stack. However, there is a problem in the latest netwire 5.0.1, as reported by dhobbs: http://hub.darcs.net/ertes/netwire/issue/13 Since I don't know when the problem will ever be fixed, I downloaded the repo and made the change myself. However, I don't understand how to install such a locally patched version. stack install does not install that into ~/.stack . Does anyone have an idea? Update Now I am developing some other libraries

How to avoid recompiling in this cabal file?

白昼怎懂夜的黑 提交于 2019-11-29 02:36:38
问题 I've been working on this Haskell project, and I have a cabal file for it. Now, my project is structured as a library that implements a simple interpreter. I also have a very short Main file which needs to be build into an executable to call the library. What I want to do is: 1) compile the library and expose some of the modules 2) compile the executable I have a cabal file that works and seems to do this. The problem is that when it compiles the executable it recompiles all the modules which

Statically link C++ library with a Haskell library

余生长醉 提交于 2019-11-28 23:37:12
Setup: I have a Haskell library HLib which makes calls to a C/C++ backend CLib for efficiency. The backend is small and specialized for use with HLib . The interface to CLib will only be exposed through HLib ; HLib tests, HLib benchmarks and third party libraries depending on HLib will not make direct FFI calls to CLib . From the test/benchmark/3rd party lib perspective, HLib should be appear purely Haskell. This means in the cabal file sections for, e.g., HLib tests, there should be no references to -lCLib , libCLib , etc, only a build-depends on HLib , and that executables should not need to