elm/Elm.cabal
ngunn 175f268622 Fix cabal install missing docs.json (followup)
See: 14e32add30
for discussion on first attempt

Changed Librarys.hs and LoadLibraries.hs from TemplateHaskell to usafeIO.
Avoids needing to touch LoadLibraries after we change docs.json (as the file is loaded at runtime).
Also removes need for using CPP
Drawback of using unsafeIO is fairly well known/understood + this is a classic use-case.
Added error handling to LoadLibraries.hs

Setup.hs now uses "runProcess" instead of "system" to invoke elm compiler.
This allows us to set the environment variable "Elm_datadir" which is picked up by LoadLibraries and makes sure we get the just-built version in dist/data.
Also explicitly sets the RTS file to make sure we're not using one (as we're currently building it!)
Also change the folder the compiled JavaScript ends up in to dist/js.  Writing to the source tree, then deleting isn't very nice + this should make it easier to find elm compilation errors.  cabal clean handles the file deletion, too.

I think this fixes all the defects of the first version:
1. CPP is not needed
2. touch is not needed
3. building elm-runtime.js uses dist/data/docs.json
4. running elm after install uses the installed elm-runtime.js and docs.json
5. LoadLibraries.hs is simpler.  Doesn't use CPP or TemplateHaskell.  Has error handling and a decent error message
6. cabal clean && cabal install builds everything with the right data in the right order

(tested on ghc 7.4.1)
2013-03-22 15:52:40 +00:00

159 lines
No EOL
5.4 KiB
Text

Name: Elm
Version: 0.8
Synopsis: The Elm language module.
Description: Elm aims to make client-side web-development more pleasant.
It is a statically/strongly typed, functional reactive
language to HTML, CSS, and JS. This package provides a
library for Elm compilation in Haskell and a compiler
executable.
Homepage: http://elm-lang.org
License: BSD3
License-file: LICENSE
Author: Evan Czaplicki
Maintainer: info@elm-lang.org
Copyright: Copyright: (c) 2011-2012 Evan Czaplicki
Category: Compiler, Language
Build-type: Custom
Extra-source-files: changelog.txt
Data-dir: dist/data
Data-files: elm-runtime.js docs.json
Cabal-version: >=1.8
source-repository head
type: git
location: git://github.com/evancz/Elm.git
Library
exposed-modules: Language.Elm,
Language.Elm.Quasi
Hs-Source-Dirs: compiler, compiler/Gen, compiler/Model, compiler/Transform
other-modules: Ast,
Context,
CompileToJS,
Cases,
Substitute,
ExtractNoscript,
GenerateHtml,
Guid,
LetBoundVars,
Libraries,
LoadLibraries,
Optimize,
Initialize,
Rename,
Parse.Binops,
Parse.Expr,
Parse.Foreign,
Parse.Library,
Parse.Modules,
Parse.Parser,
Parse.Patterns,
Parse.Types,
Types.Alias,
Types.Types,
Types.Constrain,
Types.Hints,
Types.Solver,
Types.Substitutions,
Types.Unify,
Paths_Elm
Build-depends: base >=4.2 && <5,
containers >= 0.3,
transformers >= 0.2,
mtl >= 2,
deepseq,
parsec >= 3.1.1,
blaze-html == 0.5.*,
blaze-markup == 0.5.1.*,
text,
template-haskell,
shakespeare >= 1,
pandoc >= 1.10,
bytestring,
hjsmin,
indents,
filepath,
template-haskell,
json,
directory
Executable elm
Main-is: Compiler.hs
Hs-Source-Dirs: compiler, compiler/Gen, compiler/Model, compiler/Transform
extensions: CPP
cpp-options: -DELM_COMPILEDATADIR="dist/data"
other-modules: Ast,
Context,
CompileToJS,
Cases,
Substitute,
ExtractNoscript,
GenerateHtml,
Guid,
LetBoundVars,
Libraries,
LoadLibraries,
Optimize,
Initialize,
Rename,
Parse.Binops,
Parse.Expr,
Parse.Foreign,
Parse.Library,
Parse.Modules,
Parse.Parser,
Parse.Patterns,
Parse.Types,
Types.Alias,
Types.Types,
Types.Constrain,
Types.Hints,
Types.Solver,
Types.Substitutions,
Types.Unify,
Paths_Elm
Build-depends: base >=4.2 && <5,
containers >= 0.3,
transformers >= 0.2,
mtl >= 2,
deepseq,
parsec >= 3.1.1,
blaze-html == 0.5.*,
blaze-markup == 0.5.1.*,
cmdargs,
pandoc >= 1.10,
bytestring,
hjsmin,
indents,
filepath,
template-haskell,
json,
directory
Executable elm-doc
Main-is: Docs.hs
Hs-Source-Dirs: compiler, compiler/Model, compiler/Transform
other-modules: Ast,
Context,
Parse.Library,
Parse.Modules,
Parse.Types,
Rename,
Types.Types
Build-depends: base >=4.2 && <5,
containers >= 0.3,
transformers >= 0.2,
mtl >= 2,
parsec >= 3.1.1,
pandoc >= 1.10,
cmdargs,
indents