[Pkg-haskell-commits] darcs: haskell-lens: Disable TH on arches where it is not available, thanks to Joey Hess for the patches. (Closes: #726372)
Joachim Breitner
mail at joachim-breitner.de
Tue Oct 15 15:17:34 UTC 2013
Tue Oct 15 15:01:39 UTC 2013 Joachim Breitner <mail at joachim-breitner.de>
* Disable TH on arches where it is not available, thanks to Joey Hess for the patches. (Closes: #726372)
M ./changelog +2
M ./control -8 +7
A ./patches/add-without-th-flag.patch
A ./patches/guard-ANNotations.patch
M ./patches/series +2
M ./rules +5
Tue Oct 15 15:01:39 UTC 2013 Joachim Breitner <mail at joachim-breitner.de>
* Disable TH on arches where it is not available, thanks to Joey Hess for the patches. (Closes: #726372)
diff -rN -u old-haskell-lens/changelog new-haskell-lens/changelog
--- old-haskell-lens/changelog 2013-10-15 15:17:34.278536401 +0000
+++ new-haskell-lens/changelog 2013-10-15 15:17:34.402551678 +0000
@@ -1,6 +1,8 @@
haskell-lens (3.9.0.2-4) UNRELEASED; urgency=low
* Adjust watch file to new hackage layout
+ * Disable TH on arches where it is not available, thanks to Joey Hess for
+ the patches. (Closes: #726372)
-- Joachim Breitner <nomeata at debian.org> Sat, 05 Oct 2013 18:20:55 +0200
diff -rN -u old-haskell-lens/control new-haskell-lens/control
--- old-haskell-lens/control 2013-10-15 15:17:34.261678316 +0000
+++ new-haskell-lens/control 2013-10-15 15:17:34.282537201 +0000
@@ -26,9 +26,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 @@
, 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 @@
, 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 @@
, 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 -rN -u old-haskell-lens/patches/add-without-th-flag.patch new-haskell-lens/patches/add-without-th-flag.patch
--- old-haskell-lens/patches/add-without-th-flag.patch 1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-lens/patches/add-without-th-flag.patch 2013-10-15 15:17:34.286536563 +0000
@@ -0,0 +1,132 @@
+From 42c73dc2026eb8aeeb1cf60ca4102357f3718a06 Mon Sep 17 00:00:00 2001
+From: Joey Hess <joey at kitenet.net>
+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
+
diff -rN -u old-haskell-lens/patches/guard-ANNotations.patch new-haskell-lens/patches/guard-ANNotations.patch
--- old-haskell-lens/patches/guard-ANNotations.patch 1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-lens/patches/guard-ANNotations.patch 2013-10-15 15:17:34.286536563 +0000
@@ -0,0 +1,232 @@
+From 7eae0e500fb5762a2f09939a43fcbb8f6e4ef8af Mon Sep 17 00:00:00 2001
+From: Joey Hess <joey at kitenet.net>
+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
+
diff -rN -u old-haskell-lens/patches/series new-haskell-lens/patches/series
--- old-haskell-lens/patches/series 2013-10-15 15:17:34.226536480 +0000
+++ new-haskell-lens/patches/series 2013-10-15 15:17:34.290536231 +0000
@@ -1,3 +1,5 @@
+add-without-th-flag.patch
+guard-ANNotations.patch
fix-doctest-path.hs
fudge-doctest-nonascii.diff
no-transformers-compat.diff
diff -rN -u old-haskell-lens/rules new-haskell-lens/rules
--- old-haskell-lens/rules 2013-10-15 15:17:34.226536480 +0000
+++ new-haskell-lens/rules 2013-10-15 15:17:34.290536231 +0000
@@ -10,3 +10,8 @@
# 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
+
More information about the Pkg-haskell-commits
mailing list