Skip to content
Browse files

Make cabal2macpkg do profiling

  • Loading branch information...
1 parent 527934a commit 5fd3cbd70a0bf7edbbea8b259fbdda5ba28426b9 @gregorycollins committed
Showing with 44 additions and 33 deletions.
  1. +3 −3 Program/MakePackage.hs
  2. +40 −29 Program/Options.hs
  3. +1 −1 cabal2macpkg.cabal
View
6 Program/MakePackage.hs
@@ -118,9 +118,9 @@ makeMacPkg opts tmpdir pkgDesc = do
--------------------------------------------------------------------
-- uses cabal to build the package into the work area
buildPackageContents = do
- runSetup "configure" ["--global", "--prefix="++prefix]
+ runSetup "configure" ["--global", "--prefix="++prefix, "-p"]
runSetup "build" []
- runSetup "haddock" []
+ runSetup "haddock" ["--hyperlink-source"]
runSetup "copy" ["--destdir=" ++ contentsDir]
runSetup "register" ["--gen-pkg-config=" ++ temporaryPkgConfig]
@@ -198,7 +198,7 @@ makeMacPkg opts tmpdir pkgDesc = do
-> [String] -- ^ additional arguments
-> IO ()
runSetup cmd args =
- runCmd "runghc" $ ["Setup", cmd] ++ mkOpts args
+ runCmd "cabal" $ [cmd] ++ mkOpts args
where
mkOpts s = s ++ ["--builddir=" ++ cabalBuildDir]
View
69 Program/Options.hs
@@ -72,45 +72,50 @@ data Options = Options {
-- for .pkg and .mpkg files in the
-- directory, and plop them into the
-- .mpkg file we generate
+
+ , areProfiling :: Bool
} deriving (Eq, Show)
defaultOptions :: Options
defaultOptions = Options {
- installPrefix = Just "/usr/local"
- , showUsage = False
- , packageMakerPath = Just "/Developer/usr/bin/packagemaker"
- , packageOutputDir = Nothing
- , packageOutputFile = Nothing
- , areBuildingMetaPackage = False
- , executableDeps = []
- , extraPkgDir = Nothing
- }
+ installPrefix = Just "/usr/local"
+ , showUsage = False
+ , packageMakerPath = Just "/Developer/usr/bin/packagemaker"
+ , packageOutputDir = Nothing
+ , packageOutputFile = Nothing
+ , areBuildingMetaPackage = False
+ , executableDeps = []
+ , extraPkgDir = Nothing
+ , areProfiling = False
+ }
instance Monoid Options where
- mempty = Options {
- installPrefix = Nothing
- , showUsage = False
- , packageMakerPath = Nothing
- , packageOutputDir = Nothing
- , packageOutputFile = Nothing
- , areBuildingMetaPackage = False
- , executableDeps = []
- , extraPkgDir = Nothing
- }
+ mempty = Options
+ { installPrefix = Nothing
+ , showUsage = False
+ , packageMakerPath = Nothing
+ , packageOutputDir = Nothing
+ , packageOutputFile = Nothing
+ , areBuildingMetaPackage = False
+ , executableDeps = []
+ , extraPkgDir = Nothing
+ , areProfiling = False
+ }
a `mappend` b =
Options {
- installPrefix = override installPrefix
- , packageMakerPath = override packageMakerPath
- , packageOutputDir = override packageOutputDir
- , packageOutputFile = override packageOutputFile
- , showUsage = showUsage a || showUsage b
- , areBuildingMetaPackage = areBuildingMetaPackage a
- || areBuildingMetaPackage b
- , executableDeps = addUp executableDeps
- , extraPkgDir = override extraPkgDir
+ installPrefix = override installPrefix
+ , packageMakerPath = override packageMakerPath
+ , packageOutputDir = override packageOutputDir
+ , packageOutputFile = override packageOutputFile
+ , showUsage = showUsage a || showUsage b
+ , areBuildingMetaPackage = areBuildingMetaPackage a
+ || areBuildingMetaPackage b
+ , executableDeps = addUp executableDeps
+ , extraPkgDir = override extraPkgDir
+ , areProfiling = areProfiling a || areProfiling b
}
where
-- monoid append using "Last" behaviour
@@ -134,7 +139,13 @@ optionFlags = [ GetOpt.Option
"m"
["meta"]
(GetOpt.NoArg $ mempty {areBuildingMetaPackage=True})
- "output install package to the given file"
+ "build a metapackage"
+
+ , GetOpt.Option
+ "p"
+ ["profiling"]
+ (GetOpt.NoArg $ mempty {areProfiling=True})
+ "build using profiling support"
, GetOpt.Option
""
View
2 cabal2macpkg.cabal
@@ -1,5 +1,5 @@
name: cabal2macpkg
-version: 0.3
+version: 0.3.1
homepage: http://gregorycollins.net/
synopsis: Create OSX installation packages from Cabal packages
description: Create OSX installation packages from Cabal packages

0 comments on commit 5fd3cbd

Please sign in to comment.
Something went wrong with that request. Please try again.