From 9b9916db456f1f7f6322cd4cfdc25c27cdadb40a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Dec 2012 12:20:00 -0400 Subject: install libs using short names, with symlinks to we can tell what libraries they are supposed to be --- Build/OSXMkLibs.hs | 7 +++++-- 1 file 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') -- cgit v1.2.3