Now uses the Haskell Glob library, rather than pcre-light, avoiding the need to install libpcre. Currently done only for Cabal or when the Makefile is made to use -DWITH_GLOB

This commit is contained in:
Joey Hess 2013-02-11 11:47:53 -04:00
parent a86fe5ae94
commit 521398cc3d
8 changed files with 23 additions and 31 deletions

View file

@ -12,7 +12,9 @@ module Limit where
import Data.Time.Clock.POSIX
import qualified Data.Set as S
import qualified Data.Map as M
#ifndef WITH_ANDROID
#ifdef WITH_GLOB
import System.FilePath.Glob (simplify, compile, match)
#else
import Text.Regex.PCRE.Light.Char8
import System.Path.WildMatch
#endif
@ -85,10 +87,12 @@ limitExclude :: MkLimit
limitExclude glob = Right $ const $ return . not . matchglob glob
matchglob :: String -> Annex.FileInfo -> Bool
#ifdef WITH_ANDROID
matchglob _ _ = error "glob matching not supported"
#else
matchglob glob (Annex.FileInfo { Annex.matchFile = f }) =
#ifdef WITH_GLOB
match pattern f
where
pattern = simplify $ compile glob
#else
isJust $ match cregex f []
where
cregex = compile regex []

View file

@ -6,7 +6,7 @@ BASEFLAGS=-Wall -outputdir $(GIT_ANNEX_TMP_BUILD_DIR) -IUtility
# you can turn off some of these features.
#
# If you're using an old version of yesod, enable -DWITH_OLD_YESOD
FEATURES?=$(GIT_ANNEX_LOCAL_FEATURES) -DWITH_ASSISTANT -DWITH_S3 -DWITH_WEBDAV -DWITH_WEBAPP -DWITH_PAIRING -DWITH_XMPP -DWITH_DNS
FEATURES?=$(GIT_ANNEX_LOCAL_FEATURES) -DWITH_ASSISTANT -DWITH_S3 -DWITH_WEBDAV -DWITH_WEBAPP -DWITH_PAIRING -DWITH_XMPP -DWITH_DNS -DWITH_GLOB
bins=git-annex
mans=git-annex.1 git-annex-shell.1
@ -234,7 +234,7 @@ android:
$(MAKE) Build/SysConfig.hs
GHC=$$HOME/.ghc/android-14/arm-linux-androideabi-4.7/bin/arm-unknown-linux-androideabi-ghc \
CC=$$HOME/.ghc/android-14/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc \
FEATURES="-DWITH_ANDROID -DWITH_ASSISTANT -DWITH_DNS" \
FEATURES="-DWITH_ANDROID -DWITH_ASSISTANT -DWITH_GLOB -DWITH_DNS" \
ANDROID=1 $(MAKE) fast
# used by ./ghci

3
debian/changelog vendored
View file

@ -1,6 +1,9 @@
git-annex (3.20130208) UNRELEASED; urgency=low
* Now uses the Haskell uuid library, rather than needing a uuid program.
* Now uses the Haskell Glob library, rather than pcre-light, avoiding
the need to install libpcre. Currently done only for Cabal or when
the Makefile is made to use -DWITH_GLOB
-- Joey Hess <joeyh@debian.org> Sun, 10 Feb 2013 14:52:01 -0400

View file

@ -9,7 +9,7 @@ Should be as simple as: `yum install git-annex`
Older version? Here's an installation recipe for Fedora 14 through 15.
<pre>
sudo yum install ghc cabal-install pcre-devel
sudo yum install ghc cabal-install
git clone git://git-annex.branchable.com/ git-annex
cd git-annex
git checkout ghc7.0

View file

@ -24,7 +24,7 @@ the app for OSX Lion.
<pre>
brew update
brew install haskell-platform git ossp-uuid md5sha1sum coreutils pcre libgsasl gnutls libidn libgsasl pkg-config libxml2
brew install haskell-platform git ossp-uuid md5sha1sum coreutils libgsasl gnutls libidn libgsasl pkg-config libxml2
brew link libxml2
cabal update
PATH=$HOME/bin:$PATH
@ -38,10 +38,7 @@ The version provided by Macports is too old to work with current versions of git
Then execute
<pre>
sudo port install git-core ossp-uuid md5sha1sum coreutils pcre gnutls libxml2 libgsasl pkgconfig
sudo ln -s /opt/local/include/pcre.h /usr/include/pcre.h # This is hack that allows pcre-light to find pcre
sudo port install git-core ossp-uuid md5sha1sum coreutils gnutls libxml2 libgsasl pkgconfig
sudo cabal update
PATH=$HOME/bin:$PATH
cabal install c2hs git-annex --bindir=$HOME/bin

