diff -Nru haskell-protobuf-0.2.1.1/CHANGELOG haskell-protobuf-0.2.1.2/CHANGELOG --- haskell-protobuf-0.2.1.1/CHANGELOG 2016-06-09 16:06:19.000000000 +0000 +++ haskell-protobuf-0.2.1.2/CHANGELOG 2018-05-22 15:26:31.000000000 +0000 @@ -1,3 +1,6 @@ +0.2.1.2: +- Fix #36: Compile on GHC >= 8.0 + 0.2.1.1: - Fix #26: Import orphan Foldable Last instance from base-orphans - Fix #27: Fix failure when decoding empty [packed] fields diff -Nru haskell-protobuf-0.2.1.1/debian/changelog haskell-protobuf-0.2.1.2/debian/changelog --- haskell-protobuf-0.2.1.1/debian/changelog 2018-05-07 02:10:23.000000000 +0000 +++ haskell-protobuf-0.2.1.2/debian/changelog 2018-07-04 02:46:21.000000000 +0000 @@ -1,3 +1,9 @@ +haskell-protobuf (0.2.1.2-1) unstable; urgency=medium + + * New upstream release + + -- Clint Adams Tue, 03 Jul 2018 22:46:21 -0400 + haskell-protobuf (0.2.1.1-4) unstable; urgency=medium [ Clint Adams ] diff -Nru haskell-protobuf-0.2.1.1/debian/control haskell-protobuf-0.2.1.2/debian/control --- haskell-protobuf-0.2.1.1/debian/control 2018-05-07 02:10:23.000000000 +0000 +++ haskell-protobuf-0.2.1.2/debian/control 2018-07-04 02:46:21.000000000 +0000 @@ -39,7 +39,7 @@ Standards-Version: 4.1.4 Homepage: https://github.com/alphaHeavy/protobuf Vcs-Browser: https://salsa.debian.org/haskell-team/DHG_packages/tree/master/p/haskell-protobuf -Vcs-Git: https://salsa.debian.org/haskell-team/DHG_packages.git +Vcs-Git: https://salsa.debian.org/haskell-team/DHG_packages.git [p/haskell-protobuf] X-Description: Google Protocol Buffers for Haskell Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. This is an implementation of a diff -Nru haskell-protobuf-0.2.1.1/debian/patches/0001-Fix-compilation-on-GHC-8.0.patch haskell-protobuf-0.2.1.2/debian/patches/0001-Fix-compilation-on-GHC-8.0.patch --- haskell-protobuf-0.2.1.1/debian/patches/0001-Fix-compilation-on-GHC-8.0.patch 2018-05-07 02:10:23.000000000 +0000 +++ haskell-protobuf-0.2.1.2/debian/patches/0001-Fix-compilation-on-GHC-8.0.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,154 +0,0 @@ -From 0689cb6f0e5e980cb85e89eac53fa4fdb968b9ee Mon Sep 17 00:00:00 2001 -From: YoEight -Date: Wed, 16 May 2018 17:05:11 +0200 -Subject: [PATCH 1/3] Fix compilation on GHC >= 8.0 - ---- - protobuf.cabal | 3 +++ - src/Data/Binary/Builder/Sized.hs | 6 +++++- - src/Data/ProtocolBuffers/Message.hs | 8 ++++++-- - src/Data/ProtocolBuffers/Types.hs | 28 ++++++++++++++++------------ - 4 files changed, 30 insertions(+), 15 deletions(-) - -Index: haskell-protobuf-0.2.1.1/protobuf.cabal -=================================================================== ---- haskell-protobuf-0.2.1.1.orig/protobuf.cabal -+++ haskell-protobuf-0.2.1.1/protobuf.cabal -@@ -58,6 +58,9 @@ - ghc-options: - -Wall - -+ if impl(ghc < 8.0) -+ build-depends: semigroups == 0.18.* -+ - -- executable protoc-gen-hs - -- default-language: - -- Haskell2010 -Index: haskell-protobuf-0.2.1.1/src/Data/ProtocolBuffers/Message.hs -=================================================================== ---- haskell-protobuf-0.2.1.1.orig/src/Data/ProtocolBuffers/Message.hs -+++ haskell-protobuf-0.2.1.1/src/Data/ProtocolBuffers/Message.hs -@@ -17,10 +17,11 @@ - import Control.Applicative - import Control.DeepSeq (NFData(..)) - import Data.Foldable --import Data.Monoid -+import Data.Monoid hiding ((<>)) - import Data.Serialize.Get - import Data.Serialize.Put - import Data.Traversable -+import Data.Semigroup (Semigroup(..)) - - import GHC.Generics - import GHC.TypeLits -@@ -96,9 +97,12 @@ - newtype Message m = Message {runMessage :: m} - deriving (Eq, Foldable, Functor, Ord, Show, Traversable) - -+instance (Generic m, GMessageMonoid (Rep m)) => Semigroup (Message m) where -+ Message x <> Message y = Message . to $ gmappend (from x) (from y) -+ - instance (Generic m, GMessageMonoid (Rep m)) => Monoid (Message m) where - mempty = Message . to $ gmempty -- Message x `mappend` Message y = Message . to $ gmappend (from x) (from y) -+ mappend = (<>) - - instance (Decode a, Monoid (Message a), KnownNat n) => GDecode (K1 i (Field n (RequiredField (Always (Message a))))) where - gdecode = fieldDecode (Required . Always) -Index: haskell-protobuf-0.2.1.1/src/Data/ProtocolBuffers/Types.hs -=================================================================== ---- haskell-protobuf-0.2.1.1.orig/src/Data/ProtocolBuffers/Types.hs -+++ haskell-protobuf-0.2.1.1/src/Data/ProtocolBuffers/Types.hs -@@ -29,7 +29,8 @@ - import Control.DeepSeq (NFData) - import Data.Bits - import Data.Foldable as Fold --import Data.Monoid -+import Data.Monoid hiding ((<>)) -+import Data.Semigroup (Semigroup(..)) - import Data.Traversable - import Data.Typeable - -@@ -38,25 +39,25 @@ - -- | - -- 'Value' selects the normal/typical way for encoding scalar (primitive) values. - newtype Value a = Value {runValue :: a} -- deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) -+ deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) - - -- | - -- 'RequiredField' is a newtype wrapped used to break overlapping instances - -- for encoding and decoding values - newtype RequiredField a = Required {runRequired :: a} -- deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) -+ deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) - - -- | - -- 'OptionalField' is a newtype wrapped used to break overlapping instances - -- for encoding and decoding values - newtype OptionalField a = Optional {runOptional :: a} -- deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) -+ deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) - - -- | - -- 'RepeatedField' is a newtype wrapped used to break overlapping instances - -- for encoding and decoding values - newtype RepeatedField a = Repeated {runRepeated :: a} -- deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) -+ deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) - - -- | - -- Fields are merely a way to hold a field tag along with its type, this shouldn't normally be referenced directly. -@@ -64,7 +65,7 @@ - -- This provides better error messages than older versions which used 'Data.Tagged.Tagged' - -- - newtype Field (n :: Nat) a = Field {runField :: a} -- deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) -+ deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) - - -- | - -- To provide consistent instances for serialization a 'Traversable' 'Functor' is needed to -@@ -74,9 +75,12 @@ - newtype Always a = Always {runAlways :: a} - deriving (Bounded, Eq, Enum, Foldable, Functor, Ord, NFData, Show, Traversable, Typeable) - -+instance Semigroup (Always a) where -+ _ <> y = y -+ - instance Monoid (Always a) where - mempty = error "Always is not a Monoid" -- mappend _ y = y -+ mappend = (<>) - - -- | - -- Functions for wrapping and unwrapping record fields. -@@ -175,24 +179,24 @@ - -- | - -- 'Enumeration' fields use 'Prelude.fromEnum' and 'Prelude.toEnum' when encoding and decoding messages. - newtype Enumeration a = Enumeration {runEnumeration :: a} -- deriving (Bounded, Eq, Enum, Foldable, Functor, Ord, Monoid, NFData, Show, Traversable, Typeable) -+ deriving (Bounded, Eq, Enum, Foldable, Functor, Ord, Semigroup, Monoid, NFData, Show, Traversable, Typeable) - - -- | - -- A 'Traversable' 'Functor' used to select packed sequence encoding/decoding. - newtype PackedField a = PackedField {runPackedField :: a} -- deriving (Eq, Foldable, Functor, Monoid, NFData, Ord, Show, Traversable, Typeable) -+ deriving (Eq, Foldable, Functor, Semigroup, Monoid, NFData, Ord, Show, Traversable, Typeable) - - -- | - -- A list that is stored in a packed format. - newtype PackedList a = PackedList {unPackedList :: [a]} -- deriving (Eq, Foldable, Functor, Monoid, NFData, Ord, Show, Traversable, Typeable) -+ deriving (Eq, Foldable, Functor, Semigroup, Monoid, NFData, Ord, Show, Traversable, Typeable) - - -- | - -- Signed integers are stored in a zz-encoded form. - newtype Signed a = Signed a -- deriving (Bits, Bounded, Enum, Eq, Floating, Foldable, Fractional, Functor, Integral, Monoid, NFData, Num, Ord, Real, RealFloat, RealFrac, Show, Traversable, Typeable) -+ deriving (Bits, Bounded, Enum, Eq, Floating, Foldable, Fractional, Functor, Integral, Semigroup, Monoid, NFData, Num, Ord, Real, RealFloat, RealFrac, Show, Traversable, Typeable) - - -- | - -- Fixed integers are stored in little-endian form without additional encoding. - newtype Fixed a = Fixed a -- deriving (Bits, Bounded, Enum, Eq, Floating, Foldable, Fractional, Functor, Integral, Monoid, NFData, Num, Ord, Real, RealFloat, RealFrac, Show, Traversable, Typeable) -+ deriving (Bits, Bounded, Enum, Eq, Floating, Foldable, Fractional, Functor, Integral, Semigroup, Monoid, NFData, Num, Ord, Real, RealFloat, RealFrac, Show, Traversable, Typeable) diff -Nru haskell-protobuf-0.2.1.1/debian/patches/0002-Fix-tests-compilation.patch haskell-protobuf-0.2.1.2/debian/patches/0002-Fix-tests-compilation.patch --- haskell-protobuf-0.2.1.1/debian/patches/0002-Fix-tests-compilation.patch 2018-05-07 02:10:23.000000000 +0000 +++ haskell-protobuf-0.2.1.2/debian/patches/0002-Fix-tests-compilation.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From 904fbe1f964436dc525cb0ac2d85587977534cea Mon Sep 17 00:00:00 2001 -From: YoEight -Date: Wed, 16 May 2018 17:05:37 +0200 -Subject: [PATCH 2/3] Fix tests compilation - ---- - tests/Main.hs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/Main.hs b/tests/Main.hs -index a6b1b01..569a90f 100644 ---- a/tests/Main.hs -+++ b/tests/Main.hs -@@ -13,7 +13,7 @@ - {-# OPTIONS_GHC -fno-warn-orphans #-} - - import Test.QuickCheck --import Test.QuickCheck.Property -+import Test.QuickCheck.Property hiding (testCase) - import Test.Tasty - import Test.Tasty.HUnit - import Test.Tasty.QuickCheck --- -2.17.0 - diff -Nru haskell-protobuf-0.2.1.1/debian/patches/series haskell-protobuf-0.2.1.2/debian/patches/series --- haskell-protobuf-0.2.1.1/debian/patches/series 2018-05-07 02:10:23.000000000 +0000 +++ haskell-protobuf-0.2.1.2/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -0001-Fix-compilation-on-GHC-8.0.patch -0002-Fix-tests-compilation.patch diff -Nru haskell-protobuf-0.2.1.1/protobuf.cabal haskell-protobuf-0.2.1.2/protobuf.cabal --- haskell-protobuf-0.2.1.1/protobuf.cabal 2016-06-09 16:06:19.000000000 +0000 +++ haskell-protobuf-0.2.1.2/protobuf.cabal 2018-05-22 15:26:31.000000000 +0000 @@ -1,5 +1,5 @@ name: protobuf -version: 0.2.1.1 +version: 0.2.1.2 synopsis: Google Protocol Buffers via GHC.Generics description: Google Protocol Buffers via GHC.Generics. @@ -58,6 +58,9 @@ ghc-options: -Wall + if impl(ghc < 8.0) + build-depends: semigroups == 0.18.* + -- executable protoc-gen-hs -- default-language: -- Haskell2010 diff -Nru haskell-protobuf-0.2.1.1/src/Data/ProtocolBuffers/Message.hs haskell-protobuf-0.2.1.2/src/Data/ProtocolBuffers/Message.hs --- haskell-protobuf-0.2.1.1/src/Data/ProtocolBuffers/Message.hs 2016-06-09 16:06:19.000000000 +0000 +++ haskell-protobuf-0.2.1.2/src/Data/ProtocolBuffers/Message.hs 2018-05-22 15:26:31.000000000 +0000 @@ -17,10 +17,11 @@ import Control.Applicative import Control.DeepSeq (NFData(..)) import Data.Foldable -import Data.Monoid +import Data.Monoid hiding ((<>)) import Data.Serialize.Get import Data.Serialize.Put import Data.Traversable +import Data.Semigroup (Semigroup(..)) import GHC.Generics import GHC.TypeLits @@ -96,9 +97,12 @@ newtype Message m = Message {runMessage :: m} deriving (Eq, Foldable, Functor, Ord, Show, Traversable) +instance (Generic m, GMessageMonoid (Rep m)) => Semigroup (Message m) where + Message x <> Message y = Message . to $ gmappend (from x) (from y) + instance (Generic m, GMessageMonoid (Rep m)) => Monoid (Message m) where mempty = Message . to $ gmempty - Message x `mappend` Message y = Message . to $ gmappend (from x) (from y) + mappend = (<>) instance (Decode a, Monoid (Message a), KnownNat n) => GDecode (K1 i (Field n (RequiredField (Always (Message a))))) where gdecode = fieldDecode (Required . Always) diff -Nru haskell-protobuf-0.2.1.1/src/Data/ProtocolBuffers/Types.hs haskell-protobuf-0.2.1.2/src/Data/ProtocolBuffers/Types.hs --- haskell-protobuf-0.2.1.1/src/Data/ProtocolBuffers/Types.hs 2016-06-09 16:06:19.000000000 +0000 +++ haskell-protobuf-0.2.1.2/src/Data/ProtocolBuffers/Types.hs 2018-05-22 15:26:31.000000000 +0000 @@ -29,7 +29,8 @@ import Control.DeepSeq (NFData) import Data.Bits import Data.Foldable as Fold -import Data.Monoid +import Data.Monoid hiding ((<>)) +import Data.Semigroup (Semigroup(..)) import Data.Traversable import Data.Typeable @@ -38,25 +39,25 @@ -- | -- 'Value' selects the normal/typical way for encoding scalar (primitive) values. newtype Value a = Value {runValue :: a} - deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) + deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) -- | -- 'RequiredField' is a newtype wrapped used to break overlapping instances -- for encoding and decoding values newtype RequiredField a = Required {runRequired :: a} - deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) + deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) -- | -- 'OptionalField' is a newtype wrapped used to break overlapping instances -- for encoding and decoding values newtype OptionalField a = Optional {runOptional :: a} - deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) + deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) -- | -- 'RepeatedField' is a newtype wrapped used to break overlapping instances -- for encoding and decoding values newtype RepeatedField a = Repeated {runRepeated :: a} - deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) + deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) -- | -- Fields are merely a way to hold a field tag along with its type, this shouldn't normally be referenced directly. @@ -64,7 +65,7 @@ -- This provides better error messages than older versions which used 'Data.Tagged.Tagged' -- newtype Field (n :: Nat) a = Field {runField :: a} - deriving (Bounded, Eq, Enum, Foldable, Functor, Monoid, Ord, NFData, Show, Traversable, Typeable) + deriving (Bounded, Eq, Enum, Foldable, Functor, Semigroup, Monoid, Ord, NFData, Show, Traversable, Typeable) -- | -- To provide consistent instances for serialization a 'Traversable' 'Functor' is needed to @@ -74,9 +75,12 @@ newtype Always a = Always {runAlways :: a} deriving (Bounded, Eq, Enum, Foldable, Functor, Ord, NFData, Show, Traversable, Typeable) +instance Semigroup (Always a) where + _ <> y = y + instance Monoid (Always a) where mempty = error "Always is not a Monoid" - mappend _ y = y + mappend = (<>) -- | -- Functions for wrapping and unwrapping record fields. @@ -175,24 +179,24 @@ -- | -- 'Enumeration' fields use 'Prelude.fromEnum' and 'Prelude.toEnum' when encoding and decoding messages. newtype Enumeration a = Enumeration {runEnumeration :: a} - deriving (Bounded, Eq, Enum, Foldable, Functor, Ord, Monoid, NFData, Show, Traversable, Typeable) + deriving (Bounded, Eq, Enum, Foldable, Functor, Ord, Semigroup, Monoid, NFData, Show, Traversable, Typeable) -- | -- A 'Traversable' 'Functor' used to select packed sequence encoding/decoding. newtype PackedField a = PackedField {runPackedField :: a} - deriving (Eq, Foldable, Functor, Monoid, NFData, Ord, Show, Traversable, Typeable) + deriving (Eq, Foldable, Functor, Semigroup, Monoid, NFData, Ord, Show, Traversable, Typeable) -- | -- A list that is stored in a packed format. newtype PackedList a = PackedList {unPackedList :: [a]} - deriving (Eq, Foldable, Functor, Monoid, NFData, Ord, Show, Traversable, Typeable) + deriving (Eq, Foldable, Functor, Semigroup, Monoid, NFData, Ord, Show, Traversable, Typeable) -- | -- Signed integers are stored in a zz-encoded form. newtype Signed a = Signed a - deriving (Bits, Bounded, Enum, Eq, Floating, Foldable, Fractional, Functor, Integral, Monoid, NFData, Num, Ord, Real, RealFloat, RealFrac, Show, Traversable, Typeable) + deriving (Bits, Bounded, Enum, Eq, Floating, Foldable, Fractional, Functor, Integral, Semigroup, Monoid, NFData, Num, Ord, Real, RealFloat, RealFrac, Show, Traversable, Typeable) -- | -- Fixed integers are stored in little-endian form without additional encoding. newtype Fixed a = Fixed a - deriving (Bits, Bounded, Enum, Eq, Floating, Foldable, Fractional, Functor, Integral, Monoid, NFData, Num, Ord, Real, RealFloat, RealFrac, Show, Traversable, Typeable) + deriving (Bits, Bounded, Enum, Eq, Floating, Foldable, Fractional, Functor, Integral, Semigroup, Monoid, NFData, Num, Ord, Real, RealFloat, RealFrac, Show, Traversable, Typeable) diff -Nru haskell-protobuf-0.2.1.1/tests/Main.hs haskell-protobuf-0.2.1.2/tests/Main.hs --- haskell-protobuf-0.2.1.1/tests/Main.hs 2016-06-09 16:06:19.000000000 +0000 +++ haskell-protobuf-0.2.1.2/tests/Main.hs 2018-05-22 15:26:31.000000000 +0000 @@ -13,7 +13,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} import Test.QuickCheck -import Test.QuickCheck.Property +import Test.QuickCheck.Property hiding (testCase) import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.QuickCheck