packages feed

Z-IO-0.5.0.0: Z-IO.cabal

cabal-version:              2.4
name:                       Z-IO
version:                    0.5.0.0
synopsis:                   Simple and high performance IO toolkit for Haskell
description:                Simple and high performance IO toolkit for Haskell, including
                            file system, network, ipc and more!
license:                    BSD-3-Clause
license-file:               LICENSE
author:                     Dong Han, Tao He
maintainer:                 winterland1989@gmail.com
copyright:                  (c) Project Z Contributors
category:                   Data
build-type:                 Simple
homepage:                   https://github.com/haskell-Z/Z-IO
bug-reports:                https://github.com/haskell-Z/Z-IO/issues

extra-source-files:         ChangeLog.md
                            README.md
                            LICENSE

                            -- zlib C sources
                            third_party/zlib/crc32.h
                            third_party/zlib/inffast.h 
                            third_party/zlib/inflate.h
                            third_party/zlib/trees.h 
                            third_party/zlib/deflate.h 
                            third_party/zlib/inffixed.h
                            third_party/zlib/inftrees.h 
                            third_party/zlib/zutil.h
                            third_party/zlib/gzguts.h

                            -- cwalk header
                            third_party/cwalk/include/cwalk.h

                            -- libuv C sources
                            third_party/libuv/include/uv.h
                            third_party/libuv/include/uv/aix.h
                            third_party/libuv/include/uv/android-ifaddrs.h
                            third_party/libuv/include/uv/bsd.h
                            third_party/libuv/include/uv/darwin.h
                            third_party/libuv/include/uv/errno.h
                            third_party/libuv/include/uv/linux.h
                            third_party/libuv/include/uv/os390.h
                            third_party/libuv/include/uv/posix.h
                            third_party/libuv/include/uv/stdint-msvc2008.h
                            third_party/libuv/include/uv/sunos.h
                            third_party/libuv/include/uv/threadpool.h
                            third_party/libuv/include/uv/tree.h
                            third_party/libuv/include/uv/unix.h
                            third_party/libuv/include/uv/version.h
                            third_party/libuv/include/uv/win.h

                            third_party/libuv/src/heap-inl.h
                            third_party/libuv/src/idna.h
                            third_party/libuv/src/queue.h
                            third_party/libuv/src/strscpy.h
                            third_party/libuv/src/uv-common.h

                            third_party/libuv/src/win/atomicops-inl.h
                            third_party/libuv/src/win/fs-fd-hash-inl.h
                            third_party/libuv/src/win/handle-inl.h
                            third_party/libuv/src/win/internal.h
                            third_party/libuv/src/win/req-inl.h
                            third_party/libuv/src/win/stream-inl.h
                            third_party/libuv/src/win/winapi.h
                            third_party/libuv/src/win/winsock.h

                            third_party/libuv/src/unix/atomic-ops.h
                            third_party/libuv/src/unix/darwin-stub.h
                            third_party/libuv/src/unix/darwin-stub.h
                            third_party/libuv/src/unix/internal.h
                            third_party/libuv/src/unix/linux-syscalls.h
                            third_party/libuv/src/unix/spinlock.h
                            third_party/libuv/src/unix/os390-syscalls.h

source-repository head
    type:     git
    location: git://github.com/haskell-Z/Z-IO.git

flag no-pkg-config
    description: Don't use pkg-config to check for library dependences(on platforms other than linux, win and osx)
    default: False
    manual: True

