summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/cabal-install-base16-bytestring1.0.patch
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2021-09-28 14:22:34 +0200
committerLars-Dominik Braun <lars@6xq.net>2021-10-08 09:13:53 +0200
commita38919085522cf1bd0761728f7dfefe0072bc548 (patch)
treeb196fa80a4267a6096bd7a2072b4156dfb92169f /gnu/packages/patches/cabal-install-base16-bytestring1.0.patch
parentb97f549b14402421fcfb360ddd4cff7de93b9af0 (diff)
downloadguix-patches-a38919085522cf1bd0761728f7dfefe0072bc548.tar
guix-patches-a38919085522cf1bd0761728f7dfefe0072bc548.tar.gz
gnu: cabal-install: Build with GHC 8.10.
* gnu/packages/patches/cabal-install-base16-bytestring1.0.patch: New patch. * gnu/packages/patches/cabal-install-ghc8.10.patch: Ditto. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/haskell-apps.scm (cabal-install) [source]: Use them.
Diffstat (limited to 'gnu/packages/patches/cabal-install-base16-bytestring1.0.patch')
-rw-r--r--gnu/packages/patches/cabal-install-base16-bytestring1.0.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/gnu/packages/patches/cabal-install-base16-bytestring1.0.patch b/gnu/packages/patches/cabal-install-base16-bytestring1.0.patch
new file mode 100644
index 0000000000..998bf08718
--- /dev/null
+++ b/gnu/packages/patches/cabal-install-base16-bytestring1.0.patch
@@ -0,0 +1,29 @@
+Restore compatibility with newer version of base16-bytestring.
+
+Taken from https://raw.githubusercontent.com/archlinux/svntogit-community/packages/trunk/cabal-install-base16-bytestring1.0.patch
+
+diff --git a/Distribution/Client/HashValue.hs b/Distribution/Client/HashValue.hs
+index 54b8aee9e..11e647c1c 100644
+--- a/Distribution/Client/HashValue.hs
++++ b/Distribution/Client/HashValue.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DeriveDataTypeable #-}
+ {-# LANGUAGE DeriveGeneric #-}
+ module Distribution.Client.HashValue (
+@@ -72,10 +73,14 @@ hashFromTUF (Sec.Hash hashstr) =
+ --TODO: [code cleanup] either we should get TUF to use raw bytestrings or
+ -- perhaps we should also just use a base16 string as the internal rep.
+ case Base16.decode (BS.pack hashstr) of
++#if MIN_VERSION_base16_bytestring(1,0,0)
++ Right hash -> HashValue hash
++ Left _ -> error "hashFromTUF: cannot decode base16"
++#else
+ (hash, trailing) | not (BS.null hash) && BS.null trailing
+ -> HashValue hash
+ _ -> error "hashFromTUF: cannot decode base16 hash"
+-
++#endif
+
+ -- | Truncate a 32 byte SHA256 hash to
+ --