packages feed

hnix-0.5.2: package.yaml

name:       hnix
version:    0.5.2
synopsis:   Haskell implementation of the Nix language
github:     haskell-nix/hnix
author:     John Wiegley
maintainer: johnw@newartisans.com
category:   System, Data, Nix
license:    BSD3

description:
  Haskell implementation of the Nix language.

extra-source-files:
  - LICENSE
  - README.md
  - package.yaml
  - data/*
  - data/nix/*
  - data/nix/corepkgs/*
  - data/nix/config/*
  - data/nix/perl/*
  - data/nix/perl/lib/Nix/*
  - data/nix/tests/*
  - data/nix/tests/plugins/*
  - data/nix/tests/lang/*
  - data/nix/tests/lang/readDir/*
  - data/nix/tests/lang/readDir/foo/*
  - data/nix/tests/lang/dir2/*
  - data/nix/tests/lang/dir4/*
  - data/nix/tests/lang/dir3/*
  - data/nix/tests/lang/dir1/*
  - data/nix/maintainers/*
  - data/nix/mk/*
  - data/nix/scripts/*
  - tests/eval-compare/*

flags:
  tracing:
    description: Enable full debug tracing
    manual: True
    default: False

  profiling:
    description: Enable profiling
    manual: True
    default: False

  optimize:
    description: Enable all optimization flags
    manual: True
    default: False

ghc-options:
  - -Wall

dependencies:
  - base                        >= 4.9 && < 5
  - ansi-wl-pprint
  - bytestring
  - containers
  - data-fix
  - deepseq                     >= 1.4.2 && < 1.5
  - exceptions
  - filepath
  - hashing
  - mtl
  - optparse-applicative
  - template-haskell
  - text
  - time
  - transformers
  - unordered-containers        >= 0.2.9 && < 0.3

when:
  - condition: flag(optimize)
    ghc-options:
      - -fexpose-all-unfoldings
      - -fspecialise-aggressively
      - -O2

  - condition: flag(tracing)
    cpp-options: -DENABLE_TRACING=1

  - condition: "os(linux) && impl(ghc >= 8.2) && impl(ghc < 8.3)"
    dependencies:
      - compact

  - condition: "!impl(ghcjs)"
    dependencies:
      - base16-bytestring
      - cryptohash-md5
      - cryptohash-sha1
      - cryptohash-sha256
      - cryptohash-sha512
      - serialise

library:
  source-dirs: src
  dependencies:
    - aeson
    - ansi-wl-pprint
    - array                     >= 0.4   && < 0.6
    - binary
    - deriving-compat           >= 0.3   && < 0.6
    - directory
    - http-types
    - http-client
    - http-client-tls
    - interpolate
    - lens-family-th
    - logict
    - megaparsec                >= 6.5   && < 7.0
    - monadlist
    - process
    - regex-tdfa
    - regex-tdfa-text
    - scientific
    - semigroups                >= 0.18  && < 0.19
    - split
    - syb
    - these
    - unix
    - vector
    - xml
  when:
    - condition: "impl(ghc < 8.1)"
      then:
        dependencies:
          - lens-family       == 1.2.1
          - lens-family-core  == 1.2.1
      else:
        dependencies:
          - lens-family       >= 1.2.2
          - lens-family-core  >= 1.2.2

    - condition: "impl(ghc < 8.4.0) && !flag(profiling)"
      dependencies:
        - ghc-datasize

    - condition: "impl(ghcjs)"
      then:
        dependencies:
          - hashable >= 1.2.4 && < 1.3
      else:
        exposed-modules:
          - Nix.Options.Parser
        dependencies:
          - hashable >= 1.2.5 && < 1.3
          - haskeline
          - pretty-show

executables:
  hnix:
    source-dirs: main
    main: Main.hs
    dependencies:
      - hnix
      - aeson
      - pretty-show
      - repline
      - haskeline
    when:
      - condition: "impl(ghcjs)"
        then:
          buildable: false
        else:
          buildable: true

tests:
  hnix-tests:
    source-dirs: tests
    main: Main.hs
    ghc-options: -threaded
    verbatim:
      build-tool-depends:
        hspec-discover:hspec-discover == 2.*
    dependencies:
      - hnix
      - Glob
      - directory
      - interpolate
      - process
      - split
      - tasty
      - tasty-hedgehog
      - tasty-hunit
      - tasty-th
      - unix
      - hedgehog
      - generic-random
      - Diff
      - megaparsec
      - tasty-quickcheck
      - pretty-show
    when:
      - condition: "impl(ghcjs)"
        then:
          buildable: false
        else:
          buildable: true

benchmarks:
  hnix-benchmarks:
    source-dirs: benchmarks
    main: Main.hs
    dependencies:
      - hnix
      - criterion
    when:
      - condition: "impl(ghcjs)"
        then:
          buildable: false
        else:
          buildable: true