packages feed

nano-ui-0.1.0.1: nano-ui.cabal

cabal-version:      3.4
name:               nano-ui
version:            0.1.0.1
synopsis:           Immediate-mode GUI toolkit for Haskell
description:
    Widgets, layout, and input handling for immediate-mode interfaces. A view
    is a function that runs every frame, and widgets return what the user did.
    Pair it with a window backend such as nano-ui-sdl or nano-ui-rgfw.
license:            MIT
license-file:       LICENSE
author:             goolord
maintainer:         zacharyachurchill@gmail.com
category:           Graphics
build-type:         Simple
extra-doc-files:
    CHANGELOG.md
    README.md

common extensions
    default-language: GHC2024
    default-extensions:
        DuplicateRecordFields
        MagicHash
        OverloadedStrings
        UnboxedTuples

common rts-options
    ghc-options:
        -rtsopts
        -threaded
        "-with-rtsopts=-N1 -A64m -T -I0"

common test-rts-options
    ghc-options: -rtsopts -threaded "-with-rtsopts=-A8m -H64m -K128m -T"

common warnings
  ghc-options:
    -Wall
    -Wextra
    -Wcompat
    -Widentities
    -Wincomplete-record-updates
    -Wincomplete-uni-patterns
    -Wmissing-export-lists
    -Wmissing-home-modules
    -Wpartial-fields
    -Wredundant-constraints

-- Tests, benchmarks and executables build against the library and also
-- reject dependencies they never import.
common downstream
    import:           extensions
    import:           warnings
    ghc-options:      -Wunused-packages
    build-depends:
        base ^>=4.22.0.0,
        nano-ui

library
    import:           extensions
    import:           warnings
    exposed-modules:
        NanoUI
        NanoUI.Context
        NanoUI.Context.Types
        NanoUI.Debug
        NanoUI.Id
        NanoUI.Input
        NanoUI.Layout.Arena
        NanoUI.Layout.Solve
        NanoUI.Monad
        NanoUI.Emit
        NanoUI.Testing
        NanoUI.Testing.Assert
        NanoUI.Testing.Harness
        NanoUI.Testing.Runner
        NanoUI.Widgets.TextBuffer
        NanoUI.Widgets.TextCommand
        NanoUI.Widgets.TextEditor
        NanoUI.Widgets.TextField
        NanoUI.Widgets.TextArea
        NanoUI.Widgets.Combo
        NanoUI.Widgets.Custom
        NanoUI.Widgets.RichText
        NanoUI.Widgets.PaneGrid
        NanoUI.Widgets.SplitPane
        NanoUI.Store
        NanoUI.Frame.Hit
        NanoUI.Frame.TextEdit
        NanoUI.Frame.Window
        NanoUI.Runner
        NanoUI.Bidi
        NanoUI.SIMD
        NanoUI.Svg
    other-modules:
        NanoUI.Animatable
        NanoUI.Animation
        NanoUI.Atlas
        NanoUI.Compact
        NanoUI.Context.Animation
        NanoUI.Context.Core
        NanoUI.Context.Drawing
        NanoUI.Context.Overlay
        NanoUI.Context.Scroll
        NanoUI.Damage
        NanoUI.Draw
        NanoUI.Font
        NanoUI.Hooks
        NanoUI.Frame
        NanoUI.Frame.Cursor
        NanoUI.Draw.Arena
        NanoUI.Draw.Shapes
        NanoUI.Draw.Text
        NanoUI.Draw.Types
        NanoUI.Frame.Input
        NanoUI.Frame.Chrome
        NanoUI.Frame.Focus
        NanoUI.Frame.Paint
        NanoUI.Frame.Paint.Types
        NanoUI.Frame.Paint.Widgets
        NanoUI.Frame.Redraw
        NanoUI.Frame.Scroll
        NanoUI.Frame.Scroll.Geometry
        NanoUI.Frame.Select
        NanoUI.Frame.Node
        NanoUI.Frame.Overlay
        NanoUI.Frame.Spans
        NanoUI.Frame.SpanArena
        NanoUI.Frame.TextArea
        NanoUI.Frame.TextArea.Content
        NanoUI.Frame.TextArea.Geometry
        NanoUI.Frame.TextEdit.Menu
        NanoUI.Frame.TextInput
        NanoUI.Style
        NanoUI.Types
        NanoUI.WidgetText
        NanoUI.Widgets.Node
        NanoUI.Widgets.Chrome
        NanoUI.Widgets.Layout
        NanoUI.Widgets.Tabs
        NanoUI.Widgets.Radio
        NanoUI.Widgets.Tree
        NanoUI.Widgets.ColorPicker
        NanoUI.Widgets.Drawing
        NanoUI.Widgets.TextInput
        NanoUI.Widgets.NumericInput
        NanoUI.Widgets.TextCommon
        NanoUI.Widgets.Animate
        NanoUI.Widgets.Overlay
        NanoUI.Widgets.Popup
        NanoUI.Widgets.Menu
        NanoUI.Widgets.Table
        NanoUI.Widgets.Behavior
        NanoUI.Widgets.Combinators
        NanoUI.Widgets.Drop
        NanoUI.Widgets.Button
        NanoUI.Widgets.Checkbox
        NanoUI.Widgets.Display
        NanoUI.Widgets.Select
        NanoUI.Widgets.Slider
    build-depends:
        base ^>=4.22.0.0,
        bytestring ^>=0.12,
        colonnade ^>=1.2,
        containers ^>=0.8,
        effectful-core ^>=2.6,
        ghc-compact ^>=0.1,
        hashable ^>=1.5,
        hashtables ^>=1.4,
        hexml ^>=0.3.5,
        primitive ^>=0.9,
        text ^>=2.1,
        text-short ^>=0.1.6,
        unordered-containers ^>=0.2,
        vector ^>=0.13
    hs-source-dirs:   lib

