packages feed

LambdaHack-0.11.0.0: LambdaHack.cabal

cabal-version: 2.4
name:          LambdaHack
-- 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
--             | |  +----- minor or non-breaking API additions
--             | |  | +--- code changes with no API change
version:       0.11.0.0
synopsis:      A game engine library for tactical squad ASCII roguelike dungeon crawlers
description: LambdaHack is a Haskell game engine library for ASCII roguelike
             games of arbitrary theme, size and complexity, with optional
             tactical squad combat. It's packaged together with a sample
             dungeon crawler in a quirky fantasy setting. The sample game can be
             tried out in the browser at <http://lambdahack.github.io>.
             .
             Please see the changelog file for recent improvements
             and the issue tracker for short-term plans. Long term goals
             include multiplayer tactical squad combat, in-game content
             creation, auto-balancing and persistent content modification
             based on player behaviour. Contributions are welcome.
             .
             Other games known to use the LambdaHack library:
             .
             * Allure of the Stars, a near-future Sci-Fi game,
             <http://hackage.haskell.org/package/Allure>
             .
             Note: All modules in this library are kept visible,
             to let games override and reuse them.
             OTOH, to reflect that some modules are implementation details
             relative to others, the source code adheres to the following
             convention. If a module has the same name as a directory,
             the module is the exclusive interface to the directory.
             No references to the modules in the directory are allowed
             except from the interface module. This policy is only binding
             when developing the library --- library users are free
             to access any modules, since the library authors are in
             no position to guess their particular needs.
             .
             This is a workaround .cabal file, flattened to eliminate
             internal libraries until generating haddocks for them
             is fixed. The original .cabal file is in .cabal.bkp file.
homepage:      https://lambdahack.github.io
bug-reports:   http://github.com/LambdaHack/LambdaHack/issues
license:       BSD-3-Clause
license-file:  COPYLEFT
tested-with:   GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.4, GHC==8.10.7,
               GHC==9.0.1
-- Enough files is included in the Hackage package to run CI and manual
-- tests off it, to be presentable on Hackage and to create user-friendly
-- binary packages.
extra-source-files: GameDefinition/config.ui.default,
                    GameDefinition/PLAYING.md,
                    GameDefinition/fonts/16x16xw.woff,
                    GameDefinition/fonts/16x16xw.bdf,
                    GameDefinition/fonts/16x16x.fnt,
                    GameDefinition/fonts/8x8xb.fnt,
                    GameDefinition/fonts/8x8x.fnt,
                    GameDefinition/fonts/BinarySansProLH-Regular.ttf.woff,
                    GameDefinition/fonts/BinarySansProLH-Semibold.ttf.woff,
                    GameDefinition/fonts/BinaryCodeProLH-Bold.ttf.woff,
                    GameDefinition/fonts/DejaVuLGCSans.ttf.woff,
                    GameDefinition/fonts/DejaVuLGCSans-Bold.ttf.woff,
                    GameDefinition/fonts/Hack-Bold.ttf.woff
extra-doc-files:    GameDefinition/InGameHelp.txt,
                    README.md,
                    CHANGELOG.md,
                    LICENSE,
                    COPYLEFT,
                    CREDITS,
                    cabal.project,
                    Makefile
author:        Andres Loeh, Mikolaj Konarski and others
maintainer:    Mikolaj Konarski <mikolaj.konarski@funktory.com>
category:      Game Engine, Game
build-type:    Simple

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

flag with_expensive_assertions
  description:        turn on expensive assertions of well-tested code
  default:            False
  manual:             True

flag with_costly_optimizations
  description:        turn on costly (mostly GHC heap size) optimizations (that give 15-25% speedup)
  default:            True
  manual:             True

flag release
  description:        prepare for a release (expose internal functions and types, etc.)
  default:            True
  manual:             True

flag supportNodeJS
  description:        compile so that the JS blob works in terminal with NodeJS
  default:            True
  manual:             True

flag jsaddle
  description:        switch to the JSaddle frontend (may be bit-rotted)
  default:            False
  manual:             True

