-- The name of the package.
name:                ihaskell

-- The package version.  See the Haskell package versioning policy (PVP)
-- for standards guiding when and how versions should be incremented.
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
-- PVP summary:      +--+------- breaking API changes
--                   |  | +----- non-breaking API additions
--                   |  | | +--- code changes with no API change
version:             0.12.0.0

-- A short (one-line) description of the package.
synopsis:            A Haskell backend kernel for the Jupyter project.

-- A longer description of the package.
description:         IHaskell is a Haskell backend kernel for the Jupyter project. This allows using Haskell via
                     a console or notebook interface. Additional packages may be installed to provide richer data visualizations.

-- URL for the project homepage or repository.
homepage:            http://github.com/gibiansky/IHaskell

-- The license under which the package is released.
license:             MIT

-- The file containing the license text.
license-file:        LICENSE

-- The package author(s).
author:              Andrew Gibiansky

-- An email address to which users can send suggestions, bug reports, and
-- patches.
maintainer:          andrew.gibiansky@gmail.com

-- A copyright notice.
-- copyright:

category:            Development

build-type:          Simple

-- Constraint on the version of Cabal needed to build this package.
cabal-version:       1.16

data-files:
    html/kernel.js
    html/logo-64x64.svg
    jupyterlab-ihaskell/labextension/package.json
    jupyterlab-ihaskell/labextension/static/*.js

flag use-hlint
  description: Include HLint support
  default:     True
  manual:      True

library
  hs-source-dirs:      src
  default-language:    Haskell2010
  ghc-options:         -Wall

  if impl (ghc >= 8.4)
    ghc-options:       -Wpartial-fields
    build-depends:     ghc-syntax-highlighter
    exposed-modules:   IHaskell.Eval.Evaluate.HTML

  build-depends:
                       base                  >=4.9 && <5,
                       binary                ,
                       containers            ,
                       directory             ,
                       bytestring            ,
                       exceptions            ,
                       filepath              ,
                       ghc                   >=8.4 && <9.11,
                       ghc-boot              ,
                       haskeline             ,
                       parsec                ,
                       process               ,
                       random                ,
                       stm                   ,
                       text                  ,
                       time                  ,
                       transformers          ,
                       unix                  ,
                       aeson                 >=1.0,
                       base64-bytestring     >=1.0,
                       cmdargs               >=0.10,
                       ghc-parser            >=0.2.1,
                       ghc-paths             >=0.1,
                       http-client           >=0.4,
                       http-client-tls       >=0.2,
                       shelly                >=1.5,
                       split                 >=0.2,
                       strict                >=0.3,
                       unordered-containers  -any,
                       utf8-string           -any,
                       vector                -any,
                       ipython-kernel        >=0.11.0.0

  exposed-modules: IHaskell.Display
                   IHaskell.Convert
                   IHaskell.Convert.Args
                   IHaskell.Convert.IpynbToLhs
                   IHaskell.Convert.LhsToIpynb
                   IHaskell.Eval.Completion
                   IHaskell.Eval.Inspect
                   IHaskell.Eval.Evaluate
                   IHaskell.Eval.Info
                   IHaskell.Eval.Parser
                   IHaskell.Eval.Hoogle
                   IHaskell.Eval.ParseShell
                   IHaskell.Eval.Widgets
                   IHaskell.Eval.Util
                   IHaskell.Publish
                   IHaskell.IPython
                   IHaskell.IPython.Stdin
                   IHaskell.Flags
                   IHaskell.Types
                   IHaskell.BrokenPackages
                   IHaskell.CSS
                   Paths_ihaskell
                   IHaskellPrelude
  other-modules:
                   StringUtils

  if flag(use-hlint)
    exposed-modules: IHaskell.Eval.Lint
    build-depends: hlint >=1.9
    cpp-options: -DUSE_HLINT

  if flag(use-hlint) && impl (ghc < 8.10)
    build-depends: haskell-src-exts     >=1.18

executable ihaskell
  -- .hs or .lhs file containing the Main module.
  main-is:             Main.hs
  hs-source-dirs: main
  other-modules:
                   Paths_ihaskell
  ghc-options: -threaded -rtsopts -Wall

  if os(darwin)
    ghc-options: -optP-Wno-nonportable-include-path

  if impl (ghc >= 8.4)
    ghc-options:       -Wpartial-fields

  -- Other library packages from which modules are imported.
  default-language:    Haskell2010
  build-depends:
                       base                 ,
                       bytestring           ,
                       containers           ,
                       directory            ,
                       text                 ,
                       transformers         ,
                       ghc                  ,
                       process              ,
                       unix                 ,
                       aeson                ,
                       ihaskell             ,
                       ipython-kernel       ,
                       strict               ,
                       unordered-containers

Test-Suite hspec
    Type: exitcode-stdio-1.0
    Ghc-Options: -threaded -Wall

    if impl (ghc >= 8.4)
      ghc-options:     -Wpartial-fields

    Main-Is: Hspec.hs
    hs-source-dirs: src/tests
    other-modules:
        IHaskell.Test.Eval
        IHaskell.Test.Completion
        IHaskell.Test.Util
        IHaskell.Test.Parser
        IHaskell.Test.Hoogle
    default-language: Haskell2010
    build-depends:
        aeson,
        base,
        ghc,
        ghc-paths,
        transformers,
        directory,
        text,
        ihaskell,
        hspec,
        hspec-contrib,
        HUnit,
        shelly,
        raw-strings-qq,
        setenv

source-repository head
  type:     git
  location: git://github.com/gibiansky/IHaskell.git