diff options
author | Joey Hess <joey@kitenet.net> | 2013-04-22 13:33:29 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-04-22 13:33:29 -0400 |
commit | 032c802d45c7872f704de1faf0733740b256444d (patch) | |
tree | e35c61900c3d4d3b5cb746d50aa69e42e099ae71 /Build/Standalone.hs | |
parent | 3f2a065f9079fe9c7e62e6d039475698a8dac675 (diff) |
handle rpath in OSXMkLibs
Now oberon has some binaries and libraries that use rpath, so I had to put
in this ugly hack to replace the @rapth/lib with the lib in the app.
This was particularly tricky for libraries that use @rpath because I could
not find a way to extract the rpath from the library. (Only from the
executable, by running it.. ugh!) The hack I put in place may fail if
multiple different libraries use rpath to refer to other libraries,
and the "@rpath/lib" string is the same, but actually refers to different
files.
Diffstat (limited to 'Build/Standalone.hs')
-rw-r--r-- | Build/Standalone.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Build/Standalone.hs b/Build/Standalone.hs index 163e3ea79..aa4521730 100644 --- a/Build/Standalone.hs +++ b/Build/Standalone.hs @@ -60,12 +60,15 @@ progDir topdir = topdir progDir topdir = topdir </> "bin" #endif -installProg :: FilePath -> FilePath -> IO () +installProg :: FilePath -> FilePath -> IO (FilePath, FilePath) installProg dir prog = searchPath prog >>= go where go Nothing = error $ "cannot find " ++ prog ++ " in PATH" - go (Just f) = unlessM (boolSystem "install" [File f, File dir]) $ - error $ "install failed for " ++ prog + go (Just f) = do + let dest = dir </> takeFileName f + unlessM (boolSystem "install" [File f, File dest]) $ + error $ "install failed for " ++ prog + return (dest, f) main = getArgs >>= go where @@ -73,5 +76,5 @@ main = getArgs >>= go go (topdir:_) = do let dir = progDir topdir createDirectoryIfMissing True dir - forM_ thirdpartyProgs $ installProg dir - + installed <- forM thirdpartyProgs $ installProg dir + writeFile "tmp/standalone-installed" (show installed) |