-
Notifications
You must be signed in to change notification settings - Fork 18
/
macosx-app.hs
29 lines (27 loc) · 944 Bytes
/
macosx-app.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module Main where
import Distribution.MacOSX
import Distribution.MacOSX.AppBuildInfo
import System.Directory
import System.Environment
import System.FilePath
main = do
pname <- getProgName
xs <- getArgs
exe <- case xs of
[x1] -> return x1
_ -> fail $ "Usage: " ++ pname ++ " <exe>"
exeExists <- doesFileExist exe
let macapp = MacApp { appName = takeFileName exe
, appIcon = Nothing
, appPlist = Nothing
, resources = []
, otherBins = []
, appDeps = DoNotChase
}
appInfo = AppBuildInfo { abApp = macapp
, abAppPath = appName macapp <.> "app"
, abAppOrigExe = exe
}
if exeExists
then makeAppBundle appInfo
else fail $ exe ++ " does not exist"