Joachim Breitner wrote:
> thanks. Some hunks went into the wrong patches, e.g. changes to
> debian/control in "remove hlint ANNotations". Could you rebase them?

done

> Also, is there a corresponding upstream tickets, at least for the
> add-without-th-flag.patch? I’d feel more comfortable applying it
> upstream already carries it.

I have not had a chance to update the patches to the newer upstream
version.

-- 
see shy jo
From ada3d5e40893019ace7e339c96ef70928b30959e Mon Sep 17 00:00:00 2001
From: Joey Hess <[email protected]>
Date: Tue, 15 Oct 2013 09:54:16 -0400
Subject: [PATCH 1/3] packaging changes

---
 debian/control | 15 +++++++--------
 debian/rules   |  5 +++++
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/debian/control b/debian/control
index 83af3b0..fa467a6 100644
--- a/debian/control
+++ b/debian/control
@@ -26,9 +26,9 @@ Build-Depends: debhelper (>= 9)
  , libghc-distributive-dev (>> 0.3)
  , libghc-distributive-dev (<< 1)
  , libghc-distributive-prof
- , libghc-generic-deriving-dev (>> 1.4)
- , libghc-generic-deriving-dev (<< 1.6)
- , libghc-generic-deriving-prof
+ , libghc-generic-deriving-dev (>> 1.4) [!armel !armhf !mips !mipsel !s390 !s390x]
+ , libghc-generic-deriving-dev (<< 1.6) [!armel !armhf !mips !mipsel !s390 !s390x]
+ , libghc-generic-deriving-prof [!armel !armhf !mips !mipsel !s390 !s390x]
  , libghc-hashable-dev (>> 1.1.2.3)
  , libghc-hashable-dev (<< 1.3)
  , libghc-hashable-prof
@@ -47,9 +47,9 @@ Build-Depends: debhelper (>= 9)
  , libghc-profunctors-dev (>> 3.2)
  , libghc-profunctors-dev (<< 4)
  , libghc-profunctors-prof
- , libghc-reflection-dev (>> 1.1.6)
- , libghc-reflection-dev (<< 2)
- , libghc-reflection-prof
+ , libghc-reflection-dev (>> 1.1.6) [!armel !armhf !mips !mipsel !s390 !s390x]
+ , libghc-reflection-dev (<< 2) [!armel !armhf !mips !mipsel !s390 !s390x]
+ , libghc-reflection-prof [!armel !armhf !mips !mipsel !s390 !s390x]
  , libghc-semigroupoids-dev (>> 3.0.2)
  , libghc-semigroupoids-dev (<< 4)
  , libghc-semigroupoids-prof
@@ -62,7 +62,6 @@ Build-Depends: debhelper (>= 9)
  , libghc-tagged-dev (>> 0.4.4)
  , libghc-tagged-dev (<< 1)
  , libghc-tagged-prof
- , ghc-ghci
  , libghc-text-dev (>> 0.11)
  , libghc-text-dev (<< 0.12)
  , libghc-text-prof
@@ -83,7 +82,7 @@ Build-Depends: debhelper (>= 9)
  , libghc-test-framework-dev (>> 0.6)
  , libghc-test-framework-quickcheck2-dev (>> 0.2)
  , libghc-test-framework-hunit-dev (>> 0.2)
- , libghc-test-framework-th-dev (>> 0.2)
+ , libghc-test-framework-th-dev (>> 0.2) [!armel !armhf !mips !mipsel !s390 !s390x]
  , libghc-doctest-dev (>> 0.9.1)
  , libghc-simple-reflect-dev (>> 0.3.1)
 Build-Depends-Indep: ghc-doc
diff --git a/debian/rules b/debian/rules
index 8ec1809..8ad7013 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,3 +10,8 @@ ifeq ($(DEB_HOST_ARCH),sparc)
 	# Disable tests that require SMP.
 	DEB_SETUP_GHC_CONFIGURE_ARGS := -f-test-hunit -f-test-properties
 endif
+
+ifeq ($(shell if [ ! -e /usr/bin/ghci ]; then echo 0; fi),0)
+	DEB_SETUP_GHC_CONFIGURE_ARGS := -fwithout-th -f-test-hunit -f-test-properties -f-test-doctests
+endif
+
-- 
1.8.4.rc3

From 42c73dc2026eb8aeeb1cf60ca4102357f3718a06 Mon Sep 17 00:00:00 2001
From: Joey Hess <[email protected]>
Date: Tue, 15 Oct 2013 09:56:50 -0400
Subject: [PATCH 2/3] add without-th flag

