Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell Cabal: How to ignore dependencies

I'm trying to install a package (nymphaea as it happens). This depends on an earlier version of base than the one I have. I'm not keen on downgrading my base libraries, so I'd like to try to just ignore that dependency, and see how things go.

Is there a way to tell cabal to miss out a particular dependency?

Update: After I edit the cabal file, what do I do with it? Cabal doesn't have an obvious way to point it at a file, nor anywhere I can manually put cabal files, as far as I can tell.

[As per below, apparently I should just invoke cabal install in a directory containing the edited cabal file ]

Update 2: Unfortunately, cabal gives me a weird error about package versions being required which I appear to have:

$ cabal install -v --upgrade-dependencies time
Reading available packages...
Resolving dependencies...
In order, the following would be installed:
time-1.2.0.5 (new version)
Extracting
C:\Users\Marcin\AppData\Roaming\cabal\packages\hackage.haskell.org\time\1.2.0.5\time-1.2.0.5.tar.gz
to C:\Users\Marcin\time-1.2.0.54736...
Creating C:\Users\Marcin\time-1.2.0.54736\time-1.2.0.5\dist\setup (and its
parents)
C:\Program Files (x86)\Haskell Platform\2011.2.0.1\bin\ghc.exe --make C:\Users\Marcin\time-1.2.0.54736\time-1.2.0.5\Setu
p.hs -o C:\Users\Marcin\time-1.2.0.54736\time-1.2.0.5\dist\setup\setup.exe -odir C:\Users\Marcin\time-1.2.0.54736\time-1
.2.0.5\dist\setup -hidir C:\Users\Marcin\time-1.2.0.54736\time-1.2.0.5\dist\setup -i -iC:\Users\Marcin\time-1.2.0.54736\
time-1.2.0.5 -package Cabal-1.10.1.0
<command line>: cannot satisfy -package Cabal-1.10.1.0:
    Cabal-1.10.1.0-55f781465ee9f32289755ad706c71f0f is unusable due to missing or recursive dependencies:
      directory-1.1.0.0-3a2367d72569467a8af8a231656ff1b8 process-1.0.1.5-b3dded8e54a2e13d22af410bdcfafff4
    (use -v for more information)
World file is already up to date.
cabal.exe: Error: some packages failed to install:
time-1.2.0.5 failed during the configure step. The exception was:
ExitFailure 1
like image 871
Marcin Avatar asked Jun 10 '11 22:06

Marcin


2 Answers

To follow up on the comments to Don's answer:

First, grab the package from Hackage.

$ cabal unpack nymphaea

Then edit the .cabal file and change base <= 4.1.0.0 to base > 3 && < 5.

$ cd nymphaea-0.3
$ vim nymphaea.cabal

Now, try to install it.

$ cabal install

I got it to work with this change using Haskell Platform 2011.2.0.1 on Ubuntu Natty after installing the required Debian packages.

like image 147
hammar Avatar answered Oct 20 '22 06:10

hammar


You must edit the .cabal file associated with the package and remove any constraints on base that you see. Change, for example,

base < 3

to

base >= 3 && < 5

And see if it compiles. If it works, you might bump the version and let the maintainer know. If they don't respond, you might upload the fixed version to Hackage yourself.

like image 24
Don Stewart Avatar answered Oct 20 '22 07:10

Don Stewart