diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index b5ccb3d8f3a0..bf8ff6df994a 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1036,4 +1036,6 @@ self: super: { substituteInPlace ./libmpd.cabal --replace "time >=1.5 && <1.6" "time >=1.5" ''; })); + + timezone-series = appendPatch super.timezone-series ./patches/timezone-series.patch; } diff --git a/pkgs/development/haskell-modules/patches/timezone-series.patch b/pkgs/development/haskell-modules/patches/timezone-series.patch new file mode 100644 index 000000000000..4605d16f86c9 --- /dev/null +++ b/pkgs/development/haskell-modules/patches/timezone-series.patch @@ -0,0 +1,64 @@ +commit f8dece8c016db6476e2bb0d4f972769a76f6ff40 +Author: Ryan Trinkle +Date: Wed May 11 20:17:23 2016 -0400 + + Add support for time-1.6 + +diff --git a/Data/Time/LocalTime/TimeZone/Series.hs b/Data/Time/LocalTime/TimeZone/Series.hs +index babcc0b..c8bb0ad 100644 +--- a/Data/Time/LocalTime/TimeZone/Series.hs ++++ b/Data/Time/LocalTime/TimeZone/Series.hs +@@ -2,6 +2,7 @@ + -- clock settings that occurred in the past and are scheduled to occur + -- in the future for the timezone. + ++{-# LANGUAGE CPP #-} + module Data.Time.LocalTime.TimeZone.Series + ( + -- * Representing a timezone +@@ -76,8 +77,18 @@ instance Show TimeZoneSeries where + instance Read TimeZoneSeries where + readsPrec n = map (first $ flip TimeZoneSeries []) . readsPrec n + ++-- In time-1.6, buildTime was changed to return a `Maybe t` rather ++-- than just a `t` ++#if MIN_VERSION_time(1,6,0) ++mapBuiltTime :: (a -> b) -> Maybe a -> Maybe b ++mapBuiltTime = fmap ++#else ++mapBuiltTime :: (a -> b) -> a -> b ++mapBuiltTime = id ++#endif ++ + instance ParseTime TimeZoneSeries where +- buildTime locale = flip TimeZoneSeries [] . buildTime locale ++ buildTime locale = mapBuiltTime (flip TimeZoneSeries []) . buildTime locale + + -- | The latest non-summer @TimeZone@ in a @TimeZoneSeries@ is in some + -- sense representative of the timezone. +@@ -167,7 +178,7 @@ instance Read ZoneSeriesTime where + readsPrec n = map (first zonedTimeToZoneSeriesTime) . readsPrec n + + instance ParseTime ZoneSeriesTime where +- buildTime locale = zonedTimeToZoneSeriesTime . buildTime locale ++ buildTime locale = mapBuiltTime zonedTimeToZoneSeriesTime . buildTime locale + + instance FormatTime ZoneSeriesTime where + formatCharacter = +diff --git a/timezone-series.cabal b/timezone-series.cabal +index 058c142..4ee73a4 100644 +--- a/timezone-series.cabal ++++ b/timezone-series.cabal +@@ -1,5 +1,5 @@ + Name: timezone-series +-Version: 0.1.5.1 ++Version: 0.1.5.2 + Synopsis: Enhanced timezone handling for Data.Time + Description: This package endows Data.Time, from the time + package, with several data types and functions +@@ -28,4 +28,4 @@ Library + Exposed-modules: Data.Time.LocalTime.TimeZone.Series + Default-extensions: DeriveDataTypeable + Build-depends: base >= 4.4 && < 5, +- time >= 1.1.4 && < 1.6 ++ time >= 1.1.4 && < 1.7