diff options
author | Lennart Kolmodin <kolmodin@gentoo.org> | 2007-08-05 19:15:18 +0000 |
---|---|---|
committer | Lennart Kolmodin <kolmodin@gentoo.org> | 2007-08-05 19:15:18 +0000 |
commit | 1012e3a4bf8d86b2f31d8315bb7c7b2f20c2120c (patch) | |
tree | 38a7a91a781b2070e304a72594fe41ef1e9461be /dev-haskell | |
parent | Stable on ppc64; bug #187205 (diff) | |
download | historical-1012e3a4bf8d86b2f31d8315bb7c7b2f20c2120c.tar.gz historical-1012e3a4bf8d86b2f31d8315bb7c7b2f20c2120c.tar.bz2 historical-1012e3a4bf8d86b2f31d8315bb7c7b2f20c2120c.zip |
Initial versions of dev-haskell/regex-base
Package-Manager: portage-2.1.3.1
Diffstat (limited to 'dev-haskell')
-rw-r--r-- | dev-haskell/regex-base/ChangeLog | 12 | ||||
-rw-r--r-- | dev-haskell/regex-base/Manifest | 38 | ||||
-rw-r--r-- | dev-haskell/regex-base/files/digest-regex-base-0.72 | 3 | ||||
-rw-r--r-- | dev-haskell/regex-base/files/digest-regex-base-0.91 | 3 | ||||
-rw-r--r-- | dev-haskell/regex-base/files/regex-base-0.71-0.72.patch | 422 | ||||
-rw-r--r-- | dev-haskell/regex-base/metadata.xml | 8 | ||||
-rw-r--r-- | dev-haskell/regex-base/regex-base-0.72.ebuild | 32 | ||||
-rw-r--r-- | dev-haskell/regex-base/regex-base-0.91.ebuild | 18 |
8 files changed, 536 insertions, 0 deletions
diff --git a/dev-haskell/regex-base/ChangeLog b/dev-haskell/regex-base/ChangeLog new file mode 100644 index 000000000000..bcec9f833729 --- /dev/null +++ b/dev-haskell/regex-base/ChangeLog @@ -0,0 +1,12 @@ +# ChangeLog for dev-haskell/regex-base +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/regex-base/ChangeLog,v 1.1 2007/08/05 19:15:18 kolmodin Exp $ + +*regex-base-0.91 (05 Aug 2007) +*regex-base-0.72 (05 Aug 2007) + + 05 Aug 2007; Lennart Kolmodin <kolmodin@gentoo.org> + +files/regex-base-0.71-0.72.patch, +metadata.xml, +regex-base-0.72.ebuild, + +regex-base-0.91.ebuild: + Initial import. + diff --git a/dev-haskell/regex-base/Manifest b/dev-haskell/regex-base/Manifest new file mode 100644 index 000000000000..236a05c41aee --- /dev/null +++ b/dev-haskell/regex-base/Manifest @@ -0,0 +1,38 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX regex-base-0.71-0.72.patch 17967 RMD160 8d641b19973b6e88fe41de94a4e30aac589ed5db SHA1 8d774ab33e1b935979d4b97702e31229ec5e1872 SHA256 2d2c99e429c8b1a8875abed2178d54dfb99f4c2a27ee07888f72d17d04f955a2 +MD5 f2a181bc165f17de00b52a107c1196b0 files/regex-base-0.71-0.72.patch 17967 +RMD160 8d641b19973b6e88fe41de94a4e30aac589ed5db files/regex-base-0.71-0.72.patch 17967 +SHA256 2d2c99e429c8b1a8875abed2178d54dfb99f4c2a27ee07888f72d17d04f955a2 files/regex-base-0.71-0.72.patch 17967 +DIST regex-base-0.71.tar.gz 6759 RMD160 61fb61b7f777732e2ae5b19229e79c14ff13781c SHA1 f084f797dd5dac1107e2e1dffc38f0432d35f1d7 SHA256 af230c3088c6a963c4dc29a203c8804b707aa02c135113cce13d1fefdde02ff9 +DIST regex-base-0.91.tar.gz 8956 RMD160 2c3203614c45a21d551106b56f1040c40f92baa7 SHA1 52b7a1fb87b58ad4609c7ca8b2bc84c33d278920 SHA256 67267a52350f22e349ce1a84678ade602455a434399862f5742ba324ceaec339 +EBUILD regex-base-0.72.ebuild 806 RMD160 94fe4a3218b7aff4869c50789ca11a8d6eadb273 SHA1 bd98551b3b9f2a01860e5a5272d2ebe7a16c4a92 SHA256 092a8f79fce3e389d85bf703b36d0bafa96889da5622eaebec41a4daa5cfc534 +MD5 704ac8fcb455c58231a213acec6e7ae0 regex-base-0.72.ebuild 806 +RMD160 94fe4a3218b7aff4869c50789ca11a8d6eadb273 regex-base-0.72.ebuild 806 +SHA256 092a8f79fce3e389d85bf703b36d0bafa96889da5622eaebec41a4daa5cfc534 regex-base-0.72.ebuild 806 +EBUILD regex-base-0.91.ebuild 567 RMD160 6156f7621501eeaad0bc5114459dd090f9d393ac SHA1 f9d61903d1e9215093d8a9c2f7af37403073c89c SHA256 a7aea0e7d0b8378280c83f11f4c18a6656cbe5a2ca19da79728643a8d1a88aee +MD5 923915c4950847eeab550c8fa3fa716b regex-base-0.91.ebuild 567 +RMD160 6156f7621501eeaad0bc5114459dd090f9d393ac regex-base-0.91.ebuild 567 +SHA256 a7aea0e7d0b8378280c83f11f4c18a6656cbe5a2ca19da79728643a8d1a88aee regex-base-0.91.ebuild 567 +MISC ChangeLog 459 RMD160 6632b6c0c37bf790a2f9042901b020facde079bc SHA1 630974ea230dff7db3da58cfdd1fd4c73019a041 SHA256 b19350fcd29785d2a0b62d0c00f67524f2347c6e9e717bb087e61492531482ff +MD5 6026b7d3719e96486a32998a8d7f505d ChangeLog 459 +RMD160 6632b6c0c37bf790a2f9042901b020facde079bc ChangeLog 459 +SHA256 b19350fcd29785d2a0b62d0c00f67524f2347c6e9e717bb087e61492531482ff ChangeLog 459 +MISC metadata.xml 223 RMD160 7783e6057effb8b8f0b79cffe8b557b32c633839 SHA1 7b962c77f2e38479a9d1621ec8d307ca9f761753 SHA256 1d00c8be162a6cb87b3de440b3e63e10b39c12d56e8fbfe592e75aed872b2508 +MD5 c694674dcbef799cd4fdb6914683ebff metadata.xml 223 +RMD160 7783e6057effb8b8f0b79cffe8b557b32c633839 metadata.xml 223 +SHA256 1d00c8be162a6cb87b3de440b3e63e10b39c12d56e8fbfe592e75aed872b2508 metadata.xml 223 +MD5 1a67390775e5158583f27ef71dc11033 files/digest-regex-base-0.72 241 +RMD160 ffdb8b350e4cc7d960f3b2b58df043b6ca59e3a9 files/digest-regex-base-0.72 241 +SHA256 94d60b0a2fde96607de57e3d3b919d32721f1775f05475e3c36f28e4616577f7 files/digest-regex-base-0.72 241 +MD5 3ee8232dd2dce6c84f66be2a41b9f031 files/digest-regex-base-0.91 241 +RMD160 ed909417b9dc2d3a55175e0533543f9c14c56aa3 files/digest-regex-base-0.91 241 +SHA256 2ded62b1a2d6be93bddc3b37ef5c4edf235adda3cfb4d7f557f6852a2b6950ec files/digest-regex-base-0.91 241 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.7 (GNU/Linux) + +iD8DBQFGtiHM1n/CYbXjntIRAs+AAJ9Nmzh5pNKW6giF5YlO8fqhggfnGwCeLQwv ++GaGqw93nrq3wSSy8kz0glI= +=x/rN +-----END PGP SIGNATURE----- diff --git a/dev-haskell/regex-base/files/digest-regex-base-0.72 b/dev-haskell/regex-base/files/digest-regex-base-0.72 new file mode 100644 index 000000000000..8d05788f333b --- /dev/null +++ b/dev-haskell/regex-base/files/digest-regex-base-0.72 @@ -0,0 +1,3 @@ +MD5 7d9f3b4c3509691cd0f26a631d742b47 regex-base-0.71.tar.gz 6759 +RMD160 61fb61b7f777732e2ae5b19229e79c14ff13781c regex-base-0.71.tar.gz 6759 +SHA256 af230c3088c6a963c4dc29a203c8804b707aa02c135113cce13d1fefdde02ff9 regex-base-0.71.tar.gz 6759 diff --git a/dev-haskell/regex-base/files/digest-regex-base-0.91 b/dev-haskell/regex-base/files/digest-regex-base-0.91 new file mode 100644 index 000000000000..ec4fb3dc2219 --- /dev/null +++ b/dev-haskell/regex-base/files/digest-regex-base-0.91 @@ -0,0 +1,3 @@ +MD5 e29c01c251b2553c35bec578fbdcfd8d regex-base-0.91.tar.gz 8956 +RMD160 2c3203614c45a21d551106b56f1040c40f92baa7 regex-base-0.91.tar.gz 8956 +SHA256 67267a52350f22e349ce1a84678ade602455a434399862f5742ba324ceaec339 regex-base-0.91.tar.gz 8956 diff --git a/dev-haskell/regex-base/files/regex-base-0.71-0.72.patch b/dev-haskell/regex-base/files/regex-base-0.71-0.72.patch new file mode 100644 index 000000000000..7d20ce4e10f1 --- /dev/null +++ b/dev-haskell/regex-base/files/regex-base-0.71-0.72.patch @@ -0,0 +1,422 @@ +diff -urwpN regex-base-0.71/doc/lazy.html ghc-6.6.1/libraries/regex-base/doc/lazy.html +--- regex-base-0.71/doc/lazy.html 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/doc/lazy.html 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1,139 @@ ++<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ++<HTML> ++ <head> ++ <title>Text.Regex.Lazy</title> ++ </head> ++<body> ++<h1><tt>Text.Regex.Lazy</tt></h1> ++<h2>Version 0.70 (2006-08-10)</h2> ++ ++<h3>By Chris Kuklewicz (TextRegexLazy (at) personal (dot) mightyreason (dot) com)</h3> ++ ++Changes from 0.66 to 0.70 ++<ul> ++ <li> regex-tre added for libtre backend (Text.Regex.TRE), see http://laurikari.net/tre/ ++ <li> regex-devel added for tests and benchmarks ++ <li> Text.Regex.*.Wrap APIs improved: the exported wrap* functions ++ never call fail or error under normal circumstances, and use Either ++ types to report errors. Allocation failures are reported with fail. ++ <li> Text.Regex.*.(ByteString|String) all should export ++ compile/execute/regexec functions which report errors using Either. ++</ul> ++ ++Changes from 0.55 to 0.66 ++<ul> ++ <li> I broke this into many packages, regex-base for the interface and regex-pcre, regex-posix, regex-parsec, regex-dfa for the four backends and regex-compat to replace Text.Regex(.New) ++ <li> The top level Makefile now can drive setup and installation of all the packages at once. ++</ul> ++ ++Changes from 0.44 to 0.55 ++<ul> ++ <li> <b>JRegex has been assimilated: PCRE and PosixRE are here</b>. ++ The JRegex-style API rocks, see below and Context.hs and Example.hs ++ <li> Haddock seems to run via ./setup haddock, but the documentation is very thin ++ <li> ./setup test runs TestTestRegexLazy binary if uncommented in cabal file ++ <li> default is now to compile with -Wall -Werror -O2 ++ <li> You may need to point the cabal file's "Extra-Lib-Dirs" to point to pcre. ++ <li> You may or may not need a "-lpcre" option to ghc when building ++ projects that depend on Text.Regex.Lazy now. ++</ul> ++ ++Changes from 0.33 to 0.44 ++<ul> ++ <li> Cabal ++ <li> Compile with -Wall -Werror ++ <li> Change DFAEngineFPS from Data.FastPackedString to Data.ByteString ++</ul> ++See the LICENSE file for details on copyright. See README for building instructions. ++<br/> ++The new API is very close to JRegex and supports 4 backends: ++<ul> ++ <li> Posix, the standard c regex library ++ <li> PCRE, the <a href="http://www.pcre.org/">Perl Compatible Regular Expressions</a> c library ++ <li> Full, the lazy Parsec based library (see old api below) ++ <li> DFA, the fast lazy matching library (see old api below) ++</ul> ++And for all backends, there are two types that can be used as a source ++of regular expressions or to match a regular expression against: ++String, and ByteString. The ByteString library will be in the next ++GHC and can be gotten ++from <a ++href="http://www.cse.unsw.edu.au/~dons/fps.html">http://www.cse.unsw.edu.au/~dons/fps.html</a>. ++<p> ++For simplest use of the new API: import Text.Regex.Lazy and one of ++<pre> ++import Text.Regex.PCRE((=~),(=~~)) ++import Text.Regex.Parsec((=~),(=~~)) ++import Text.Regex.DFA((=~),(=~~)) ++import Text.Regex.PosixRE((=~),(=~~)) ++import Text.Regex.TRE((=~),(=~~)) ++</pre> ++The things you can demand of (=~) and (=~~) are all ++instance defined in Text.Regex.Impl.Context and they are used ++in <tt>Example.hs</tt> as well. ++<p> ++<p> ++You can redefine (=~) and (=~~) to use different options by using makeRegexOpts: ++<pre> ++(=~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target) => source1 -> source -> target ++(=~) x r = let q :: Regex ++ q = makeRegexOpts (some compoption) (some execoption) r ++ in match q x ++ ++(=~~) ::(RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Monad m) => source1 -> source -> m target ++(=~~) x r = let q :: Regex ++ q = makeRegexOpts (some compoption) (some execoption) r ++ in matchM q x ++</pre> ++There is a medium level API with functions compile/execute/regexec in ++all the Text.Regex.*.(String|ByteString) modules. These allow for ++errors to be reported as Either types when compiling or running. ++<p> ++The low level APIs are in the Text.Regex.*.Wrap modules. For the ++c-library backends these expose most of the c-api in wrap* functions ++that make the type more Haskell-like: CString and CStingLen and ++newtypes to specify compile and execute options. The actual foreign ++calls are not exported; it does not export the raw c api. ++<p> ++Also, Text.Regex.PCRE.Wrap will let you query if it was compiled with ++UTF8 suppor: <tt>configUTF8 :: Bool</tt>. But I do not provide a way ++to marshall to or from UTF8. (If you have a UTF8 ByteString then you ++would probably be able to make it work, assuming the indices PCRE uses ++are in bytes, otherwise look at the wrap* functions which are a thin ++layer over the pcreapi). ++<p> ++ ++<p> ++The old Text.Regex API is can be replaced. If you need to be drop in ++compatible with <tt>Text.Regex</tt> then you can ++import <tt>Text.Regex.New</tt> and report any infidelities as bugs. ++ ++Some advantages of <tt>Text.Regex.Parsec</tt> over <tt>Text.Regex</tt>: ++<ul> ++ <li> It does not marshal to and from c-code arrays, so it is much ++ faster on large input strings. ++ <li> It consumes the input <tt>String</tt> in a mostly lazy manner. ++ This makes streaming from input to output possible. ++ <li> It performs sanity checks so that <tt>subRegex</tt> ++ and <tt>splitRegex</tt> don't loop or go crazy if the pattern ++ matches an empty string -- it will just return the input. ++ <li> If the <tt>String</tt> regex does not parse then you get a nicer error ++ message. ++</ul> ++<p> ++Internally it uses <tt>Parsec</tt> to turn the string regex into ++a <tt>Pattern</tt> data type, simplify the <tt>Pattern</tt>, then ++transform the <tt>Pattern</tt> into a <tt>Parsec</tt> parser that ++accepts matching strings and stores the sub-strings of parenthesized ++groups. ++<p> ++All of this was motivated by the inability to use <tt>Text.Regex</tt> ++to complete ++the <a ++href="http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=all">regex-dna ++benchmark</a> on <a href="http://shootout.alioth.debian.org/">The ++Computer Language Shootout</a>. The current entry there, by Don ++Stewart and Alson Kemp and Chris Kuklewicz, does not use this Parsec ++solution, but rather a custom DFA lexer from the CTK library. ++</body> ++</HTML> +diff -urwpN regex-base-0.71/doc/README ghc-6.6.1/libraries/regex-base/doc/README +--- regex-base-0.71/doc/README 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/doc/README 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1,39 @@ ++README for TestRegexLazy-0.66 ++ ++By Chris Kuklewicz (TextRegexLazy (at) personal (dot) mightyreason (dot) com) ++ ++For more detail on Text.Regex.Lazy look at the very very outdated ++lazy.html file or the LICENSE file. ++ ++To build and install: ++ get Data.ByteString from http://www.cse.unsw.edu.au/~dons/fps.html ++ (You probably want to configure ByteString's cabal with -p for profiling) ++ edit list of BACKENDS in Makefile if you want to exclude regex-tre or regex-pcre ++ edit regex-pcre/regex-pcre.cabal to point to your PCRE installation ++ edit CONF and USER variables in Makefile to point to your setup ++ (The CONF includes -p for profiling) ++ run "make all" which will create and install all the packages in $(SUBDIRS) ++ ++The packages: ++ regex-base : This hold the type class definitions and (most) RegexContext,Extract instances ++ regex-compat : Builds Text.Regex.New (soon to replace Text.Regex) on top of regex-parsec ++ regex-pcre : Build the PCRE backend, http://www.pcre.org/ ++ regex-posix : Builds the Posix backend ++ regex-parsec : Builds my lazy parsec based pure haskell backend ++ regex-dfa : Build the simple backend based on CTKLight (this is LGPL) ++ ++There is an additional "regex-devel" package where I am setting up ++testing and bechmarking. Use "make regex-devel" at the top level to ++compile (not install), or use its cabal Setup.hs. ++regex-devel/bench/runbench.sh is my simple toy benchmark. ++ ++To use =~ and =~~ new API: ++ ++> import Text.Regex.(Parsec|DFA|PCRE|PosixRE|TRE) ++and perhaps ++> import Text.Regex.Base ++ ++Look at Example*.hs and instances in Text.Regex.Base.Context.hs for what it can do. ++ ++For old "Text.Regex" API drop in compatibility, import Text.Regex.New (uses PosixRE backend) ++ +diff -urwpN regex-base-0.71/doc/Redesign.txt ghc-6.6.1/libraries/regex-base/doc/Redesign.txt +--- regex-base-0.71/doc/Redesign.txt 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/doc/Redesign.txt 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1,14 @@ ++The regular expression stuff needs some of a rethink. ++ ++Things that could be made more efficient, as I think of them: ++ ++(1) Making Arrays in Wrap* may be a bit inefficient ++counter: Usage may be like "look up element 3" so random access is good ++ ++(2) String DFA: the findRegex computes the prefix string itself, which is sometimes wasted / sometimes wanted / always discarded. Also, the input string at the start of the match is discarded ++ ++(3) Lazy computes MatchedStrings array then discards it. Wasteful. ++ ++(4) Mighty extend RegexLike with ability to return "strings", i.e. Extract instance. The default conversion could be left in for some things. Then RegexContext could pull from that instead of matchOnce/matchAll. ++ ++(5) make RegexLike default matchAll/matchOnce in terms of matchOnceText and matchAllText +diff -urwpN regex-base-0.71/examples/Example2.hs ghc-6.6.1/libraries/regex-base/examples/Example2.hs +--- regex-base-0.71/examples/Example2.hs 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/examples/Example2.hs 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1,44 @@ ++{-# OPTIONS_GHC -fglasgow-exts #-} ++import Text.Regex.Base ++import Text.Regex.Posix(Regex,(=~),(=~~)) -- or DFA or PCRE or PosixRE ++import qualified Data.ByteString.Char8 as B(ByteString,pack) ++ ++-- Show mixing of ByteString and String as well as polymorphism: ++ ++main = let x :: (RegexContext Regex String target) => target ++ x = ("abaca" =~ B.pack "(.)a") ++ x' :: (RegexContext Regex String target,Monad m) => m target ++ x' = ("abaca" =~~ "(.)a") ++ y :: (RegexContext Regex B.ByteString target) => target ++ y = (B.pack "abaca" =~ "(.)a") ++ y' :: (RegexContext Regex B.ByteString target,Monad m) => m target ++ y' = (B.pack "abaca" =~~ B.pack "(.)a") ++ in do print (x :: Bool) ++ print (x :: Int) ++ print (x :: [MatchArray]) ++ print (x' :: Maybe (String,String,String,[String])) ++ print (y :: Bool) ++ print (y :: Int) ++ print (y :: [MatchArray]) ++ print (y' :: Maybe (B.ByteString,B.ByteString,B.ByteString,[B.ByteString])) ++ ++{- Output is, except for replacing Full with DFA (which has no capture) ++True ++2 ++[array (0,1) [(0,(1,2)),(1,(1,1))],array (0,1) [(0,(3,2)),(1,(3,1))]] ++Just ("a","ba","ca",["b"]) ++True ++2 ++[array (0,1) [(0,(1,2)),(1,(1,1))],array (0,1) [(0,(3,2)),(1,(3,1))]] ++Just ("a","ba","ca",["b"]) ++-} ++{- The output for DFA is ++True ++2 ++[array (0,0) [(0,(1,2))],array (0,0) [(0,(3,2))]] ++Just ("a","ba","ca",[]) ++True ++2 ++[array (0,0) [(0,(1,2))],array (0,0) [(0,(3,2))]] ++Just ("a","ba","ca",[]) ++-} +diff -urwpN regex-base-0.71/examples/Example3.lhs ghc-6.6.1/libraries/regex-base/examples/Example3.lhs +--- regex-base-0.71/examples/Example3.lhs 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/examples/Example3.lhs 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1,21 @@ ++> {-# OPTIONS_GHC -fglasgow-exts #-} ++ ++> import Text.Regex.Base ++ ++> import qualified Text.Regex.PCRE as R ++> import qualified Text.Regex.PosixRE as S ++> import qualified Text.Regex.Parsec as F ++ ++Choose which library to use depending on presence of PCRE library. ++ ++> (=~) :: (RegexMaker R.Regex R.CompOption R.ExecOption a,RegexContext R.Regex b t ++> ,RegexMaker F.Regex F.CompOption F.ExecOption a,RegexContext F.Regex b t ++> ,RegexMaker S.Regex S.CompOption S.ExecOption a,RegexContext S.Regex b t) ++> => b -> a -> t ++> (=~) = case R.getVersion of ++> Just _ -> (R.=~) ++> Nothing -> case S.getVersion of ++> Just _ -> (S.=~) ++> Nothing -> (F.=~) ++ ++> main = print ("abc" =~ "(.)c" :: Bool) +\ No newline at end of file +diff -urwpN regex-base-0.71/examples/Example.hs ghc-6.6.1/libraries/regex-base/examples/Example.hs +--- regex-base-0.71/examples/Example.hs 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/examples/Example.hs 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1,14 @@ ++{-# OPTIONS_GHC -fglasgow-exts #-} ++import Text.Regex.Base ++import Text.Regex.Posix((=~),(=~~)) -- or DFA or PCRE or PosixRE ++import qualified Data.ByteString.Char8 as B(ByteString,pack) ++ ++main = let b :: Bool ++ b = ("abaca" =~ "(.)a") ++ c :: [MatchArray] ++ c = ("abaca" =~ "(.)a") ++ d :: Maybe (String,String,String,[String]) ++ d = ("abaca" =~~ "(.)a") ++ in do print b ++ print c ++ print d +diff -urwpN regex-base-0.71/Makefile ghc-6.6.1/libraries/regex-base/Makefile +--- regex-base-0.71/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/Makefile 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1,20 @@ ++TOP=.. ++include $(TOP)/mk/boilerplate.mk ++ ++SUBDIRS = ++ ++ALL_DIRS = \ ++ Text/Regex \ ++ Text/Regex/Base ++ ++PACKAGE = regex-base ++VERSION = 0.72 ++PACKAGE_DEPS = base ++ ++EXCLUDED_SRCS = Setup.hs ++ ++SRC_HC_OPTS += -cpp ++ ++SRC_HADDOCK_OPTS += -t "Haskell Hierarchical Libraries ($(PACKAGE) package)" ++ ++include $(TOP)/mk/target.mk +diff -urwpN regex-base-0.71/package.conf.in ghc-6.6.1/libraries/regex-base/package.conf.in +--- regex-base-0.71/package.conf.in 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/package.conf.in 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1,27 @@ ++name: PACKAGE ++version: VERSION ++license: BSD3 ++maintainer: TextRegexLazy@personal.mightyreason.com ++exposed: True ++ ++exposed-modules: Text.Regex.Base ++ Text.Regex.Base.RegexLike ++ Text.Regex.Base.Context ++ Text.Regex.Base.Impl ++ ++hidden-modules: ++ ++import-dirs: IMPORT_DIR ++library-dirs: LIB_DIR ++hs-libraries: "HSregex-base" ++extra-libraries: ++include-dirs: ++includes: ++depends: base ++hugs-options: ++cc-options: ++ld-options: ++framework-dirs: ++frameworks: ++haddock-interfaces: HADDOCK_IFACE ++haddock-html: HTML_DIR +diff -urwpN regex-base-0.71/prologue.txt ghc-6.6.1/libraries/regex-base/prologue.txt +--- regex-base-0.71/prologue.txt 1970-01-01 01:00:00.000000000 +0100 ++++ ghc-6.6.1/libraries/regex-base/prologue.txt 2007-04-25 18:24:10.000000000 +0100 +@@ -0,0 +1 @@ ++Interfaces for regular expressions +diff -urwpN regex-base-0.71/regex-base.cabal ghc-6.6.1/libraries/regex-base/regex-base.cabal +--- regex-base-0.71/regex-base.cabal 2006-12-05 18:29:02.000000000 +0000 ++++ ghc-6.6.1/libraries/regex-base/regex-base.cabal 2007-04-25 18:24:10.000000000 +0100 +@@ -2,7 +2,7 @@ + -- To fix for cabal < 1.1.4 comment out the Extra-Source-Files line + -- **************************************************************** + Name: regex-base +-Version: 0.71 ++Version: 0.72 + -- Cabal-Version: >=1.1.4 + License: BSD3 + License-File: LICENSE +@@ -28,7 +28,7 @@ Buildable: True + -- Other-Modules: + -- ********* Be backward compatible until 6.4.2 is futher deployed + -- HS-Source-Dirs: "." +-Extensions: MultiParamTypeClasses, FunctionalDependencies ++Extensions: MultiParamTypeClasses, FunctionalDependencies, CPP + -- GHC-Options: -Wall -Werror + GHC-Options: -Wall -Werror -O2 + -- GHC-Options: -Wall -ddump-minimal-imports +diff -urwpN regex-base-0.71/Text/Regex/Base/Context.hs ghc-6.6.1/libraries/regex-base/Text/Regex/Base/Context.hs +--- regex-base-0.71/Text/Regex/Base/Context.hs 2006-12-05 18:29:02.000000000 +0000 ++++ ghc-6.6.1/libraries/regex-base/Text/Regex/Base/Context.hs 2007-04-25 18:24:10.000000000 +0100 +@@ -185,9 +185,12 @@ instance (RegexLike a b) => RegexContext + match r s = maybe (-1,0) (!0) (matchOnce r s) + matchM r s = maybe regexFailed (return.(!0)) (matchOnce r s) + ++#if __GLASGOW_HASKELL__ ++-- overlaps with instance (RegexLike a b) => RegexContext a b (Array Int b) + instance (RegexLike a b) => RegexContext a b MatchArray where + match r s = maybe nullArray id (matchOnce r s) + matchM r s = maybe regexFailed return (matchOnce r s) ++#endif + + instance (RegexLike a b) => RegexContext a b (b,MatchText b,b) where + match r s = maybe (s,nullArray,empty) id (matchOnceText r s) +@@ -216,21 +219,27 @@ instance (RegexLike a b) => RegexContext + , mrMatch = whole + , mrAfter = post + , mrSubs = fmap fst ma +- , mrSubList = tail (map fst subs) }) ++ , mrSubList = map fst subs }) + + -- ** Instances based on matchAll,matchAllText + ++#if __GLASGOW_HASKELL__ ++-- overlaps with instance (RegexLike a b) => RegexContext a b [Array Int b] + instance (RegexLike a b) => RegexContext a b [MatchArray] where + match = matchAll + matchM = nullFail ++#endif + + instance (RegexLike a b) => RegexContext a b [MatchText b] where + match = matchAllText + matchM = nullFail + ++#if __GLASGOW_HASKELL__ ++-- overlaps with instance (RegexLike a b) => RegexContext a b [b] + instance (RegexLike a b) => RegexContext a b [(MatchOffset,MatchLength)] where + match r s = [ ma!0 | ma <- matchAll r s ] + matchM = nullFail ++#endif + + instance (RegexLike a b) => RegexContext a b [b] where + match r s = [ fst (ma!0) | ma <- matchAllText r s ] diff --git a/dev-haskell/regex-base/metadata.xml b/dev-haskell/regex-base/metadata.xml new file mode 100644 index 000000000000..8c66906af531 --- /dev/null +++ b/dev-haskell/regex-base/metadata.xml @@ -0,0 +1,8 @@ +<?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> +</pkgmetadata> diff --git a/dev-haskell/regex-base/regex-base-0.72.ebuild b/dev-haskell/regex-base/regex-base-0.72.ebuild new file mode 100644 index 000000000000..c6daf568f5f6 --- /dev/null +++ b/dev-haskell/regex-base/regex-base-0.72.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/regex-base/regex-base-0.72.ebuild,v 1.1 2007/08/05 19:15:18 kolmodin Exp $ + +CABAL_FEATURES="profile haddock lib" +inherit eutils haskell-cabal + +MY_PV="0.71" +MY_P="regex-base-${MY_PV}" + +DESCRIPTION="Replaces/Enhances Text.Regex" +HOMEPAGE="http://sourceforge.net/projects/lazy-regex" +SRC_URI="http://hackage.haskell.org/packages/archive/${PN}/${MY_PV}/${MY_P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND=">=dev-lang/ghc-6.6" + +CABAL_CORE_LIB_GHC_PV="6.6.1" + +src_unpack() { + unpack "${A}" + + # Upgrade us from 0.71 to 0.72 which comes with ghc-6.6.1 + cd "${S}" + epatch "${FILESDIR}/${PN}-0.71-0.72.patch" +} + +S="${WORKDIR}/${MY_P}" diff --git a/dev-haskell/regex-base/regex-base-0.91.ebuild b/dev-haskell/regex-base/regex-base-0.91.ebuild new file mode 100644 index 000000000000..ccbbc3014527 --- /dev/null +++ b/dev-haskell/regex-base/regex-base-0.91.ebuild @@ -0,0 +1,18 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/regex-base/regex-base-0.91.ebuild,v 1.1 2007/08/05 19:15:18 kolmodin Exp $ + +CABAL_FEATURES="profile haddock lib" +inherit haskell-cabal + +DESCRIPTION="Replaces/Enhances Text.Regex" +HOMEPAGE="http://sourceforge.net/projects/lazy-regex" +SRC_URI="http://hackage.haskell.org/packages/archive/${PN}/${PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND=">=dev-lang/ghc-6.6 + dev-haskell/mtl" |