summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2016-04-21 22:52:18 -0400
committerjoe <joe@jerkface.net>2016-04-21 22:52:18 -0400
commited0ea3133b14d84cede60d8706e925f03db9da53 (patch)
treeb5b4c12ec31334a22610dd6b2d61468bca5731da
parentdbe039a17b3e3ffa6f90c974f758a0b830f9fdba (diff)
Build fixes for Debian Jessie.
-rw-r--r--Compat.hs4
-rw-r--r--clean-dep.sh9
-rw-r--r--kiki.cabal17
-rw-r--r--kiki.hs2
4 files changed, 26 insertions, 6 deletions
diff --git a/Compat.hs b/Compat.hs
index 43f62c0..3b77851 100644
--- a/Compat.hs
+++ b/Compat.hs
@@ -1,3 +1,4 @@
1{-# LANGUAGE CPP #-}
1module Compat where 2module Compat where
2 3
3import Data.Bits 4import Data.Bits
@@ -7,6 +8,8 @@ import Data.ASN1.Encoding
7import Data.ASN1.BinaryEncoding 8import Data.ASN1.BinaryEncoding
8import Crypto.PubKey.RSA as RSA 9import Crypto.PubKey.RSA as RSA
9 10
11#if defined(VERSION_cryptonite)
12
10instance ASN1Object PublicKey where 13instance ASN1Object PublicKey where
11 toASN1 pubKey = \xs -> Start Sequence 14 toASN1 pubKey = \xs -> Start Sequence
12 : IntVal (public_n pubKey) 15 : IntVal (public_n pubKey)
@@ -38,6 +41,7 @@ instance ASN1Object PublicKey where
38 fromASN1 _ = 41 fromASN1 _ =
39 Left "fromASN1: RSA.PublicKey: unexpected format" 42 Left "fromASN1: RSA.PublicKey: unexpected format"
40 43
44#endif
41 45
42toPositive :: Integer -> Integer 46toPositive :: Integer -> Integer
43toPositive int 47toPositive int
diff --git a/clean-dep.sh b/clean-dep.sh
new file mode 100644
index 0000000..2a1bfe2
--- /dev/null
+++ b/clean-dep.sh
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3# Clean up generated debian/control file for jessie build.
4
5mv debian/control debian/control.bad
6
7grep -v -- '-cryptonite-\|-hourglass-\|-memory-' debian/control.bad | sed '/-x509-/{ s/1.6/1.4/; }' > debian/control
8
9# dpkg-checkbuilddeps: Unmet build dependencies: libghc-cryptonite-dev libghc-cryptonite-prof libghc-hourglass-dev libghc-hourglass-prof libghc-memory-dev libghc-memory-prof libghc-x509-dev (>= 1.6) libghc-x509-prof (>= 1.6) libghc-cryptonite-doc libghc-hourglass-doc libghc-memory-doc libghc-x509-doc (>= 1.6)
diff --git a/kiki.cabal b/kiki.cabal
index e301d7f..9e9e314 100644
--- a/kiki.cabal
+++ b/kiki.cabal
@@ -15,6 +15,10 @@ Flag cryptonite
15 Description: Use newer cryptonite-based x509 version 1.6 and higher 15 Description: Use newer cryptonite-based x509 version 1.6 and higher
16 Default: True 16 Default: True
17 17
18Flag hourglass
19 Description: Use newer hourglass-based x509 version 1.5 and higher
20 Default: True
21
18Executable kiki 22Executable kiki
19 Main-is: kiki.hs 23 Main-is: kiki.hs
20 -- base >=4.6 due to use of readEither in KikiD.Message 24 -- base >=4.6 due to use of readEither in KikiD.Message
@@ -24,15 +28,18 @@ Executable kiki
24 asn1-types -any, asn1-encoding -any, 28 asn1-types -any, asn1-encoding -any,
25 dataenc -any, text -any, pretty -any, pretty-show -any, 29 dataenc -any, text -any, pretty -any, pretty-show -any,
26 bytestring -any, binary -any, 30 bytestring -any, binary -any,
27 unix, time, 31 unix, time,
28 containers -any, process -any, filepath -any, 32 containers -any, process -any, filepath -any,
29 network -any, old-locale -any, zlib -any, 33 network -any, old-locale -any, zlib -any
30 hourglass -any
31 if !flag(cryptonite) 34 if !flag(cryptonite)
32 Build-Depends: crypto-pubkey >=0.2.3, cryptohash -any, 35 Build-Depends: crypto-pubkey >=0.2.3, cryptohash -any,
33 crypto-pubkey-types -any, x509 <1.6 36 crypto-pubkey-types -any
37 if flag(hourglass)
38 Build-Depends: hourglass -any, x509 >=1.5 && <1.6
39 else
40 Build-Depends: x509 <1.6
34 else 41 else
35 Build-Depends: cryptonite, x509 >=1.6, memory 42 Build-Depends: cryptonite, x509 >=1.6, memory, hourglass
36 ghc-options: -O2 -fwarn-unused-binds -fwarn-unused-imports 43 ghc-options: -O2 -fwarn-unused-binds -fwarn-unused-imports
37 c-sources: dotlock.c 44 c-sources: dotlock.c
38 45
diff --git a/kiki.hs b/kiki.hs
index 1be5b92..9a2000a 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -30,7 +30,7 @@ import System.Exit
30import System.IO (hPutStrLn,stderr) 30import System.IO (hPutStrLn,stderr)
31import qualified Codec.Binary.Base64 as Base64 31import qualified Codec.Binary.Base64 as Base64
32#if !defined(VERSION_cryptonite) 32#if !defined(VERSION_cryptonite)
33-- import qualified Crypto.Hash.RIPEMD160 as RIPEMD160 33import qualified Crypto.Hash.RIPEMD160 as RIPEMD160
34import qualified Crypto.Hash.SHA256 as SHA256 34import qualified Crypto.Hash.SHA256 as SHA256
35#else 35#else
36import Crypto.Hash.Algorithms (RIPEMD160(..)) 36import Crypto.Hash.Algorithms (RIPEMD160(..))