---
 lens.cabal                             | 28 +++++++++++++++++++++-------
 src/Control/Lens/Internal/Exception.hs |  6 ++++++
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/lens.cabal b/lens.cabal
index 8714cdd..7c31cab 100644
--- a/lens.cabal
+++ b/lens.cabal
@@ -133,6 +133,11 @@ flag dump-splices
   default: False
   manual: True
 
+-- Avoid bulding modules that need TH
+flag without-th
+  default: False
+  manual: True
+
 -- You can disable the doctests test suite with -f-test-doctests
 flag test-doctests
   default: True
@@ -175,7 +180,6 @@ library
     containers                >= 0.4.0    && < 0.6,
     distributive              >= 0.3      && < 1,
     filepath                  >= 1.2.0.0  && < 1.4,
-    generic-deriving          >= 1.4      && < 1.6,
     ghc-prim,
     hashable                  >= 1.1.2.3  && < 1.3,
     MonadCatchIO-transformers >= 0.3      && < 0.4,
@@ -183,7 +187,6 @@ library
     parallel                  >= 3.1.0.1  && < 3.3,
     profunctors               >= 3.2      && < 4,
     profunctor-extras         >= 3.3      && < 4,
-    reflection                >= 1.1.6    && < 2,
     semigroupoids             >= 3.0.2    && < 4,
     semigroups                >= 0.8.4    && < 1,
     split                     == 0.2.*,
@@ -237,7 +240,6 @@ library
     Control.Lens.Review
     Control.Lens.Setter
     Control.Lens.Simple
-    Control.Lens.TH
     Control.Lens.Traversal
     Control.Lens.Tuple
     Control.Lens.Type
@@ -268,14 +270,23 @@ library
     Data.Typeable.Lens
     Data.Vector.Lens
     Data.Vector.Generic.Lens
-    Generics.Deriving.Lens
-    GHC.Generics.Lens
     System.Exit.Lens
     System.FilePath.Lens
-    System.IO.Error.Lens
-    Language.Haskell.TH.Lens
     Numeric.Lens
 
+  if flag(without-th)
+    cpp-options: -DDISABLE_TEMPLATE_HASKELL
+  else
+    build-depends:
+      generic-deriving          >= 1.4      && < 1.6,
+      reflection                >= 1.1.6    && < 2
+    exposed-modules:
+      Control.Lens.TH
+      Language.Haskell.TH.Lens
+      Generics.Deriving.Lens
+      GHC.Generics.Lens
+      System.IO.Error.Lens
+
   if flag(safe)
     cpp-options: -DSAFE=1
 
@@ -308,6 +319,9 @@ test-suite templates
   build-depends: base, lens
   ghc-options: -Wall -threaded
   hs-source-dirs: tests
+  
+  if flag(without-th)
+    buildable: False
 
   if flag(dump-splices)
     ghc-options: -ddump-splices
diff --git a/src/Control/Lens/Internal/Exception.hs b/src/Control/Lens/Internal/Exception.hs
index 387203e..43a59fa 100644
--- a/src/Control/Lens/Internal/Exception.hs
+++ b/src/Control/Lens/Internal/Exception.hs
@@ -34,7 +34,9 @@ import Control.Monad.CatchIO as CatchIO
 import Data.IORef
 import Data.Monoid
 import Data.Proxy
+#ifndef DISABLE_TEMPLATE_HASKELL
 import Data.Reflection
+#endif
 import Data.Typeable
 import System.IO.Unsafe
 
