Skip to content
Snippets Groups Projects
Commit a5d22cab authored by John Ericson's avatar John Ericson Committed by Marge Bot
Browse files

hadrian: `need` any `configure` script we will call

When the script is changed, we should reconfigure.
parent fa977034
No related branches found
No related tags found
No related merge requests found
...@@ -144,17 +144,21 @@ configurePackage context@Context {..} = do ...@@ -144,17 +144,21 @@ configurePackage context@Context {..} = do
need deps need deps
-- Figure out what hooks we need. -- Figure out what hooks we need.
let configureFile = replaceFileName (pkgCabalFile package) "configure"
-- induce dependency on the file
autoconfUserHooks = do
need [configureFile]
pure C.autoconfUserHooks
hooks <- case C.buildType (C.flattenPackageDescription gpd) of hooks <- case C.buildType (C.flattenPackageDescription gpd) of
C.Configure -> pure C.autoconfUserHooks C.Configure -> autoconfUserHooks
C.Simple -> pure C.simpleUserHooks C.Simple -> pure C.simpleUserHooks
C.Make -> fail "build-type: Make is not supported" C.Make -> fail "build-type: Make is not supported"
-- The 'time' package has a 'C.Custom' Setup.hs, but it's actually -- The 'time' package has a 'C.Custom' Setup.hs, but it's actually
-- 'C.Configure' plus a @./Setup test@ hook. However, Cabal is also -- 'C.Configure' plus a @./Setup test@ hook. However, Cabal is also
-- 'C.Custom', but doesn't have a configure script. -- 'C.Custom', but doesn't have a configure script.
C.Custom -> do C.Custom -> do
configureExists <- doesFileExist $ configureExists <- doesFileExist configureFile
replaceFileName (pkgCabalFile package) "configure" if configureExists then autoconfUserHooks else pure C.simpleUserHooks
pure $ if configureExists then C.autoconfUserHooks else C.simpleUserHooks
-- Compute the list of flags, and the Cabal configuration arguments -- Compute the list of flags, and the Cabal configuration arguments
flagList <- interpret (target context (Cabal Flags stage) [] []) getArgs flagList <- interpret (target context (Cabal Flags stage) [] []) getArgs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment