cvs commit: fptools/libraries/Cabal/Distribution Simple.hs
ross at soi.city.ac.uk
ross at soi.city.ac.uk
Sat Jan 1 21:51:30 EST 2005
> ** used basic preConf from HugsSetup as default preConf
I don't think that's right: I have Setup.description as the static info,
and Setup.buildinfo as extras to add to that (because I don't want to
duplicate the package description). I would have something like
preConf args (_, _, _, mb_prefix) = do
let prefix_opt pref opts = ("--prefix=" ++ pref) : opts
whenM (doesFileExist "configure") $
rawSystem "./configure" (maybe id prefix_opt mb_prefix args)
readHook
readHook = do
pkg_desc <- readPackageDescription defaultPackageDesc
exists <- doesFileExist buildInfoFile
if exists then do
inp <- readFile buildInfoFile
case parseBuildParameters pkg_descr inp of
Left err -> die (buildInfoFile ++ ": " ++ showError err)
Right pkg_descr' -> return (Just pkg_descr')
else
return (Just pkg_descr)
I also might want a more complicated preConf to deal with systems that
don't support configure scripts (via hardwired output).
An alternative to putting all that in the library would be to have a
cutdown version of HugsSetup.hs (though it should now work for any
implementation) in Cabal/examples.
More information about the Cvs-libraries
mailing list