commit:     dfe2412fd89b3abd9efc1755bfc0c1939bbce9d6
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 21:12:08 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 21:12:22 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfe2412f

dev-haskell/hps: tweak for ghc-8.8

Reported-by:  Agostino Sarubbo
Closes: https://bugs.gentoo.org/736028
Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-haskell/hps/files/hps-0.15-ghc84.patch | 28 ++++++++++++++++++++++++++++
 dev-haskell/hps/hps-0.15.ebuild            |  4 ++++
 2 files changed, 32 insertions(+)

diff --git a/dev-haskell/hps/files/hps-0.15-ghc84.patch 
b/dev-haskell/hps/files/hps-0.15-ghc84.patch
new file mode 100644
index 00000000000..cbc67705459
--- /dev/null
+++ b/dev-haskell/hps/files/hps-0.15-ghc84.patch
@@ -0,0 +1,28 @@
+--- a/Graphics/PS/PS.hs
++++ b/Graphics/PS/PS.hs
+@@ -14,2 +14,3 @@ import qualified Graphics.PS.Paper as P
+ import qualified Graphics.PS.Image as I
++import qualified Data.Semigroup as S
+ 
+@@ -248,2 +249,6 @@ newtype MonadMonoid m = MonadMonoid {appMonadMonoid :: m 
()}
+ 
++instance Monad m => S.Semigroup (MonadMonoid m) where
++   (<>) (MonadMonoid a) (MonadMonoid b) =
++      MonadMonoid (a >> b)
++
+ instance Monad m => Monoid (MonadMonoid m) where
+--- a/Graphics/PS/Statistics.hs
++++ b/Graphics/PS/Statistics.hs
+@@ -6,2 +6,3 @@ import Graphics.PS.Image
+ import Graphics.PS.Path
++import qualified Data.Semigroup as S
+ 
+@@ -16,2 +17,8 @@ data Statistics = Statistics {nMoveTo :: Integer
+ 
++instance S.Semigroup Statistics where
++    (<>) p q =
++        let (Statistics m1 l1 c1 f1 g1 t1) = p
++            (Statistics m2 l2 c2 f2 g2 t2) = q
++        in Statistics (m1+m2) (l1+l2) (c1+c2) (f1+f2) (g1+g2) (t1+t2)
++
+ instance Monoid Statistics where

diff --git a/dev-haskell/hps/hps-0.15.ebuild b/dev-haskell/hps/hps-0.15.ebuild
index 672d8d90b53..ca36c1bdc7f 100644
--- a/dev-haskell/hps/hps-0.15.ebuild
+++ b/dev-haskell/hps/hps-0.15.ebuild
@@ -25,6 +25,10 @@ DEPEND="${RDEPEND}
        >=dev-haskell/cabal-1.8
 "
 
+PATCHES=(
+       "${FILESDIR}"/${P}-ghc84.patch
+)
+
 src_configure() {
        haskell-cabal_src_configure \
                $(cabal_flag build-exec build-exec)

Reply via email to