I've also been trying to find a good way to do this. I had a somewhat hacky driver that would use GHC to compile the plugin in a temporary directory, then create a custom package database with only that plugin and add that database to the stack of package databases when compiling the target program. The annoying part was creating the package description, as you need to determine which other packages the plugin depends on. However, it just occurred to me that "ghc --make" does this, so its probably a matter of finding the proper GHC API call to get the list of packages used to build the plugin and converting that into a package description.
Can anyone familiar with either the plugin API or Cabal/ghc-pkg comment on whether there is an easier way?
Thanks!
Andrew