packages feed

intricacy-0.9.1.0: intricacy.cabal

cabal-version:      2.2
name:               intricacy
version:            0.9.1.0
license:            GPL-3.0-or-later
license-file:       COPYING
maintainer:         mbays@sdf.org
author:             Martin Bays
homepage:           http://mbays.freeshell.org/intricacy
synopsis:           A game of competitive puzzle-design
description:
    A lockpicking-themed turn-based puzzle game on a hex grid. A series of
    preset puzzles serves as an extended single-player introduction, after
    which players enter a multi-player game with a client-server architecture,
    in which players design puzzles (locks) and solve those designed by
    others. A metagame encourages the design of maximally difficult puzzles,
    within tight size constraints. The client supports Curses and SDL, with
    all graphics in SDL mode drawn by code using SDL-gfx. The network protocol
    is based on the 'binary' package, and is intended to be reasonably
    efficient. TVars are used to give transparent local caching and background
    network operations. Also incorporates an implementation of a graph
    5-colouring algorithm (see GraphColouring.hs).

category:           Game
build-type:         Simple
data-files:
    VeraMoBd.ttf
    tutorial/*.lock
    tutorial/*.text
    initiation/initiation.map
    initiation/*.lock
    initiation/*.text
    sounds/*.ogg
extra-source-files:
    Main_stub.h
extra-doc-files:
    README.md
    BUILD
    NEWS.md
    tutorial-extra/*.lock
    tutorial-extra/README

source-repository head
    type:     git
    location: http://mbays.freeshell.org/intricacy/.git

flag game
    description: Build game
    manual:      True

flag sdl2
    description: Enable SDL2 UI

flag embed
    description: Embed font into executable (with Template Haskell) when using sdl2

flag sound
    description: Enable sound

flag sdl1
    description: Enable SDL1 UI (deprecated)
    manual: True
    default: False

flag curses
    description: Enable Curses UI (disables sdl2)
    manual: True
    default: False

flag server
    description: Build server
    default:     False
    manual:      True

flag sendmail
    description: Include support for sending mail

executable intricacy
    main-is:          Intricacy.hs
    autogen-modules:
        Paths_intricacy
    other-modules:
        AsciiLock
        BinaryInstances
        BoardColouring
        Cache
        Command
        CVec
        Database
        EditGameState
        Frame
        GameState
        GameStateTypes
        GraphColouring
        Hex
        Init
        InputMode
        Interact
        InteractUtil
        KeyBindings
        Lock
        MainState
        Maxlocksize
        Metagame
        Mundanities
        Paths_intricacy
        Physics
        Protocol
        ServerAddr
        SimpleCache
        Util
        Version

    default-language: Haskell2010

    if !flag(game) || (!flag(sdl1) && !flag(sdl2) && !flag(curses))
        buildable: False
    else
        default-extensions: DoAndIfThenElse
        build-depends:
            base >=4.3 && <5,
            mtl >=2.1.3.1 && <2.4,
            transformers >=0.3.0.0 && <0.8,
            stm >=2.1 && <2.6,
            directory >=1.0 && <1.4,
            exceptions >=0.8.3 && <0.11,
            filepath >=1.0 && <1.6,
            time >=1.2 && <1.15,
            bytestring >=0.10 && <0.13,
            array >=0.3 && <0.6,
            containers >=0.4 && <0.9,
            vector >=0.9 && <0.14,
            binary >=0.5 && <0.11,
            network-simple >=0.3 && <0.5,
            safe >=0.3.18 && <0.4,
            memory >=0.11 && <0.19,
            crypton <1.1,
            text >=0.1 && <3

        if !impl(ghc >=8.0)
            build-depends: semigroups ==0.18.*

        if flag(sdl1)
            build-depends:
                SDL >=0.6.5 && <0.7,
                SDL-ttf ==0.6.*,
                SDL-gfx >=0.6 && <0.8,
                random >=1.0 && <1.4
            cpp-options:   -DMAIN_SDL1
            other-modules:
                SDLGlyph
                SDLRender
                SDLUI
                SDLUIMInstance

            if flag(sound)
                cpp-options:   -DSOUND
                build-depends:
                    SDL-mixer ==0.6.*

            if os(windows)
                extra-libraries:
                    SDL_ttf
                    SDL
                    SDL_gfx
                    freetype
                ghc-options:     -optl-mwindows
                if flag(sound)
                    extra-libraries: SDL_mixer

            if os(osx)
                cpp-options:  -DAPPLE_SDL1
                c-sources:    c_main.c
                include-dirs: /usr/include/SDL /usr/local/include/SDL
                ghc-options:  -no-hs-main

        if flag(sdl2) && !flag(sdl1) && !flag(curses)
            -- compiling with curses causes sdl2 mode to crash; I'm not sure why.
            build-depends:
                sdl2 >=2.3 && <2.6,
                sdl2-ttf >=2.0 && <2.3,
                sdl2-gfx >=0.2 && <0.4,
                random >=1.0 && <1.4
            cpp-options:   -DMAIN_SDL2
            other-modules:
                SDL2Glyph
                SDL2Keys
                SDL2Render
                SDL2RenderCache
                SDL2UI
                SDL2UIMInstance

            if flag(sound)
                cpp-options:   -DSOUND
                build-depends:
                    sdl2-mixer <1.3

            if flag(embed)
                cpp-options: -DEMBED
                other-modules:
                    Font
                build-depends:
                    file-embed <0.1

            if os(windows)
                extra-libraries:
                    SDL2_ttf
                    SDL2
                    SDL2_gfx
                    freetype
                ghc-options:     -optl-mwindows
                cpp-options: -DWINDOWS
                if flag(sound)
                    extra-libraries: SDL2_mixer

            if os(osx)
                cpp-options:  -DAPPLE
                c-sources:    c_main.c
                include-dirs: /usr/include/SDL2 /usr/local/include/SDL2
                ghc-options:  -no-hs-main

        if flag(curses)
            cpp-options:       -DMAIN_CURSES -DCURSES
            pkgconfig-depends: ncursesw -any
            other-modules:
                CursesRender
                CursesUI
                CursesUIMInstance
            build-depends:     hscurses <1.6

executable intricacy-server
    main-is:          Server.hs
    autogen-modules:
        Paths_intricacy
    other-modules:
        AsciiLock
        BinaryInstances
        BoardColouring
        CVec
        Database
        Frame
        GameState
        GameStateTypes
        GraphColouring
        Hex
        Lock
        Maxlocksize
        Metagame
        Mundanities
        Paths_intricacy
        Physics
        Protocol
        Util
        Version

    default-language: Haskell2010

    if flag(server)
        default-extensions: DoAndIfThenElse
        build-depends:
            base >=4.3 && <5,
            mtl >=2.2 && <2.4,
            transformers >=0.4 && <0.8,
            stm >=2.1 && <2.6,
            directory >=1.0 && <1.4,
            exceptions >=0.8.3 && <0.11,
            filepath >=1.0 && <1.6,
            time >=1.5 && <1.15,
            bytestring >=0.10 && <0.13,
            array >=0.3 && <0.6,
            containers >=0.4 && <0.9,
            vector >=0.9 && <0.14,
            binary >=0.5 && <0.11,
            network-fancy >=0.1.5 && <0.3,
            safe >=0.3.18 && <0.4,
            random >=1.0 && <1.4,
            pipes >=4 && <4.4,
            feed >=1.1 && <1.4,
            xml-conduit >=1.0 && <1.11,
            email-validate >=1.0 && <2.4,
            text >=0.1 && <3,
            text-short ==0.1.*,
            mime-mail >=0.4.4 && <0.6,
            memory >=0.11 && <0.19,
            crypton <1.1,
            argon2 ==1.3.*

        if !impl(ghc >=8.0)
            build-depends: semigroups ==0.18.*

        if flag(sendmail)
            cpp-options:   -DSENDMAIL
            build-depends:
                smtp-mail >=0.1.4.1 && <0.6
    else
        buildable: False