Permalink
Browse files

hdbc-odbc: Use Cabal configurations. The odbc/odbc32 choice is now ha…

…ndled with os(win32) (untested as I don't have Windows).
  • Loading branch information...
1 parent ff4b192 commit f97834c4777bbbee75f72f497a1a00dbe8a8f379 @bringert bringert committed Jan 6, 2008
Showing with 27 additions and 34 deletions.
  1. +24 −16 HDBC-odbc.cabal
  2. +3 −18 Setup.hs
View
@@ -1,8 +1,7 @@
--- Extra-Libraries: odbc -- handled via Setup.hs in its buildinfo file
-include-dirs: .
--- extra-lib-dirs:
Name: HDBC-odbc
Version: 1.1.3.1
+Cabal-Version: >=1.2
+Build-type: Simple
License: LGPL
Maintainer: John Goerzen <jgoerzen@complete.org>
Author: John Goerzen
@@ -17,16 +16,25 @@ Description: This package provides an ODBC database backend for HDBC.
and Microsoft ODBC on Windows. It is also the preferred way to access
MySQL databases from Haskell.
Stability: Beta
-Exposed-Modules: Database.HDBC.ODBC
-Other-Modules: Database.HDBC.ODBC.Connection,
- Database.HDBC.ODBC.Statement,
- Database.HDBC.ODBC.Types,
- Database.HDBC.ODBC.Utils,
- Database.HDBC.ODBC.TypeConv,
- Database.HDBC.ODBC.ConnectionImpl
---Extensions: ExistentialQuantification, AllowOverlappingInstances,
--- AllowUndecidableInstances, CPP
-Extensions: ExistentialQuantification
-Build-Depends: base, mtl, HDBC>=1.1.0, parsec
-GHC-Options: -O2
-C-Sources: hdbc-odbc-helper.c
+
+Library
+ Exposed-Modules: Database.HDBC.ODBC
+ Other-Modules: Database.HDBC.ODBC.Connection,
+ Database.HDBC.ODBC.Statement,
+ Database.HDBC.ODBC.Types,
+ Database.HDBC.ODBC.Utils,
+ Database.HDBC.ODBC.TypeConv,
+ Database.HDBC.ODBC.ConnectionImpl
+ Extensions:
+ ExistentialQuantification,
+ ForeignFunctionInterface,
+ PatternSignatures
+ Build-Depends: base, mtl, HDBC>=1.1.0, parsec
+ GHC-Options: -O2
+ C-Sources: hdbc-odbc-helper.c
+ if os(win32)
+ Extra-Libraries: odbc32
+ else
+ Extra-Libraries: odbc
+ include-dirs: .
+ -- extra-lib-dirs:
View
@@ -1,20 +1,5 @@
-import Distribution.Simple
-import qualified System.Info
-import Data.List
-import Distribution.Simple.Utils
-import Distribution.PackageDescription
-import System.Exit
-
-main = defaultMainWithHooks defaultUserHooks{preConf = conf, postConf = ok}
- where ok _ _ _ _ = return ExitSuccess
+#!/usr/bin/env runhaskell
-conf args flags =
- do config <- if isWindows
- then do putStrLn "On Windows -- using odbc32"
- return (emptyBuildInfo {extraLibs = ["odbc32"]})
- else do putStrLn "Not on Windows -- using odbc"
- return (emptyBuildInfo {extraLibs = ["odbc"]})
- writeHookedBuildInfo "HDBC-odbc.buildinfo" (Just config, [])
- return (Just config, [])
+import Distribution.Simple
- where isWindows = isPrefixOf "mingw" System.Info.os
+main = defaultMain

0 comments on commit f97834c

Please sign in to comment.