[Haskell-cafe] Split package organization (AntTweakBar, Cabal,
Gregory D. Weber
gdweber at iue.edu
Tue Aug 4 12:03:42 EDT 2009
I'm working on a Haskell binding for AntTweakBar,
a light user interface for OpenGL applications
I have three questions about how to organize it as a
Haskell package or packages, Cabal, and darcs.
First, since AntTweakBar provides support for handling
events from GLUT, GLFW, and SDL, as well as customizable
event handling from other sources, would it be best to
divide it into four packages -- AntTweakBar (core),
AntTweakBar-GLUT, AntTweakBar-GLFW, and AntTweakBar-SDL?
A few other "package groups" on Hackage have taken this
approach of splitting according to the user interface:
for example, grapefruit-ui-gtk, reactive-glut,
though not on such a large scale as I am proposing.
Advantages of four packages rather than one:
-- Fewer build dependencies, for example, for users who want to use
just SDL and not have to install GLUT or GLFW.
-- If one of the build dependencies is broken (as for example GLFW
is just at the moment with the latest OpenGL), users could still
build the other AntTweakBar-* packages.
-- More packages to install, for those who want it all.
-- I might seem to be grabbing an undue share of the package namespace.
And it could get way out of hand if I further split the examples
from the library, making
AntTweakBar-(base|GLUT|GLFW|SDL)-(lib|examples) = 8 packages!
Would that be a problem?
-- Possible inconvenience for the developer (see second question).
Second question, assuming the four-way split is the best way to
package this: my impression is that a directory can have only one
cabal package file and one Setup.hs file.
"Creating a Package")
So for example I could not have,
in the same directory, AntTweakBar.cabal, AntTweakBar-GLUT.cabal, etc.
That means the four packages would each have to have their own
directories, and it is sometimes inconvenient to be jumping
back and forth between them. Any good way around that?
Third question, assuming four separate directories for the four
Cabal package files. Putting all four into one darcs repo
(i.e., the darcs repo would have one main directory and
a subdirectory for each package) seems to make it easier to coordinate
development of the related packages --
for example, a single 'darcs rec -a' takes
care of recording the related changes in all four subdirectories.
Any reason not to do it that way?
___ ___ __ _
/ _ \ / _ \| | | | Gregory D. Weber, Associate Professor
/ /_\// / | | | /\ | | Indiana University East
/ /_\\/ /__| | |/ \| | http://mypage.iu.edu/~gdweber/
\____/\_____/\___/\__/ Tel. (765) 973-8420; FAX (765) 973-8550
More information about the Haskell-Cafe