diff options
Diffstat (limited to 'devel/hs-drift')
-rw-r--r-- | devel/hs-drift/Makefile | 19 | ||||
-rw-r--r-- | devel/hs-drift/files/patch-src__ChaseImports.hs | 11 | ||||
-rw-r--r-- | devel/hs-drift/files/patch-src__DrIFT.hs | 21 | ||||
-rw-r--r-- | devel/hs-drift/files/patch-src__GenUtil.hs | 78 | ||||
-rw-r--r-- | devel/hs-drift/files/patch-src__Makefile.in | 11 |
5 files changed, 138 insertions, 2 deletions
diff --git a/devel/hs-drift/Makefile b/devel/hs-drift/Makefile index dcd8d007c6ad..fe536673e096 100644 --- a/devel/hs-drift/Makefile +++ b/devel/hs-drift/Makefile @@ -6,7 +6,7 @@ PORTNAME= drift PORTVERSION= 2.2.3 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= devel haskell MASTER_SITES= http://repetae.net/computer/haskell/DrIFT/drop/ PKGNAMEPREFIX= hs- @@ -21,7 +21,8 @@ OPTIONS= NHC98 "Build with nhc98" off \ .include <bsd.port.pre.mk> .if !defined(WITH_NHC98) -BUILD_DEPENDS= ghc:${PORTSDIR}/lang/ghc +BUILD_DEPENDS= ghc:${PORTSDIR}/lang/ghc \ + hs-random>=0:${PORTSDIR}/devel/hs-random LIB_DEPENDS= gmp.10:${PORTSDIR}/math/gmp .else BUILD_DEPENDS= nhc98:${PORTSDIR}/lang/nhc98 @@ -46,6 +47,20 @@ pre-everything:: @${ECHO} " DrIFT will be build with ghc" @${ECHO} " Define WITH_NHC98 to build with nhc98." @${ECHO} "" + +.else +post-patch: + @${REINPLACE_CMD} 's|import List|import Data.List| ; \ + s|import Char|import Data.Char| ; \ + s|import Monad|import Control.Monad| ; \ + s|import IO|import System.IO.Error| ; \ + s|import Directory|import System.Directory| ; \ + s|import Maybe|import Data.Maybe| ; \ + s|import Array|import Data.Array| ; \ + s|import Time|import System.Time| ; \ + s|import Random|import System.Random| ; \ + s|import System[^\.]|import System.Exit|' \ + `${FIND} ${WRKSRC} -name '*.*hs'` .endif .include <bsd.port.post.mk> diff --git a/devel/hs-drift/files/patch-src__ChaseImports.hs b/devel/hs-drift/files/patch-src__ChaseImports.hs new file mode 100644 index 000000000000..61ae0b6c59fa --- /dev/null +++ b/devel/hs-drift/files/patch-src__ChaseImports.hs @@ -0,0 +1,11 @@ +--- ./src/ChaseImports.hs.orig 2008-02-10 15:38:31.000000000 +0100 ++++ ./src/ChaseImports.hs 2012-05-13 11:51:52.000000000 +0200 +@@ -24,7 +24,7 @@ + import DataP + import CommandP + import ParseLib2 +-import System ++import System.Environment + import List + import qualified Unlit + import Monad diff --git a/devel/hs-drift/files/patch-src__DrIFT.hs b/devel/hs-drift/files/patch-src__DrIFT.hs new file mode 100644 index 000000000000..0bf97251f098 --- /dev/null +++ b/devel/hs-drift/files/patch-src__DrIFT.hs @@ -0,0 +1,21 @@ +--- ./src/DrIFT.hs.orig 2008-02-10 15:38:31.000000000 +0100 ++++ ./src/DrIFT.hs 2012-05-13 11:52:13.000000000 +0200 +@@ -17,7 +17,8 @@ + import RuleUtils(Rule,Tag) + import Version + import qualified Rules(rules) +-import qualified System ++import qualified System.Environment ++import System.IO + + data Op = OpList | OpDerive | OpVersion + +@@ -78,7 +79,7 @@ + + header = "Usage: DrIFT [OPTION...] file" + main = do +- argv <- System.getArgs ++ argv <- System.Environment.getArgs + (env,n) <- case (getOpt Permute options argv) of + (as,n,[]) -> return (foldr ($) env as ,n) + (_,_,errs) -> putErrDie (concat errs ++ usageInfo header options) diff --git a/devel/hs-drift/files/patch-src__GenUtil.hs b/devel/hs-drift/files/patch-src__GenUtil.hs new file mode 100644 index 000000000000..28989419a789 --- /dev/null +++ b/devel/hs-drift/files/patch-src__GenUtil.hs @@ -0,0 +1,78 @@ +--- ./src/GenUtil.hs.orig 2008-02-10 15:38:31.000000000 +0100 ++++ ./src/GenUtil.hs 2012-05-13 11:53:22.000000000 +0200 +@@ -39,7 +39,7 @@ + -- ** Simple deconstruction + fromLeft,fromRight,fsts,snds,splitEither,rights,lefts, + -- ** System routines +- exitSuccess, System.exitFailure, epoch, lookupEnv,endOfTime, ++ exitSuccess, System.Exit.exitFailure, epoch, lookupEnv,endOfTime, + -- ** Random routines + repMaybe, + liftT2, liftT3, liftT4, +@@ -94,9 +94,11 @@ + import Char(isAlphaNum, isSpace, toLower, ord) + import List(group,sort) + import List(intersperse, sortBy, groupBy) +-import Monad +-import qualified IO +-import qualified System ++import Monad hiding (replicateM, replicateM_) ++import qualified System.IO ++import qualified System.IO.Error ++import qualified System.Exit ++import qualified System.Environment + import Random(StdGen, newStdGen, Random(randomR)) + import Time + +@@ -127,7 +129,7 @@ + + -- | write string to standard error + putErr :: String -> IO () +-putErr = IO.hPutStr IO.stderr ++putErr = System.IO.hPutStr System.IO.stderr + + -- | write string and newline to standard error + putErrLn :: String -> IO () +@@ -137,13 +139,13 @@ + -- | write string and newline to standard error, + -- then exit program with failure. + putErrDie :: String -> IO a +-putErrDie s = putErrLn s >> System.exitFailure ++putErrDie s = putErrLn s >> System.Exit.exitFailure + + + -- | exit program successfully. 'exitFailure' is + -- also exported from System. + exitSuccess :: IO a +-exitSuccess = System.exitWith System.ExitSuccess ++exitSuccess = System.Exit.exitWith System.Exit.ExitSuccess + + + {-# INLINE fromRight #-} +@@ -381,7 +383,7 @@ + -- | looks up an enviornment variable and returns it in a 'MonadPlus' rather + -- than raising an exception if the variable is not set. + lookupEnv :: MonadPlus m => String -> IO (m String) +-lookupEnv s = catch (fmap return $ System.getEnv s) (\e -> if IO.isDoesNotExistError e then return mzero else ioError e) ++lookupEnv s = catch (fmap return $ System.Environment.getEnv s) (\e -> if System.IO.Error.isDoesNotExistError e then return mzero else ioError e) + + {-# SPECIALIZE fmapLeft :: (a -> c) -> [(Either a b)] -> [(Either c b)] #-} + fmapLeft :: Functor f => (a -> c) -> f (Either a b) -> f (Either c b) +@@ -482,7 +484,7 @@ + _ `overlaps` _ = True + + -- | translate a number of seconds to a string representing the duration expressed. +-showDuration :: Integral a => a -> String ++showDuration :: (Show a, Integral a) => a -> String + showDuration x = st "d" dayI ++ st "h" hourI ++ st "m" minI ++ show secI ++ "s" where + (dayI, hourI) = divMod hourI' 24 + (hourI', minI) = divMod minI' 60 +@@ -495,7 +497,7 @@ + -- arguments are given, read stdin. + + getArgContents = do +- as <- System.getArgs ++ as <- System.Environment.getArgs + let f "-" = getContents + f fn = readFile fn + cs <- mapM f as diff --git a/devel/hs-drift/files/patch-src__Makefile.in b/devel/hs-drift/files/patch-src__Makefile.in new file mode 100644 index 000000000000..2dd1390e47a4 --- /dev/null +++ b/devel/hs-drift/files/patch-src__Makefile.in @@ -0,0 +1,11 @@ +--- ./src/Makefile.in.orig 2008-02-10 15:41:19.000000000 +0100 ++++ ./src/Makefile.in 2012-05-13 11:54:07.000000000 +0200 +@@ -364,7 +364,7 @@ + + # all: DrIFT + DrIFT: $(DrIFT_SOURCES) $(nodist_DrIFT_SOURCES) +- $(HC) $(HCFLAGS) -i. -i@srcdir@ -hidir . -odir . -o $@ --make @srcdir@/DrIFT.hs ++ $(HC) $(HCFLAGS) -i. -i@srcdir@ -hidir . -odir . -o $@ --make @srcdir@/DrIFT.hs -package random + + #.hs.o: + # $(HC) -O -i. -i@srcdir@ $(HCFLAGS) -hidir . -o $@ -c $< |