cabal-macosx 0.1.2.2 → 0.2
raw patch · 4 files changed
+35/−8 lines, 4 files
Files
- Distribution/MacOSX.hs +6/−4
- Distribution/MacOSX/AppBuildInfo.hs +24/−0
- cabal-macosx.cabal +2/−1
- macosx-app.hs +3/−3
Distribution/MacOSX.hs view
@@ -23,6 +23,8 @@ defaultExclusions ) where +import Control.Exception+import Prelude hiding ( catch ) import Control.Monad (forM_, when) import Data.String.Utils (replace) import Distribution.PackageDescription (PackageDescription(..),@@ -79,7 +81,7 @@ createDirectoryIfMissing False applicationsDir forM_ apps $ \app -> do let appInfo = toAppBuildInfo localb app- appPathSrc = appPath appInfo+ appPathSrc = abAppPath appInfo appPathTgt = applicationsDir </> takeFileName appPathSrc exe ap = ap </> pathInApp app (appName app) installDirectoryContents verbosity appPathSrc appPathTgt@@ -105,11 +107,11 @@ -- build area. (for internal use only) makeAppBundle :: AppBuildInfo -> IO () makeAppBundle appInfo@(AppBuildInfo appPath _ app) =- do createAppDir appInfo+ do _ <- createAppDir appInfo maybeCopyPlist appPath app maybeCopyIcon appPath app- `catch` \err -> putStrLn ("Warning: could not set up icon for " ++- appName app ++ ": " ++ show err)+ `catch` \(SomeException err) ->+ putStrLn $ "Warning: could not set up icon for " ++ appName app ++ ": " ++ show err includeResources appPath app includeDependencies appPath app osxIncantations appPath app
+ Distribution/MacOSX/AppBuildInfo.hs view
@@ -0,0 +1,24 @@+module Distribution.MacOSX.AppBuildInfo where++import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..))+import System.FilePath++import Distribution.MacOSX.Common++-- | Information needed to build a bundle+--+-- This exists to make it possible to have a standalone+-- macosx-app executable without it necessarily having to+-- know a lot of Cabal internals+data AppBuildInfo = AppBuildInfo+ { abAppPath :: FilePath+ , abAppOrigExe :: FilePath+ , abApp :: MacApp+ }++toAppBuildInfo :: LocalBuildInfo -> MacApp -> AppBuildInfo+toAppBuildInfo localb app = AppBuildInfo+ { abAppPath = buildDir localb </> appName app <.> "app"+ , abAppOrigExe = buildDir localb </> appName app </> appName app+ , abApp = app+ }
cabal-macosx.cabal view
@@ -1,5 +1,5 @@ Name: cabal-macosx-Version: 0.1.2.2+Version: 0.2 Stability: Alpha Synopsis: Cabal support for creating Mac OSX application bundles. Description:@@ -36,6 +36,7 @@ , filepath, MissingH, parsec, process Exposed-modules: Distribution.MacOSX Other-modules: Distribution.MacOSX.Common,+ Distribution.MacOSX.AppBuildInfo, Distribution.MacOSX.Dependencies, Distribution.MacOSX.DG ghc-options: -fwarn-tabs -Wall
macosx-app.hs view
@@ -20,9 +20,9 @@ , otherBins = [] , appDeps = DoNotChase } - appInfo = AppBuildInfo { app = macapp- , appPath = appName macapp <.> "app"- , appOrigExe = exe+ appInfo = AppBuildInfo { abApp = macapp+ , abAppPath = appName macapp <.> "app"+ , abAppOrigExe = exe } if exeExists then makeAppBundle appInfo