From 4718b5c523e1beccc2baee2e1ee3c991a0dedd55 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 28 Apr 2018 13:31:33 -0700 Subject: Switch to c2hs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- btls.cabal | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'btls.cabal') 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 -- cgit v1.2.3