Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added Setup.lhs

Ignore-this: 9aa7fb6d9f2f426072020a9bd7c73347

darcs-hash:20100614093054-7b3c0-6e7935d24c95fa1fcfc10834215a5a3fc8764316.gz
  • Loading branch information...
commit c16a6592744afa84a30c2effeef556c935387681 1 parent b71d50f
@ekmett authored
Showing with 48 additions and 0 deletions.
  1. +48 −0 Setup.lhs
View
48 Setup.lhs
@@ -0,0 +1,48 @@
+#!/usr/bin/env runhaskell
+
+TODO: update the po/kata.pot and any procedural .po files here?
+
+\begin{code}
+{-# LANGUAGE CPP #-}
+
+{-
+import Control.Monad ( zipWithM_, when, unless, filterM )
+import Data.Version( showVersion )
+import Distribution.Text ( display )
+import Distribution.System (OS(Windows), buildOS)
+import Distribution.Version (Version(versionBranch))
+import Distribution.Package ( packageVersion, packageName, PackageName(..) )
+import Distribution.PackageDescription
+ ( PackageDescription(executables), Executable(buildInfo, exeName)
+ , BuildInfo(customFieldsBI), emptyBuildInfo
+ , updatePackageDescription, cppOptions, ccOptions
+ , library, libBuildInfo, otherModules )
+import Distribution.Simple.BuildPaths ( autogenModulesDir )
+import Distribution.Simple.Setup (buildVerbosity, copyDest, copyVerbosity, fromFlag, haddockVerbosity, installVerbosity, sDistVerbosity)
+import Distribution.Simple.Utils (copyFiles, createDirectoryIfMissingVerbose, rawSystemStdout, rewriteFile)
+import Distribution.Verbosity ( Verbosity )
+import System.Directory
+ (copyFile, createDirectory, createDirectoryIfMissing,
+ doesDirectoryExist, doesFileExist,
+ getCurrentDirectory, getDirectoryContents,
+ removeDirectoryRecursive, removeFile, setCurrentDirectory)
+-}
+import GHC.IOBase (ExitCode(..))
+import Control.Monad (unless)
+import Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(..) ) -- , absoluteInstallDirs, externalPackageDeps )
+
+import Distribution.Simple (defaultMainWithHooks, UserHooks(..), simpleUserHooks)
+import System.IO (openFile, IOMode (..))
+import System.FilePath ( (</>), splitDirectories, isAbsolute )
+import System.Process
+
+main = defaultMainWithHooks simpleUserHooks { runTests = testHook }
+
+testHook args _ _ lbi = do
+ let args' = if null args then [] else "-t" : args
+ exitcode <- system (unwords ((buildDir lbi </> "test-ersatz" </> "test-ersatz") : args'))
+ unless (exitcode == ExitSuccess) $
+ fail "Test failed"
+
+
+\end{code}
Please sign in to comment.
Something went wrong with that request. Please try again.