@@ -128,6 +130,7 @@ class Handleable e (m :: * -> *) (h :: * -> *) | h -> e m where
   handler_ l = handler l . const
   {-# INLINE handler_ #-}
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 instance Handleable SomeException IO Exception.Handler where
   handler = handlerIO
 
@@ -139,6 +142,7 @@ handlerIO l f = reify (preview l) $ \ (_ :: Proxy s) -> Exception.Handler (\(Han
 
 handlerCatchIO :: forall m a r. Getting (First a) SomeException a -> (a -> m r) -> CatchIO.Handler m r
 handlerCatchIO l f = reify (preview l) $ \ (_ :: Proxy s) -> CatchIO.Handler (\(Handling a :: Handling a s m) -> f a)
+#endif
 
 ------------------------------------------------------------------------------
 -- Helpers
@@ -172,8 +176,10 @@ instance Show (Handling a s m) where
   showsPrec d _ = showParen (d > 10) $ showString "Handling ..."
   {-# INLINE showsPrec #-}
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 instance Reifies s (SomeException -> Maybe a) => Exception (Handling a s m) where
   toException _ = SomeException HandlingException
   {-# INLINE toException #-}
   fromException = fmap Handling . reflect (Proxy :: Proxy s)
   {-# INLINE fromException #-}
+#endif
-- 
1.8.4.rc3

From 7eae0e500fb5762a2f09939a43fcbb8f6e4ef8af Mon Sep 17 00:00:00 2001
From: Joey Hess <[email protected]>
Date: Tue, 15 Oct 2013 10:03:28 -0400
Subject: [PATCH 3/3] guard ANNotations

---
 src/Control/Exception/Lens.hs       | 2 ++
 src/Control/Lens.hs                 | 2 ++
 src/Control/Lens/Equality.hs        | 3 +++
 src/Control/Lens/Fold.hs            | 2 ++
 src/Control/Lens/Internal.hs        | 3 +++
 src/Control/Lens/Internal/Zipper.hs | 2 ++
 src/Control/Lens/Iso.hs             | 2 ++
 src/Control/Lens/Lens.hs            | 2 ++
 src/Control/Lens/Operators.hs       | 3 +++
 src/Control/Lens/Plated.hs          | 2 ++
 src/Control/Lens/Prism.hs           | 2 ++
 src/Control/Lens/Setter.hs          | 2 ++
 src/Control/Lens/TH.hs              | 2 ++
 src/Data/Data/Lens.hs               | 2 ++
 14 files changed, 31 insertions(+)

diff --git a/src/Control/Exception/Lens.hs b/src/Control/Exception/Lens.hs
index 4bc3926..13b7beb 100644
--- a/src/Control/Exception/Lens.hs
+++ b/src/Control/Exception/Lens.hs
@@ -112,7 +112,9 @@ import Prelude
   ,  Maybe(..), Either(..), Functor(..), String, IO
   )
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use Control.Exception.catch" #-}
+#endif
 
 -- $setup
 -- >>> :set -XNoOverloadedStrings
diff --git a/src/Control/Lens.hs b/src/Control/Lens.hs
index 242c3c1..c53e6f6 100644
--- a/src/Control/Lens.hs
+++ b/src/Control/Lens.hs
@@ -99,4 +99,6 @@ import Control.Lens.Wrapped
 import Control.Lens.Zipper
 import Control.Lens.Zoom
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use import/export shortcut" #-}
+#endif
diff --git a/src/Control/Lens/Equality.hs b/src/Control/Lens/Equality.hs
index 982c2d7..b06d4b5 100644
--- a/src/Control/Lens/Equality.hs
+++ b/src/Control/Lens/Equality.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE Rank2Types #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -28,8 +29,10 @@ module Control.Lens.Equality
 import Control.Lens.Internal.Setter
 import Control.Lens.Type
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use id" #-}
 {-# ANN module "HLint: ignore Eta reduce" #-}
+#endif
 
 -- $setup
 -- >>> import Control.Lens
diff --git a/src/Control/Lens/Fold.hs b/src/Control/Lens/Fold.hs
index 32a4073..459f959 100644
--- a/src/Control/Lens/Fold.hs
+++ b/src/Control/Lens/Fold.hs
@@ -163,9 +163,11 @@ import Data.Traversable
 -- >>> let g :: Expr -> Expr; g = Debug.SimpleReflect.Vars.g
 -- >>> let timingOut :: NFData a => a -> IO a; timingOut = fmap (fromMaybe (error "timeout")) . timeout (5*10^6) . evaluate . force
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Eta reduce" #-}
 {-# ANN module "HLint: ignore Use camelCase" #-}
 {-# ANN module "HLint: ignore Use curry" #-}
+#endif
 
 infixl 8 ^.., ^?, ^?!, ^@.., ^@?, ^@?!
 
diff --git a/src/Control/Lens/Internal.hs b/src/Control/Lens/Internal.hs
index 295662e..6166014 100644
--- a/src/Control/Lens/Internal.hs
+++ b/src/Control/Lens/Internal.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Control.Lens.Internal
@@ -43,4 +44,6 @@ import Control.Lens.Internal.Review
 import Control.Lens.Internal.Setter
 import Control.Lens.Internal.Zoom
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use import/export shortcut" #-}
+#endif
diff --git a/src/Control/Lens/Internal/Zipper.hs b/src/Control/Lens/Internal/Zipper.hs
index 95875b7..2840bd9 100644
--- a/src/Control/Lens/Internal/Zipper.hs
+++ b/src/Control/Lens/Internal/Zipper.hs
@@ -53,7 +53,9 @@ import Data.Profunctor.Unsafe
 -- >>> import Control.Lens
 -- >>> import Data.Char
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use foldl" #-}
+#endif
 
 ------------------------------------------------------------------------------
 -- * Jacket
diff --git a/src/Control/Lens/Iso.hs b/src/Control/Lens/Iso.hs
index 1152af4..66a9588 100644
--- a/src/Control/Lens/Iso.hs
+++ b/src/Control/Lens/Iso.hs
@@ -82,7 +82,9 @@ import Data.Maybe
 import Data.Profunctor
 import Data.Profunctor.Unsafe
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use on" #-}
+#endif
 
 -- $setup
 -- >>> :set -XNoOverloadedStrings
diff --git a/src/Control/Lens/Lens.hs b/src/Control/Lens/Lens.hs
index b26cc06..e3fe89c 100644
--- a/src/Control/Lens/Lens.hs
+++ b/src/Control/Lens/Lens.hs
@@ -126,7 +126,9 @@ import Data.Profunctor.Rep
 import Data.Profunctor.Unsafe
 import Data.Void
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use ***" #-}
+#endif
 
 -- $setup
 -- >>> :set -XNoOverloadedStrings
diff --git a/src/Control/Lens/Operators.hs b/src/Control/Lens/Operators.hs
index 11868e0..1c062f3 100644
--- a/src/Control/Lens/Operators.hs
+++ b/src/Control/Lens/Operators.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Control.Lens.Operators
@@ -108,4 +109,6 @@ import Control.Lens.Review
 import Control.Lens.Setter
 import Control.Lens.Zipper
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use import/export shortcut" #-}
+#endif
diff --git a/src/Control/Lens/Plated.hs b/src/Control/Lens/Plated.hs
index a8c4d20..019fded 100644
--- a/src/Control/Lens/Plated.hs
+++ b/src/Control/Lens/Plated.hs
@@ -95,7 +95,9 @@ import           Data.Data.Lens
 import           Data.Monoid
 import           Data.Tree
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Reduce duplication" #-}
+#endif
 
 -- | A 'Plated' type is one where we know how to extract its immediate self-similar children.
 --
diff --git a/src/Control/Lens/Prism.hs b/src/Control/Lens/Prism.hs
index 0f3253f..e3a0a01 100644
--- a/src/Control/Lens/Prism.hs
+++ b/src/Control/Lens/Prism.hs
@@ -51,7 +51,9 @@ import Data.Void
 import Unsafe.Coerce
 #endif
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use camelCase" #-}
+#endif
 
 -- $setup
 -- >>> :set -XNoOverloadedStrings
diff --git a/src/Control/Lens/Setter.hs b/src/Control/Lens/Setter.hs
index a1e953f..dc16dc4 100644
--- a/src/Control/Lens/Setter.hs
+++ b/src/Control/Lens/Setter.hs
@@ -87,7 +87,9 @@ import Data.Profunctor
 import Data.Profunctor.Rep
 import Data.Profunctor.Unsafe
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Avoid lambda" #-}
+#endif
 
 -- $setup
 -- >>> import Control.Lens
diff --git a/src/Control/Lens/TH.hs b/src/Control/Lens/TH.hs
index a05eb07..00353dc 100644
--- a/src/Control/Lens/TH.hs
+++ b/src/Control/Lens/TH.hs
@@ -87,7 +87,9 @@ import Language.Haskell.TH
 import Language.Haskell.TH.Syntax
 import Language.Haskell.TH.Lens
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Use foldl" #-}
+#endif
 
 -- | Flags for 'Lens' construction
 data LensFlag
diff --git a/src/Data/Data/Lens.hs b/src/Data/Data/Lens.hs
index cf1e7c9..52490b5 100644
--- a/src/Data/Data/Lens.hs
+++ b/src/Data/Data/Lens.hs
@@ -65,9 +65,11 @@ import           Data.Monoid
 import           GHC.Exts (realWorld#)
 #endif
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 {-# ANN module "HLint: ignore Eta reduce" #-}
 {-# ANN module "HLint: ignore Use foldl" #-}
 {-# ANN module "HLint: ignore Reduce duplication" #-}
+#endif
 
 -- $setup
 -- >>> :set -XNoOverloadedStrings
-- 
1.8.4.rc3

Attachment: signature.asc
Description: Digital signature

Reply via email to