Skip to content

Commit

Permalink
Use mariadb_config when mysql_config is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
François Gannaz committed Apr 25, 2015
1 parent 1c724df commit ac45c11
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Setup.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
{- OPTIONS_GHC -Wall #-}

import Control.Monad (liftM2, mplus)
import Control.Monad (liftM, msum, sequence)
import Data.List (isPrefixOf)
import Distribution.PackageDescription
import Distribution.Simple
Expand Down Expand Up @@ -37,9 +37,11 @@ main = defaultMainWithHooks simpleUserHooks {
}

mysqlConfigProgram = (simpleProgram "mysql_config") {
programFindLocation = \verbosity -> constOrId $ liftM2 mplus
(findProgramLocation verbosity "mysql_config")
(findProgramLocation verbosity "mysql_config5")
programFindLocation = \verbosity -> constOrId $ liftM msum $ sequence
[ (findProgramLocation verbosity "mysql_config")
, (findProgramLocation verbosity "mysql5_config")
, (findProgramLocation verbosity "mariadb_config")
]
}

mysqlBuildInfo :: LocalBuildInfo -> IO BuildInfo
Expand Down

0 comments on commit ac45c11

Please sign in to comment.