diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2011-07-31 15:38:07 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2011-07-31 15:38:07 +0000 |
commit | d6c8448379030c8179a6b1ea68e1453ce97b306e (patch) | |
tree | 7f212caa3e4a80a5864671e8dd3feae19ce10f80 /dev-haskell/alex | |
parent | alpha/ia64/sparc stable wrt #373393 (diff) | |
download | gentoo-2-d6c8448379030c8179a6b1ea68e1453ce97b306e.tar.gz gentoo-2-d6c8448379030c8179a6b1ea68e1453ce97b306e.tar.bz2 gentoo-2-d6c8448379030c8179a6b1ea68e1453ce97b306e.zip |
Version bump. Added tests support.
(Portage version: 2.1.10.7/cvs/Linux x86_64)
Diffstat (limited to 'dev-haskell/alex')
-rw-r--r-- | dev-haskell/alex/ChangeLog | 8 | ||||
-rw-r--r-- | dev-haskell/alex/alex-2.3.5.ebuild | 73 | ||||
-rw-r--r-- | dev-haskell/alex/files/alex-2.3.5-ghc-7.2.patch | 24 | ||||
-rw-r--r-- | dev-haskell/alex/files/alex-2.3.5-missing-test.patch | 72 |
4 files changed, 176 insertions, 1 deletions
diff --git a/dev-haskell/alex/ChangeLog b/dev-haskell/alex/ChangeLog index 9ac9e6c3cb5c..c3a136f0ff5c 100644 --- a/dev-haskell/alex/ChangeLog +++ b/dev-haskell/alex/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-haskell/alex # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-haskell/alex/ChangeLog,v 1.45 2011/02/27 20:15:23 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/alex/ChangeLog,v 1.46 2011/07/31 15:38:07 slyfox Exp $ + +*alex-2.3.5 (31 Jul 2011) + + 31 Jul 2011; Sergei Trofimovich <slyfox@gentoo.org> +alex-2.3.5.ebuild, + +files/alex-2.3.5-ghc-7.2.patch, +files/alex-2.3.5-missing-test.patch: + Version bump. Added tests support. 27 Feb 2011; Sergei Trofimovich <slyfox@gentoo.org> -alex-2.1.0.ebuild, -alex-2.2.ebuild: diff --git a/dev-haskell/alex/alex-2.3.5.ebuild b/dev-haskell/alex/alex-2.3.5.ebuild new file mode 100644 index 000000000000..1b96a11b1907 --- /dev/null +++ b/dev-haskell/alex/alex-2.3.5.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/alex/alex-2.3.5.ebuild,v 1.1 2011/07/31 15:38:07 slyfox Exp $ + +# ebuild generated by hackport 0.2.9 + +EAPI="3" + +CABAL_FEATURES="bin" +inherit autotools eutils haskell-cabal + +DESCRIPTION="Alex is a tool for generating lexical analysers in Haskell" +HOMEPAGE="http://www.haskell.org/alex/" +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 + >=dev-lang/ghc-6.8.2 + doc? ( ~app-text/docbook-xml-dtd-4.2 + app-text/docbook-xsl-stylesheets + >=dev-libs/libxslt-1.1.2 )" + +src_prepare() { + epatch "${FILESDIR}/${PN}-2.3.5-missing-test.patch" + epatch "${FILESDIR}/${PN}-2.3.5-ghc-7.2.patch" + + for f in Scan Parser; do + rm "${S}/src/$f."* + mv "${S}/dist/build/alex/alex-tmp/$f.hs" "${S}"/src/ + done + + if use doc; then + cd "${S}/doc/" + eautoreconf || die "eautoreconf for docs failed" + fi +} + +src_configure() { + cabal_src_configure + + if use doc; then + cd "${S}/doc/" + econf || die "econf for docs failed" + fi +} + +src_compile() { + cabal_src_compile + + if use doc; then + emake -C "${S}/doc/" -j1 || die "emake for docs failed" + fi +} + +src_test() { + emake -C "${S}/tests/" || die "emake for tests failed" +} + +src_install() { + cabal_src_install + + if use doc; then + doman "${S}/doc/alex.1" + dohtml -r "${S}/doc/alex/" + fi + dodoc README +} diff --git a/dev-haskell/alex/files/alex-2.3.5-ghc-7.2.patch b/dev-haskell/alex/files/alex-2.3.5-ghc-7.2.patch new file mode 100644 index 000000000000..31ab1ceee597 --- /dev/null +++ b/dev-haskell/alex/files/alex-2.3.5-ghc-7.2.patch @@ -0,0 +1,24 @@ +diff --git a/alex.cabal b/alex.cabal +index d04467b..b262af7 100644 +--- a/alex.cabal ++++ b/alex.cabal +@@ -72,7 +72,7 @@ executable alex + + build-depends: base < 5 + +- extensions: CPP ++ extensions: CPP, BangPatterns + ghc-options: -Wall + other-modules: + AbsSyn +diff --git a/doc/configure.ac b/doc/configure.ac +index 51fa85d..6e772c0 100644 +--- a/doc/configure.ac ++++ b/doc/configure.ac +@@ -9,5 +9,5 @@ FP_DIR_DOCBOOK_XSL([/usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/ + + AC_PATH_PROG(DbLatexCmd,dblatex) + +-AC_CONFIG_FILES([config.mk]) ++AC_CONFIG_FILES([config.mk alex.1]) + AC_OUTPUT diff --git a/dev-haskell/alex/files/alex-2.3.5-missing-test.patch b/dev-haskell/alex/files/alex-2.3.5-missing-test.patch new file mode 100644 index 000000000000..3c80b88a2096 --- /dev/null +++ b/dev-haskell/alex/files/alex-2.3.5-missing-test.patch @@ -0,0 +1,72 @@ +commit 883587ca4feecab72381991533b2f686a57a4d57 +Author: Sergei Trofimovich <slyfox@gentoo.org> +Date: Mon Jul 25 08:20:13 2011 +0300 + + added missing tokens_bytestring test + + Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> + +diff --git a/alex.cabal b/alex.cabal +index b262af7..c6f6e22 100644 +--- a/alex.cabal ++++ b/alex.cabal +@@ -57,6 +57,7 @@ extra-source-files: + tests/tokens.x + tests/tokens_gscan.x + tests/tokens_posn.x ++ tests/tokens_bytestring.x + + flag small_base + description: Choose the new smaller, split-up base package. +diff --git a/tests/tokens_bytestring.x b/tests/tokens_bytestring.x +new file mode 100644 +index 0000000..0cb23c8 +--- /dev/null ++++ b/tests/tokens_bytestring.x +@@ -0,0 +1,46 @@ ++{ ++{-# LANGUAGE OverloadedStrings #-} ++module Main (main) where ++import System.Exit ++import Data.ByteString.Lazy.Char8 (unpack) ++} ++ ++%wrapper "posn-bytestring" ++ ++$digit = 0-9 -- digits ++$alpha = [a-zA-Z] -- alphabetic characters ++ ++tokens :- ++ ++ $white+ ; ++ "--".* ; ++ let { tok (\p s -> Let p) } ++ in { tok (\p s -> In p) } ++ $digit+ { tok (\p s -> Int p (read (unpack s))) } ++ [\=\+\-\*\/\(\)] { tok (\p s -> Sym p (head (unpack s))) } ++ $alpha [$alpha $digit \_ \']* { tok (\p s -> Var p (unpack s)) } ++ ++{ ++-- Each right-hand side has type :: AlexPosn -> String -> Token ++ ++-- Some action helpers: ++tok f p s = f p s ++ ++-- The token type: ++data Token = ++ Let AlexPosn | ++ In AlexPosn | ++ Sym AlexPosn Char | ++ Var AlexPosn String | ++ Int AlexPosn Int | ++ Err AlexPosn ++ deriving (Eq,Show) ++ ++main = if test1 /= result1 then exitFailure ++ else exitWith ExitSuccess ++ ++test1 = alexScanTokens " let in 012334\n=+*foo bar__'" ++result1 = [Let (AlexPn 2 1 3),In (AlexPn 6 1 7),Int (AlexPn 9 1 10) 12334,Sym (AlexPn 16 2 1) '=',Sym (AlexPn 17 2 2) '+',Sym (AlexPn 18 2 3) '*',Var (AlexPn 19 2 4) "foo",Var (AlexPn 23 2 8) "bar__'"] ++ ++ ++} |