From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2CE59138359 for ; Fri, 7 Aug 2020 21:57:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 085EEE0907; Fri, 7 Aug 2020 21:57:06 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D70A8E0907 for ; Fri, 7 Aug 2020 21:57:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3254A34F4AB for ; Fri, 7 Aug 2020 21:57:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D20822FD for ; Fri, 7 Aug 2020 21:57:02 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1596837411.d89c8965369e2c264653128521a4a0112c243302.slyfox@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-haskell/test-framework-th-prime/files/, dev-haskell/test-framework-th-prime/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-haskell/test-framework-th-prime/files/test-framework-th-prime-0.0.8-ghc-8.patch dev-haskell/test-framework-th-prime/files/test-framework-th-prime-0.0.9-hse-1.18.patch dev-haskell/test-framework-th-prime/test-framework-th-prime-0.0.9.ebuild X-VCS-Directories: dev-haskell/test-framework-th-prime/ dev-haskell/test-framework-th-prime/files/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: d89c8965369e2c264653128521a4a0112c243302 X-VCS-Branch: master Date: Fri, 7 Aug 2020 21:57:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ecbd92ef-a5dd-4c05-b305-080e4b4c871b X-Archives-Hash: 7eb4c2d7951d62e1bd34136d4a170372 commit: d89c8965369e2c264653128521a4a0112c243302 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Aug 7 21:56:51 2020 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Aug 7 21:56:51 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d89c8965 dev-haskell/test-framework-th-prime: port to ghc-8 Reported-by: Agostino Sarubbo Closes: https://bugs.gentoo.org/736252 Package-Manager: Portage-3.0.1, Repoman-2.3.23 Signed-off-by: Sergei Trofimovich gentoo.org> .../test-framework-th-prime-0.0.8-ghc-8.patch | 25 +++++++ .../test-framework-th-prime-0.0.9-hse-1.18.patch | 76 ++++++++++++++++++++++ .../test-framework-th-prime-0.0.9.ebuild | 2 + 3 files changed, 103 insertions(+) diff --git a/dev-haskell/test-framework-th-prime/files/test-framework-th-prime-0.0.8-ghc-8.patch b/dev-haskell/test-framework-th-prime/files/test-framework-th-prime-0.0.8-ghc-8.patch new file mode 100644 index 00000000000..b3cbf27a28f --- /dev/null +++ b/dev-haskell/test-framework-th-prime/files/test-framework-th-prime-0.0.8-ghc-8.patch @@ -0,0 +1,25 @@ +diff --git a/Test/Framework/TH/Prime.hs b/Test/Framework/TH/Prime.hs +index 75b0798..0bed643 100644 +--- a/Test/Framework/TH/Prime.hs ++++ b/Test/Framework/TH/Prime.hs +@@ -1,2 +1,3 @@ + {-# LANGUAGE QuasiQuotes, TemplateHaskell #-} ++{-# LANGUAGE CPP #-} + +@@ -119,3 +120,7 @@ isDefined :: String -> Q Bool + isDefined n = return False `recover` do ++#if MIN_VERSION_template_haskell(2,11,0) ++ VarI (Name _ flavour) _ _ <- reify (mkName n) ++#else + VarI (Name _ flavour) _ _ _ <- reify (mkName n) ++#endif + modul <- loc_module <$> location +diff --git a/Test/Framework/TH/Prime/Parser.hs b/Test/Framework/TH/Prime/Parser.hs +index 7f541c4..fef60f1 100644 +--- a/Test/Framework/TH/Prime/Parser.hs ++++ b/Test/Framework/TH/Prime/Parser.hs +@@ -78,3 +78,3 @@ parseTest file = do + #if MIN_VERSION_haskell_src_exts(1, 14, 0) +- extensions = nub $ EnableExtension TemplateHaskell : exts raw ++ extensions = nub $ EnableExtension Language.Haskell.Exts.Extension.TemplateHaskell : exts raw + #else diff --git a/dev-haskell/test-framework-th-prime/files/test-framework-th-prime-0.0.9-hse-1.18.patch b/dev-haskell/test-framework-th-prime/files/test-framework-th-prime-0.0.9-hse-1.18.patch new file mode 100644 index 00000000000..359d5ea4f6a --- /dev/null +++ b/dev-haskell/test-framework-th-prime/files/test-framework-th-prime-0.0.9-hse-1.18.patch @@ -0,0 +1,76 @@ +diff --git a/Test/Framework/TH/Prime/Parser.hs b/Test/Framework/TH/Prime/Parser.hs +index 87553a6..f188390 100644 +--- a/Test/Framework/TH/Prime/Parser.hs ++++ b/Test/Framework/TH/Prime/Parser.hs +@@ -10,2 +10,5 @@ import Language.Haskell.Exts.Extension + import Language.Haskell.Exts.Parser ++#if MIN_VERSION_haskell_src_exts(1, 18, 0) ++import Language.Haskell.Exts.SrcLoc ++#endif + import Language.Haskell.Exts.Syntax hiding (VarName, Exp) +@@ -14,2 +17,11 @@ import Language.Preprocessor.Cpphs hiding (Ident) + ++#if MIN_VERSION_haskell_src_exts(1, 18, 0) ++-- location field for haskell-src-exts-1.18 ++#define L SrcSpanInfo ++#define loc _ ++#else ++#define L ++#define loc ++#endif ++ + ---------------------------------------------------------------- +@@ -45,3 +57,7 @@ getTests :: FilePath -> IO ([String], [String]) + getTests file = do ++#if MIN_VERSION_haskell_src_exts(1, 18, 0) ++ ParseOk (Module _ _ _ _ decls) <- parseTest file ++#else + ParseOk (Module _ _ _ _ _ _ decls) <- parseTest file ++#endif + let funs = map fromFunBind $ filter isFunBind decls +@@ -54,3 +70,3 @@ getTests file = do + +-parseTest :: FilePath -> IO (ParseResult Module) ++parseTest :: FilePath -> IO (ParseResult (Module L)) + parseTest file = do +@@ -74,4 +90,4 @@ parseTest file = do + #endif +- toStr (Ident str) = str +- toStr (Symbol str) = str ++ toStr (Ident loc str) = str ++ toStr (Symbol loc str) = str + opt raw = defaultParseMode { +@@ -88,7 +104,7 @@ parseTest file = do + +-isFunBind :: Decl -> Bool +-isFunBind (FunBind _) = True +-isFunBind _ = False ++isFunBind :: Decl L -> Bool ++isFunBind (FunBind loc _) = True ++isFunBind _ = False + +-isPatBind :: Decl -> Bool ++isPatBind :: Decl L -> Bool + isPatBind PatBind{} = True +@@ -96,6 +112,6 @@ isPatBind _ = False + +-fromPatBind :: Decl -> String ++fromPatBind :: Decl L -> String + #if MIN_VERSION_haskell_src_exts(1, 16, 0) +-fromPatBind (PatBind _ (PVar (Ident name)) _ _) = name +-fromPatBind (PatBind _ (PVar (Symbol name)) _ _) = name ++fromPatBind (PatBind _ (PVar loc (Ident loc name)) _ _) = name ++fromPatBind (PatBind _ (PVar loc (Symbol loc name)) _ _) = name + #else +@@ -106,5 +122,10 @@ fromPatBind _ = error "fromPatBind" + +-fromFunBind :: Decl -> String ++fromFunBind :: Decl L -> String ++#if MIN_VERSION_haskell_src_exts(1, 18, 0) ++fromFunBind (FunBind _floc (Match _ (Ident _iloc name) _ _ _:_)) = name ++fromFunBind (FunBind _floc (Match _ (Symbol _sloc name) _ _ _:_)) = name ++#else + fromFunBind (FunBind (Match _ (Ident name) _ _ _ _:_)) = name + fromFunBind (FunBind (Match _ (Symbol name) _ _ _ _:_)) = name ++#endif + fromFunBind _ = error "fromFunBind" diff --git a/dev-haskell/test-framework-th-prime/test-framework-th-prime-0.0.9.ebuild b/dev-haskell/test-framework-th-prime/test-framework-th-prime-0.0.9.ebuild index fd0bfb0801c..ab54c1b6765 100644 --- a/dev-haskell/test-framework-th-prime/test-framework-th-prime-0.0.9.ebuild +++ b/dev-haskell/test-framework-th-prime/test-framework-th-prime-0.0.9.ebuild @@ -25,3 +25,5 @@ RDEPEND=">=dev-haskell/cpphs-0.2.1:=[profile?] DEPEND="${RDEPEND} >=dev-haskell/cabal-1.6 " + +PATCHES=("${FILESDIR}"/${P}-hse-1.18.patch)