Apply patch from upstream to allow th-expand-syns-0.3.0.4 to build with ghc 7.10
authorMark Wright <gienah@gentoo.org>
Sun, 4 Jan 2015 04:50:03 +0000 (04:50 +0000)
committerMark Wright <gienah@gentoo.org>
Sun, 4 Jan 2015 04:50:03 +0000 (04:50 +0000)
Package-Manager: portage-2.2.15/cvs/Linux x86_64
Manifest-Sign-Key: 0x618E971F

dev-haskell/th-expand-syns/ChangeLog
dev-haskell/th-expand-syns/Manifest
dev-haskell/th-expand-syns/files/th-expand-syns-0.3.0.4-ghc-7.10-1.patch [new file with mode: 0644]
dev-haskell/th-expand-syns/files/th-expand-syns-0.3.0.4-ghc-7.10-2.patch [new file with mode: 0644]
dev-haskell/th-expand-syns/th-expand-syns-0.3.0.4.ebuild

index 818e64845dc5af75b383bcf9daa040583b0719b3..aee1b25513a3167e6d4e1900d96d6cee64d6a30b 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for dev-haskell/th-expand-syns
-# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-haskell/th-expand-syns/ChangeLog,v 1.1 2014/12/14 06:18:18 gienah Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-haskell/th-expand-syns/ChangeLog,v 1.2 2015/01/04 04:49:53 gienah Exp $
+
+  04 Jan 2015; Mark Wright <gienah@gentoo.org>
+  +files/th-expand-syns-0.3.0.4-ghc-7.10-1.patch,
+  +files/th-expand-syns-0.3.0.4-ghc-7.10-2.patch, th-expand-syns-0.3.0.4.ebuild:
+  Apply patch from upstream to allow th-expand-syns-0.3.0.4 to build with ghc
+  7.10
 
 *th-expand-syns-0.3.0.4 (14 Dec 2014)
 
index 6d3eee1d57466c0311b03cf68a2c6e69b3589538..ef2cecf7f16b7af96fea7f6dd9846750be508b70 100644 (file)
@@ -1,14 +1,16 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA256
 
+AUX th-expand-syns-0.3.0.4-ghc-7.10-1.patch 9161 SHA256 09d7e031382a9059c1a81cb6e0cc647988598dd384688dad746b76597b203b9c SHA512 11550be9024df28a4ea48385d6e89fe43d7c7e9b6b2f022fbf21cc9154d3c76fc9c0855a59335ecc25c82d36a4c353c3209df56f1e21d069dcebf10e1483be28 WHIRLPOOL ed1cb1f701392bcbda893d03602addbbaf842774cc69f767d0a75ee15fcbfdf4194f9523078796c80638af81fa8627fa2c226146b92c8d5a7d52ed4e585e1b50
+AUX th-expand-syns-0.3.0.4-ghc-7.10-2.patch 2121 SHA256 9fa041acc822fe8ed05f81a077076cabdae7848416ccac9f015670d7780cc70b SHA512 e3f079cb9b9a06c649d45778975d857c6826f2db5c240a7199c6920e14ef4f22f3f9902aa4785c9ff5a44b1963c2c96484bb64bec688a7045ac3997ef786d128 WHIRLPOOL 4c7d64f352f796e7c7684502d6fb9c7da6702542af7e346d01288378b3fc131e3be59b4847fe18a10bb51398904e3eb69f6865578c3e33a19d2728a591d6b256
 DIST th-expand-syns-0.3.0.4.tar.gz 5605 SHA256 d82360ff04ae814bc9fb118c7cfc45ad40768c6ead6d16114102e07faa720f17 SHA512 308ffa7d1bc8c96aa103c729c64554a71593e69edfed996079ea75f1ae243b07df01be5e6f633f456862136a3e8e86b9bc372f2a0561d6e2415fd4ee48b6f227 WHIRLPOOL 11a50ea84381039771202c840ab4eda595060decaab0a97ed47dbc38b56c28d552d2f845127aa74e48383cdd54d2ddb75ffbbe230c9b0ae1729538c86fd2549d