benchmark nano-ui-id-bench
    import:           downstream
    import:           test-rts-options
    type:             exitcode-stdio-1.0
    main-is:          IdBench.hs
    build-depends:
        tasty-bench ^>=0.4
    hs-source-dirs:   benchmark

test-suite text-buffer-spec
    import:           downstream
    type:             exitcode-stdio-1.0
    main-is:          NanoUI/TextBufferSpec.hs
    build-depends:
        hspec ^>=2.11,
        text ^>=2.1
    hs-source-dirs:   test

test-suite nano-ui-test
    import:           downstream
    import:           test-rts-options
    type:             exitcode-stdio-1.0
    main-is:          Main.hs
    other-modules:
        Cases
        Cases.Animation
        Cases.Atlas
        Cases.Combo
        Cases.Damage
        Cases.Demo
        Cases.Grid
        Cases.HostDraw
        Cases.Keyboard
        Cases.Cache
        Cases.Runner
        Cases.RichText
        Cases.SIMD
        Cases.Shaping
        Cases.Styling
        Cases.Svg
        Cases.State
        Cases.Table
        Cases.Modal
        Cases.NoThunks
        Cases.Scroll
        Cases.Select
        Cases.Tabs
        Cases.TextInput
        Cases.NumericInput
        Cases.ContextMenu
        Cases.PointerRelease
        Cases.CustomWidget
        Cases.Tooltip
        Cases.Window
    build-depends:
        bytestring,
        containers,
        effectful ^>=2.6,
        nothunks,
        primitive ^>=0.9,
        text ^>=2.1
    hs-source-dirs:   test/integration

executable nano-ui-profile
    import:           downstream
    import:           rts-options
    main-is:          Profile.hs
    hs-source-dirs:   examples
    build-depends:
        primitive ^>=0.9,
        text ^>=2.1

-- Compile-time verification of optimization invariants (inspection-testing).
-- Assertions fail the build if GHC stops inlining or starts allocating in the
-- checked bindings, converting silent performance regressions into errors.
test-suite nano-ui-inspection
    import:           downstream
    type:             exitcode-stdio-1.0
    main-is:          Inspection.hs
    ghc-options:      -fplugin=Test.Inspection.Plugin
    build-depends:
        inspection-testing
    hs-source-dirs:   test/inspection