I thought that too, but the package is local. I checked it by putting some garbage in one file, and it failed there. :-)
But I noticed some other strange things. It seems that sometimes it passes the flag and sometimes not.

Also, in one particular file I noticed that if it fails and than space is added between last # and ifdef (# ifdef) than it works, and reinstall immediately after fails until space is removed (#ifdef).

Any ideas?

(Package CV-0.3.7, file Transformers.chs, flag opencv24, GHC 7.8.3, Cabal 1.20)


-------- Original Message --------
Subject: Re: [Haskell-cafe] Specifying cabal sandbox flag for local package
From: Krzysztof Skrzętnicki <gtener@gmail.com>
To: vlatko.basic@gmail.com
Date: 03.07.2014 20:18


This is odd. I'm pretty sure I have done something like this before and it did work. Are you sure you are using the forked package? Maybe the cabal is pulling in different version because of some other dependencies...

03-07-2014 20:07, "Vlatko Basic" <vlatko.basic@gmail.com> napisał(a):
Hi Krzysztof,

No, it doesn't. Just tried it.

vlatko

-------- Original Message --------
Subject: Re: [Haskell-cafe] Specifying cabal sandbox flag for local package
From: Krzysztof Skrzętnicki <gtener@gmail.com>
To: vlatko.basic@gmail.com
Date: 03.07.2014 19:54


Maybe cpp-options will work here?

03-07-2014 19:32, "Vlatko Basic" <vlatko.basic@gmail.com> napisał(a):
Hi Anthony,

I can install it manually, I'm just trying to find out if a solution exist to tell cabal to use a flag for compiling an external package, i.e. to treat it as if there is no flag.

Something like "add-source-flags" would do. :-)


I also tried 'ghc-options: -DFLAG' in project's cabal file, but no luck.


vlatko

-------- Original Message  --------
Subject: Re: [Haskell-cafe] Specifying cabal sandbox flag for local package
From: Anthony Cowley <acowley@seas.upenn.edu>
To: vlatko.basic@gmail.com
Cc: haskell-cafe <haskell-cafe@haskell.org>
Date: 03.07.2014 19:24

On Thu, Jul 3, 2014 at 12:47 PM, Vlatko Basic <vlatko.basic@gmail.com> wrote:
Hello Cafe,

I have a local forked package and added its path to sandboxed project with
  'cabal sandbox add-source PATH'.

However, to build that package I have to specify a flag to 'cabal install'.
In other words I can't install it by
   'cabal install --only-dependencies',
but separately with
   'cabal install PACKAGE -fFLAG'.

Is there a way to tell cabal sandbox (or in project.cabal) to always use
some flag(s) for compiling a (particular) package in local path?

A way of side stepping this problem is to setup a sandbox in the
forked project directory with "cabal sandbox init
--sandbox=../MyProject/.cabal-sandbox", then you can run "cabal
install --flags" in the forked project directory, and it will install
to the sandbox for your downstream project.

Anthony

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe