[Haskell-beginners] Deploying a haskell application (not a webapp)

Vale Cofer-Shabica vale.cofershabica at gmail.com
Thu Dec 18 17:50:00 UTC 2014


Does anyone have any experience with Halcyon[1]? It purports to do just
this.

[1] https://halcyon.sh/

--
vale cofer-shabica

<401.267.8253>

On Thu, Dec 18, 2014 at 10:39 AM, Michael Orlitzky <michael at orlitzky.com>
wrote:
>
> On 12/18/2014 03:20 AM, Alan Buxton wrote:
> > Oh that's cool. Is there a way to configure this in some file so that
> when I
> > build just this application a particular datadir is used?
>
> The usual Setup.hs is just a dummy file; Cabal even ignores it. But if
> you switch to a "custom" build (from "simple") you can do some
> preprocessing in Setup.hs:
>
>   https://www.haskell.org/cabal/users-guide/developing-packages.html
>
> In the section "More complex packages", it shows you how to add hooks
> that get executed before each configure/build/etc stage. If you add a
> configure hook that mangles the datadir template, you can override the
> default. Here's a Setup.hs that seems to work:
>
> -- Welcome to the jungle, baby.
> import Distribution.PackageDescription
> import Distribution.Simple
> import Distribution.Simple.Configure
> import Distribution.Simple.InstallDirs
> import Distribution.Simple.LocalBuildInfo
> import Distribution.Simple.Setup
>
> my_hooks :: UserHooks
> my_hooks = simpleUserHooks { confHook = my_conf_hook }
>
> main :: IO ()
> main = defaultMainWithHooks my_hooks
>
> my_conf_hook :: (GenericPackageDescription, HookedBuildInfo)
>              -> ConfigFlags
>              -> IO LocalBuildInfo
> my_conf_hook (gpd,hbi) cf = do
>   lbi <- configure (gpd, hbi) cf
>
>   let orig_dirs = installDirTemplates lbi
>   let my_datadir = toPathTemplate "/foo/bar"
>   let my_dirs = orig_dirs { datadir = my_datadir }
>   let my_lbi = lbi { installDirTemplates = my_dirs }
>   return my_lbi
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20141218/f8d88d91/attachment.html>


More information about the Beginners mailing list