View file

@ -29,23 +29,11 @@ don't want things to be system wide)
$ export PATH=/usr/hs/bin:$PATH
On SL5 pcre is at version 6.6 which is far too old for one of the
dependancies that git-annex requires. Therefore the user must install
an updated version of _pcre_ either from source or another method, I
chose to install it from source and by hand into /usr/local
$ wget http://sourceforge.net/projects/pcre/files/pcre/8.30/pcre-8.30.tar.gz/download
$ tar zxvf pcre-8.30.tar.gz
$ cd pcre-8.30
$ ./configure
$ make && make install
Once the packages are installed and are in your execution path, using
cabal to configure and build git-annex just makes life easier, it
should install all the needed dependancies.
$ cabal update
$ cabal install pcre-light --extra-include-dirs=/usr/local/include
$ git clone git://git.kitenet.net/git-annex
$ cd git-annex
$ make git-annex.1

View file

@ -5,7 +5,6 @@ quite a lot.
* [The Haskell Platform](http://haskell.org/platform/) (GHC 7.4 or newer)
* [mtl](http://hackage.haskell.org.package/mtl) (2.1.1 or newer)
* [MissingH](http://github.com/jgoerzen/missingh/wiki)
* [pcre-light](http://hackage.haskell.org/package/pcre-light)
* [utf8-string](http://hackage.haskell.org/package/utf8-string)
* [SHA](http://hackage.haskell.org/package/SHA)
* [dataenc](http://hackage.haskell.org/package/dataenc)
@ -21,6 +20,7 @@ quite a lot.
* [DAV](http://hackage.haskell.org/package/DAV) (optional)
* [SafeSemaphore](http://hackage.haskell.org/package/SafeSemaphore)
* [UUID](http://hackage.haskell.org/package/uuid)
* [Glob](http://hackage.haskell.org/package/Glob)
* Optional haskell stuff, used by the [[assistant]] and its webapp (edit Makefile to disable)
* [stm](http://hackage.haskell.org/package/stm)
(version 2.3 or newer)

View file

@ -57,16 +57,16 @@ Executable git-annex
Build-Depends: MissingH, hslogger, directory, filepath,
unix, containers, utf8-string, network (>= 2.0), mtl (>= 2.1.1),
bytestring, old-locale, time,
pcre-light, extensible-exceptions, dataenc, SHA, process, json,
extensible-exceptions, dataenc, SHA, process, json,
base (>= 4.5 && < 4.8), monad-control, transformers-base, lifted-base,
IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, process,
SafeSemaphore, UUID
SafeSemaphore, UUID, Glob
-- Need to list these because they're generated from .hsc files.
Other-Modules: Utility.Touch Utility.Mounts
Include-Dirs: Utility
C-Sources: Utility/libdiskfree.c Utility/libmounts.c
Extensions: CPP
GHC-Options: -threaded
GHC-Options: -threaded -DWITH_GLOB
if flag(S3)
Build-Depends: hS3
@ -123,15 +123,15 @@ Test-Suite test
Main-Is: test.hs
Build-Depends: testpack, HUnit, MissingH, hslogger, directory, filepath,
unix, containers, utf8-string, network, mtl (>= 2.1.1), bytestring,
old-locale, time, pcre-light, extensible-exceptions, dataenc, SHA,
old-locale, time, extensible-exceptions, dataenc, SHA,
process, json, HTTP, base (>= 4.5 && < 4.7), monad-control,
transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1,
bloomfilter, edit-distance, process, SafeSemaphore
bloomfilter, edit-distance, process, SafeSemaphore, Glob
Other-Modules: Utility.Touch
Include-Dirs: Utility
C-Sources: Utility/libdiskfree.c
Extensions: CPP
GHC-Options: -threaded
GHC-Options: -threaded -DWITH_GLOB
source-repository head
type: git