now db lib takusen can be used as well

svn path=/nixpkgs/trunk/; revision=11060
This commit is contained in:
Marc Weber 2008-03-11 15:50:20 +00:00
parent 59708608cb
commit 7ad7fe870e
2 changed files with 64 additions and 0 deletions

View File

@ -55,6 +55,19 @@ rec {
# echo 'build-depends: old-locale, old-time' >> *.cabal";
# };
takusen = rec { name = "takusen-0.8"; p_deps = [ x.base x.mtl x.haskell98 x.time postgresql sqlite ];
src = sourceByName "takusen";
pass = {
inherit postgresql sqlite;
patch = ./takusen_setup_patch;
# no ODBC, Oracle support in nix
patchPhase = "patch -p1 Setup.hs < \$patch
sed -e '/ODBC/d' -i Takusen.cabal
sed -e '/Oracle/d' -i Takusen.cabal
sed -e \"s=pg_path=\$postgresql=\" -e \"s=sqlite_path=\$sqlite=\" -i Setup.hs
";
};
};
# 1.13 is stable. There are more recent non stable versions
haxml = rec { name = "HaXml-1.13.3"; p_deps = [ x.base x.rts x.directory x.process x.pretty x.containers x.filepath x.haskell98 ];

View File

@ -0,0 +1,51 @@
--- orig/Setup.hs 2008-03-11 16:35:54.000000000 +0100
+++ mod/Setup.hs 2008-03-11 16:45:16.000000000 +0100
@@ -1,3 +1,4 @@
+-- packages:HAppS-Server,mtl,HAppS-Data,HAppS-State,mtl,process,filepath,Cabal,directory
-- #!/usr/bin/env runhaskell
{-# OPTIONS -cpp #-}
@@ -8,12 +9,13 @@
import Control.Exception (bracket)
import Control.Monad (when)
import Data.List (isPrefixOf, unionBy)
+import Distribution.PackageDescription.Parse (writeHookedBuildInfo)
import Distribution.PackageDescription
( PackageDescription(..), Library(..), BuildInfo(..), HookedBuildInfo
- , emptyHookedBuildInfo, writeHookedBuildInfo, emptyBuildInfo, hasLibs
+ , emptyHookedBuildInfo, emptyBuildInfo, hasLibs
)
import Distribution.Simple.Setup -- ( --Flag, fromFlag, toFlag
- ( ConfigFlags(..), BuildFlags(..)
+ ( fromFlag, Flag(..), ConfigFlags(..), BuildFlags(..)
, InstallFlags(..), HaddockFlags(..)
, CopyFlags(..)
, RegisterFlags(..), emptyRegisterFlags
@@ -78,11 +80,16 @@
preConf args flags = do
try (removeFile "takusen.buildinfo")
return emptyHookedBuildInfo
+ conf libName path = (Just emptyBuildInfo {
+ extraLibs = [libName]
+ , extraLibDirs = [ path ++ "/lib" ]
+ , includeDirs = [ path ++ "/include" ]
+ })
postConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
postConf args flags _ localbuildinfo = do
let verbose = (configVerbose flags)
- sqliteBI <- configSqlite3 verbose
- pgBI <- configPG verbose
+ let sqliteBI = conf "sqlite3" "sqlite_path"
+ let pgBI = conf "pq" "pg_path"
oraBI <- configOracle verbose
odbcBI <- configOdbc verbose
let bis = [sqliteBI, pgBI, oraBI, odbcBI]
@@ -99,7 +106,7 @@
defaultInstallHook :: PackageDescription -> LocalBuildInfo
-> UserHooks -> InstallFlags -> IO ()
defaultInstallHook pkg_descr localbuildinfo _ (InstallFlags uInstFlag verbosity) = do
- install pkg_descr localbuildinfo (CopyFlags NoCopyDest verbosity)
+ install pkg_descr localbuildinfo (CopyFlags (Flag NoCopyDest) verbosity)
when (hasLibs pkg_descr) $
register pkg_descr localbuildinfo
emptyRegisterFlags{ regPackageDB=uInstFlag, regVerbose=verbosity }