aboutsummaryrefslogblamecommitdiffstats
path: root/nara.cabal
blob: 450dab49c387b0a3790e6ef24992cfd6106927f1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                    

                                                                                       
 





                       
               




















                               





                                      



                                    




                                           
                                          
                                     

                                            

                
               


                  
                          







                               
        











                         
 









                                
                      



                  





                   





                          
                            
                

                   

           



                   




               
                          


                               
name:                nara
version:             0.0.0.0
synopsis:            A userspace WireGuard implementation in Haskell
license:             GPL-3
license-file:        LICENSE
author:              Bin Jin
maintainer:          bjin@ctrl-d.org
category:            Network
build-type:          Simple
extra-source-files:  include/uapi.h, cbits/tun.h
cabal-version:       >=1.10
description:
    nara is a userspace implementation of <https://www.wireguard.io WireGuard> ,
    a fast, modern and secure VPN based on <https://noiseprotocol.org/ Noise> protocol.

flag static
  description:
    enable static build
  default:
    False

executable nara
  hs-source-dirs:      app
  main-is:             Main.hs
  ghc-options:
    -Wall -Werror -O2 -threaded
  if flag(static)
    ghc-options:
      -optl-static
  build-depends:       
    base,
    nara,
    directory,
    filepath,
    unix == 2.7.*,
    optparse-applicative
  default-language: 
    Haskell2010

library
--  main-is:
--    Main.hs
  exposed-modules:
    Network.WireGuard.Core,
    Network.WireGuard.Daemon,
    Network.WireGuard.Foreign.In6Addr,
    Network.WireGuard.Foreign.Key,
    Network.WireGuard.Foreign.Tun,
    Network.WireGuard.Foreign.UAPI,
    Network.WireGuard.RPC,
    Network.WireGuard.TunListener,
    Network.WireGuard.UdpListener,
    Network.WireGuard.Internal.Util,
    Network.WireGuard.Internal.Constant,
    Network.WireGuard.Internal.IPPacket,
    Network.WireGuard.Internal.Noise,
    Network.WireGuard.Internal.Packet,
    Network.WireGuard.Internal.PacketQueue,
    Network.WireGuard.Internal.RpcParsers,
    Network.WireGuard.Internal.State,
    Network.WireGuard.Internal.Data.Types,
    Network.WireGuard.Internal.Data.RpcTypes
  build-depends:
    async,
    attoparsec,
    base == 4.9.*,
    blake2,
    bytestring,
    bytestring-conversion,
    cacophony >=0.9.2 && <0.10,
    cereal,
    conduit,
    conduit-extra,
    cryptonite,
    directory,
    exceptions,
    filepath,
    hex,
    iproute == 1.7.*,
    lens,
    memory == 0.14.*,
    network == 2.6.*,
    optparse-applicative,
    random,
    stm,
    streaming-commons,
    transformers,
    unix == 2.7.*,
    unordered-containers


  if os(linux)
    c-sources: cbits/tun-linux.c
    cpp-options: -DOS_LINUX
  if os(darwin)
    c-sources: cbits/tun-macos.c
    cpp-options: -DOS_MACOS
  if !os(linux) && !os(darwin)
    buildable: False

  ghc-options:
    -Wall -Werror -O2 
  if flag(static)
    ghc-options:
      -optl-static

  hs-source-dirs:
    src
  include-dirs:
    include
  default-language:
    Haskell2010

test-suite nara-test
  type: exitcode-stdio-1.0
  main-is: Spec.hs
  hs-source-dirs:
      tests/spec
  ghc-options: -Wall -Werror
  build-depends:
      attoparsec
    , base == 4.9.*
    , hspec
    , nara
    , bytestring
    , conduit-extra
    , conduit
    , stm
    , memory
    , cacophony
    , hex
    , network
    , iproute
    , unordered-containers
  other-modules:
    Network.WireGuard.RPCSpec
  default-language: Haskell2010