ghc-9.2 tweaks: fix parseTime error and bytestring for readable
This commit is contained in:
parent
14f46f6c78
commit
8cad6df585
@ -22,7 +22,8 @@ Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
|
|||||||
Source1: https://hackage.haskell.org/package/%{readable}/%{readable}.tar.gz
|
Source1: https://hackage.haskell.org/package/%{readable}/%{readable}.tar.gz
|
||||||
Source2: https://hackage.haskell.org/package/%{pkgver}/%{pkg_name}.cabal#/%{pkgver}.cabal
|
Source2: https://hackage.haskell.org/package/%{pkgver}/%{pkg_name}.cabal#/%{pkgver}.cabal
|
||||||
# End cabal-rpm sources
|
# End cabal-rpm sources
|
||||||
Patch1: snap-core-0.9.2.2-portable-flag.patch
|
Patch0: snap-core-0.9.2.2-portable-flag.patch
|
||||||
|
Patch1: snap-core-parseTime.patch
|
||||||
|
|
||||||
# Begin cabal-rpm deps:
|
# Begin cabal-rpm deps:
|
||||||
BuildRequires: dos2unix
|
BuildRequires: dos2unix
|
||||||
@ -128,7 +129,7 @@ This package provides the Haskell %{pkg_name} profiling library.
|
|||||||
%global main_version %{version}
|
%global main_version %{version}
|
||||||
|
|
||||||
%if %{defined ghclibdir}
|
%if %{defined ghclibdir}
|
||||||
%ghc_lib_subpackage %{readable}
|
%ghc_lib_subpackage -l BSD-3-Clause %{readable}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%global version %{main_version}
|
%global version %{main_version}
|
||||||
@ -139,9 +140,15 @@ This package provides the Haskell %{pkg_name} profiling library.
|
|||||||
%setup -q -n %{pkgver} -a1
|
%setup -q -n %{pkgver} -a1
|
||||||
dos2unix -k -n %{SOURCE2} %{pkg_name}.cabal
|
dos2unix -k -n %{SOURCE2} %{pkg_name}.cabal
|
||||||
# End cabal-rpm setup
|
# End cabal-rpm setup
|
||||||
|
%patch0 -p1 -b .orig
|
||||||
%patch1 -p1 -b .orig
|
%patch1 -p1 -b .orig
|
||||||
cabal-tweak-drop-dep bytestring-builder
|
cabal-tweak-drop-dep bytestring-builder
|
||||||
|
|
||||||
|
(
|
||||||
|
cd %{readable}
|
||||||
|
cabal-tweak-dep-ver bytestring '< 0.11' '< 0.12'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Begin cabal-rpm build:
|
# Begin cabal-rpm build:
|
||||||
|
12
snap-core-parseTime.patch
Normal file
12
snap-core-parseTime.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -up snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs~ snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs
|
||||||
|
--- snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs~ 2001-09-09 09:46:40.000000000 +0800
|
||||||
|
+++ snap-core-1.0.5.0/src/Snap/Internal/Http/Types.hs 2023-01-26 17:11:45.155960424 +0800
|
||||||
|
@@ -1282,7 +1282,7 @@ formatLogTime ctime = do
|
||||||
|
parseHttpTime = return . toCTime . prs . S.unpack
|
||||||
|
where
|
||||||
|
prs :: String -> Maybe UTCTime
|
||||||
|
- prs = parseTime defaultTimeLocale "%a, %d %b %Y %H:%M:%S GMT"
|
||||||
|
+ prs = parseTimeM True defaultTimeLocale "%a, %d %b %Y %H:%M:%S GMT"
|
||||||
|
|
||||||
|
toCTime :: Maybe UTCTime -> CTime
|
||||||
|
toCTime (Just t) = fromInteger $ truncate $ utcTimeToPOSIXSeconds t
|
Loading…
Reference in New Issue
Block a user