common options
  default-language:   Haskell2010
  default-extensions: MonoLocalBinds, ScopedTypeVariables, OverloadedStrings,
                      BangPatterns, RecordWildCards, NamedFieldPuns, MultiWayIf,
                      LambdaCase, DefaultSignatures, InstanceSigs,
                      PatternSynonyms, StrictData, CPP, TypeApplications
  other-extensions:   TemplateHaskell, MultiParamTypeClasses, RankNTypes,
                      TypeFamilies, FlexibleContexts, FlexibleInstances,
                      DeriveFunctor, FunctionalDependencies,
                      GeneralizedNewtypeDeriving, TupleSections,
                      DeriveFoldable, DeriveTraversable,
                      ExistentialQuantification, GADTs, StandaloneDeriving,
                      DataKinds, KindSignatures, DeriveGeneric, DeriveLift
  ghc-options:        -Wall -Wcompat -Worphans -Wincomplete-uni-patterns -Wincomplete-record-updates -Wimplicit-prelude -Wmissing-home-modules -Widentities -Wredundant-constraints -Wmissing-export-lists -Wpartial-fields -Wunused-packages -Winvalid-haddock
-- TODO: remove -Winvalid-haddock when added to -Wall in a GHC I use for haddock
  ghc-options:        -fno-ignore-asserts

  if flag(with_costly_optimizations)
    ghc-options:        -fexpose-all-unfoldings -fspecialise-aggressively -fsimpl-tick-factor=200

  if flag(with_expensive_assertions)
    cpp-options:      -DWITH_EXPENSIVE_ASSERTIONS

  if flag(release)
    cpp-options:      -DEXPOSE_INTERNAL

  ghcjs-options:      -DUSE_JSFILE

  if !flag(supportNodeJS)
    ghcjs-options:    -DREMOVE_TELETYPE

common exe-options
  ghc-options:        -rtsopts
-- (Ignored by GHCJS) Minimize median lag at the cost of occasional bigger
-- GC lag, which fortunately sometimes fits into idle time between turns):
-- (Ignored by GHCJS) Avoid frequent GCs. Only idle-GC during a break in
-- gameplay (5s), not between slow keystrokes.
  ghc-options:        "-with-rtsopts=-A99m -I5"

-- Haskell GC in GHCJS every 10s.
  ghcjs-options:      -DGHCJS_GC_INTERVAL=10000
-- This is the largest GHCJS_BUSY_YIELD value that does not cause dropped frames
-- on my machine with default --maxFps.
  ghcjs-options:      -DGHCJS_BUSY_YIELD=50
  ghcjs-options:      -dedupe

  if !flag(supportNodeJS)
    ghcjs-options:    -DGHCJS_BROWSER

