diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2012-03-26 09:01:54 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2012-03-26 09:01:54 +0000 |
commit | 1c8647fd123f985736f97ea079a528b7458de979 (patch) | |
tree | 0249d297db8c07afe8d4bc091fbd10f07e0d338b /dev-haskell/happy | |
parent | Version bump, remove old. (diff) | |
download | gentoo-2-1c8647fd123f985736f97ea079a528b7458de979.tar.gz gentoo-2-1c8647fd123f985736f97ea079a528b7458de979.tar.bz2 gentoo-2-1c8647fd123f985736f97ea079a528b7458de979.zip |
Version bump. Compatible with ghc-7.4 (noticed by xvilka).
(Portage version: 2.2.0_alpha93_p2/cvs/Linux x86_64)
Diffstat (limited to 'dev-haskell/happy')
-rw-r--r-- | dev-haskell/happy/ChangeLog | 10 | ||||
-rw-r--r-- | dev-haskell/happy/files/happy-1.18.9-missing-tests.patch | 260 | ||||
-rw-r--r-- | dev-haskell/happy/happy-1.18.9.ebuild | 73 | ||||
-rw-r--r-- | dev-haskell/happy/metadata.xml | 11 |
4 files changed, 348 insertions, 6 deletions
diff --git a/dev-haskell/happy/ChangeLog b/dev-haskell/happy/ChangeLog index e81e148a965c..bcfbf3c0566c 100644 --- a/dev-haskell/happy/ChangeLog +++ b/dev-haskell/happy/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-haskell/happy -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-haskell/happy/ChangeLog,v 1.52 2011/08/05 10:53:54 slyfox Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/happy/ChangeLog,v 1.53 2012/03/26 09:01:54 slyfox Exp $ + +*happy-1.18.9 (26 Mar 2012) + + 26 Mar 2012; Sergei Trofimovich <slyfox@gentoo.org> + +files/happy-1.18.9-missing-tests.patch, +happy-1.18.9.ebuild, metadata.xml: + Version bump. Compatible with ghc-7.4 (noticed by xvilka). 05 Aug 2011; Sergei Trofimovich <slyfox@gentoo.org> happy-1.18.6.ebuild: Fix build failure for USE=-doc case. Discovered and fixed by Yvan Royon, bug diff --git a/dev-haskell/happy/files/happy-1.18.9-missing-tests.patch b/dev-haskell/happy/files/happy-1.18.9-missing-tests.patch new file mode 100644 index 000000000000..5b2b9b2cb42c --- /dev/null +++ b/dev-haskell/happy/files/happy-1.18.9-missing-tests.patch @@ -0,0 +1,260 @@ +--- happy-1.18.9-orig/happy.cabal 2012-02-06 20:49:56.000000000 +1100 ++++ happy-1.18.9/happy.cabal 2012-02-07 20:50:33.859004968 +1100 +@@ -100,10 +100,13 @@ + templates/GLR_Base.hs + templates/GenericTemplate.hs + templates/GLR_Lib.hs ++ tests/AttrGrammar001.y ++ tests/AttrGrammar002.y + tests/error001.y + tests/error001.stdout + tests/error001.stderr + tests/monad001.y ++ tests/monaderror.y + tests/Makefile + tests/TestMulti.ly + tests/Partial.ly +--- happy-1.18.9-orig/tests/Makefile 2012-02-06 20:49:55.000000000 +1100 ++++ happy-1.18.9/tests/Makefile 2012-02-07 20:50:33.859004968 +1100 +@@ -1,5 +1,5 @@ + HAPPY=../dist/build/happy/happy +-HC=ghc ++HC=ghc -package array -package mtl + + TESTS = Test.ly TestMulti.ly TestPrecedence.ly bug001.ly \ + monad001.y monad002.ly precedence001.ly precedence002.y \ +--- /dev/null 2012-02-07 10:04:42.144206507 +1100 ++++ happy-1.18.9/tests/AttrGrammar001.y 2012-02-07 20:50:47.013316418 +1100 +@@ -0,0 +1,68 @@ ++{ ++import Control.Monad (unless) ++} ++ ++%tokentype { Char } ++ ++%token a { 'a' } ++%token b { 'b' } ++%token c { 'c' } ++ ++%attributetype { Attrs a } ++%attribute value { a } ++%attribute len { Int } ++ ++%name parse abcstring ++ ++%monad { Maybe } ++ ++%% ++ ++abcstring ++ : alist blist clist ++ { $$ = $1 ++ $2 ++ $3 ++ ; $2.len = $1.len ++ ; $3.len = $1.len ++ } ++ ++alist ++ : a alist ++ { $$ = $1 : $> ++ ; $$.len = $>.len + 1 ++ } ++ | { $$ = []; $$.len = 0 } ++ ++blist ++ : b blist ++ { $$ = $1 : $> ++ ; $>.len = $$.len - 1 ++ } ++ | { $$ = [] ++ ; where failUnless ($$.len == 0) "blist wrong length" ++ } ++ ++clist ++ : c clist ++ { $$ = $1 : $> ++ ; $>.len = $$.len - 1 ++ } ++ | { $$ = [] ++ ; where failUnless ($$.len == 0) "clist wrong length" ++ } ++ ++{ ++happyError = error "parse error" ++failUnless b msg = unless b (fail msg) ++ ++main = case parse "" of { Just _ -> ++ case parse "abc" of { Just _ -> ++ case parse "aaaabbbbcccc" of { Just _ -> ++ case parse "abbcc" of { Nothing -> ++ case parse "aabcc" of { Nothing -> ++ case parse "aabbc" of { Nothing -> ++ putStrLn "Test works"; ++ _ -> quit } ; _ -> quit }; _ -> quit }; ++ _ -> quit } ; _ -> quit }; _ -> quit } ++ ++quit = putStrLn "Test failed" ++} +--- /dev/null 2012-02-07 10:04:42.144206507 +1100 ++++ happy-1.18.9/tests/AttrGrammar002.y 2012-02-07 20:50:47.013316418 +1100 +@@ -0,0 +1,58 @@ ++ ++%tokentype { Char } ++ ++%token minus { '-' } ++%token plus { '+' } ++%token one { '1' } ++%token zero { '0' } ++ ++%attributetype { Attrs } ++%attribute value { Integer } ++%attribute pos { Int } ++ ++%name parse start ++ ++%monad { Maybe } ++ ++%% ++ ++start ++ : num { $$ = $1 } ++ ++num ++ : bits { $$ = $1 ; $1.pos = 0 } ++ | plus bits { $$ = $2 ; $2.pos = 0 } ++ | minus bits { $$ = negate $2; $2.pos = 0 } ++ ++bits ++ : bit { $$ = $1 ++ ; $1.pos = $$.pos ++ } ++ ++ | bits bit { $$ = $1 + $2 ++ ; $1.pos = $$.pos + 1 ++ ; $2.pos = $$.pos ++ } ++ ++bit ++ : zero { $$ = 0 } ++ | one { $$ = 2^($$.pos) } ++ ++ ++{ ++happyError msg = fail $ "parse error: "++msg ++ ++main = case parse "" of { Nothing -> ++ case parse "abc" of { Nothing -> ++ case parse "0" of { Just 0 -> ++ case parse "1" of { Just 1 -> ++ case parse "101" of { Just 5 -> ++ case parse "111" of { Just 7 -> ++ case parse "10001" of { Just 17 -> ++ putStrLn "Test worked"; ++ _ -> quit }; _ -> quit }; _ -> quit }; ++ _ -> quit }; _ -> quit }; _ -> quit }; ++ _ -> quit } ++ ++quit = putStrLn "Test Failed" ++} +--- /dev/null 2012-02-07 10:04:42.144206507 +1100 ++++ happy-1.18.9/tests/ParGF.y 2012-02-07 20:50:47.014316443 +1100 +@@ -0,0 +1,40 @@ ++{- ++ ++With Happy 1.17 this file produces "Internal Happy error" when run: ++ ++$ happy ParGF.y && runghc ParGF.hs ++ParGF.hs: Internal Happy error ++ ++The problem is that we always pass around the "current token". When not ++using %lexer and we've run out of tokens, the current token is notHappyAtAll, ++which gets passed to happyError when there's an error. ++ ++-} ++ ++{ ++} ++ ++%name pGrammar ++ ++%tokentype { String } ++%error { parseError } ++ ++%token ++ 'a' { "a" } ++ ++%% ++ ++Grammar :: { () } ++Grammar : 'a' 'a' { () } ++ ++{ ++ ++parseError :: [String] -> a ++-- commenting out the below line gets rid of the "Internal Happy Error" ++parseError ("":_) = error "bar" ++parseError _ = error "foo" ++ ++main :: IO () ++main = print $ pGrammar ["a"] ++ ++} +--- /dev/null 2012-02-07 10:04:42.144206507 +1100 ++++ happy-1.18.9/tests/monaderror.y 2012-02-07 20:50:47.015316467 +1100 +@@ -0,0 +1,57 @@ ++{ ++module Main where ++ ++import Data.Char ++import Control.Monad.Error ++import System.Exit ++} ++ ++%name parseFoo ++%tokentype { Token } ++%error { handleError } ++ ++%monad { ParseM } { (>>=) } { return } ++ ++%token ++ 'S' { TokenSucc } ++ 'Z' { TokenZero } ++ ++%% ++ ++Exp : 'Z' { 0 } ++ | 'S' Exp { $2 + 1 } ++ ++{ ++ ++type ParseM a = Either ParseError a ++data ParseError ++ = ParseError (Maybe Token) ++ | StringError String ++ deriving (Eq,Show) ++instance Error ParseError where ++ strMsg = StringError ++ ++data Token ++ = TokenSucc ++ | TokenZero ++ deriving (Eq,Show) ++ ++handleError :: [Token] -> ParseM a ++handleError [] = throwError $ ParseError Nothing ++handleError ts = throwError $ ParseError $ Just $ head ts ++ ++lexer :: String -> [Token] ++lexer [] = [] ++lexer (c:cs) ++ | isSpace c = lexer cs ++ | c == 'S' = TokenSucc:(lexer cs) ++ | c == 'Z' = TokenZero:(lexer cs) ++ | otherwise = error "lexer error" ++ ++main :: IO () ++main = do ++ let tokens = lexer "S S" ++ when (parseFoo tokens /= Left (ParseError Nothing)) $ do ++ print (parseFoo tokens) ++ exitWith (ExitFailure 1) ++} diff --git a/dev-haskell/happy/happy-1.18.9.ebuild b/dev-haskell/happy/happy-1.18.9.ebuild new file mode 100644 index 000000000000..44a0fce9f455 --- /dev/null +++ b/dev-haskell/happy/happy-1.18.9.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/happy/happy-1.18.9.ebuild,v 1.1 2012/03/26 09:01:54 slyfox Exp $ + +# ebuild generated by hackport 0.2.9 + +EAPI="4" + +CABAL_FEATURES="bin" +inherit base haskell-cabal autotools + +DESCRIPTION="Happy is a parser generator for Haskell" +HOMEPAGE="http://www.haskell.org/happy/" +SRC_URI="http://hackage.haskell.org/packages/archive/${PN}/${PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="doc" + +RDEPEND="" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-1.2.3 + >=dev-haskell/mtl-1.0 + >=dev-lang/ghc-6.8.2 + doc? ( ~app-text/docbook-xml-dtd-4.2 + app-text/docbook-xsl-stylesheets )" + +PATCHES=("${FILESDIR}/${PN}-1.18.6-man.patch" + "${FILESDIR}/${PN}-1.18.9-missing-tests.patch") + +src_prepare() { + base_src_prepare + + use doc && cd doc && eautoconf +} + +src_configure() { + cabal_src_configure + + if use doc; then + cd doc && econf || die "econf failed in /doc" + fi +} + +src_compile() { + cabal_src_compile + + if use doc; then + cd doc && emake -j1 || die "emake failed in /doc" + fi +} + +src_test() { + if has_version "dev-haskell/monads-fd"; then + sed -e 's@HC=ghc@HC=ghc -hide-package monads-fd@' \ + -i "${S}/tests/Makefile" || die "Could not patch tests Makefile" + fi + if has_version "dev-haskell/monads-tf"; then + sed -e 's@HC=ghc@HC=ghc -hide-package monads-tf@' \ + -i "${S}/tests/Makefile" || die "Could not patch tests Makefile" + fi + emake -C "${S}/tests/" || die "emake for tests failed" +} + +src_install() { + cabal_src_install + if use doc; then + cd doc + dohtml -r happy/* + doman "${S}/doc/happy.1" + fi +} diff --git a/dev-haskell/happy/metadata.xml b/dev-haskell/happy/metadata.xml index 8c66906af531..2a4d5881edae 100644 --- a/dev-haskell/happy/metadata.xml +++ b/dev-haskell/happy/metadata.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> -<herd>haskell</herd> -<maintainer> - <email>haskell@gentoo.org</email> -</maintainer> + <herd>haskell</herd> + <maintainer> + <email>haskell@gentoo.org</email> + </maintainer> + <longdescription> + Happy is a parser generator for Haskell + </longdescription> </pkgmetadata> |