# Hpack >= 0.35.0 is provided by Stack >= 2.9.1.
spec-version: 0.35.0

name: stack
version: '2.12.0'
synopsis: The Haskell Tool Stack
description: |
  Please see the documentation at <https://docs.haskellstack.org>
  for usage information.
  .
  If building a 'stack' executable for distribution, please download the
  source code from <https://github.com/commercialhaskell/stack/releases>
  and build it using Stack itself in order to ensure identical behaviour
  to official binaries. This package on Hackage is provided for convenience
  and bootstrapping purposes.
  .
  Note that the API for the library is not currently stable, and may
  change significantly, even between minor releases. It is
  currently only intended for use by the executable.
category: Development
author: Commercial Haskell SIG
maintainer: manny@fpcomplete.com
license: BSD3
github: commercialhaskell/stack
homepage: http://haskellstack.org
custom-setup:
  dependencies:
  - base >= 4.14.3.0 && < 5
  - Cabal < 3.10
  - filepath
extra-source-files:
# note: leaving out 'package.yaml' because it causes confusion with hackage metadata revisions
- CONTRIBUTING.md
- ChangeLog.md
- README.md
- stack.yaml
- doc/*.md
- src/setup-shim/StackSetupShim.hs
- test/package-dump/ghc-7.10.txt
- test/package-dump/ghc-7.8.4-osx.txt
- test/package-dump/ghc-7.8.txt
- test/package-dump/ghc-head.txt
- src/test/Stack/Untar/test1.tar.gz
- src/test/Stack/Untar/test2.tar.gz
# Support for people who prefer, or need, to build Stack with Cabal (the tool):
- cabal.project
- cabal.config
# GHC's GHC2021 language extension is supported by GHC >= 9.2.1
language: GHC2021
ghc-options:
- -fwrite-ide-info
- -hiedir=.hie
- -Wall
- -Wmissing-export-lists
# Workaround for https://github.com/haskell/cabal/issues/4739.
# -Wnon-noportable-include-path is a Clang diagnostic flag. See
# https://clang.llvm.org/docs/DiagnosticsReference.html#wnonportable-include-path
- -optP-Wno-nonportable-include-path
dependencies:
- base >= 4.14.3.0 && < 5
- Cabal >= 3.8.1.0
- aeson >= 2.0.3.0
- ansi-terminal >= 1.0
- array
- async
- attoparsec
- base64-bytestring
- bytestring
- casa-client
- conduit
- conduit-extra
- containers
- cryptonite
- directory
- echo
- exceptions
- extra
- file-embed
- filelock
- filepath
- fsnotify >= 0.4.1
- generic-deriving
- hi-file-parser >= 0.1.4.0
- hpack
- hpc
- http-client
- http-client-tls
- http-conduit
- http-download
- http-types
- memory
- microlens
- mtl
- mustache
- neat-interpolation
- open-browser
- optparse-applicative >= 0.18.1.0
- pantry >= 0.8.2.2
- path
- path-io
# In order for Cabal (the tool) to build Stack, it needs to be told of the
# upper bound on persistent. See
# https://github.com/commercialhaskell/stack/pull/5677#issuecomment-1193318542
- persistent >= 2.14.0.0 && < 2.15
- persistent-sqlite
- pretty
- process >= 1.6.13.2
- project-template
- random
- rio >= 0.1.22.0
- rio-prettyprint >= 0.1.4.0
- split
- stm
- tar
- template-haskell
- text
- time
- transformers
- unix-compat
- unordered-containers
- vector
- yaml
- zlib
when:
- condition: os(windows)
  then:
    cpp-options: -DWINDOWS
    dependencies:
    - Win32
  else:
    verbatim: |
      build-tool-depends:
          hsc2hs:hsc2hs
    dependencies:
    - unix
# See https://github.com/haskell/network/pull/552.
- condition: impl(ghc >= 9.4.5) && os(windows)
  dependencies: network >= 3.1.2.9
- condition: flag(developer-mode)
  then:
    cpp-options: -DSTACK_DEVELOPER_MODE_DEFAULT=True
  else:
    cpp-options: -DSTACK_DEVELOPER_MODE_DEFAULT=False
library:
  source-dirs: src/
  ghc-options:
  - -Widentities
  generated-exposed-modules:
  - Paths_stack
  exposed-modules:
  - Control.Concurrent.Execute
  - Data.Attoparsec.Args
  - Data.Attoparsec.Combinators
  - Data.Attoparsec.Interpreter
  - Data.Monoid.Map
  - Network.HTTP.StackClient
  - Options.Applicative.Args
  - Options.Applicative.Builder.Extra
  - Options.Applicative.Complicated
  - Path.CheckInstall
  - Path.Extra
  - Path.Find
  - Stack.Build
  - Stack.Build.Cache
  - Stack.Build.ConstructPlan
  - Stack.Build.Execute
  - Stack.Build.Haddock
  - Stack.Build.Installed
  - Stack.Build.Source
  - Stack.Build.Target
  - Stack.BuildPlan
  - Stack.Clean
  - Stack.Config
  - Stack.Config.Build
  - Stack.Config.Docker
  - Stack.Config.Nix
  - Stack.ConfigCmd
  - Stack.Constants
  - Stack.Constants.Config
  - Stack.Coverage
  - Stack.DefaultColorWhen
  - Stack.Docker
  - Stack.DockerCmd
  - Stack.Dot
  - Stack.Eval
  - Stack.Exec
  - Stack.FileWatch
  - Stack.GhcPkg
  - Stack.Ghci
  - Stack.Ghci.Script
  - Stack.Hoogle
  - Stack.IDE
  - Stack.Init
  - Stack.List
  - Stack.Ls
  - Stack.Lock
  - Stack.New
  - Stack.Nix
  - Stack.Options.BenchParser
  - Stack.Options.BuildMonoidParser
  - Stack.Options.BuildParser
  - Stack.Options.CleanParser
  - Stack.Options.ConfigParser
  - Stack.Options.Completion
  - Stack.Options.DockerParser
  - Stack.Options.DotParser
  - Stack.Options.EvalParser
  - Stack.Options.ExecParser
  - Stack.Options.GhcBuildParser
  - Stack.Options.GhciParser
  - Stack.Options.GhcVariantParser
  - Stack.Options.GlobalParser
  - Stack.Options.HaddockParser
  - Stack.Options.HpcReportParser
  - Stack.Options.InitParser
  - Stack.Options.LogLevelParser
  - Stack.Options.LsParser
  - Stack.Options.NewParser
  - Stack.Options.NixParser
  - Stack.Options.PackageParser
  - Stack.Options.PathParser
  - Stack.Options.ResolverParser
  - Stack.Options.SDistParser
  - Stack.Options.ScriptParser
  - Stack.Options.SetupParser
  - Stack.Options.TestParser
  - Stack.Options.UpgradeParser
  - Stack.Options.UploadParser
  - Stack.Options.Utils
  - Stack.Package
  - Stack.PackageDump
  - Stack.Path
  - Stack.Prelude
  - Stack.Query
  - Stack.Runners
  - Stack.Script
  - Stack.SDist
  - Stack.Setup
  - Stack.Setup.Installed
  - Stack.SetupCmd
  - Stack.SourceMap
  - Stack.Storage.Project
  - Stack.Storage.User
  - Stack.Storage.Util
  - Stack.Templates
  - Stack.Types.AddCommand
  - Stack.Types.AllowNewerDeps
  - Stack.Types.ApplyGhcOptions
  - Stack.Types.ApplyProgOptions
  - Stack.Types.Build
  - Stack.Types.Build.Exception
  - Stack.Types.BuildConfig
  - Stack.Types.BuildOpts
  - Stack.Types.CabalConfigKey
  - Stack.Types.ColorWhen
  - Stack.Types.CompilerBuild
  - Stack.Types.CompilerPaths
  - Stack.Types.Compiler
  - Stack.Types.Config
  - Stack.Types.Config.Exception
  - Stack.Types.ConfigMonoid
  - Stack.Types.ConfigureOpts
  - Stack.Types.Curator
  - Stack.Types.Docker
  - Stack.Types.DockerEntrypoint
  - Stack.Types.DownloadInfo
  - Stack.Types.DumpLogs
  - Stack.Types.DumpPackage
  - Stack.Types.EnvConfig
  - Stack.Types.EnvSettings
  - Stack.Types.ExtraDirs
  - Stack.Types.GHCDownloadInfo
  - Stack.Types.GHCVariant
  - Stack.Types.GhcOptionKey
  - Stack.Types.GhcOptions
  - Stack.Types.GhcPkgId
  - Stack.Types.GlobalOpts
  - Stack.Types.GlobalOptsMonoid
  - Stack.Types.IsMutable
  - Stack.Types.LockFileBehavior
  - Stack.Types.NamedComponent
  - Stack.Types.Nix
  - Stack.Types.Package
  - Stack.Types.PackageName
  - Stack.Types.ParentMap
  - Stack.Types.Platform
  - Stack.Types.Project
  - Stack.Types.ProjectAndConfigMonoid
  - Stack.Types.ProjectConfig
  - Stack.Types.PvpBounds
  - Stack.Types.Resolver
  - Stack.Types.Runner
  - Stack.Types.SCM
  - Stack.Types.SetupInfo
  - Stack.Types.SourceMap
  - Stack.Types.StackYamlLoc
  - Stack.Types.TemplateName
  - Stack.Types.UnusedFlags
  - Stack.Types.Version
  - Stack.Types.VersionedDownloadInfo
  - Stack.Uninstall
  - Stack.Unpack
  - Stack.Update
  - Stack.Upgrade
  - Stack.Upload
  - System.Info.ShortPathName
  - System.Permissions
  - System.Process.Pager
  - System.Terminal
  when:
  - condition: 'os(windows)'
    then:
      source-dirs: src/windows/
    else:
      source-dirs: src/unix/
      c-sources: src/unix/cbits/uname.c
executables:
  stack:
    main: Main.hs
    source-dirs: src/main
    generated-other-modules:
    - Build_stack
    - Paths_stack
    ghc-options:
    - -threaded
    - -rtsopts
    dependencies:
    - stack
    when:
    - condition: flag(static)
      ld-options:
      - -static
      - -pthread
    - condition: ! '!(flag(disable-git-info))'
      cpp-options: -DUSE_GIT_INFO
      dependencies:
      - githash
      - optparse-simple
    - condition: flag(hide-dependency-versions)
      cpp-options: -DHIDE_DEP_VERSIONS
    - condition: flag(supported-build)
      cpp-options: -DSUPPORTED_BUILD
  stack-integration-test:
    main: IntegrationSpec.hs
    source-dirs:
    - test/integration
    - test/integration/lib
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    dependencies:
    - filepath
    - hspec
    - optparse-generic
    when:
    - condition: ! '!(flag(integration-tests))'
      buildable: false
    - condition: flag(static)
      ld-options:
      - -static
      - -pthread
tests:
  stack-test:
    main: Spec.hs
    source-dirs: src/test
    when:
    - condition: 'os(windows)'
      then:
        source-dirs: src/test/windows/
      else:
        source-dirs: src/test/unix/
    ghc-options:
    - -threaded
    dependencies:
    - QuickCheck
    - hspec
    - raw-strings-qq
    - stack
    verbatim: |
      build-tool-depends:
          hspec-discover:hspec-discover
flags:
  static:
    description: >-
      When building the Stack executable, or the stack-integration-test
      executable, pass the -static and -pthread flags to the linker used by GHC.
    manual: true
    default: false
  disable-git-info:
    description: >-
      Disable inclusion of current Git information in the Stack executable when
      it is built.
    manual: true
    default: false
  hide-dependency-versions:
    description: >-
      Hides dependency versions from 'stack --version'. Used only when building
      a Stack executable for official release. Note to packagers/distributors:
      DO NOT OVERRIDE THIS FLAG IF YOU ARE BUILDING STACK ANY OTHER WAY (e.g.
      using Cabal or from Hackage), as it makes debugging support requests more
      difficult.
    manual: true
    default: false
  integration-tests:
    description: Run the integration test suite.
    manual: true
    default: false
  supported-build:
    description: >-
      If false, causes 'stack --version' to issue a warning about the build
      being unsupported. Used only when building a Stack executable for official
      release. Note to packagers/distributors: DO NOT OVERRIDE THIS FLAG IF YOU
      ARE BUILDING STACK ANY OTHER WAY (e.g. using Cabal or from Hackage), as it
      makes debugging support requests more difficult.
    manual: true
    default: false
  developer-mode:
    description: >-
      By default, output extra developer information.
    manual: true
    default: false
