commit:     68efb77efb808d9575e5066690c4012271e5aebe
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 10:01:00 2016 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 10:01:41 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68efb77e

app-forensics/quickfuzz: a new experimental propert-based fuzzer

10-page paper on how it works and how to use it:
    
https://github.com/CIFASIS/QuickFuzz/releases/download/haskell16-draft/draft-haskell16.pdf

TL;DR:

    $ QuickFuzz Png 'pngcheck @' -a zzuf -s 10
  or
    $ QuickFuzz Png 'pngcheck @' -a radamsa -s 10
  or
    $ QuickFuzz Png 'pngcheck @' -a honggfuzz -s 10

Many other formats are supported.

Package-Manager: portage-2.3.0

 app-forensics/quickfuzz/Manifest                   |   1 +
 .../quickfuzz/files/quickfuzz-0.1-QC-2.9.patch     |  23 +++
 ...fuzz-0.1_p20160909-megadeth-better-erroro.patch |   9 ++
 ...ickfuzz-0.1_p20160909-megadeth-ghc-8-gadt.patch |  12 ++
 .../quickfuzz-0.1_p20160909-megadeth-ghc-8.patch   |  34 ++++
 .../files/quickfuzz-0.1_p20160909-th-2.11-1.patch  |  22 +++
 .../files/quickfuzz-0.1_p20160909-th-2.11-2.patch  |  87 +++++++++++
 .../quickfuzz-0.1_p20160909-ttasm-layout.patch     |  11 ++
 .../quickfuzz-9999-megadeth-better-erroro.patch    |   9 ++
 .../files/quickfuzz-9999-megadeth-ghc-8-gadt.patch |  12 ++
 .../files/quickfuzz-9999-megadeth-ghc-8.patch      |  34 ++++
 .../quickfuzz/files/quickfuzz-9999-th-2.11-1.patch |  22 +++
 .../quickfuzz/files/quickfuzz-9999-th-2.11-2.patch |  87 +++++++++++
 .../files/quickfuzz-9999-ttasm-layout.patch        |  11 ++
 app-forensics/quickfuzz/metadata.xml               |  23 +++
 .../quickfuzz/quickfuzz-0.1_p20160909.ebuild       | 148 ++++++++++++++++++
 app-forensics/quickfuzz/quickfuzz-9999.ebuild      | 173 +++++++++++++++++++++
 17 files changed, 718 insertions(+)

diff --git a/app-forensics/quickfuzz/Manifest b/app-forensics/quickfuzz/Manifest
new file mode 100644
index 00000000..ae9940c
--- /dev/null
+++ b/app-forensics/quickfuzz/Manifest
@@ -0,0 +1 @@
+DIST quickfuzz-0.1_p20160909.tar.bz2 32556776 SHA256 
a0ea0b0b46e8b123afa0f3b71ceaf44b233185dd8d310e9472055aea3abe8442 SHA512 
4408e1a06c178c5963a8897204615e96dfce59e98a4403e20b364d9b5200cb690209e85a1542ecd3d562f39c6117ae022877b2cea46a6be0ca1bde5a7c72800c
 WHIRLPOOL 
f923858987058b96f06c07cf3e18908dc4a156a61d1cbb91859af63b78014ad573aa3ff818c9375b3a971ba9926d070f58a5d9d2b4d8ff3d68c849818e7cbe7d

