[darcs-devel] darcs patch: configure.ac: restore bytestring to default (and 25 more)

zooko zooko at zooko.com
Mon Apr 21 19:39:01 UTC 2008


> By Windows, do you mean cygwin? I hadn't heard that the build on
> Windows was ever broken!

I mean building on Windows by using the GHC package for Windows which  
is available from here:

http://www.haskell.org/ghc/download_ghc_682.html#windows

I did use cygwin bash and cygwin make to execute the darcs autoconf,  
configure, and make scripts, but the problems that I detected (as  
corrected in the patch quoted below) don't seem to have to do with  
the shell or make program.

At least some of these problems (the use of ccall when we need  
stdcall) were reported months ago and I thought that they had already  
been fixed in darcs, so I wasn't sure why it was using ccall still or  
again.

Regards,

Zooko

> Copying pristine 141/180 : PopulationData.lhs
> Copying pristine 243/256 : Add.lhs
> Copying pristine 386/438 : Aggregator.pm
> Thu Apr 10 14:48:30 MDT 2008  zooko at zooko.com
>   * make darcs build on win32 by conditionally compiling out a few  
> bits that are unused or meaningless on win32
> diff -rN -u old-darcs-2/src/Darcs/Arguments.lhs new-darcs-2/src/ 
> Darcs/Arguments.lhs
> --- old-darcs-2/src/Darcs/Arguments.lhs	2008-04-21  
> 13:37:20.000000000 -0600
> +++ new-darcs-2/src/Darcs/Arguments.lhs	2008-04-21  
> 13:37:20.000000000 -0600
> @@ -83,16 +83,20 @@
>  import Control.Monad ( liftM, when, unless )
>  import Data.Char ( isDigit )
>  #ifndef WIN32
> +import Printer ( renderString )
>  import System.Posix.Env ( setEnv )
> +import Darcs.Hopefully ( info )
> +import Darcs.Patch ( list_touched_files )
> +import Darcs.Patch.Info ( to_xml )
> +import Darcs.Progress ( beginTedious, endTedious, tediousSize,  
> finishedOneIO )
> +import Printer ( vcat )
>  #endif
>
> -import Darcs.Hopefully ( PatchInfoAnd, info )
> -import Darcs.Patch ( RepoPatch, Patchy, showNicely, description,  
> list_touched_files )
> -import Darcs.Patch.Info ( to_xml )
> +import Darcs.Hopefully ( PatchInfoAnd )
> +import Darcs.Patch ( RepoPatch, Patchy, showNicely, description )
>  import Darcs.Patch.Ordered ( FL, mapFL )
>  import qualified Darcs.Patch ( summary )
>  import Darcs.Utils ( askUser, maybeGetEnv, firstNotBlank,  
> firstJustIO )
> -import Darcs.Progress ( beginTedious, endTedious, tediousSize,  
> finishedOneIO )
>  import Darcs.Repository.Prefs ( boring_file_filter, get_preflist,  
> get_global )
>  import Darcs.URL ( is_url )
>  import Darcs.FilePathUtils ( DarcsPath(RepoDP)
> @@ -105,7 +109,7 @@
>  import Darcs.Repository ( slurp_pending, withRepository, ($-) )
>  import Darcs.Repository.HashedRepo ( slurp_all_but_darcs )
>  import Darcs.SlurpDirectory ( list_slurpy )
> -import Printer ( renderString, Doc, putDocLn, text, vcat, vsep, ($ 
> $) )
> +import Printer ( Doc, putDocLn, text, vsep, ($$) )
>  \end{code}
>
>  \begin{code}
> diff -rN -u old-darcs-2/src/fpstring.c new-darcs-2/src/fpstring.c
> --- old-darcs-2/src/fpstring.c	2008-04-21 13:37:20.000000000 -0600
> +++ new-darcs-2/src/fpstring.c	2008-04-21 13:37:20.000000000 -0600
> @@ -70,12 +70,7 @@
>
>  char *my_mmap(int length, int fd)
>  {
> -    HANDLE file = (HANDLE)_get_osfhandle(fd);
> -    HANDLE hnd = CreateFileMapping(file, 0, PAGE_READONLY, 0, 0, 0);
> -    DWORD offhi = 0, offlo = 0;
> -    SIZE_T size = 0;
> -    char *p = MapViewOfFile(hnd, FILE_MAP_READ, offhi, offlo, size);
> -    return p;
> +  exit(1); /* mmap is not implemented on Windows */
>  }
>
>  int munmap(void *start, size_t length)
> diff -rN -u old-darcs-2/src/umask.c new-darcs-2/src/umask.c
> --- old-darcs-2/src/umask.c	2008-04-21 13:37:20.000000000 -0600
> +++ new-darcs-2/src/umask.c	2008-04-21 13:37:20.000000000 -0600
> @@ -7,6 +7,7 @@
>  int
>  set_umask(char *mask_string)
>  {
> +#ifndef WIN32
>      int rc;
>      unsigned mask;
>      char *end;
> @@ -19,6 +20,10 @@
>
>      rc = umask(mask);
>      return rc;
> +#else
> +    /* umask() has no useful meaning on win32. */
> +    return 0;
> +#endif /* #ifndef WIN32 ... else ... */
>  }
>
>  int
> diff -rN -u old-darcs-2/src/win32/System/Posix.hs new-darcs-2/src/ 
> win32/System/Posix.hs
> --- old-darcs-2/src/win32/System/Posix.hs	2008-04-21  
> 13:37:20.000000000 -0600
> +++ new-darcs-2/src/win32/System/Posix.hs	2008-04-21  
> 13:37:20.000000000 -0600
> @@ -31,7 +31,7 @@
>        t <- peek p :: IO CTime
>        return t
>
> -foreign import ccall "winbase.h SleepEx" c_SleepEx :: CULong ->  
> CUInt -> IO CInt
> +foreign import stdcall "winbase.h SleepEx" c_SleepEx :: CULong ->  
> CUInt -> IO CInt
>
>  sleep :: Integer -> IO CInt
>  sleep n = c_SleepEx (1000 * fromIntegral n) 1
>


More information about the darcs-devel mailing list