-EBUILD th-expand-syns-0.3.0.4.ebuild 727 SHA256 2eb78f3497201a72a5e55577c0c190e1921150eef2478cb1cedf8166c4e4126a SHA512 a7a27e10bed2bc1896bae04c37ab128b859805431dc838b46d6b81c8dfe970b540602da142471a9dd3de58942f51022a6feceb73bbb916d63c8457124a5ee23f WHIRLPOOL b464bc5231ccef68932e672fb6eb360c3b22e400f9074e95c11b0d2808ee1e401b2028f042d96c91d8f4084821d20c450ad7dc7c386f78b69c2ecfb8622954fa
-MISC ChangeLog 381 SHA256 3c0e195b1e374b08d170a4df8dee8ec635417e8a6be2342004e19ee2e22a3668 SHA512 40ac07f685629d9d87626b80ac10eb5fa55c4a469499d196610bd833c14a33c53edeaf97c2ea9aa07f39ca30a2f0caad36010e7e254a5a3c0bfb982503c8a4c7 WHIRLPOOL 2ee23ddd61f89024ed85ebcde1b6cc331f563e52fe1fa46c14503f2b48be326c04b5bcd111fe78160b3237c47cd64b86d5a8c83579e6e29982b5af4580f30c10
+EBUILD th-expand-syns-0.3.0.4.ebuild 836 SHA256 d448938e2b07e9537d9488dda3617d8a536e6ac79b1455331ce8ab9e566a3315 SHA512 ed60a45052456a74859c5be1789ff3608d31ad7dd232d10b1231b701a635370499d5f74952a5501dbaed34625449f4cc3bc8499289d34be2d6aadae55edba298 WHIRLPOOL 16a2027b82158aa54e7a96c0cc1832af312d0f376f19206b690c781deb9215122abbc116444c402a51c49bbaec6361e78b95c6e7c320eb5d5620e7d3cdfb8cd1
+MISC ChangeLog 645 SHA256 b6cadd875ad35e0e11a643d0c0f1986aefa729e271ad6cfdea98fcb5798a5500 SHA512 27e1c2fffbee97a564868957695a85fca36e64d069c73b1b49457922658f934f7d97aff216519d24e559bd9625e52bb35e1c1e3ad633d5dbe89a6e0ffdda1db5 WHIRLPOOL 107a956fa9d5ee8aebfccccde6913bb49d8197ac1b9548c0d2370d91d3d3d58f98ea258f58ea261f2b5add33d29b680afbf415243942e21c873b6e866f120a71
 MISC metadata.xml 249 SHA256 640cf63d31458d56c1c0a2695b42f52bd29f9ffc0cdfae87192581c66a53b63a SHA512 c410dac8b58ca958e991c3f2d1ee171ca802e4ba678a10e16003cf9222b5506125d6e5e996564ae23f31be286520871c5a62a3bbd283f930033cfef0275c692e WHIRLPOOL 0acf48b26b579ff0c562c4a2af89fb64eb59bbf472784ac8893ac12eb9718bd6a2d1a03b7f4c983b0e4fff8ac915ea53f3dc29673db0c3f00efcdccbe6f7913f
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
-iF4EAREIAAYFAlSNK7MACgkQoBEVQmGOlx+6jQD+LMtyydaH9TQNcIDPlIXNvBt5
-LcTB0QtwxApQImITmk8A/j0J0GWaVe8HKiTfvndu4RNje3AJdDH7KhJBQAYw2OOd
-=tgWt
+iF4EAREIAAYFAlSoxnoACgkQoBEVQmGOlx+mjAEAjpZmbX0QS/EbtS1KpjAQGibf
+JbBj+/17Cf2gV5pd2DQBALT9mmxg8qxy61RTBpBqSqzJ+Tgq6GMatGbBvd6gK7ps
+=yEy3
 -----END PGP SIGNATURE-----
