Author: nanardon
Date: Sat Feb 17 05:47:41 2007
New Revision: 122076
Added:
packages/cooker/darcs/current/SOURCES/darcs-ghc6.6.patch
Modified:
packages/cooker/darcs/current/SPECS/darcs.spec
Log:
- rebuild for curl
- patch0: upstream patches to fix compil with ghc 6.6
Added: packages/cooker/darcs/current/SOURCES/darcs-ghc6.6.patch
==============================================================================
--- (empty file)
+++ packages/cooker/darcs/current/SOURCES/darcs-ghc6.6.patch Sat Feb 17
05:47:41 2007
@@ -0,0 +1,170 @@
+Wed Aug 16 01:41:27 CEST 2006 Esa Ilari Vuokko <[EMAIL PROTECTED]>
+ * Workaround for HasBounds that was removed in base-2.0 (GHC 6.6)
+diff -rN -u old-darcs/Lcs.lhs new-darcs/Lcs.lhs
+--- old-darcs/Lcs.lhs 2007-02-17 04:31:31.647714177 +0100
++++ new-darcs/Lcs.lhs 2007-02-17 04:31:37.838272841 +0100
+@@ -358,7 +358,8 @@
+ -- | goto next unchanged line, return the given line if unchanged
+ nextUnchanged :: BSTArray s -> Int -> ST s Int
+ nextUnchanged c i = do
+- if i == (aLen c) + 1 then return i
++ len <- aLenM c
++ if i == len + 1 then return i
+ else do b <- readArray c i
+ if b then nextUnchanged c (i+1)
+ else return i
+@@ -367,7 +368,8 @@
+ -- behind the last line
+ skipOneUnChanged :: BSTArray s -> Int -> ST s Int
+ skipOneUnChanged c i = do
+- if i == (aLen c) + 1 then return i
++ len <- aLenM c
++ if i == len + 1 then return i
+ else do b <- readArray c i
+ if not b then return (i+1)
+ else skipOneUnChanged c (i+1)
+@@ -381,8 +383,9 @@
+
+ -- | goto next changed line, return the given line if changed
+ nextChanged :: BSTArray s -> Int -> ST s (Maybe Int)
+-nextChanged c i =
+- if i <= aLen c
++nextChanged c i = do
++ len <- aLenM c
++ if i <= len
+ then do b <- readArray c i
+ if not b then nextChanged c (i+1)
+ else return $ Just i
+@@ -430,8 +433,17 @@
+ initP :: [PackedString] -> PArray
+ initP a = listArray (0, length a) (nilPS:a)
+
++#if __GLASGOW_HASKELL__ > 604
++aLen :: (IArray a e) => a Int e -> Int
++aLen a = snd $ bounds a
++aLenM :: (MArray a e m) => a Int e -> m Int
++aLenM a = getBounds a >>= return . snd
++#else
+ aLen :: HasBounds a => a Int e -> Int
+ aLen a = snd $ bounds a
++aLenM :: (HasBounds a, Monad m) => a Int e -> m Int
++aLenM = return . snd . bounds
++#endif
+ \end{code}
+
+ \begin{code}
+
+Wed Aug 16 01:57:39 CEST 2006 Esa Ilari Vuokko <[EMAIL PROTECTED]>
+ * Check for module Text.Html in package html
+diff -rN -u old-darcs/configure.ac new-darcs/configure.ac
+--- old-darcs/configure.ac 2007-02-17 05:19:49.199848954 +0100
++++ new-darcs/configure.ac 2007-02-17 05:19:55.000381165 +0100
+@@ -124,6 +124,10 @@
+
+ GHC_CHECK_MODULE(Text.ParserCombinators.Parsec, parsec, errorPos undefined)
+
++dnl Check if we need package html
++
++GHC_CHECK_MODULE(Text.Html, html, text "foo")
++
+ dnl Deal with systems on which getCurrentDirectory uses '\\' rather than '/':
+
+ WORKAROUND_getCurrentDirectory
+
+Wed Oct 4 14:31:58 CEST 2006 Josef Svenningsson <[EMAIL PROTECTED]>
+ * Look for Text.Regex in package regex-compat. Needed for GHC 6.6
+diff -rN -u old-darcs/configure.ac new-darcs/configure.ac
+--- old-darcs/configure.ac 2007-02-17 05:20:12.351973198 +0100
++++ new-darcs/configure.ac 2007-02-17 05:20:19.172599001 +0100
+@@ -110,6 +110,7 @@
+ dnl Look for Text.Regex
+
+ GHC_CHECK_MODULE(Text.Regex( mkRegex, matchRegex, Regex ), text, mkRegex
undefined)
++GHC_CHECK_MODULE(Text.Regex( mkRegex, matchRegex, Regex ), regex-compat,
mkRegex undefined)
+
+ dnl See if we need a package for QuickCheck
+
+
+Mon Dec 25 21:18:30 CET 2006 Eric Kow <[EMAIL PROTECTED]>
+ * Add Workaround.bracketOnError (introduced in GHC 6.6).
+
+ This is to compensate for the missing Control.Exception.bracketOnError
+ in GHC 6.4.2
+
+diff -rN -u old-darcs/aclocal.m4 new-darcs/aclocal.m4
+--- old-darcs/aclocal.m4 2007-02-17 05:20:51.315548140 +0100
++++ new-darcs/aclocal.m4 2007-02-17 05:20:51.905602275 +0100
+@@ -157,6 +157,36 @@
+ )
+ ])
+
++# WORKAROUND_bracketOnError
++# -----------------------
++# Work around missing bracketOnError
++AC_DEFUN([WORKAROUND_bracketOnError],[
++ EXPORT_WORKAROUND([ bracketOnError, ])
++ GHC_CHECK_MODULE(Control.Exception( bracketOnError ), base ,
++ bracketOnError (return ()) (const $ return ()) (const $ return ()),
++ [IMPORT_WORKAROUND([import Control.Exception( bracketOnError )])],
++ [IMPORT_WORKAROUND([import qualified Control.Exception( catch, throw,
block, unblock )])
++ CODE_WORKAROUND([[
++
++-- | Like bracket, but only performs the final action if there was an
++-- exception raised by the in-between computation.
++-- From GHC 6.6 (with twiddling for qualified block, catch, etc)
++bracketOnError
++ :: IO a -- ^ computation to run first (\"acquire resource\")
++ -> (a -> IO b) -- ^ computation to run last (\"release resource\")
++ -> (a -> IO c) -- ^ computation to run in-between
++ -> IO c -- returns the value from the in-between computation
++bracketOnError before after thing =
++ Control.Exception.block (do
++ a <- before
++ Control.Exception.catch
++ (Control.Exception.unblock (thing a))
++ (\e -> do { after a; Control.Exception.throw e })
++ )
++]])
++])
++])
++
+ # WORKAROUND_createLink
+ # -----------------------
+ # Work around missing POSIX createLink code.
+@@ -422,3 +452,4 @@
+ )
+ )
+ ])
++
+diff -rN -u old-darcs/configure.ac new-darcs/configure.ac
+--- old-darcs/configure.ac 2007-02-17 05:20:51.315548140 +0100
++++ new-darcs/configure.ac 2007-02-17 05:20:51.925604110 +0100
+@@ -149,6 +149,10 @@
+
+ WORKAROUND_renameFile
+
++dnl Deal with systems without bracketWithError
++
++WORKAROUND_bracketOnError
++
+ dnl Handle systems that don't do POSIX file modes
+
+ WORKAROUND_fileModes
+
+Wed Aug 16 01:57:14 CEST 2006 Esa Ilari Vuokko <[EMAIL PROTECTED]>
+ * Link to relevant symbol when checking for Control.Monad.Error
+diff -rN -u old-darcs/configure.ac new-darcs/configure.ac
+--- old-darcs/configure.ac 2007-02-17 05:32:02.017019606 +0100
++++ new-darcs/configure.ac 2007-02-17 05:32:10.967837438 +0100
+@@ -117,8 +117,8 @@
+
+ dnl See if we need the util or mtl packages for Control.Monad
+
+-GHC_CHECK_MODULE(Control.Monad.Error, util, putStr undefined)
+-GHC_CHECK_MODULE(Control.Monad.Error, mtl, putStr undefined)
++GHC_CHECK_MODULE(Control.Monad.Error, util, strMsg "foo" :: String)
++GHC_CHECK_MODULE(Control.Monad.Error, mtl, strMsg "foo" :: String)
+
+ dnl See if we need a package for parsec...
+
+
Modified: packages/cooker/darcs/current/SPECS/darcs.spec
==============================================================================
--- packages/cooker/darcs/current/SPECS/darcs.spec (original)
+++ packages/cooker/darcs/current/SPECS/darcs.spec Sat Feb 17 05:47:41 2007
@@ -3,7 +3,7 @@
%define name darcs
%define version 1.0.8
-%define release %mkrel 3
+%define release %mkrel 4
%define withgit 1
@@ -15,6 +15,9 @@
Version: %version
Release: %release
Source0: %{name}-%{version}.tar.bz2
+# upstream patch from unstable repos
+# Fix compil with ghc 6.6
+Patch0: darcs-ghc6.6.patch
License: GPL
Group: Development/Other
Url: http://abridgegame.org/darcs/
@@ -59,6 +62,7 @@
%prep
%setup -q
+%patch0 -p1 -b .hasbounds
%build
%configure \
@@ -75,7 +79,7 @@
make DESTDIR=%{buildroot} installbin installserver manual/index.html
# yes, it is a hack
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/www/
-mv -f $RPM_BUILD_ROOT/%{_libdir}/cgi-bin/
$RPM_BUILD_ROOT/%{_localstatedir}/www/cgi/
+mv -f $RPM_BUILD_ROOT/%{_libdir}/cgi-bin
$RPM_BUILD_ROOT/%{_localstatedir}/www/cgi
%check
PATH="$PWD:$PATH" make check