packages feed

wgpu-hs-0.4.0.0: wgpu-hs.cabal

cabal-version:      3.0
name:               wgpu-hs
version:            0.4.0.0
synopsis:           WGPU
description:        A high-level binding to WGPU.
bug-reports:        https://github.com/lancelet/wgpu-hs/issues
license:            BSD-3-Clause
license-file:       LICENSE
author:             Jonathan Merritt
maintainer:         j.s.merritt@gmail.com
copyright:          Copyright (C) Jonathan Merritt, 2021
category:           Graphics
extra-source-files: CHANGELOG.md

flag glfw
  description: Enable GLFW integration
  default:     True
  manual:      True

flag examples
  description: Build the examples
  default:     True
  manual:      True

flag sdl2
  description: Enable SDL2 integration
  default:     True
  manual:      True

common base
  default-language: Haskell2010
  build-depends:    base ^>=4.14.0.0

common ghc-options
  ghc-options:
    -Wall -Wcompat -Wincomplete-record-updates
    -Wincomplete-uni-patterns -Wredundant-constraints

library wgpu-hs-internal
  import:          base, ghc-options
  hs-source-dirs:  src-internal
  exposed-modules:
    WGPU.Internal.Adapter
    WGPU.Internal.Binding
    WGPU.Internal.Buffer
    WGPU.Internal.ChainedStruct
    WGPU.Internal.Color
    WGPU.Internal.CommandBuffer
    WGPU.Internal.CommandEncoder
    WGPU.Internal.Device
    WGPU.Internal.Instance
    WGPU.Internal.Memory
    WGPU.Internal.Multipurpose
    WGPU.Internal.Pipeline
    WGPU.Internal.Queue
    WGPU.Internal.RenderPass
    WGPU.Internal.Sampler
    WGPU.Internal.Shader
    WGPU.Internal.SMaybe
    WGPU.Internal.Surface
    WGPU.Internal.SwapChain
    WGPU.Internal.Texture

  if flag(glfw)
    build-depends:   GLFW-b
    exposed-modules: WGPU.Internal.GLFW.Surface

  if flag(sdl2)
    build-depends:   sdl2
    exposed-modules: WGPU.Internal.SDL.Surface

  build-depends:
    , bytestring
    , data-default
    , data-has
    , lens
    , mtl
    , resourcet
    , text
    , vector
    , wgpu-raw-hs

library
  import:          base, ghc-options
  hs-source-dirs:  src
  build-depends:
    , bytestring        ^>=0.10.12
    , containers        ^>=0.6.5.1
    , data-default      ^>=0.7.1.1
    , data-has          ^>=0.4.0.0
    , lens              ^>=5.0.1
    , mtl               ^>=2.2.2
    , resourcet         ^>=1.2.4.3
    , safe-exceptions   ^>=0.1.7.2
    , text              ^>=1.2.4
    , vector            ^>=0.12.3
    , wgpu-hs-internal
    , wgpu-raw-hs       ==0.4.0.0

  exposed-modules:
    WGPU
    WGPU.Classy

  if flag(glfw)
    build-depends:   GLFW-b ^>=3.3.0
    exposed-modules: WGPU.GLFW.Surface

  if flag(sdl2)
    build-depends:   sdl2 ^>=2.5.3.0
    exposed-modules:
      WGPU.BoneYard.SimpleSDL
      WGPU.SDL.Surface

executable triangle-sdl
  import:         base, ghc-options

  if (flag(examples) && flag(sdl2))
    build-depends:
      , data-default     ^>=0.7.1.1
      , data-has         ^>=0.4.0.0
      , lens             ^>=5.0.1
      , mtl              ^>=2.2.2
      , resourcet        ^>=1.2.4.3
      , safe-exceptions  ^>=0.1.7.2
      , sdl2             ^>=2.5.3.0
      , string-qq        ^>=0.0.4
      , text             ^>=1.2.4
      , vector           ^>=0.12.3
      , wgpu-hs

  else
    buildable: False

  hs-source-dirs: examples/triangle-sdl
  main-is:        TriangleSDL.hs

executable triangle-glfw
  import:         base, ghc-options

  if (flag(examples) && flag(glfw))
    build-depends:
      , data-default  ^>=0.7.1.1
      , GLFW-b        ^>=3.3.0
      , text          ^>=1.2.4
      , transformers  ^>=0.5.6
      , wgpu-hs

  else
    buildable: False

  hs-source-dirs: examples/triangle-glfw
  main-is:        TriangleGLFW.hs

executable cube
  import:         base, ghc-options

  if (flag(examples) && flag(sdl2))
    build-depends:
      , data-default     ^>=0.7.1.1
      , data-has         ^>=0.4.0.0
      , derive-storable  ^>=0.3.0.0
      , JuicyPixels      ^>=3.3.5
      , lens             ^>=5.0.1
      , linear           ^>=1.21.6
      , mtl              ^>=2.2.2
      , resourcet        ^>=1.2.4.3
      , safe-exceptions  ^>=0.1.7.2
      , sdl2             ^>=2.5.3.0
      , string-qq        ^>=0.0.4
      , text             ^>=1.2.4
      , vector           ^>=0.12.3
      , wgpu-hs

  else
    buildable: False

  hs-source-dirs: examples/cube
  main-is:        Cube.hs