diff --git a/app-forensics/quickfuzz/files/quickfuzz-0.1-QC-2.9.patch 
b/app-forensics/quickfuzz/files/quickfuzz-0.1-QC-2.9.patch
new file mode 100644
index 00000000..1cbf88d
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-0.1-QC-2.9.patch
@@ -0,0 +1,23 @@
+diff --git a/src/Misc.hs b/src/Misc.hs
+index 1aa0699..c514ae9 100644
+--- a/src/Misc.hs
++++ b/src/Misc.hs
+@@ -1,9 +1,12 @@
++{-# LANGUAGE CPP #-}
+ module Misc where
+ 
+ import Test.QuickCheck
+ import Data.Map
+ import Data.Monoid
+ 
++#if ! MIN_VERSION_QuickCheck(2,9,0)
++
+ instance Arbitrary a => Arbitrary (Last a) where
+        arbitrary = do
+            ga <- arbitrary
+@@ -43,3 +46,5 @@ instance (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary 
d, Arbitrary e, Arbit
+      x6 <- arbitrary
+      x7 <- arbitrary
+      return (x1,x2,x3,x4,x5,x6,x7)
++
++#endif

diff --git 
a/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-better-erroro.patch
 
b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-better-erroro.patch
new file mode 100644
index 00000000..a9ce21b
--- /dev/null
+++ 
b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-better-erroro.patch
@@ -0,0 +1,9 @@
+diff --git a/Megadeth/Prim.hs b/Megadeth/Prim.hs
+index ad1782c..2f39336 100644
+--- a/bundled/megadeth/Megadeth/Prim.hs
++++ b/bundled/megadeth/Megadeth/Prim.hs
+@@ -82,3 +82,3 @@ simpleConView tyName c =
+   ForallC _ _ innerCon -> simpleConView tyName innerCon
+-
++  _ -> error $ "simpleConView: failed on " ++ show c
+ 

diff --git 
a/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-ghc-8-gadt.patch
 
b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-ghc-8-gadt.patch
new file mode 100644
index 00000000..87d7cf2
--- /dev/null
+++ 
b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-ghc-8-gadt.patch
@@ -0,0 +1,12 @@
+diff --git a/Megadeth/Prim.hs b/Megadeth/Prim.hs
+index 2f39336..7911bc3 100644
+--- a/bundled/megadeth/Megadeth/Prim.hs
++++ b/bundled/megadeth/Megadeth/Prim.hs
+@@ -82,2 +82,7 @@ simpleConView tyName c =
+   ForallC _ _ innerCon -> simpleConView tyName innerCon
++#if MIN_VERSION_template_haskell(2,11,0)
++  -- handling: GadtC [Codec.Picture.Metadata.Gamma] [] (AppT (ConT 
Codec.Picture.Metadata.Keys) (ConT GHC.Types.Double))
++  GadtC [n] sts _ -> let ts = map snd sts
++                     in SimpleCon n (count ts) ts
++#endif
+   _ -> error $ "simpleConView: failed on " ++ show c

diff --git 
a/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-ghc-8.patch 
b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-ghc-8.patch
new file mode 100644
index 00000000..68219db
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-megadeth-ghc-8.patch
@@ -0,0 +1,34 @@
+diff --git a/Megadeth/Prim.hs b/Megadeth/Prim.hs
+index eb969a5..ad1782c 100644
+--- a/bundled/megadeth/Megadeth/Prim.hs
++++ b/bundled/megadeth/Megadeth/Prim.hs
+@@ -3,2 +3,3 @@
+ {-# LANGUAGE ViewPatterns    #-}
++{-# LANGUAGE CPP             #-}
+ module Megadeth.Prim where
+@@ -137,3 +138,7 @@ getDeps t ban = do
+       case tip of
++#if MIN_VERSION_template_haskell(2,11,0)
++                    TyConI (DataD _ _ _ _mkind constructors _) -> do
++#else
+                     TyConI (DataD _ _ _ constructors _) -> do
++#endif
+                           let innerTypes = nub $ concat [ findLeafTypes ty | 
(simpleConView t -> SimpleCon _ _ tys) <- constructors, ty <- tys, not (isVarT 
ty) ]
+@@ -146,3 +151,7 @@ getDeps t ban = do
+                           mapM_ getDeps' hof
++#if MIN_VERSION_template_haskell(2,11,0)
++                    TyConI (NewtypeD _ nm _  _mkind constructor _) -> do
++#else
+                     TyConI (NewtypeD _ nm _ constructor _) -> do
++#endif
+                           let (SimpleCon _ 0 ts )= simpleConView nm 
constructor
+@@ -187,4 +196,9 @@ isinsName className n = do
+         case inf of
++#if MIN_VERSION_template_haskell(2,11,0)
++            TyConI (DataD _ _ preq _mkind _ _) -> doPreq className n preq
++            TyConI (NewtypeD _ _ preq _mkind _ _) -> doPreq className n preq
++#else
+             TyConI (DataD _ _ preq _ _) -> doPreq className n preq
+             TyConI (NewtypeD _ _ preq _ _) -> doPreq className n preq
++#endif
+             TyConI (TySynD _ preq _ ) -> doPreq className n preq

diff --git 
a/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-th-2.11-1.patch 
b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-th-2.11-1.patch
new file mode 100644
index 00000000..436df0e
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-th-2.11-1.patch
@@ -0,0 +1,22 @@
+diff --git a/src/DeriveArbitrary.hs b/src/DeriveArbitrary.hs
+index d42b896..fc94945 100644
+--- a/src/DeriveArbitrary.hs
++++ b/src/DeriveArbitrary.hs
+@@ -26,7 +26,7 @@ import Data.List.Split
+ import Data.Maybe
+ -- Gen
+ import Language.Haskell.TH
+-import Language.Haskell.TH.Syntax
++import Language.Haskell.TH.Syntax as TH
+ import Test.QuickCheck
+ import GHC.Exts
+ import GHC.Types
+@@ -38,7 +38,7 @@ import Control.Applicative
+ import Data.List
+ 
+ -- | Build the arbitrary function with makeArbs
+-chooseExpQ :: Name -> Name -> Name -> Integer -> Type -> ExpQ
++chooseExpQ :: Name -> Name -> Name -> Integer -> TH.Type -> ExpQ
+ chooseExpQ g n t bf (AppT ListT ty) = [| listOf $ resize ($(varE  n) `div` 
10) arbitrary |]
+ chooseExpQ g n t bf ty | headOf ty /= t = [| resize (max 0 ($(varE n) - 1)) 
arbitrary |]
+ chooseExpQ g n t bf ty =

diff --git 
a/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-th-2.11-2.patch 
b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-th-2.11-2.patch
new file mode 100644
index 00000000..5ac7f4d
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-th-2.11-2.patch
@@ -0,0 +1,87 @@
+diff --git a/src/DeriveArbitrary.hs b/src/DeriveArbitrary.hs
+index fc94945..6f2d77f 100644
+--- a/src/DeriveArbitrary.hs
++++ b/src/DeriveArbitrary.hs
+@@ -3,2 +3,3 @@
+ {-# LANGUAGE LambdaCase #-}
++{-# LANGUAGE CPP #-}
+ module DeriveArbitrary (
+@@ -39,2 +40,8 @@ import Data.List
+ 
++#if MIN_VERSION_template_haskell(2,11,0)
++#    define TH211MBKIND _maybe_kind
++#else
++#    define TH211MBKIND
++#endif
++
+ -- | Build the arbitrary function with makeArbs
+@@ -80,3 +87,3 @@ deriveArbitrary t = do
+     case inf of
+-        TyConI (DataD _ _ params constructors _) -> do
++        TyConI (DataD _ _ params TH211MBKIND constructors _) -> do
+               let ns  = map varT $ paramNames params
+@@ -111,3 +118,3 @@ deriveArbitrary t = do
+                                  where go n = $(gos 'go 'n)|]
+-        TyConI (NewtypeD _ _ params con _) -> do 
++        TyConI (NewtypeD _ _ params TH211MBKIND con _) -> do 
+             let ns = map varT $ paramNames params
+@@ -281,3 +288,3 @@ customG name = do
+                 
+-        TyConI (DataD _ _ params constructors _) ->
++        TyConI (DataD _ _ params TH211MBKIND constructors _) ->
+             let fnm = mkName "prob_gen" -- "customGen_" ++ (map (\x -> if x 
== '.' then '_' else
+diff --git a/src/DeriveFixable.hs b/src/DeriveFixable.hs
+index ec8b8be..83593e6 100644
+--- a/src/DeriveFixable.hs
++++ b/src/DeriveFixable.hs
+@@ -1,2 +1,3 @@
+ {-# Language TemplateHaskell, ConstraintKinds, FlexibleInstances, 
FlexibleContexts, IncoherentInstances, MultiParamTypeClasses #-}
++{-# Language CPP #-}
+ 
+@@ -15,2 +16,8 @@ import Control.Monad.Trans.State
+ 
++#if MIN_VERSION_template_haskell(2,11,0)
++#    define TH211MBKIND _maybe_kind
++#else
++#    define TH211MBKIND
++#endif
++
+ --The state is composed of identifiers
+@@ -147,3 +154,3 @@ mkFix i v a t = do ti <- reify t
+                    case ti of
+-                      TyConI (DataD _ _ params tcons _) -> do
++                      TyConI (DataD _ _ params TH211MBKIND tcons _) -> do
+                         let cstuff = map getStuff tcons
+@@ -155,3 +162,3 @@ mkFix i v a t = do ti <- reify t
+                         case ii of
+-                          TyConI (DataD _ _ ip _ _) -> do
++                          TyConI (DataD _ _ ip TH211MBKIND _ _) -> do
+                             let ivars = map (varT . getParName) ip
+@@ -180,3 +187,3 @@ mkFix i v a t = do ti <- reify t
+                                                             gg = $(mkFixBody 
matches) |]
+-                          TyConI (NewtypeD _ _ ip _ _) -> do
++                          TyConI (NewtypeD _ _ ip TH211MBKIND _ _) -> do
+                             let ivars = map (varT . getParName) ip
+diff --git a/src/DeriveMutation.hs b/src/DeriveMutation.hs
+index ae58345..7494c50 100644
+--- a/src/DeriveMutation.hs
++++ b/src/DeriveMutation.hs
+@@ -3,2 +3,3 @@
+ {-# LANGUAGE FlexibleInstances,UndecidableInstances#-}
++{-# LANGUAGE CPP #-}
+ module DeriveMutation where
+@@ -17,2 +18,9 @@ import Data.List
+ import Megadeth.Prim
++
++#if MIN_VERSION_template_haskell(2,11,0)
++#    define TH211MBKIND _maybe_kind
++#else
++#    define TH211MBKIND
++#endif
++
+ --import Mutation
+@@ -100,3 +108,3 @@ devMutation name customGen = do
+         TyConI (TySynD _ _ ty) -> return [] -- devMutation (headOf ty) Nothing
+-        TyConI (DataD _ _ params constructors _) -> do
++        TyConI (DataD _ _ params TH211MBKIND constructors _) -> do
+             let fnm = mkName $ "mutt" -- ++ (showName name) 

diff --git 
a/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-ttasm-layout.patch 
b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-ttasm-layout.patch
new file mode 100644
index 00000000..b66ea1a
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-0.1_p20160909-ttasm-layout.patch
@@ -0,0 +1,11 @@
+diff --git a/bundled/ttasm/TTFInstructions.hs 
b/bundled/ttasm/TTFInstructions.hs
+index 6eb9378..8db99cd 100644
+--- a/bundled/ttasm/TTFInstructions.hs
++++ b/bundled/ttasm/TTFInstructions.hs
+@@ -128,4 +128,4 @@ tableChecksum table =
+     let tc = do
+-        e <- remaining
+-        if e < 4
++         e <- remaining
++         if e < 4
+             then return 0

diff --git 
a/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-better-erroro.patch 
b/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-better-erroro.patch
new file mode 100644
index 00000000..a9ce21b
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-better-erroro.patch
@@ -0,0 +1,9 @@
+diff --git a/Megadeth/Prim.hs b/Megadeth/Prim.hs
+index ad1782c..2f39336 100644
+--- a/bundled/megadeth/Megadeth/Prim.hs
++++ b/bundled/megadeth/Megadeth/Prim.hs
+@@ -82,3 +82,3 @@ simpleConView tyName c =
+   ForallC _ _ innerCon -> simpleConView tyName innerCon
+-
++  _ -> error $ "simpleConView: failed on " ++ show c
+ 

diff --git 
a/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-ghc-8-gadt.patch 
b/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-ghc-8-gadt.patch
new file mode 100644
index 00000000..87d7cf2
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-ghc-8-gadt.patch
@@ -0,0 +1,12 @@
+diff --git a/Megadeth/Prim.hs b/Megadeth/Prim.hs
+index 2f39336..7911bc3 100644
+--- a/bundled/megadeth/Megadeth/Prim.hs
++++ b/bundled/megadeth/Megadeth/Prim.hs
+@@ -82,2 +82,7 @@ simpleConView tyName c =
+   ForallC _ _ innerCon -> simpleConView tyName innerCon
++#if MIN_VERSION_template_haskell(2,11,0)
++  -- handling: GadtC [Codec.Picture.Metadata.Gamma] [] (AppT (ConT 
Codec.Picture.Metadata.Keys) (ConT GHC.Types.Double))
++  GadtC [n] sts _ -> let ts = map snd sts
++                     in SimpleCon n (count ts) ts
++#endif
+   _ -> error $ "simpleConView: failed on " ++ show c

diff --git a/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-ghc-8.patch 
b/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-ghc-8.patch
new file mode 100644
index 00000000..68219db
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-9999-megadeth-ghc-8.patch
@@ -0,0 +1,34 @@
+diff --git a/Megadeth/Prim.hs b/Megadeth/Prim.hs
+index eb969a5..ad1782c 100644
+--- a/bundled/megadeth/Megadeth/Prim.hs
++++ b/bundled/megadeth/Megadeth/Prim.hs
+@@ -3,2 +3,3 @@
+ {-# LANGUAGE ViewPatterns    #-}
++{-# LANGUAGE CPP             #-}
+ module Megadeth.Prim where
+@@ -137,3 +138,7 @@ getDeps t ban = do
+       case tip of
++#if MIN_VERSION_template_haskell(2,11,0)
++                    TyConI (DataD _ _ _ _mkind constructors _) -> do
++#else
+                     TyConI (DataD _ _ _ constructors _) -> do
++#endif
+                           let innerTypes = nub $ concat [ findLeafTypes ty | 
(simpleConView t -> SimpleCon _ _ tys) <- constructors, ty <- tys, not (isVarT 
ty) ]
+@@ -146,3 +151,7 @@ getDeps t ban = do
+                           mapM_ getDeps' hof
++#if MIN_VERSION_template_haskell(2,11,0)
++                    TyConI (NewtypeD _ nm _  _mkind constructor _) -> do
++#else
+                     TyConI (NewtypeD _ nm _ constructor _) -> do
++#endif
+                           let (SimpleCon _ 0 ts )= simpleConView nm 
constructor
+@@ -187,4 +196,9 @@ isinsName className n = do
+         case inf of
++#if MIN_VERSION_template_haskell(2,11,0)
++            TyConI (DataD _ _ preq _mkind _ _) -> doPreq className n preq
++            TyConI (NewtypeD _ _ preq _mkind _ _) -> doPreq className n preq
++#else
+             TyConI (DataD _ _ preq _ _) -> doPreq className n preq
+             TyConI (NewtypeD _ _ preq _ _) -> doPreq className n preq
++#endif
+             TyConI (TySynD _ preq _ ) -> doPreq className n preq

diff --git a/app-forensics/quickfuzz/files/quickfuzz-9999-th-2.11-1.patch 
b/app-forensics/quickfuzz/files/quickfuzz-9999-th-2.11-1.patch
new file mode 100644
index 00000000..436df0e
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-9999-th-2.11-1.patch
@@ -0,0 +1,22 @@
+diff --git a/src/DeriveArbitrary.hs b/src/DeriveArbitrary.hs
+index d42b896..fc94945 100644
+--- a/src/DeriveArbitrary.hs
++++ b/src/DeriveArbitrary.hs
+@@ -26,7 +26,7 @@ import Data.List.Split
+ import Data.Maybe
+ -- Gen
+ import Language.Haskell.TH
+-import Language.Haskell.TH.Syntax
++import Language.Haskell.TH.Syntax as TH
+ import Test.QuickCheck
+ import GHC.Exts
+ import GHC.Types
+@@ -38,7 +38,7 @@ import Control.Applicative
+ import Data.List
+ 
+ -- | Build the arbitrary function with makeArbs
+-chooseExpQ :: Name -> Name -> Name -> Integer -> Type -> ExpQ
++chooseExpQ :: Name -> Name -> Name -> Integer -> TH.Type -> ExpQ
+ chooseExpQ g n t bf (AppT ListT ty) = [| listOf $ resize ($(varE  n) `div` 
10) arbitrary |]
+ chooseExpQ g n t bf ty | headOf ty /= t = [| resize (max 0 ($(varE n) - 1)) 
arbitrary |]
+ chooseExpQ g n t bf ty =

diff --git a/app-forensics/quickfuzz/files/quickfuzz-9999-th-2.11-2.patch 
b/app-forensics/quickfuzz/files/quickfuzz-9999-th-2.11-2.patch
new file mode 100644
index 00000000..5ac7f4d
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-9999-th-2.11-2.patch
@@ -0,0 +1,87 @@
+diff --git a/src/DeriveArbitrary.hs b/src/DeriveArbitrary.hs
+index fc94945..6f2d77f 100644
+--- a/src/DeriveArbitrary.hs
++++ b/src/DeriveArbitrary.hs
+@@ -3,2 +3,3 @@
+ {-# LANGUAGE LambdaCase #-}
++{-# LANGUAGE CPP #-}
+ module DeriveArbitrary (
+@@ -39,2 +40,8 @@ import Data.List
+ 
++#if MIN_VERSION_template_haskell(2,11,0)
++#    define TH211MBKIND _maybe_kind
++#else
++#    define TH211MBKIND
++#endif
++
+ -- | Build the arbitrary function with makeArbs
+@@ -80,3 +87,3 @@ deriveArbitrary t = do
+     case inf of
+-        TyConI (DataD _ _ params constructors _) -> do
++        TyConI (DataD _ _ params TH211MBKIND constructors _) -> do
+               let ns  = map varT $ paramNames params
+@@ -111,3 +118,3 @@ deriveArbitrary t = do
+                                  where go n = $(gos 'go 'n)|]
+-        TyConI (NewtypeD _ _ params con _) -> do 
++        TyConI (NewtypeD _ _ params TH211MBKIND con _) -> do 
+             let ns = map varT $ paramNames params
+@@ -281,3 +288,3 @@ customG name = do
+                 
+-        TyConI (DataD _ _ params constructors _) ->
++        TyConI (DataD _ _ params TH211MBKIND constructors _) ->
+             let fnm = mkName "prob_gen" -- "customGen_" ++ (map (\x -> if x 
== '.' then '_' else
+diff --git a/src/DeriveFixable.hs b/src/DeriveFixable.hs
+index ec8b8be..83593e6 100644
+--- a/src/DeriveFixable.hs
++++ b/src/DeriveFixable.hs
+@@ -1,2 +1,3 @@
+ {-# Language TemplateHaskell, ConstraintKinds, FlexibleInstances, 
FlexibleContexts, IncoherentInstances, MultiParamTypeClasses #-}
++{-# Language CPP #-}
+ 
+@@ -15,2 +16,8 @@ import Control.Monad.Trans.State
+ 
++#if MIN_VERSION_template_haskell(2,11,0)
++#    define TH211MBKIND _maybe_kind
++#else
++#    define TH211MBKIND
++#endif
++
+ --The state is composed of identifiers
+@@ -147,3 +154,3 @@ mkFix i v a t = do ti <- reify t
+                    case ti of
+-                      TyConI (DataD _ _ params tcons _) -> do
++                      TyConI (DataD _ _ params TH211MBKIND tcons _) -> do
+                         let cstuff = map getStuff tcons
+@@ -155,3 +162,3 @@ mkFix i v a t = do ti <- reify t
+                         case ii of
+-                          TyConI (DataD _ _ ip _ _) -> do
++                          TyConI (DataD _ _ ip TH211MBKIND _ _) -> do
+                             let ivars = map (varT . getParName) ip
+@@ -180,3 +187,3 @@ mkFix i v a t = do ti <- reify t
+                                                             gg = $(mkFixBody 
matches) |]
+-                          TyConI (NewtypeD _ _ ip _ _) -> do
++                          TyConI (NewtypeD _ _ ip TH211MBKIND _ _) -> do
+                             let ivars = map (varT . getParName) ip
+diff --git a/src/DeriveMutation.hs b/src/DeriveMutation.hs
+index ae58345..7494c50 100644
+--- a/src/DeriveMutation.hs
++++ b/src/DeriveMutation.hs
+@@ -3,2 +3,3 @@
+ {-# LANGUAGE FlexibleInstances,UndecidableInstances#-}
++{-# LANGUAGE CPP #-}
+ module DeriveMutation where
+@@ -17,2 +18,9 @@ import Data.List
+ import Megadeth.Prim
++
++#if MIN_VERSION_template_haskell(2,11,0)
++#    define TH211MBKIND _maybe_kind
++#else
++#    define TH211MBKIND
++#endif
++
+ --import Mutation
+@@ -100,3 +108,3 @@ devMutation name customGen = do
+         TyConI (TySynD _ _ ty) -> return [] -- devMutation (headOf ty) Nothing
+-        TyConI (DataD _ _ params constructors _) -> do
++        TyConI (DataD _ _ params TH211MBKIND constructors _) -> do
+             let fnm = mkName $ "mutt" -- ++ (showName name) 

diff --git a/app-forensics/quickfuzz/files/quickfuzz-9999-ttasm-layout.patch 
b/app-forensics/quickfuzz/files/quickfuzz-9999-ttasm-layout.patch
new file mode 100644
index 00000000..b66ea1a
--- /dev/null
+++ b/app-forensics/quickfuzz/files/quickfuzz-9999-ttasm-layout.patch
@@ -0,0 +1,11 @@
+diff --git a/bundled/ttasm/TTFInstructions.hs 
b/bundled/ttasm/TTFInstructions.hs
+index 6eb9378..8db99cd 100644
+--- a/bundled/ttasm/TTFInstructions.hs
++++ b/bundled/ttasm/TTFInstructions.hs
+@@ -128,4 +128,4 @@ tableChecksum table =
+     let tc = do
+-        e <- remaining
+-        if e < 4
++         e <- remaining
++         if e < 4
+             then return 0

diff --git a/app-forensics/quickfuzz/metadata.xml 
b/app-forensics/quickfuzz/metadata.xml
new file mode 100644
index 00000000..1e1e291
--- /dev/null
+++ b/app-forensics/quickfuzz/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>hask...@gentoo.org</email>
+               <name>Gentoo Haskell</name>
+       </maintainer>
+       <use>
+               <flag name='archs'>support archive formats</flag>
+               <flag name='codes'>support cource code formats</flag>
+               <flag name='docs'>support document formats</flag>
+               <flag name='imgs'>support image formats</flag>
+               <flag name='media'>support media formats</flag>
+               <flag name='net'>support networking formats</flag>
+               <flag name='pki'>support PKI formats</flag>
+       </use>
+       <longdescription>
+               An experimental grammar fuzzer in Haskell using QuickCheck.
+       </longdescription>
+       <upstream>
+               <remote-id type="github">CIFASIS/QuickFuzz</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/app-forensics/quickfuzz/quickfuzz-0.1_p20160909.ebuild 
b/app-forensics/quickfuzz/quickfuzz-0.1_p20160909.ebuild
new file mode 100644
index 00000000..b6ab783
--- /dev/null
+++ b/app-forensics/quickfuzz/quickfuzz-0.1_p20160909.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+# ebuild generated by hackport 0.5.9999
+
+CABAL_FEATURES="bin"
+inherit haskell-cabal
+
+MY_PN="QuickFuzz"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="An experimental grammar fuzzer in Haskell using QuickCheck"
+HOMEPAGE="http://quickfuzz.org/";
+SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${P}.tar.bz2";
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="archs codes docs imgs media net pki"
+
+RDEPEND="dev-haskell/abstract-par:=
+       dev-haskell/argparser:=
+       dev-haskell/derive:=
+       dev-haskell/linear:=
+       dev-haskell/monad-par:=
+       dev-haskell/mtl:=
+       dev-haskell/parallel-io:=
+       dev-haskell/primitive:=
+       dev-haskell/quickcheck:2=
+       dev-haskell/quickcheck-unicode:=
+       dev-haskell/random:=
+       dev-haskell/split:=
+       dev-haskell/text:=
+       dev-haskell/vector:=
+       dev-haskell/wl-pprint:=
+       >=dev-lang/ghc-7.8.2:=
+       archs? ( dev-haskell/base16-bytestring:=
+                       dev-haskell/tar:=
+                       dev-haskell/zip-archive:= )
+       !archs? ( net? ( dev-haskell/base16-bytestring:= ) )
+       codes? ( dev-haskell/haxml:=
+                       dev-haskell/json:=
+                       dev-haskell/language-bash:=
+                       dev-haskell/language-css:=
+                       dev-haskell/language-dot:=
+                       dev-haskell/language-ecmascript:=
+                       dev-haskell/language-glsl:=
+                       dev-haskell/language-lua:=
+                       dev-haskell/language-python:=
+                       dev-haskell/shell-escape:=
+                       dev-haskell/uniplate:= )
+       docs? ( app-text/pandoc:=
+               dev-haskell/data-default:=
+               dev-haskell/hcg-minus:=
+               dev-haskell/hps:=
+               dev-haskell/icalendar:=
+               dev-haskell/pandoc-types:= )
+       imgs? ( dev-haskell/ac-ppm:=
+               dev-haskell/memory:=
+               dev-haskell/attoparsec:=
+               dev-haskell/lens:=
+               dev-haskell/scientific:=
+               dev-haskell/thyme:=
+               dev-haskell/xml:=
+               dev-haskell/zlib:= )
+       !imgs? ( archs? ( dev-haskell/zlib:= ) )
+       media? ( dev-haskell/hcodecs:=
+                       dev-haskell/hunit:=
+                       dev-haskell/mtl:=
+                       dev-haskell/old-locale:=
+                       dev-haskell/random:=
+                       dev-haskell/idiii:=
+                       dev-haskell/bitwise:=
+                       dev-haskell/monad-loops:=
+                       dev-haskell/mtl:=
+                       dev-haskell/wavy:= )
+       net? ( dev-haskell/concurrent-extra:=
+               dev-haskell/dns:=
+               dev-haskell/http:=
+               dev-haskell/iproute:=
+               dev-haskell/network:=
+               dev-haskell/network-uri:=
+               dev-haskell/unbounded-delays:= )
+       pki? ( dev-haskell/hourglass:=
+               dev-haskell/asn1-types:=
+               dev-haskell/asn1-parse:=
+               dev-haskell/cryptonite:=
+               dev-haskell/hourglass:=
+               dev-haskell/memory:= )
+"
+DEPEND="${RDEPEND}
+       >=dev-haskell/cabal-1.18.1.3
+"
+
+PATCHES=(
+       # bundled libs:
+       "${FILESDIR}"/${PN}-0.1_p20160909-megadeth-ghc-8.patch
+       "${FILESDIR}"/${PN}-0.1_p20160909-megadeth-better-erroro.patch
+       "${FILESDIR}"/${PN}-0.1_p20160909-megadeth-ghc-8-gadt.patch
+
+       "${FILESDIR}"/${PN}-0.1_p20160909-ttasm-layout.patch
+
+       # package itself:
+       "${FILESDIR}"/${PN}-0.1-QC-2.9.patch
+       "${FILESDIR}"/${PN}-0.1_p20160909-th-2.11-1.patch
+       "${FILESDIR}"/${PN}-0.1_p20160909-th-2.11-2.patch
+)
+
+# As of 2016-09-10 QuickFuzz forks a few hackage packages
+# without renames:
+# - asn1-encoding: stabilised handling of corrupterd data
+# - hogg: more functions are exported directly
+# - juicypixels: more functions and modules are exported,
+#                unsafe functions are changed to safe
+# - svg-tree: expose internal modules
+# - x509: stabilised handling of corrupterd data
+# - megadeth: not a fork but has no releases
+# - ttasm: cabalised, renamed module
+
+src_prepare() {
+       default
+
+       # inline dependencies of bundled dependencies
+       cabal_chdeps \
+               'JuicyPixels'   'memory' \
+               'asn1-encoding' 'hourglass' \
+               'hogg'          'array' \
+               'megadeth'      'base' \
+               'svg-tree'      'attoparsec, lens, scientific, thyme' \
+               'ttasm'         'bitwise, mtl, monad-loops' \
+               'x509'          'asn1-parse, cryptonite, hourglass, memory' \
+               \
+               'hs-source-dirs:      src' 'hs-source-dirs: src, 
bundled/Juicy.Pixels/src, bundled/hogg, bundled/hs-asn1-encoding, 
bundled/hs-certificate-x509, bundled/megadeth, bundled/svg-tree/src, 
bundled/ttasm'
+}
+
+src_configure() {
+       haskell-cabal_src_configure \
+               $(cabal_flag archs archs) \
+               $(cabal_flag codes codes) \
+               $(cabal_flag docs docs) \
+               $(cabal_flag imgs imgs) \
+               $(cabal_flag media media) \
+               $(cabal_flag net net) \
+               $(cabal_flag pki pki)
+}

diff --git a/app-forensics/quickfuzz/quickfuzz-9999.ebuild 
b/app-forensics/quickfuzz/quickfuzz-9999.ebuild
new file mode 100644
index 00000000..245d3d5
--- /dev/null
+++ b/app-forensics/quickfuzz/quickfuzz-9999.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+# ebuild generated by hackport 0.5.9999
+
+CABAL_FEATURES="bin"
+inherit git-r3 haskell-cabal
+
+MY_PN="QuickFuzz"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="An experimental grammar fuzzer in Haskell using QuickCheck"
+HOMEPAGE="http://quickfuzz.org/";
+EGIT_REPO_URI="https://github.com/CIFASIS/QuickFuzz.git";
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="archs codes docs imgs media net pki"
+
+RDEPEND="dev-haskell/abstract-par:=
+       dev-haskell/argparser:=
+       dev-haskell/derive:=
+       dev-haskell/linear:=
+       dev-haskell/monad-par:=
+       dev-haskell/mtl:=
+       dev-haskell/parallel-io:=
+       dev-haskell/primitive:=
+       dev-haskell/quickcheck:2=
+       dev-haskell/quickcheck-unicode:=
+       dev-haskell/random:=
+       dev-haskell/split:=
+       dev-haskell/text:=
+       dev-haskell/vector:=
+       dev-haskell/wl-pprint:=
+       >=dev-lang/ghc-7.8.2:=
+       archs? ( dev-haskell/base16-bytestring:=
+                       dev-haskell/tar:=
+                       dev-haskell/zip-archive:= )
+       !archs? ( net? ( dev-haskell/base16-bytestring:= ) )
+       codes? ( dev-haskell/haxml:=
+                       dev-haskell/json:=
+                       dev-haskell/language-bash:=
+                       dev-haskell/language-css:=
+                       dev-haskell/language-dot:=
+                       dev-haskell/language-ecmascript:=
+                       dev-haskell/language-glsl:=
+                       dev-haskell/language-lua:=
+                       dev-haskell/language-python:=
+                       dev-haskell/shell-escape:=
+                       dev-haskell/uniplate:= )
+       docs? ( app-text/pandoc:=
+               dev-haskell/data-default:=
+               dev-haskell/hcg-minus:=
+               dev-haskell/hps:=
+               dev-haskell/icalendar:=
+               dev-haskell/pandoc-types:= )
+       imgs? ( dev-haskell/ac-ppm:=
+               dev-haskell/memory:=
+               dev-haskell/attoparsec:=
+               dev-haskell/lens:=
+               dev-haskell/scientific:=
+               dev-haskell/thyme:=
+               dev-haskell/xml:=
+               dev-haskell/zlib:= )
+       !imgs? ( archs? ( dev-haskell/zlib:= ) )
+       media? ( dev-haskell/hcodecs:=
+                       dev-haskell/hunit:=
+                       dev-haskell/mtl:=
+                       dev-haskell/old-locale:=
+                       dev-haskell/random:=
+                       dev-haskell/idiii:=
+                       dev-haskell/bitwise:=
+                       dev-haskell/monad-loops:=
+                       dev-haskell/mtl:=
+                       dev-haskell/wavy:= )
+       net? ( dev-haskell/concurrent-extra:=
+               dev-haskell/dns:=
+               dev-haskell/http:=
+               dev-haskell/iproute:=
+               dev-haskell/network:=
+               dev-haskell/network-uri:=
+               dev-haskell/unbounded-delays:= )
+       pki? ( dev-haskell/hourglass:=
+               dev-haskell/asn1-types:=
+               dev-haskell/asn1-parse:=
+               dev-haskell/cryptonite:=
+               dev-haskell/hourglass:=
+               dev-haskell/memory:= )
+"
+DEPEND="${RDEPEND}
+       >=dev-haskell/cabal-1.18.1.3
+"
+
+PATCHES=(
+       # bundled libs:
+       "${FILESDIR}"/${P}-megadeth-ghc-8.patch
+       "${FILESDIR}"/${P}-megadeth-better-erroro.patch
+       "${FILESDIR}"/${P}-megadeth-ghc-8-gadt.patch
+
+       "${FILESDIR}"/${P}-ttasm-layout.patch
+
+       # package itself:
+       "${FILESDIR}"/${PN}-0.1-QC-2.9.patch
+       "${FILESDIR}"/${P}-th-2.11-1.patch
+       "${FILESDIR}"/${P}-th-2.11-2.patch
+)
+
+# As of 2016-09-10 QuickFuzz forks a few hackage packages
+# without renames:
+# - asn1-encoding: stabilised handling of corrupterd data
+# - hogg: more functions are exported directly
+# - juicypixels: more functions and modules are exported,
+#                unsafe functions are changed to safe
+# - svg-tree: expose internal modules
+# - x509: stabilised handling of corrupterd data
+# - megadeth: not a fork but has no releases
+# - ttasm: cabalised, renamed module
+
+src_unpack() {
+       git-r3_src_unpack
+
+       cd "${S}"
+
+       local forked_repos=(
+               Juicy.Pixels
+               hogg
+               hs-asn1-encoding
+               hs-certificate-x509
+               svg-tree
+               ttasm
+
+               # not exactly fork. just unreleased upstream library
+               megadeth
+       )
+       local repo_name
+       local repo_subdir=${S}/bundled
+
+       mkdir "${repo_subdir}/" || die
+       for repo_name in "${forked_repos[@]}"; do
+               git-r3_fetch    https://github.com/CIFASIS/${repo_name}.git
+               git-r3_checkout https://github.com/CIFASIS/${repo_name}.git 
"${repo_subdir}/${repo_name}"
+       done
+}
+
+src_prepare() {
+       default
+
+       # inline dependencies of bundled dependencies
+       cabal_chdeps \
+               'JuicyPixels'   'memory' \
+               'asn1-encoding' 'hourglass' \
+               'hogg'          'array' \
+               'megadeth'      'base' \
+               'svg-tree'      'attoparsec, lens, scientific, thyme' \
+               'ttasm'         'bitwise, mtl, monad-loops' \
+               'x509'          'asn1-parse, cryptonite, hourglass, memory' \
+               \
+               'hs-source-dirs:      src' 'hs-source-dirs: src, 
bundled/Juicy.Pixels/src, bundled/hogg, bundled/hs-asn1-encoding, 
bundled/hs-certificate-x509, bundled/megadeth, bundled/svg-tree/src, 
bundled/ttasm'
+}
+
+src_configure() {
+       haskell-cabal_src_configure \
+               $(cabal_flag archs archs) \
+               $(cabal_flag codes codes) \
+               $(cabal_flag docs docs) \
+               $(cabal_flag imgs imgs) \
+               $(cabal_flag media media) \
+               $(cabal_flag net net) \
+               $(cabal_flag pki pki)
+}

Reply via email to