Permalink
Browse files

dev-lang/ghc-7.6.2: fix USE=-gmp build failure (missing divInteger fu…

…nction)

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
1 parent 7b22340 commit 943cd3d2a3f18c906e9eb0082ab52a7036b52594 @trofi trofi committed Mar 22, 2013
Showing with 58 additions and 0 deletions.
  1. +57 −0 dev-lang/ghc/files/ghc-7.6.2-integer-simple-div-mod.patch
  2. +1 −0 dev-lang/ghc/ghc-7.6.2.ebuild
@@ -0,0 +1,57 @@
+commit de13417726b90b0945aaaf0b9cfbaf8ab975d8b5
+Author: Gabor Greif <ggreif@gmail.com>
+Date: Tue Jul 24 14:31:36 2012 +0200
+
+ track integer-gmp and add 'divInteger', 'modInteger'
+
+diff --git a/libraries/integer-simple/GHC/Integer.hs b/libraries/integer-simple/GHC/Integer.hs
+index c9b50a7..4122d38 100644
+--- a/libraries/integer-simple/GHC/Integer.hs
++++ b/libraries/integer-simple/GHC/Integer.hs
+@@ -4,7 +4,7 @@
+ -----------------------------------------------------------------------------
+ -- |
+ -- Module : GHC.Integer
+--- Copyright : (c) Ian Lynagh 2007-2008
++-- Copyright : (c) Ian Lynagh 2007-2012
+ -- License : BSD3
+ --
+ -- Maintainer : igloo@earth.li
+@@ -27,6 +27,7 @@ module GHC.Integer (
+ plusInteger, minusInteger, timesInteger, negateInteger,
+ eqInteger, neqInteger, absInteger, signumInteger,
+ leInteger, gtInteger, ltInteger, geInteger, compareInteger,
++ divInteger, modInteger,
+ divModInteger, quotRemInteger, quotInteger, remInteger,
+ encodeFloatInteger, decodeFloatInteger, floatFromInteger,
+ encodeDoubleInteger, decodeDoubleInteger, doubleFromInteger,
+diff --git a/libraries/integer-simple/GHC/Integer/Type.hs b/libraries/integer-simple/GHC/Integer/Type.hs
+index c3d812c..67ed19c 100644
+--- a/libraries/integer-simple/GHC/Integer/Type.hs
++++ b/libraries/integer-simple/GHC/Integer/Type.hs
+@@ -7,7 +7,7 @@
+ -----------------------------------------------------------------------------
+ -- |
+ -- Module : GHC.Integer.Type
+--- Copyright : (c) Ian Lynagh 2007-2008
++-- Copyright : (c) Ian Lynagh 2007-2012
+ -- License : BSD3
+ --
+ -- Maintainer : igloo@earth.li
+@@ -370,6 +370,16 @@ n `divModInteger` d =
+ then (# q `minusInteger` oneInteger, r `plusInteger` d #)
+ else (# q, r #)
+
++{-# NOINLINE divInteger #-}
++divInteger :: Integer -> Integer -> Integer
++n `divInteger` d = quotient
++ where (# quotient, _ #) = n `divModInteger` d
++
++{-# NOINLINE modInteger #-}
++modInteger :: Integer -> Integer -> Integer
++n `modInteger` d = modulus
++ where (# _, modulus #) = n `divModInteger` d
++
+ {-# NOINLINE quotRemInteger #-}
+ quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
+ Naught `quotRemInteger` (!_) = (# Naught, Naught #)
@@ -394,6 +394,7 @@ src_prepare() {
use ghcmakebinary || epatch "${FILESDIR}"/${PN}-7.5.20120505-system-libffi.patch
epatch "${FILESDIR}"/${PN}-7.4.1-ticket-7339-fix-unaligned-unreg.patch
+ epatch "${FILESDIR}"/${PN}-7.6.2-integer-simple-div-mod.patch
if use prefix; then
# Make configure find docbook-xsl-stylesheets from Prefix

0 comments on commit 943cd3d

Please sign in to comment.