packages feed

unix-time-0.4.13: unix-time.cabal

cabal-version:      1.18
name:               unix-time
version:            0.4.13
license:            BSD3
license-file:       LICENSE
maintainer:         Kazu Yamamoto <kazu@iij.ad.jp>
author:             Kazu Yamamoto <kazu@iij.ad.jp>
synopsis:           Unix time parser/formatter and utilities
description:        Fast parser\/formatter\/utilities for Unix time
category:           Data
build-type:         Configure
extra-source-files:
    cbits/config.h.in
    cbits/conv.c
    cbits/strftime.c
    cbits/strptime.c
    cbits/win_patch.c
    cbits/win_patch.h
    configure
    configure.ac

extra-tmp-files:
    config.log
    config.status
    autom4te.cache
    cbits/config.h

source-repository head
    type:     git
    location: https://github.com/kazu-yamamoto/unix-time

library
    exposed-modules:  Data.UnixTime
    build-tools:      hsc2hs >=0
    c-sources:        cbits/conv.c
    other-modules:
        Data.UnixTime.Conv
        Data.UnixTime.Diff
        Data.UnixTime.Types
        Data.UnixTime.Sys

    default-language: Haskell2010
    include-dirs:     cbits
    ghc-options:      -Wall
    build-depends:
        base >=4.4 && <5,
        bytestring,
        old-time,
        binary

    if impl(ghc >=7.8)
        cc-options: -fPIC

    -- GHC 9.4.5, 9.6.1, and 9.6.2 on Windows do not link against mingwex, but
    -- unix-time implicitly depends on this library due to the use of the
    -- gettimeofday() function, which comes from mingwex on Windows. To avoid
    -- linker errors in the absence of a mingwex dependency (see
    -- https://gitlab.haskell.org/ghc/ghc/-/issues/23533 for an example of
    -- this), we depend on mingwex explicitly here.
    --
    -- Other versions of GHC on Windows already depend on mingwex, so we guard
    -- this behind appropriate conditionals.
    if os(windows)
        if (impl(ghc >= 9.4.5) && !impl(ghc >= 9.4.6)) || (impl(ghc >= 9.6.1) && !impl(ghc >= 9.6.3))
            extra-libraries: mingwex

    if os(windows)
        c-sources:
            cbits/strftime.c
            cbits/strptime.c
            cbits/win_patch.c

test-suite spec
    type:             exitcode-stdio-1.0
    main-is:          Spec.hs
    build-tools:      hspec-discover >=2.6
    hs-source-dirs:   test
    other-modules:    UnixTimeSpec
    default-language: Haskell2010
    ghc-options:      -Wall
    build-depends:
        base,
        bytestring,
        old-locale,
        old-time,
        QuickCheck,
        template-haskell,
        time,
        unix-time,
        hspec >=2.6