summaryrefslogtreecommitdiff
path: root/Build/OSXMkLibs.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-09 12:20:00 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-09 12:22:09 -0400
commit9b9916db456f1f7f6322cd4cfdc25c27cdadb40a (patch)
tree29c088856f94386aed2544ae41abdf59489858c6 /Build/OSXMkLibs.hs
parent8b50290947148e9ae15bc46804bf1cd6614bd4d0 (diff)
install libs using short names, with symlinks to we can tell what libraries
they are supposed to be
Diffstat (limited to 'Build/OSXMkLibs.hs')
-rw-r--r--Build/OSXMkLibs.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Build/OSXMkLibs.hs b/Build/OSXMkLibs.hs
index 20bf0bf69..7c15e9451 100644
--- a/Build/OSXMkLibs.hs
+++ b/Build/OSXMkLibs.hs
@@ -41,14 +41,17 @@ installLibs :: FilePath -> LibMap -> IO ([FilePath], LibMap)
installLibs appbase libmap = do
(needlibs, libmap') <- otool appbase libmap
libs <- forM needlibs $ \lib -> do
- let dest = appbase </> takeFileName lib
+ let shortlib = fromMaybe (error "internal") (M.lookup lib libmap')
+ let dest = appbase </> shortlib
+ let symdest = appbase </> takeFileName lib
ifM (doesFileExist dest)
( return Nothing
, do
createDirectoryIfMissing True appbase
- putStrLn $ "installing " ++ lib
+ putStrLn $ "installing " ++ lib ++ " as " ++ dest
_ <- boolSystem "cp" [File lib, File dest]
_ <- boolSystem "chmod" [Param "644", File dest]
+ _ <- boolSystem "ln" [Param "-s", File shortlib, File symdest]
return $ Just appbase
)
return (catMaybes libs, libmap')