1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00
nixpkgs/pkgs/misc/ghc68extraLibs/hsql-mysql-patch
Marc Weber 05ebf87bbf missing files previous patch
svn path=/nixpkgs/trunk/; revision=11565
2008-04-11 10:22:52 +00:00

74 lines
2.8 KiB
Plaintext

--- b/Setup.lhs 2008-04-04 19:21:06.000000000 +0200
+++ a/Setup.lhs 2008-04-04 19:43:42.000000000 +0200
@@ -1,12 +1,14 @@
+-- packages: process, Cabal, directory, filepath
#!/usr/bin/runghc
\begin{code}
import Data.Maybe(fromMaybe)
import Distribution.PackageDescription
+import Distribution.Verbosity
+import Distribution.PackageDescription.Parse
import Distribution.Setup
import Distribution.Simple
import Distribution.Simple.LocalBuildInfo
-import Distribution.Simple.Utils(rawSystemVerbose)
import System.Info
import System.Exit
import System.Directory
@@ -15,19 +17,19 @@
import Control.Monad(when)
import Control.Exception(try)
+
main = defaultMainWithHooks defaultUserHooks{preConf=preConf, postConf=postConf}
where
preConf :: [String] -> ConfigFlags -> IO HookedBuildInfo
preConf args flags = do
try (removeFile "MySQL.buildinfo")
return emptyHookedBuildInfo
- postConf :: [String] -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode
+ postConf :: [String] -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
postConf args flags _ localbuildinfo = do
- mb_bi <- mysqlConfigBuildInfo (configVerbose flags)
+ mb_bi <- mysqlConfigBuildInfo (fromFlag (configVerbose flags))
let default_binfo | os == "mingw32" = emptyBuildInfo{extraLibs=["libmySQL"], ccOptions=["-Dmingw32_HOST_OS"]}
| otherwise = emptyBuildInfo{extraLibs=["mysqlclient"]}
writeHookedBuildInfo "MySQL.buildinfo" (Just (fromMaybe default_binfo mb_bi),[])
- return ExitSuccess
\end{code}
The following code is derived from Distribution.Simple.Configure
@@ -46,9 +48,9 @@
message ("Using " ++ name ++ ": " ++ path)
return (Just path)
-rawSystemGrabOutput :: Int -> FilePath -> [String] -> IO String
+rawSystemGrabOutput :: Verbosity -> FilePath -> [String] -> IO String
rawSystemGrabOutput verbose path args = do
- when (verbose > 0) $
+ when (verbose > silent ) $
putStrLn (path ++ concatMap (' ':) args)
(inp,out,err,pid) <- runInteractiveProcess path args Nothing Nothing
exitCode <- waitForProcess pid
@@ -67,7 +69,7 @@
Populate BuildInfo using pkg-config tool.
\begin{code}
-mysqlConfigBuildInfo :: Int -> IO (Maybe BuildInfo)
+mysqlConfigBuildInfo :: Verbosity -> IO (Maybe BuildInfo)
mysqlConfigBuildInfo verbose = do
mb_mysql_config_path <- findProgram "mysql_config" Nothing
case mb_mysql_config_path of
--- a/hsql-mysql.cabal 2008-04-07 17:36:32.000000000 +0200
+++ b/hsql-mysql.cabal 2008-04-07 17:34:17.000000000 +0200
@@ -5,7 +5,7 @@
category: Database
description: MySQL driver for HSQL.
exposed-modules: Database.HSQL.MySQL
-build-depends: base, hsql
+build-depends: base, hsql, old-time
extensions: ForeignFunctionInterface, CPP
cc-options: -IDatabase/HSQL
extra-source-files: Database/HSQL/HsMySQL.h