summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2015-06-01 20:45:45 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2015-06-01 20:45:45 +0000
commit8618be601e11c50adbb261d85cbb29b44feffdbe (patch)
treefae09efddaa52fdc4cc1237e2ed3fc65e8f1cdbe /dev-haskell
parentclean up app-emulation/emul-linux which has been removed (diff)
downloadgentoo-2-8618be601e11c50adbb261d85cbb29b44feffdbe.tar.gz
gentoo-2-8618be601e11c50adbb261d85cbb29b44feffdbe.tar.bz2
gentoo-2-8618be601e11c50adbb261d85cbb29b44feffdbe.zip
Port to upcoming ghc-7.10.
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)
Diffstat (limited to 'dev-haskell')
-rw-r--r--dev-haskell/alex/ChangeLog6
-rw-r--r--dev-haskell/alex/alex-3.1.4.ebuild11
-rw-r--r--dev-haskell/alex/files/alex-3.1.4-ghc-7.10.patch24
3 files changed, 38 insertions, 3 deletions
diff --git a/dev-haskell/alex/ChangeLog b/dev-haskell/alex/ChangeLog
index c61f255217c4..456dc47a194d 100644
--- a/dev-haskell/alex/ChangeLog
+++ b/dev-haskell/alex/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-haskell/alex
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-haskell/alex/ChangeLog,v 1.85 2015/01/25 20:47:30 qnikst Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-haskell/alex/ChangeLog,v 1.86 2015/06/01 20:45:45 slyfox Exp $
+
+ 01 Jun 2015; Sergei Trofimovich <slyfox@gentoo.org>
+ +files/alex-3.1.4-ghc-7.10.patch, alex-3.1.4.ebuild:
+ Port to upcoming ghc-7.10.
*alex-3.1.4 (25 Jan 2015)
diff --git a/dev-haskell/alex/alex-3.1.4.ebuild b/dev-haskell/alex/alex-3.1.4.ebuild
index 3b8a226d6b53..a013cdf73351 100644
--- a/dev-haskell/alex/alex-3.1.4.ebuild
+++ b/dev-haskell/alex/alex-3.1.4.ebuild
@@ -1,13 +1,13 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-haskell/alex/alex-3.1.4.ebuild,v 1.1 2015/01/25 20:47:30 qnikst Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-haskell/alex/alex-3.1.4.ebuild,v 1.2 2015/06/01 20:45:45 slyfox Exp $
EAPI=5
# ebuild generated by hackport 0.3.4.9999
CABAL_FEATURES="bin test-suite"
-inherit autotools haskell-cabal
+inherit autotools eutils haskell-cabal
DESCRIPTION="Alex is a tool for generating lexical analysers in Haskell"
HOMEPAGE="http://www.haskell.org/alex/"
@@ -28,6 +28,8 @@ DEPEND="${RDEPEND}
>=dev-libs/libxslt-1.1.2 )"
src_prepare() {
+ epatch "${FILESDIR}"/${P}-ghc-7.10.patch
+
# drop depend on itself and happy, otherwise cabal tries to regenerate it
rm src/{Scan.x,Parser.y} || die
@@ -62,6 +64,11 @@ src_compile() {
fi
}
+src_test() {
+ # workaround https://github.com/haskell/cabal/issues/2398
+ emake -k -C tests all || die
+}
+
src_install() {
cabal_src_install
diff --git a/dev-haskell/alex/files/alex-3.1.4-ghc-7.10.patch b/dev-haskell/alex/files/alex-3.1.4-ghc-7.10.patch
new file mode 100644
index 000000000000..cb422b60d7c5
--- /dev/null
+++ b/dev-haskell/alex/files/alex-3.1.4-ghc-7.10.patch
@@ -0,0 +1,24 @@
+diff --git a/templates/wrappers.hs b/templates/wrappers.hs
+index a1a1a6d..c020cc7 100644
+--- a/templates/wrappers.hs
++++ b/templates/wrappers.hs
+@@ -284,6 +284,19 @@ runAlex input (Alex f)
+
+ newtype Alex a = Alex { unAlex :: AlexState -> Either String (AlexState, a) }
+
++instance Functor Alex where
++ fmap f a = Alex $ \s -> case unAlex a s of
++ Left msg -> Left msg
++ Right (s', a') -> Right (s', f a')
++
++instance Applicative Alex where
++ pure a = Alex $ \s -> Right (s, a)
++ fa <*> a = Alex $ \s -> case unAlex fa s of
++ Left msg -> Left msg
++ Right (s', f) -> case unAlex a s' of
++ Left msg -> Left msg
++ Right (s'', b) -> Right (s'', f b)
++
+ instance Monad Alex where
+ m >>= k = Alex $ \s -> case unAlex m s of
+ Left msg -> Left msg