library
    exposed-modules:        Z.IO
                            Z.IO.BIO
                            Z.IO.BIO.Zlib
                            Z.IO.BIO.Concurrent

                            Z.IO.FileSystem
                            Z.IO.FileSystem.FilePath
                            Z.IO.FileSystem.Threaded
                            Z.IO.FileSystem.Watch

                            Z.IO.Network.SocketAddr
                            Z.IO.Network.DNS
                            Z.IO.Network.TCP
                            Z.IO.Network.UDP
                            Z.IO.Network.IPC
                            Z.IO.Network
                            Z.IO.Buffered
                            Z.IO.Exception
                            Z.IO.LowResTimer
                            Z.IO.Logger
                            Z.IO.Process
                            Z.IO.Resource
                            Z.IO.StdStream
                            Z.IO.StdStream.Ansi
                            Z.IO.Time

                            Z.IO.UV.Errno
                            Z.IO.UV.FFI
                            Z.IO.UV.Manager
                            Z.IO.UV.UVStream
                            Z.IO.UV.Win

                            Z.IO.Environment

                            -- Z.Compression.Zlib

    build-depends:          base                    >= 4.12 && <5.0
                          , exceptions              == 0.10.*
                          , primitive               >= 0.7.1 && < 0.7.2
                          , stm                     == 2.5.*
                          , unordered-containers    == 0.2.*
                          , containers              == 0.6.*
                          , Z-Data                  == 0.5.* 
                          , time                    >= 1.9 && <= 2.0
                          , unix-time               >= 0.4.7 && <= 0.5

    default-language:       Haskell2010
    default-extensions:     BangPatterns
                            BinaryLiterals
                            CApiFFI
                            ConstraintKinds
                            CPP 
                            DerivingStrategies
                            DeriveGeneric
                            DeriveAnyClass
                            DefaultSignatures
                            DataKinds
                            ExistentialQuantification
                            FlexibleContexts
                            FlexibleInstances
                            GeneralizedNewtypeDeriving 
                            KindSignatures
                            MagicHash
                            MultiParamTypeClasses
                            MultiWayIf
                            PartialTypeSignatures
                            PatternSynonyms 
                            PolyKinds
                            QuantifiedConstraints
                            QuasiQuotes
                            OverloadedStrings
                            RankNTypes
                            RecordWildCards
                            ScopedTypeVariables 
                            StandaloneDeriving
                            TemplateHaskell
                            TypeApplications
                            TypeFamilyDependencies
                            TypeFamilies
                            TypeOperators
                            TupleSections
                            UnboxedTuples 
                            UnliftedFFITypes 
                            ViewPatterns
    build-tool-depends:     hsc2hs:hsc2hs, hspec-discover:hspec-discover
    ghc-options:            -Wall

    include-dirs:           include
                            third_party/zlib
                            third_party/cwalk/include

    includes:               hs_uv.h
                            zlib.h
                            zconf.h
                            hs_cwalk.h

    install-includes:       hs_uv.h 
                            zlib.h
                            zconf.h
                            hs_cwalk.h

    cc-options:             -march=native -D_FILE_OFFSET_BITS=64
    c-sources:              cbits/hs_uv_base.c
                            cbits/hs_uv_dns.c
                            cbits/hs_uv_file.c
                            cbits/hs_uv_fs_event.c
                            cbits/hs_uv_stream.c
                            cbits/hs_uv_process.c
                            cbits/hs_uv_udp.c
                            cbits/hs_zlib.c
                            cbits/hs_cwalk.c

                            third_party/cwalk/src/cwalk.c

                            third_party/zlib/adler32.c
                            third_party/zlib/compress.c
                            third_party/zlib/crc32.c
                            third_party/zlib/deflate.c
                            third_party/zlib/infback.c
                            third_party/zlib/inffast.c
                            third_party/zlib/inflate.c
                            third_party/zlib/inftrees.c
                            third_party/zlib/trees.c
                            third_party/zlib/uncompr.c
                            third_party/zlib/zutil.c

                            third_party/libuv/src/fs-poll.c
                            third_party/libuv/src/idna.c
                            third_party/libuv/src/inet.c
                            third_party/libuv/src/random.c
                            third_party/libuv/src/strscpy.c
                            third_party/libuv/src/threadpool.c
                            third_party/libuv/src/timer.c
                            third_party/libuv/src/uv-data-getter-setters.c
                            third_party/libuv/src/uv-common.c
                            third_party/libuv/src/version.c

    -- Note: The c-sources list is taken from libuv's Makefile.mingw, needs to be
    -- updated when we bump up libuv's version.
    -- header files are ignored here, otherwise will confuse linker
    if os(windows)
        c-sources:
                            third_party/libuv/src/win/async.c
                            third_party/libuv/src/win/core.c
                            third_party/libuv/src/win/detect-wakeup.c
                            third_party/libuv/src/win/dl.c
                            third_party/libuv/src/win/error.c
                            third_party/libuv/src/win/fs-event.c
                            third_party/libuv/src/win/fs.c
                            third_party/libuv/src/win/getaddrinfo.c
                            third_party/libuv/src/win/getnameinfo.c
                            third_party/libuv/src/win/handle.c
                            third_party/libuv/src/win/loop-watcher.c
                            third_party/libuv/src/win/pipe.c
                            third_party/libuv/src/win/poll.c
                            third_party/libuv/src/win/process-stdio.c
                            third_party/libuv/src/win/process.c
                            third_party/libuv/src/win/signal.c
                            third_party/libuv/src/win/stream.c
                            third_party/libuv/src/win/tcp.c
                            third_party/libuv/src/win/thread.c
                            third_party/libuv/src/win/tty.c
                            third_party/libuv/src/win/udp.c
                            third_party/libuv/src/win/util.c
                            third_party/libuv/src/win/winapi.c
                            third_party/libuv/src/win/winsock.c

        cc-options:         -Wall -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600 -march=native
        cpp-options:        -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600
        include-dirs:       third_party/libuv/include
                            third_party/libuv/src
        -- The C runtime dependencies are imposed by libuv.
        extra-libraries:    psapi, Iphlpapi, userenv, Ws2_32
    else
        if os(linux)
            c-sources:          third_party/libuv/src/fs-poll.c
                                third_party/libuv/src/idna.c
                                third_party/libuv/src/inet.c
                                third_party/libuv/src/random.c
                                third_party/libuv/src/strscpy.c
                                third_party/libuv/src/threadpool.c
                                third_party/libuv/src/timer.c
                                third_party/libuv/src/uv-data-getter-setters.c
                                third_party/libuv/src/uv-common.c
                                third_party/libuv/src/version.c

                                third_party/libuv/src/unix/async.c
                                third_party/libuv/src/unix/core.c
                                third_party/libuv/src/unix/dl.c
                                third_party/libuv/src/unix/fs.c
                                third_party/libuv/src/unix/getaddrinfo.c
                                third_party/libuv/src/unix/getnameinfo.c
                                third_party/libuv/src/unix/loop.c
                                third_party/libuv/src/unix/loop-watcher.c
                                third_party/libuv/src/unix/pipe.c
                                third_party/libuv/src/unix/poll.c
                                third_party/libuv/src/unix/process.c
                                third_party/libuv/src/unix/random-devurandom.c
                                third_party/libuv/src/unix/signal.c
                                third_party/libuv/src/unix/stream.c
                                third_party/libuv/src/unix/tcp.c
                                third_party/libuv/src/unix/thread.c
                                third_party/libuv/src/unix/tty.c
                                third_party/libuv/src/unix/udp.c

                                third_party/libuv/src/unix/linux-core.c
                                third_party/libuv/src/unix/linux-inotify.c
                                third_party/libuv/src/unix/linux-syscalls.c
                                third_party/libuv/src/unix/procfs-exepath.c
                                third_party/libuv/src/unix/proctitle.c
                                third_party/libuv/src/unix/random-getrandom.c
                                third_party/libuv/src/unix/random-sysctl-linux.c

            include-dirs:       third_party/libuv/include
                                third_party/libuv/src/unix
                                third_party/libuv/src
            cc-options:        -Wall -march=native
        else
            if os(osx)
                c-sources:          third_party/libuv/src/fs-poll.c
                                    third_party/libuv/src/idna.c
                                    third_party/libuv/src/inet.c
                                    third_party/libuv/src/random.c
                                    third_party/libuv/src/strscpy.c
                                    third_party/libuv/src/threadpool.c
                                    third_party/libuv/src/timer.c
                                    third_party/libuv/src/uv-data-getter-setters.c
                                    third_party/libuv/src/uv-common.c
                                    third_party/libuv/src/version.c

                                    third_party/libuv/src/unix/async.c
                                    third_party/libuv/src/unix/core.c
                                    third_party/libuv/src/unix/dl.c
                                    third_party/libuv/src/unix/fs.c
                                    third_party/libuv/src/unix/getaddrinfo.c
                                    third_party/libuv/src/unix/getnameinfo.c
                                    third_party/libuv/src/unix/loop.c
                                    third_party/libuv/src/unix/loop-watcher.c
                                    third_party/libuv/src/unix/pipe.c
                                    third_party/libuv/src/unix/poll.c
                                    third_party/libuv/src/unix/process.c
                                    third_party/libuv/src/unix/random-devurandom.c
                                    third_party/libuv/src/unix/signal.c
                                    third_party/libuv/src/unix/stream.c
                                    third_party/libuv/src/unix/tcp.c
                                    third_party/libuv/src/unix/thread.c
                                    third_party/libuv/src/unix/tty.c
                                    third_party/libuv/src/unix/udp.c

                                    third_party/libuv/src/unix/bsd-ifaddrs.c
                                    third_party/libuv/src/unix/darwin-proctitle.c
                                    third_party/libuv/src/unix/darwin.c
                                    third_party/libuv/src/unix/fsevents.c
                                    third_party/libuv/src/unix/kqueue.c
                                    third_party/libuv/src/unix/proctitle.c
                                    third_party/libuv/src/unix/random-getentropy.c
                                   
                include-dirs:       third_party/libuv/include
                                    third_party/libuv/src/unix
                                    third_party/libuv/src
                cc-options:         -Wall -march=native

            else
                if flag(no-pkg-config)
                    extra-libraries:    uv
                else
                    pkgconfig-depends:  libuv >= 1.32
        
test-suite Z-IO-Test
    type:                   exitcode-stdio-1.0
    main-is:                Spec.hs
    hs-source-dirs:         test/
    build-depends:          base
                          , Z-IO    
                          , Z-Data
                          , hspec                   >= 2.5.4
                          , hashable
                          , HUnit
                          , QuickCheck              >= 2.10
                          , quickcheck-instances
                          , scientific
                          , primitive
                          , zlib
                          , bytestring

    other-modules:          Z.IO.BIOSpec
                            Z.IO.BIO.ZlibSpec
                            Z.IO.BIO.ConcurrentSpec
                            Z.IO.FileSystem.ThreadedSpec
                            Z.IO.FileSystemSpec
                            Z.IO.Network.UDPSpec
                            Z.IO.Network.TCPSpec
                            -- Z.IO.Network.IPCSpec
                            Z.IO.LowResTimerSpec
                            Z.IO.ProcessSpec
                            Z.IO.ResourceSpec

    ghc-options:            -threaded
    default-language:       Haskell2010
    build-tool-depends:     hspec-discover:hspec-discover == 2.*