Skip to content

Commit

Permalink
Also add wrapper executables when running install
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Sep 20, 2015
1 parent 73d9ad3 commit d5c67ef
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ main = defaultMainWithHooks ghcjsHooks
ghcjsHooks :: UserHooks
ghcjsHooks = simpleUserHooks { preSDist = ghcjsSDist
, postCopy = ghcjsPostCopy
, postInst = \args -> ghcjsPostCopy args . installFlagsToCopyFlags
}

{- |
Expand All @@ -45,6 +46,15 @@ ghcjsSDist as flags = do
rawSystemExit (fromFlagOrDefault normal $ sDistVerbosity flags) "bash" ["utils/update_archives.sh"]
return emptyHookedBuildInfo

-- Necessary because postCopy isn't invoked when install is run.
-- Copied from https://github.com/haskell/cabal/blob/589cc887c4ef10f514174e0875d7df1963bdcf71/Cabal/Distribution/Simple.hs#L689
installFlagsToCopyFlags :: InstallFlags -> CopyFlags
installFlagsToCopyFlags flags = defaultCopyFlags
{ copyDistPref = installDistPref flags
, copyDest = toFlag NoCopyDest
, copyVerbosity = installVerbosity flags
}

ghcjsPostCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
ghcjsPostCopy args flags descr lbi
| (FlagName "no-wrapper-install", True) `elem` configConfigurationsFlags (configFlags lbi) =
Expand Down

0 comments on commit d5c67ef

Please sign in to comment.