[DHG_packages] 01/01: Byteorder compatibility patch by Edmund Grimley Evans (Closes: #796800)

Joachim Breitner nomeata at moszumanska.debian.org
Tue Aug 25 20:18:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

nomeata pushed a commit to annotated tag haskell-cryptonite_v0.6-2
in repository DHG_packages.

commit ef0d81df99042840644a0385a379d137dd2d6c51
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Aug 25 22:03:51 2015 +0200

    Byteorder compatibility patch by Edmund Grimley Evans (Closes: #796800)
---
 p/haskell-cryptonite/debian/changelog              |  6 ++
 p/haskell-cryptonite/debian/control                |  3 +
 .../debian/patches/cryptonite-byteorder.patch      | 95 ++++++++++++++++++++++
 p/haskell-cryptonite/debian/patches/series         |  1 +
 4 files changed, 105 insertions(+)

diff --git a/p/haskell-cryptonite/debian/changelog b/p/haskell-cryptonite/debian/changelog
index e815ad4..4c9e523 100644
--- a/p/haskell-cryptonite/debian/changelog
+++ b/p/haskell-cryptonite/debian/changelog
@@ -1,3 +1,9 @@
+haskell-cryptonite (0.6-2) experimental; urgency=medium
+
+  * Byteorder compatibility patch by Edmund Grimley Evans (Closes: #796800)
+
+ -- Joachim Breitner <nomeata at debian.org>  Tue, 25 Aug 2015 22:03:42 +0200
+
 haskell-cryptonite (0.6-1) experimental; urgency=medium
 
   * New upstream release
diff --git a/p/haskell-cryptonite/debian/control b/p/haskell-cryptonite/debian/control
index 5d56eb6..7ba117d 100644
--- a/p/haskell-cryptonite/debian/control
+++ b/p/haskell-cryptonite/debian/control
@@ -10,6 +10,8 @@ Build-Depends: debhelper (>= 9),
  ghc-prof,
  libghc-memory-dev (>= 0.2),
  libghc-memory-prof,
+ libghc-byteorder-dev,
+ libghc-byteorder-prof,
  libghc-byteable-dev,
  libghc-memory-dev,
  libghc-tasty-dev,
@@ -18,6 +20,7 @@ Build-Depends: debhelper (>= 9),
  libghc-tasty-quickcheck-dev,
 Build-Depends-Indep: ghc-doc,
  libghc-memory-doc,
+ libghc-byteorder-doc,
 Standards-Version: 3.9.6
 Homepage: https://github.com/vincenthz/cryptonite
 Vcs-Browser: http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/haskell-cryptonite
diff --git a/p/haskell-cryptonite/debian/patches/cryptonite-byteorder.patch b/p/haskell-cryptonite/debian/patches/cryptonite-byteorder.patch
new file mode 100644
index 0000000..30e4600
--- /dev/null
+++ b/p/haskell-cryptonite/debian/patches/cryptonite-byteorder.patch
@@ -0,0 +1,95 @@
+Index: haskell-cryptonite/Crypto/Internal/CompatPrim.hs
+===================================================================
+--- haskell-cryptonite.orig/Crypto/Internal/CompatPrim.hs	2015-08-25 22:03:04.947561177 +0200
++++ haskell-cryptonite/Crypto/Internal/CompatPrim.hs	2015-08-25 22:03:04.943561093 +0200
+@@ -18,32 +18,29 @@
+ module Crypto.Internal.CompatPrim
+     ( be32Prim
+     , le32Prim
+-    , byteswap32Prim
+     , booleanPrim
+-    , convert4To32
+     ) where
+ 
+ import GHC.Prim
++import System.ByteOrder
+ 
+ -- | byteswap Word# to or from Big Endian
+ --
+ -- on a big endian machine, this function is a nop.
+ be32Prim :: Word# -> Word#
+-#ifdef ARCH_IS_LITTLE_ENDIAN
+-be32Prim = byteswap32Prim
+-#else
+-be32Prim w = w
+-#endif
++be32Prim w = case byteOrder of
++    BigEndian    -> w
++    LittleEndian -> byteswap32Prim w
++    _            -> error "be32Prim"
+ 
+ -- | byteswap Word# to or from Little Endian
+ --
+ -- on a little endian machine, this function is a nop.
+ le32Prim :: Word# -> Word#
+-#ifdef ARCH_IS_LITTLE_ENDIAN
+-le32Prim w = w
+-#else
+-le32Prim = byteswap32Prim
+-#endif
++le32Prim w = case byteOrder of
++    BigEndian    -> byteswap32Prim w
++    LittleEndian -> w
++    _            -> error "le32Prim"
+ 
+ -- | Simple compatibility for byteswap the lower 32 bits of a Word#
+ -- at the primitive level
+@@ -59,23 +56,6 @@
+      in or# a (or# b (or# c d))
+ #endif
+ 
+--- | combine 4 word8 [a,b,c,d] to a word32 representing [a,b,c,d]
+-convert4To32 :: Word# -> Word# -> Word# -> Word#
+-             -> Word#
+-convert4To32 a b c d = or# (or# c1 c2) (or# c3 c4)
+-  where
+-#ifdef ARCH_IS_LITTLE_ENDIAN
+-        !c1 = uncheckedShiftL# a 24#
+-        !c2 = uncheckedShiftL# b 16#
+-        !c3 = uncheckedShiftL# c 8#
+-        !c4 = d
+-#else
+-        !c1 = uncheckedShiftL# d 24#
+-        !c2 = uncheckedShiftL# c 16#
+-        !c3 = uncheckedShiftL# b 8#
+-        !c4 = a
+-#endif
+-
+ -- | Simple wrapper to handle pre 7.8 and future, where
+ -- most comparaison functions don't returns a boolean
+ -- anymore.
+Index: haskell-cryptonite/cryptonite.cabal
+===================================================================
+--- haskell-cryptonite.orig/cryptonite.cabal	2015-08-25 22:03:04.947561177 +0200
++++ haskell-cryptonite/cryptonite.cabal	2015-08-25 22:03:04.943561093 +0200
+@@ -165,6 +165,7 @@
+                      Crypto.Internal.Words
+                      Crypto.Internal.WordArray
+   Build-depends:     base >= 4.3 && < 5
++                   , byteorder
+                    , bytestring
+                    , memory >= 0.2
+                    , ghc-prim
+@@ -199,12 +200,6 @@
+                    , cbits/cryptonite_sysrand.c
+   include-dirs:  cbits cbits/ed25519
+ 
+-  -- FIXME armel or mispel is also little endian.
+-  -- might be a good idea to also add a runtime autodetect mode.
+-  -- ARCH_ENDIAN_UNKNOWN
+-  if (arch(i386) || arch(x86_64))
+-    CPP-options: -DARCH_IS_LITTLE_ENDIAN
+-
+   if arch(i386)
+     CPP-options: -DARCH_X86
+ 
diff --git a/p/haskell-cryptonite/debian/patches/series b/p/haskell-cryptonite/debian/patches/series
new file mode 100644
index 0000000..cdf39c5
--- /dev/null
+++ b/p/haskell-cryptonite/debian/patches/series
@@ -0,0 +1 @@
+cryptonite-byteorder.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git



More information about the Pkg-haskell-commits mailing list