diff --git a/ghc-hgettext.spec b/ghc-hgettext.spec index 3a55261..a888a38 100644 --- a/ghc-hgettext.spec +++ b/ghc-hgettext.spec @@ -1,15 +1,18 @@ +# generated by cabal-rpm-0.11.1 # https://fedoraproject.org/wiki/Packaging:Haskell %global pkg_name hgettext +%global pkgver %{pkg_name}-%{version} Name: ghc-%{pkg_name} Version: 0.1.30 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Haskell binding to libintl License: BSD Url: https://hackage.haskell.org/package/%{pkg_name} -Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz +Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz +Patch0: hgettext-hse-1.18.patch BuildRequires: ghc-Cabal-devel BuildRequires: ghc-rpm-macros @@ -40,7 +43,8 @@ This package provides the Haskell %{pkg_name} library development files. %prep -%setup -q -n %{pkg_name}-%{version} +%setup -q -n %{pkgver} +%patch0 -p1 -b .orig %build @@ -68,6 +72,9 @@ This package provides the Haskell %{pkg_name} library development files. %changelog +* Wed Feb 22 2017 Jens Petersen - 0.1.30-12 +- patch for newer haskell-src-exts + * Fri Feb 10 2017 Fedora Release Engineering - 0.1.30-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/hgettext-hse-1.18.patch b/hgettext-hse-1.18.patch new file mode 100644 index 0000000..c8faf46 --- /dev/null +++ b/hgettext-hse-1.18.patch @@ -0,0 +1,49 @@ +From 5bf5932d6a40f5b830ffdbaa2cda2948eef52732 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Sat, 1 Oct 2016 15:13:10 +0100 +Subject: [PATCH] update to support haskell-src-exts-1.18 + +One of major haskell-src-exts-1.18 changes +is to parameterise AST with source location +and add that field to every ast node. + +Signed-off-by: Sergei Trofimovich +--- + hgettext.cabal | 2 +- + src/hgettext.hs | 11 +++++++++-- + 2 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/hgettext.cabal b/hgettext.cabal +index af934ac..37b659c 100644 +--- a/hgettext.cabal ++++ b/hgettext.cabal +@@ -26,6 +26,6 @@ Executable hgettext + Main-Is: hgettext.hs + Extensions: TemplateHaskell + Hs-Source-Dirs: src +- Build-Depends: base>=3.0.3.0 && <5, uniplate, haskell-src-exts ++ Build-Depends: base>=3.0.3.0 && <5, uniplate, haskell-src-exts >= 1.18 + Other-Modules: Paths_hgettext + +diff --git a/src/hgettext.hs b/src/hgettext.hs +index c3b1b12..4139cae 100644 +--- a/src/hgettext.hs ++++ b/src/hgettext.hs +@@ -49,8 +49,15 @@ parseArgs args = + where header = "Usage: hgettext [OPTION] [INPUTFILE] ..." + + +-toTranslate :: String -> H.ParseResult H.Module -> [(Int, String)] +-toTranslate f (H.ParseOk z) = nub [ (0, s) | H.App (H.Var (H.UnQual (H.Ident x))) (H.Lit (H.String s)) <- universeBi z, x == f] ++toTranslate :: String -> H.ParseResult (H.Module H.SrcSpanInfo) -> [(Int, String)] ++toTranslate f (H.ParseOk z) = nub [ (0, s) ++ | H.App _ ++ (H.Var _ ++ (H.UnQual _ ++ (H.Ident _ x))) ++ (H.Lit _ ++ (H.String _ s _slit)) <- universeBi z :: [H.Exp H.SrcSpanInfo] ++ , x == f] + toTranslate _ _ = [] + + -- Create list of messages from a single file