Skip to content
Snippets Groups Projects
Commit 304ad68d authored by Felix Yan's avatar Felix Yan
Browse files

rebuild with bencode 0.6.1.0

parent 142b0233
No related branches found
No related tags found
No related merge requests found
......@@ -3,23 +3,19 @@
_hkgname=bencode
pkgname=haskell-bencode
pkgver=0.6.0.0
pkgrel=23
pkgver=0.6.1.0
pkgrel=1
pkgdesc="Parser and printer for bencoded data."
url="https://hackage.haskell.org/package/${_hkgname}"
license=("BSD")
arch=('x86_64')
depends=('ghc-libs')
makedepends=('ghc')
source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz"
ghc-8.8.patch)
sha512sums=('be05a5a086d095e8ed79318c7b0a6e5e29f2483f8c9cbfe768c339353d473f8eb5c3060aaed9d60675bdfd13686e02b2261939ca6d34cc9488318daf2cc664d1'
'a1e2daff64d7e2d624df45630ac94d801b13b575a4c2dd6d20c08fec5e996203e08394e7a1da6dd8251a8a1ecbf378d2921973eff7cc0ca88aa93ebfcf175326')
depends=('ghc-libs' 'haskell-transformers-compat')
makedepends=('ghc' 'haskell-hspec' 'haskell-quickcheck')
source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
sha512sums=('41da03a169fdb3baca9325afa46e34c5c453f11668c48d15482811571eb73c716a7ef80fa7301f314bc18662ea18e6bf5539575a219580b339c99c272d5b52af')
prepare() {
cd $_hkgname-$pkgver
patch -p1 -i ../ghc-8.8.patch
echo -e "import Distribution.Simple\nmain = defaultMain" > Setup.hs
}
......@@ -27,7 +23,7 @@ build() {
cd $_hkgname-$pkgver
runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
--prefix=/usr --docdir=/usr/share/doc/$pkgname \
--prefix=/usr --docdir=/usr/share/doc/$pkgname --enable-tests \
--dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid
runhaskell Setup build
runhaskell Setup register --gen-script
......@@ -36,6 +32,11 @@ build() {
sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
}
check() {
cd $_hkgname-$pkgver
runhaskell Setup test
}
package() {
cd $_hkgname-$pkgver
......
From 8de5d71748c70144acc93e56c0f86065638f92ca Mon Sep 17 00:00:00 2001
From: Peter Simons <simons@cryp.to>
Date: Sat, 19 Oct 2019 16:13:18 +0200
Subject: [PATCH] Support the new MonadFail class introduced by ghc-8.8.1.
https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail
---
bencode.cabal | 2 ++
src/Data/BEncode/Parser.hs | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/src/Data/BEncode/Parser.hs b/src/Data/BEncode/Parser.hs
index 8e4cb0b..55a6160 100644
--- a/src/Data/BEncode/Parser.hs
+++ b/src/Data/BEncode/Parser.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : BParser
@@ -27,6 +28,7 @@ module Data.BEncode.Parser {-#
import Control.Applicative hiding (optional)
import Control.Monad
+import qualified Control.Monad.Fail as Fail
import Data.BEncode
import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Map as Map
@@ -61,6 +63,9 @@ instance Monad BParser where
Ok a b' -> runB (f a) b'
Error str -> Error str
return val = BParser $ Ok val
+#if MIN_VERSION_base(4,13,0)
+instance Fail.MonadFail BParser where
+#endif
fail str = BParser $ \_ -> Error str
instance Functor BParser where
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment