From dc6949b509ba92e16d5f275a7aaf5a7ba270dff3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 Apr 2015 16:38:49 -0400 Subject: [PATCH] filter out non-cygwin libs --- Build/NullSoftInstaller.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs index 75591aaa39..0abd07f95e 100644 --- a/Build/NullSoftInstaller.hs +++ b/Build/NullSoftInstaller.hs @@ -27,7 +27,7 @@ import Control.Applicative import Data.String import Data.Maybe import Data.Char -import Data.List (nub) +import Data.List (nub, isPrefixOf) import Utility.Tmp import Utility.Path @@ -47,7 +47,7 @@ main = do when (isNothing p) $ print ("unable to find in PATH", f) return p - dlls <- forM (catMaybes extrabins) findLibs + dlls <- forM (catMaybes extrabins) findCygLibs dllpaths <- mapM searchPath (nub (concat dlls)) webappscript <- vbsLauncher tmpdir "git-annex-webapp" "git-annex webapp" autostartscript <- vbsLauncher tmpdir "git-annex-autostart" "git annex assistant --autostart" @@ -189,9 +189,11 @@ htmlHelpText = unlines , " IO [FilePath] -findLibs p = mapMaybe parse . lines <$> readProcess "ldd" [p] +-- Find cygwin libraries used by the specified executable. +findCygLibs :: FilePath -> IO [FilePath] +findCygLibs p = filter iscyg . mapMaybe parse . lines <$> readProcess "ldd" [p] where parse l = case words (dropWhile isSpace l) of (dll:"=>":_dllpath:_offset:[]) -> Just dll _ -> Nothing + iscyg f = "cyg" `isPrefixOf` f || "lib" `isPrefixOf` f