name:                arrayfire
version:             0.3.0.0
synopsis:            Haskell bindings to the ArrayFire general-purpose GPU library
homepage:            https://github.com/arrayfire/arrayfire-haskell
license:             BSD3
license-file:        LICENSE
author:              David Johnson
maintainer:          djohnson.m@gmail.com
copyright:           David Johnson (c) 2018-2020
category:            Math
build-type:          Custom
extra-source-files:  CHANGELOG.md
cabal-version:       >=1.10
description:         High-level Haskell bindings to the ArrayFire General-purpose GPU library
    .
    <<https://user-images.githubusercontent.com/875324/59819388-9ff83f00-92f5-11e9-9ac0-51eef200c716.png>>
    .

flag disable-default-paths
    description:    When enabled, don't add default hardcoded include/link dirs by default. Needed for hermetic builds like in nix.
    default:        False
    manual:         True

custom-setup
 setup-depends:
   base <5,
   Cabal,
   cabal-doctest >=1 && <1.1

library
  exposed-modules:
    ArrayFire
    ArrayFire.Algorithm
    ArrayFire.Arith
    ArrayFire.Array
    ArrayFire.Backend
    ArrayFire.BLAS
    ArrayFire.Data
    ArrayFire.Device
    ArrayFire.Features
    ArrayFire.Graphics
    ArrayFire.Image
    ArrayFire.Index
    ArrayFire.LAPACK
    ArrayFire.Random
    ArrayFire.Signal
    ArrayFire.Sparse
    ArrayFire.Statistics
    ArrayFire.Types
    ArrayFire.Util
    ArrayFire.Vision
  other-modules:
    ArrayFire.FFI
    ArrayFire.Exception
    ArrayFire.Orphans
    ArrayFire.Internal.Algorithm
    ArrayFire.Internal.Arith
    ArrayFire.Internal.Array
    ArrayFire.Internal.Backend
    ArrayFire.Internal.BLAS
    ArrayFire.Internal.Data
    ArrayFire.Internal.Defines
    ArrayFire.Internal.Device
    ArrayFire.Internal.Exception
    ArrayFire.Internal.Features
    ArrayFire.Internal.Graphics
    ArrayFire.Internal.Image
    ArrayFire.Internal.Index
    ArrayFire.Internal.Internal
    ArrayFire.Internal.LAPACK
    ArrayFire.Internal.Random
    ArrayFire.Internal.Signal
    ArrayFire.Internal.Sparse
    ArrayFire.Internal.Statistics
    ArrayFire.Internal.Types
    ArrayFire.Internal.Util
    ArrayFire.Internal.Vision
  build-tools:
    hsc2hs
  extra-libraries:
    af
  c-sources:
    cbits/wrapper.c
  build-depends:
    base < 5, filepath, vector
  hs-source-dirs:
    src
  ghc-options:
    -Wall -Wno-missing-home-modules
  default-language:
    Haskell2010

  if (os(linux) || os(OSX)) && !flag(disable-default-paths)
    include-dirs:
      /opt/arrayfire/include
    extra-lib-dirs:
      /opt/arrayfire/lib
    ld-options:
      -Wl,-rpath /opt/arrayfire/lib

executable main
  hs-source-dirs:
    exe
  main-is:
    Main.hs
  build-depends:
    base < 5, arrayfire, vector
  c-sources:
    cbits/wrapper.c
  default-language:
    Haskell2010

executable gen
  main-is:
    Main.hs
  hs-source-dirs:
    gen
  build-depends:
    base < 5, parsec, text, directory
  default-language:
    Haskell2010
  other-modules:
    Lex
    Parse
    Print
    Types

test-suite test
  type:
    exitcode-stdio-1.0
  main-is:
    Main.hs
  hs-source-dirs:
    test
  build-depends:
    arrayfire,
    base < 5,
    directory,
    hspec,
    hspec-discover,
    QuickCheck,
    quickcheck-classes,
    vector
  default-language:
    Haskell2010
  other-modules:
    Spec
    ArrayFire.AlgorithmSpec
    ArrayFire.ArithSpec
    ArrayFire.ArraySpec
    ArrayFire.BLASSpec
    ArrayFire.BackendSpec
    ArrayFire.DataSpec
    ArrayFire.DeviceSpec
    ArrayFire.FeaturesSpec
    ArrayFire.GraphicsSpec
    ArrayFire.ImageSpec
    ArrayFire.IndexSpec
    ArrayFire.LAPACKSpec
    ArrayFire.RandomSpec
    ArrayFire.SignalSpec
    ArrayFire.SparseSpec
    ArrayFire.StatisticsSpec
    ArrayFire.UtilSpec
    ArrayFire.VisionSpec

test-suite doctests
  type:
    exitcode-stdio-1.0
  buildable:
    False
  ghc-options:
    -threaded
  main-is:
    Main.hs
  hs-source-dirs:
    doctests
  build-depends:
     arrayfire
   , base < 5
   , doctest >= 0.8
   , split
  autogen-modules:
    Build_doctests
  other-modules:
    Build_doctests
  default-language:
    Haskell2010

source-repository head
  type: git
  location: https://github.com/arrayfire/arrayfire-haskell.git
