[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 15:15:31 UTC 2010


The following commit has been merged in the master branch:
commit 82ddd6a0da44de7f397289b2c3ee44447743901f
Author: John Goerzen <jgoerzen at complete.org>
Date:   Fri Dec 1 00:01:49 2006 +0100

    Attempting to automate Windows/Unix detection

diff --git a/Makefile b/Makefile
index 3c7706e..703c9dd 100644
--- a/Makefile
+++ b/Makefile
@@ -37,8 +37,8 @@ hugsbuild: setup
 	./setup configure --hugs
 	./setup build
 
-setup: Setup.lhs MissingH.cabal
-	ghc -package Cabal Setup.lhs -o setup
+setup: Setup.hs MissingH.cabal
+	ghc -package Cabal Setup.hs -o setup
 
 doctmp/%.hs: %.lhs doctmp
 	mkdir -p `dirname $@`
diff --git a/MissingH.cabal b/MissingH.cabal
index e14d803..15a449f 100644
--- a/MissingH.cabal
+++ b/MissingH.cabal
@@ -84,8 +84,8 @@ Exposed-Modules: MissingH.Str, MissingH.IO, MissingH.IO.Binary, MissingH.List,
 Extensions: ExistentialQuantification, OverlappingInstances, 
    UndecidableInstances, CPP
 Build-Depends: network, parsec, base,
-               unix,
                haskell98, mtl, HUnit, regex-compat, QuickCheck
+-- Cabal will automatically add unix here on non-Windows platforms
 GHC-Options: -O2
 
 Executable: runtests
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
index 0000000..3f9a060
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,22 @@
+#!/usr/bin/env runhugs
+
+import Distribution.Simple
+import Distribution.PackageDescription
+import Distribution.Version
+import System.Info
+
+winHooks = defaultUserHooks {readDesc = customReadDesc}
+
+customReadDesc =
+    do pdesc <- readDesc defaultUserHooks
+       case pdesc of
+         Nothing -> return Nothing
+         Just d -> if System.Info.os == "mingw32"
+                      then return pdesc
+                      else return $ Just (d {buildDepends = 
+                                               (Dependency "unix" AnyVersion) :
+                                               buildDepends d})
+
+                                                          
+main = defaultMainWithHooks winHooks
+
diff --git a/Setup.lhs b/Setup.lhs
deleted file mode 100644
index 9f3d8c1..0000000
--- a/Setup.lhs
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env runhugs
-arch-tag: Main setup script
-
-> import Distribution.Simple
-
-> main = defaultMain
-

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list