library
  import: options
  hs-source-dirs:     definition-src,
                      engine-src,
                      GameDefinition/game-src,
                      GameDefinition
  exposed-modules:    Game.LambdaHack.Core.Dice
                      Game.LambdaHack.Core.Frequency
                      Game.LambdaHack.Core.Prelude
                      Game.LambdaHack.Core.Random
                      Game.LambdaHack.Definition.Ability
                      Game.LambdaHack.Definition.Color
                      Game.LambdaHack.Definition.ContentData
                      Game.LambdaHack.Definition.Defs
                      Game.LambdaHack.Definition.DefsInternal
                      Game.LambdaHack.Definition.Flavour
                      Game.LambdaHack.Content.CaveKind
                      Game.LambdaHack.Content.FactionKind
                      Game.LambdaHack.Content.ItemKind
                      Game.LambdaHack.Content.ModeKind
                      Game.LambdaHack.Content.PlaceKind
                      Game.LambdaHack.Content.RuleKind
                      Game.LambdaHack.Content.TileKind
                      Game.LambdaHack.Atomic
                      Game.LambdaHack.Atomic.CmdAtomic
                      Game.LambdaHack.Atomic.HandleAtomicWrite
                      Game.LambdaHack.Atomic.MonadStateWrite
                      Game.LambdaHack.Atomic.PosAtomicRead
                      Game.LambdaHack.Client
                      Game.LambdaHack.Client.AI
                      Game.LambdaHack.Client.AI.ConditionM
                      Game.LambdaHack.Client.AI.PickActionM
                      Game.LambdaHack.Client.AI.PickActorM
                      Game.LambdaHack.Client.AI.PickTargetM
                      Game.LambdaHack.Client.AI.Strategy
                      Game.LambdaHack.Client.Bfs
                      Game.LambdaHack.Client.BfsM
                      Game.LambdaHack.Client.CommonM
                      Game.LambdaHack.Client.HandleAtomicM
                      Game.LambdaHack.Client.HandleResponseM
                      Game.LambdaHack.Client.LoopM
                      Game.LambdaHack.Client.MonadClient
                      Game.LambdaHack.Client.Preferences
                      Game.LambdaHack.Client.Request
                      Game.LambdaHack.Client.Response
                      Game.LambdaHack.Client.State
                      Game.LambdaHack.Client.UI
                      Game.LambdaHack.Client.UI.ActorUI
                      Game.LambdaHack.Client.UI.Animation
                      Game.LambdaHack.Client.UI.Content.Input
                      Game.LambdaHack.Client.UI.Content.Screen
                      Game.LambdaHack.Client.UI.ContentClientUI
                      Game.LambdaHack.Client.UI.DrawM
                      Game.LambdaHack.Client.UI.EffectDescription
                      Game.LambdaHack.Client.UI.Frame
                      Game.LambdaHack.Client.UI.FrameM
                      Game.LambdaHack.Client.UI.Frontend
                      Game.LambdaHack.Client.UI.Frontend.Common
                      Game.LambdaHack.Client.UI.Frontend.Teletype
                      Game.LambdaHack.Client.UI.HandleHelperM
                      Game.LambdaHack.Client.UI.HandleHumanGlobalM
                      Game.LambdaHack.Client.UI.HandleHumanLocalM
                      Game.LambdaHack.Client.UI.HandleHumanM
                      Game.LambdaHack.Client.UI.HumanCmd
                      Game.LambdaHack.Client.UI.InventoryM
                      Game.LambdaHack.Client.UI.ItemDescription
                      Game.LambdaHack.Client.UI.Key
                      Game.LambdaHack.Client.UI.KeyBindings
                      Game.LambdaHack.Client.UI.MonadClientUI
                      Game.LambdaHack.Client.UI.Msg
                      Game.LambdaHack.Client.UI.MsgM
                      Game.LambdaHack.Client.UI.Overlay
                      Game.LambdaHack.Client.UI.PointUI
                      Game.LambdaHack.Client.UI.RunM
                      Game.LambdaHack.Client.UI.SessionUI
                      Game.LambdaHack.Client.UI.Slideshow
                      Game.LambdaHack.Client.UI.SlideshowM
                      Game.LambdaHack.Client.UI.UIOptions
                      Game.LambdaHack.Client.UI.UIOptionsParse
                      Game.LambdaHack.Client.UI.Watch
                      Game.LambdaHack.Client.UI.Watch.WatchCommonM
                      Game.LambdaHack.Client.UI.Watch.WatchQuitM
                      Game.LambdaHack.Client.UI.Watch.WatchSfxAtomicM
                      Game.LambdaHack.Client.UI.Watch.WatchUpdAtomicM
                      Game.LambdaHack.Common.Analytics
                      Game.LambdaHack.Common.Area
                      Game.LambdaHack.Common.Actor
                      Game.LambdaHack.Common.ActorState
                      Game.LambdaHack.Common.ClientOptions
                      Game.LambdaHack.Common.Faction
                      Game.LambdaHack.Common.File
                      Game.LambdaHack.Common.HighScore
                      Game.LambdaHack.Common.Item
                      Game.LambdaHack.Common.ItemAspect
                      Game.LambdaHack.Common.Kind
                      Game.LambdaHack.Common.Level
                      Game.LambdaHack.Common.Misc
                      Game.LambdaHack.Common.MonadStateRead
                      Game.LambdaHack.Common.Perception
                      Game.LambdaHack.Common.PointArray
                      Game.LambdaHack.Common.Point
                      Game.LambdaHack.Common.ReqFailure
                      Game.LambdaHack.Common.RingBuffer
                      Game.LambdaHack.Common.Save
                      Game.LambdaHack.Common.State
                      Game.LambdaHack.Common.Thread
                      Game.LambdaHack.Common.Tile
                      Game.LambdaHack.Common.Time
                      Game.LambdaHack.Common.Types
                      Game.LambdaHack.Common.Vector
                      Game.LambdaHack.Server
                      Game.LambdaHack.Server.BroadcastAtomic
                      Game.LambdaHack.Server.Commandline
                      Game.LambdaHack.Server.CommonM
                      Game.LambdaHack.Server.DebugM
                      Game.LambdaHack.Server.DungeonGen
                      Game.LambdaHack.Server.DungeonGen.AreaRnd
                      Game.LambdaHack.Server.DungeonGen.Cave
                      Game.LambdaHack.Server.DungeonGen.Place
                      Game.LambdaHack.Server.Fov
                      Game.LambdaHack.Server.FovDigital
                      Game.LambdaHack.Server.HandleAtomicM
                      Game.LambdaHack.Server.HandleEffectM
                      Game.LambdaHack.Server.HandleRequestM
                      Game.LambdaHack.Server.ItemRev
                      Game.LambdaHack.Server.ItemM
                      Game.LambdaHack.Server.LoopM
                      Game.LambdaHack.Server.MonadServer
                      Game.LambdaHack.Server.PeriodicM
                      Game.LambdaHack.Server.ProtocolM
                      Game.LambdaHack.Server.ServerOptions
                      Game.LambdaHack.Server.StartM
                      Game.LambdaHack.Server.State
  exposed-modules:    Content.CaveKind
                      Content.FactionKind
                      Content.ItemKind
                      Content.ItemKindEmbed
                      Content.ItemKindActor
                      Content.ItemKindOrgan
                      Content.ItemKindBlast
                      Content.ItemKindTemporary
                      Content.ModeKind
                      Content.PlaceKind
                      Content.RuleKind
                      Content.TileKind
                      TieKnot
                      Client.UI.Content.Input
                      Client.UI.Content.Screen
                      Implementation.MonadClientImplementation
                      Implementation.MonadServerImplementation
  other-modules:      Paths_LambdaHack
  autogen-modules:    Paths_LambdaHack
  build-depends:      assert-failure >= 0.1.2 && < 0.2,
                      async      >= 2.2.1,
                      base       >= 4.10 && < 99,
                      base-compat >= 0.10.0,
                      binary     >= 0.8,
                      bytestring >= 0.9.2 ,
                      containers >= 0.5.3.0,
                      deepseq    >= 1.3,
                      directory  >= 1.1.0.1,
                      enummapset >= 0.5.2.2,
                      file-embed >= 0.0.11,
                      filepath   >= 1.2.0.1,
                      hashable   >= 1.1.2.5,
                      hsini      >= 0.2,
                      witch      >= 0.3,
                      keys       >= 3,
                      miniutter  >= 0.5.0.0,
                      open-browser >= 0.2,
                      optparse-applicative >= 0.13,
                      pretty-show >= 1.6,
                      primitive  >= 0.6.1.0,
                      QuickCheck,
                      splitmix   >= 0.0.3,
                      stm        >= 2.4,
                      time       >= 1.4,
                      text       >= 0.11.2.3,
                      transformers >= 0.4,
                      unordered-containers >= 0.2.3,
                      vector     >= 0.11,
                      vector-binary-instances >= 0.2.3.1,
                      template-haskell >= 2.6,
                      th-lift-instances,
                      ghc-compact

  if impl(ghcjs) || flag(jsaddle) {
    exposed-modules:  Game.LambdaHack.Client.UI.Frontend.Dom
    build-depends:    ghcjs-dom >= 0.9.1.1
    cpp-options:      -DUSE_BROWSER
  } else {
    exposed-modules:  Game.LambdaHack.Client.UI.Frontend.Sdl
                      Game.LambdaHack.Client.UI.Frontend.ANSI
    build-depends:    sdl2 >= 2,
                      sdl2-ttf >= 2,
                      ansi-terminal >= 0.10
  }

  if impl(ghcjs) {
    other-modules:    Game.LambdaHack.Common.JSFile
    build-depends:    ghcjs-base
  } else {
    other-modules:    Game.LambdaHack.Common.HSFile
    build-depends:    zlib >= 0.5.3.1
  }

executable LambdaHack
  import: options, exe-options
  main-is:            GameDefinition/Main.hs
  build-depends:      ,LambdaHack
                      ,async
                      ,base
                      ,filepath
                      ,optparse-applicative

test-suite test
  import: options, exe-options
  type:               exitcode-stdio-1.0
  hs-source-dirs:     test
  main-is:            Spec.hs
  other-modules:      ActorStateUnitTests
                      CommonMUnitTests
                      HandleHelperMUnitTests
                      HandleHumanLocalMUnitTests
                      InventoryMUnitTests
                      ItemDescriptionUnitTests
                      ItemKindUnitTests
                      ItemRevUnitTests
                      LevelUnitTests
                      MonadClientUIUnitTests
                      ReqFailureUnitTests
                      SessionUIMock
                      SessionUIUnitTests
                      UnitTestHelpers
  build-depends:      ,LambdaHack
                      ,base
                      ,containers
                      ,enummapset
                      ,optparse-applicative
                      ,splitmix
                      ,tasty >= 1.0
                      ,tasty-quickcheck
                      ,tasty-hunit
                      ,text
                      ,transformers
                      ,vector