aboutsummaryrefslogtreecommitdiff
path: root/btls.cabal
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2018-04-28 13:31:33 -0700
committerGravatar Benjamin Barenblat <bbaren@google.com>2018-04-28 13:31:33 -0700
commit4718b5c523e1beccc2baee2e1ee3c991a0dedd55 (patch)
tree31951c140beee29e4e37e3f9d964ab3b08489fbb /btls.cabal
parent9093457e1f4bb437eb73c8cf1bcbb9eb342735e9 (diff)
Switch to c2hs
Let the computer figure out its own types for most foreign imports. Continue using the vanilla FFI for finalizers, though, as that’s the easiest way to deal with function pointers. Reuse the build hook from gtk2hs-buildtools to work around Cabal’s inability to topologically sort .chs dependencies (https://github.com/haskell/cabal/issues/1906).
Diffstat (limited to 'btls.cabal')
-rw-r--r--btls.cabal11
1 files changed, 7 insertions, 4 deletions
diff --git a/btls.cabal b/btls.cabal
index a341311..e4f7a5d 100644
--- a/btls.cabal
+++ b/btls.cabal
@@ -26,23 +26,24 @@ maintainer: bbaren@google.com
category: Network
build-type: Custom
tested-with: GHC ==8.0.2
-extra-source-files: third_party
+extra-source-files: cbits
+ , third_party
custom-setup
setup-depends: base
, Cabal >=1.4 && <2.1
, directory <1.4
, filepath <1.5
+ , gtk2hs-buildtools >=0.13.2.1 && <0.14
library
hs-source-dirs: src
default-language: Haskell2010
- other-extensions: CApiFFI
- , ExistentialQuantification
+ other-extensions: ExistentialQuantification
, NamedFieldPuns
, Rank2Types
, ScopedTypeVariables
- build-tools: hsc2hs
+ build-tools: c2hs
include-dirs: third_party/boringssl/src/include
ghc-options: -Weverything
-Wno-all-missed-specialisations
@@ -53,7 +54,9 @@ library
exposed-modules: Data.Digest
, Data.Hmac
other-modules: Data.Digest.Internal
+ , Foreign.Ptr.Cast
, Foreign.Ptr.ConstantTimeEquals
+ c-sources: cbits/btls.c
-- Use special names for the BoringSSL libraries to avoid accidentally pulling
-- in OpenSSL.
extra-libraries: btls_crypto