[Haskell-cafe] ANN: ecu-0.0.0

Brent Yorgey byorgey at seas.upenn.edu
Fri Sep 10 09:04:18 EDT 2010


On Thu, Sep 09, 2010 at 11:11:33PM -0500, Tom Hawkins wrote:
> to other fields, not just automotive.  My question is, is it possible
> for a user to select which programs to install within a given package?
>  I could see where someone would want to install a data analysis tool,
> but not want to bother with separately installing Kvaser canlib.  I
> had considered different packages for the individual tools, but that
> would get messy pretty quick, especially since many tools share a lot
> of common code.
> 
> And one last question:  The Kvaser canlib library has a different name
> depending on if the machine is Linux or Windows.  What is the best way
> to configure the build based on the platform?  Current I have the
> library name hard coded in the extra-libraries field in the cabal
> file.

You want conditional configurations in the .cabal file.  See

  http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html#configurations

For the OS issue you can do something like

  if os(windows)
    Build-depends: canlib-windows
  else
    Build-depends: canlib

or whatever.  For user-selectable programs, create some flags and use
the flags to specify which executables are buildable.  Then the user
can just pass a flag to cabal install and get the executables they
want.

-Brent


More information about the Haskell-Cafe mailing list