diff --git a/dev-haskell/th-expand-syns/files/th-expand-syns-0.3.0.4-ghc-7.10-1.patch b/dev-haskell/th-expand-syns/files/th-expand-syns-0.3.0.4-ghc-7.10-1.patch
new file mode 100644 (file)
index 0000000..c38efc5
--- /dev/null
@@ -0,0 +1,282 @@
+commit 2d8649d85bb1c728e8521b3a9aa6ebb2ff09586f
+Author: Gabor Greif <ggreif@gmail.com>
+Date:   Mon Jun 16 15:43:51 2014 +0200
+
+    M-x whitespace-cleanup
+
+diff --git a/Language/Haskell/TH/ExpandSyns.hs b/Language/Haskell/TH/ExpandSyns.hs
+index 1110124..cc0dccf 100644
+--- a/Language/Haskell/TH/ExpandSyns.hs
++++ b/Language/Haskell/TH/ExpandSyns.hs
+@@ -7,9 +7,9 @@ module Language.Haskell.TH.ExpandSyns(-- * Expand synonyms
+                                      ,substInType
+                                      ,substInCon
+                                      ,evades,evade) where
+-    
++
+ import Language.Haskell.TH hiding(cxt)
+-import qualified Data.Set as Set    
++import qualified Data.Set as Set
+ import Data.Generics
+ import Control.Monad
+ 
+@@ -20,26 +20,26 @@ import Control.Monad
+ 
+ packagename :: String
+ packagename = "th-expand-syns"
+-    
+-    
++
++
+ -- Compatibility layer for TH >=2.4 vs. 2.3
+ tyVarBndrGetName :: TyVarBndr -> Name
+ mapPred :: (Type -> Type) -> Pred -> Pred
+ bindPred :: (Type -> Q Type) -> Pred -> Q Pred
+ tyVarBndrSetName :: Name -> TyVarBndr -> TyVarBndr
+-                   
++
+ #if MIN_VERSION_template_haskell(2,4,0)
+ tyVarBndrGetName (PlainTV n) = n
+ tyVarBndrGetName (KindedTV n _) = n
+-                                
++
+ mapPred f (ClassP n ts) = ClassP n (f <$> ts)
+ mapPred f (EqualP t1 t2) = EqualP (f t1) (f t2)
+-                            
++
+ bindPred f (ClassP n ts) = ClassP n <$> mapM f ts
+ bindPred f (EqualP t1 t2) = EqualP <$> f t1 <*> f t2
+-                            
++
+ tyVarBndrSetName n (PlainTV _) = PlainTV n
+-tyVarBndrSetName n (KindedTV _ k) = KindedTV n k 
++tyVarBndrSetName n (KindedTV _ k) = KindedTV n k
+ #else
+ 
+ type TyVarBndr = Name
+@@ -48,7 +48,7 @@ tyVarBndrGetName = id
+ mapPred = id
+ bindPred = id
+ tyVarBndrSetName n _ = n
+-                       
++
+ #endif
+ 
+ 
+@@ -70,29 +70,29 @@ nameIsSyn n = do
+ #if MIN_VERSION_template_haskell(2,7,0)
+     FamilyI (FamilyD flavour name _ _) _ -> maybeWarnTypeFamily flavour name >> return Nothing
+ #endif
+-    _ -> do 
++    _ -> do
+             warn ("Don't know how to interpret the result of reify "++show n++" (= "++show i++").\n"++
+                   "I will assume that "++show n++" is not a type synonym.")
+             return Nothing
+-        
++
+ 
+ 
+ warn ::  String -> Q ()
+-warn msg = 
++warn msg =
+ #if MIN_VERSION_template_haskell(2,8,0)
+     reportWarning
+ #else
+-    report False 
++    report False
+ #endif
+       (packagename ++": "++"WARNING: "++msg)
+ 
+ 
+ #if MIN_VERSION_template_haskell(2,4,0)
+ maybeWarnTypeFamily :: FamFlavour -> Name -> Q ()
+-maybeWarnTypeFamily flavour name = 
++maybeWarnTypeFamily flavour name =
+   case flavour of
+     TypeFam ->
+-      warn ("Type synonym families (and associated type synonyms) are currently not supported (they won't be expanded). Name of unsupported family: "++show name) 
++      warn ("Type synonym families (and associated type synonyms) are currently not supported (they won't be expanded). Name of unsupported family: "++show name)
+ 
+     DataFam -> return ()
+       -- Nothing to expand for data families, so no warning
+@@ -129,8 +129,8 @@ expandSyns = \t ->
+ 
+       -- If @go args t = (args', t')@,
+       --
+-      -- Precondition: 
+-      --  All elements of `args' are expanded. 
++      -- Precondition:
++      --  All elements of `args' are expanded.
+       -- Postcondition:
+       --  All elements of `args'' and `t'' are expanded.
+       --  `t' applied to `args' equals `t'' applied to `args'' (up to expansion, of course)
+@@ -141,22 +141,22 @@ expandSyns = \t ->
+       go acc x@ArrowT = passThrough acc x
+       go acc x@(TupleT _) = passThrough acc x
+       go acc x@(VarT _) = passThrough acc x
+-                          
++
+       go [] (ForallT ns cxt t) = do
+         cxt' <- mapM (bindPred expandSyns) cxt
+         t' <- expandSyns t
+         return ([], ForallT ns cxt' t')
+ 
+-      go acc x@(ForallT _ _ _) = 
++      go acc x@(ForallT _ _ _) =
+           fail (packagename++": Unexpected application of the local quantification: "
+                 ++show x
+                 ++"\n    (to the arguments "++show acc++")")
+-                                  
+-      go acc (AppT t1 t2) = 
++
++      go acc (AppT t1 t2) =
+           do
+             r <- expandSyns t2
+             go (r:acc) t1
+-            
++
+       go acc x@(ConT n) =
+           do
+             i <- nameIsSyn n
+@@ -165,20 +165,20 @@ expandSyns = \t ->
+               Just (vars,body) ->
+                   if length acc < length vars
+                   then fail (packagename++": expandSyns: Underapplied type synonym: "++show(n,acc))
+-                  else 
++                  else
+                       let
+                           substs = zip vars acc
+                           expanded = foldr subst body substs
+                       in
+                         go (drop (length vars) acc) expanded
+-                        
++
+ 
+ #if MIN_VERSION_template_haskell(2,4,0)
+-      go acc (SigT t kind) = 
++      go acc (SigT t kind) =
+           do
+             (acc',t') <- go acc t
+-            return 
+-              (acc', 
++            return
++              (acc',
+                 SigT t' kind
+                 -- No expansion needed in kinds (todo: is this correct?)
+               )
+@@ -213,11 +213,11 @@ instance SubstTypeVariable Type where
+                     | otherwise = s
+       go ArrowT = ArrowT
+       go ListT = ListT
+-      go (ForallT vars cxt body) = 
++      go (ForallT vars cxt body) =
+           commonForallCase (v,t) (vars,cxt,body)
+-                        
++
+       go s@(TupleT _) = s
+-                        
++
+ #if MIN_VERSION_template_haskell(2,4,0)
+       go (SigT t1 kind) = SigT (go t1) kind
+ #endif
+@@ -237,23 +237,23 @@ instance SubstTypeVariable Type where
+ #endif
+ 
+ -- testCapture :: Type
+--- testCapture = 
+---     let 
++-- testCapture =
++--     let
+ --         n = mkName
+ --         v = VarT . mkName
+ --     in
+ --       substInType (n "x", v "y" `AppT` v "z")
+---                   (ForallT 
+---                    [n "y",n "z"] 
++--                   (ForallT
++--                    [n "y",n "z"]
+ --                    [ConT (mkName "Show") `AppT` v "x" `AppT` v "z"]
+ --                    (v "x" `AppT` v "y"))
+ 
+-                        
++
+ #if MIN_VERSION_template_haskell(2,4,0)
+ instance SubstTypeVariable Pred where
+     subst s = mapPred (subst s)
+ #endif
+-        
++
+ 
+ -- | Make a name (based on the first arg) that's distinct from every name in the second arg
+ --
+@@ -268,7 +268,7 @@ instance SubstTypeVariable Pred where
+ -- AST using 'mkName' to ensure a collision.
+ --
+ evade :: Data d => Name -> d -> Name
+-evade n t = 
++evade n t =
+     let
+         vars :: Set.Set Name
+         vars = everything Set.union (mkQ Set.empty Set.singleton) t
+@@ -276,11 +276,11 @@ evade n t =
+         go n1 = if n1 `Set.member` vars
+                 then go (bump n1)
+                 else n1
+-                     
++
+         bump = mkName . ('f':) . nameBase
+     in
+       go n
+-         
++
+ -- | Make a list of names (based on the first arg) such that every name in the result
+ -- is distinct from every name in the second arg, and from the other results
+ evades :: (Data t) => [Name] -> t -> [Name]
+@@ -300,7 +300,7 @@ instance SubstTypeVariable Con where
+       go (NormalC n ts) = NormalC n [(x, st y) | (x,y) <- ts]
+       go (RecC n ts) = RecC n [(x, y, st z) | (x,y,z) <- ts]
+       go (InfixC (y1,t1) op (y2,t2)) = InfixC (y1,st t1) op (y2,st t2)
+-      go (ForallC vars cxt body) = 
++      go (ForallC vars cxt body) =
+           commonForallCase (v,t) (vars,cxt,body)
+ 
+ 
+@@ -316,18 +316,18 @@ instance HasForallConstruct Con where
+ 
+ 
+ 
+-commonForallCase :: (SubstTypeVariable a, HasForallConstruct a) => 
++commonForallCase :: (SubstTypeVariable a, HasForallConstruct a) =>
+ 
+-                    (Name,Type) 
++                    (Name,Type)
+                  -> ([TyVarBndr],Cxt,a)
+                  -> a
+ commonForallCase vt@(v,t) (bndrs,cxt,body)
+ 
+-            -- If a variable with the same name as the one to be replaced is bound by the forall, 
++            -- If a variable with the same name as the one to be replaced is bound by the forall,
+             -- the variable to be replaced is shadowed in the body, so we leave the whole thing alone (no recursion)
+-          | v `elem` (tyVarBndrGetName <$> bndrs) = mkForall bndrs cxt body 
++          | v `elem` (tyVarBndrGetName <$> bndrs) = mkForall bndrs cxt body
+ 
+-          | otherwise = 
++          | otherwise =
+               let
+                   -- prevent capture
+                   vars = tyVarBndrGetName <$> bndrs
+@@ -336,11 +336,11 @@ commonForallCase vt@(v,t) (bndrs,cxt,body)
+                   substs = zip vars (VarT <$> freshes)
+                   doSubsts :: SubstTypeVariable b => b -> b
+                   doSubsts x = foldr subst x substs
+-                               
++
+               in
+-                mkForall 
++                mkForall
+                   freshTyVarBndrs
+-                  (fmap (subst vt . doSubsts) cxt ) 
++                  (fmap (subst vt . doSubsts) cxt )
+                   (     (subst vt . doSubsts) body)
+ 
+ 
diff --git a/dev-haskell/th-expand-syns/files/th-expand-syns-0.3.0.4-ghc-7.10-2.patch b/dev-haskell/th-expand-syns/files/th-expand-syns-0.3.0.4-ghc-7.10-2.patch
new file mode 100644 (file)
index 0000000..c6ada20
--- /dev/null
@@ -0,0 +1,69 @@
+commit dbf14af22edd0636d4f9c8b083e42565bfcf99c9
+Author: Gabor Greif <ggreif@gmail.com>
+Date:   Mon Jun 16 16:15:39 2014 +0200
+
+    Support for GHC HEAD (v7.9, aka. template-haskell-2.10)
+    
+    Pred is a type synonym now, and EqualityT is new.
+
+diff --git a/Language/Haskell/TH/ExpandSyns.hs b/Language/Haskell/TH/ExpandSyns.hs
+index cc0dccf..7a18c17 100644
+--- a/Language/Haskell/TH/ExpandSyns.hs
++++ b/Language/Haskell/TH/ExpandSyns.hs
+@@ -24,7 +24,9 @@ packagename = "th-expand-syns"
+ 
+ -- Compatibility layer for TH >=2.4 vs. 2.3
+ tyVarBndrGetName :: TyVarBndr -> Name
++#if !MIN_VERSION_template_haskell(2,10,0)
+ mapPred :: (Type -> Type) -> Pred -> Pred
++#endif
+ bindPred :: (Type -> Q Type) -> Pred -> Q Pred
+ tyVarBndrSetName :: Name -> TyVarBndr -> TyVarBndr
+ 
+@@ -32,11 +34,15 @@ tyVarBndrSetName :: Name -> TyVarBndr -> TyVarBndr
+ tyVarBndrGetName (PlainTV n) = n
+ tyVarBndrGetName (KindedTV n _) = n
+ 
++#if MIN_VERSION_template_haskell(2,10,0)
++bindPred = id
++#else
+ mapPred f (ClassP n ts) = ClassP n (f <$> ts)
+ mapPred f (EqualP t1 t2) = EqualP (f t1) (f t2)
+ 
+ bindPred f (ClassP n ts) = ClassP n <$> mapM f ts
+ bindPred f (EqualP t1 t2) = EqualP <$> f t1 <*> f t2
++#endif
+ 
+ tyVarBndrSetName n (PlainTV _) = PlainTV n
+ tyVarBndrSetName n (KindedTV _ k) = KindedTV n k
+@@ -198,6 +204,10 @@ expandSyns = \t ->
+       go acc x@(LitT _) = passThrough acc x
+ #endif
+ 
++#if MIN_VERSION_template_haskell(2,10,0)
++      go acc x@EqualityT = passThrough acc x
++#endif
++
+ class SubstTypeVariable a where
+     -- | Capture-free substitution
+     subst :: (Name, Type) -> a -> a
+@@ -236,6 +246,10 @@ instance SubstTypeVariable Type where
+       go s@(LitT _) = s
+ #endif
+ 
++#if MIN_VERSION_template_haskell(2,10,0)
++      go s@EqualityT = s
++#endif
++
+ -- testCapture :: Type
+ -- testCapture =
+ --     let
+@@ -249,7 +263,7 @@ instance SubstTypeVariable Type where
+ --                    (v "x" `AppT` v "y"))
+ 
+ 
+-#if MIN_VERSION_template_haskell(2,4,0)
++#if MIN_VERSION_template_haskell(2,4,0) && !MIN_VERSION_template_haskell(2,10,0)
+ instance SubstTypeVariable Pred where
+     subst s = mapPred (subst s)
+ #endif
index 8ffab641ae67f02965924cdc8cb87bcc3b0f004b..425674e3e0f7725b67554c95864f2b2928b46e3d 100644 (file)
@@ -1,13 +1,13 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-haskell/th-expand-syns/th-expand-syns-0.3.0.4.ebuild,v 1.1 2014/12/14 06:18:18 gienah Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-haskell/th-expand-syns/th-expand-syns-0.3.0.4.ebuild,v 1.2 2015/01/04 04:49:53 gienah Exp $
 
 EAPI=5
 
 # ebuild generated by hackport 0.4.4.9999
 
 CABAL_FEATURES="lib profile haddock hoogle hscolour"
-inherit haskell-cabal
+inherit base haskell-cabal
 
 DESCRIPTION="Expands type synonyms in Template Haskell ASTs"
 HOMEPAGE="http://hackage.haskell.org/package/th-expand-syns"
@@ -24,3 +24,7 @@ RDEPEND="dev-haskell/syb:=[profile?]
 DEPEND="${RDEPEND}
        >=dev-haskell/cabal-1.6
 "
+
+PATCHES=(
+       "${FILESDIR}/${PN}-0.3.0.4-ghc-7.10-1.patch"
+       "${FILESDIR}/${PN}-0.3.0.4-ghc-7.10-2.patch")