packages feed

cabal-macosx 0.2.4.0 → 0.2.4.1

raw patch · 4 files changed

+68/−18 lines, 4 filesdep ~HUnitdep ~basedep ~fglPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: HUnit, base, fgl, hscolour, test-framework, test-framework-hunit

API changes (from Hackage documentation)

Files

Distribution/MacOSX/Dependencies.hs view
@@ -142,7 +142,9 @@   -> Exclusions -- ^ List of exclusions for dependency chasing.   -> IO FDeps getFDeps appPath app path exclusions =-  do contents <- readProcess oTool ["-L", absPath] ""+  do putStrLn $ "path: " ++ path+     contents <- readProcess oTool ["-L", absPath] ""+     putStrLn $ "contents: " ++ contents      case parse parseFileDeps "" contents of        Left err -> error $ show err        Right fDeps -> return $ exclude exclusions fDeps@@ -152,6 +154,7 @@         parseFileDeps :: Parser FDeps         parseFileDeps = do f <- manyTill (noneOf ":") (char ':')                            _ <- char '\n'+                            deps <- parseDepOrName `sepEndBy` char '\n'                            eof                            return $ FDeps f $ filter (f /=) $ catMaybes deps@@ -159,12 +162,22 @@         parseDepOrName = do c <- oneOf "\t/"                             case c of                               '\t' -> -- A dependency.-                                      do dep <- parseDep-                                         return $ Just dep+                                      do dep <- parseDepOrIgnoreAt+                                         return $ dep                               '/' -> -- Same filename, alternative arch                                      do _ <- manyTill (noneOf ":") (char ':')                                         return Nothing                               _ -> error "Can't happen"+        parseDepOrIgnoreAt :: Parser (Maybe FilePath)+        parseDepOrIgnoreAt = do c <- lookAhead (oneOf "/@")+                                case c of+                                  '/' -> -- A dependency.+                                         do dep <- parseDep+                                            return $ Just $ dep+                                  '@' -> -- ignore entries that start with @+                                         do _ <- manyTill (noneOf ")") (char ')')+                                            return Nothing+                                  _ -> error "Can't happen"         parseDep :: Parser FilePath         parseDep = do dep <- manyTill (noneOf " ") (char ' ')                       _ <- char '('
Distribution/MacOSX/Internal.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-} {- | Cabal support for creating Mac OSX application bundles.  GUI applications on Mac OSX should be run as application /bundles/;@@ -20,14 +21,18 @@   osxIncantations ) where +#if MIN_VERSION_Cabal(2,0,0)+import Data.String (fromString)+import Distribution.Text (display)+#endif import Prelude hiding ( catch ) import System.Cmd ( system ) import System.Exit import System.FilePath import Control.Monad (filterM) import System.Directory (doesDirectoryExist)-import Distribution.PackageDescription (BuildInfo(..), Executable(..)) +import Distribution.PackageDescription (BuildInfo(..), Executable(..)) import Distribution.MacOSX.Common  -- | Filter or create new 'MacApp's that are associated by name to buildable 'Executable's.@@ -40,11 +45,19 @@     [] -> map mkDefault buildables     xs -> filter buildableApp xs   where -- Make a default MacApp in absence of explicit from Setup.hs+#if MIN_VERSION_Cabal(2,0,0)+        mkDefault x = MacApp (display $ exeName x) Nothing Nothing [] [] DoNotChase+#else         mkDefault x = MacApp (exeName x) Nothing Nothing [] [] DoNotChase+#endif          -- Check if a MacApp is in that list of buildable executables.         buildableApp :: MacApp -> Bool+#if MIN_VERSION_Cabal(2,0,0)+        buildableApp app = any (\e -> exeName e == fromString (appName app)) buildables+#else         buildableApp app = any (\e -> exeName e == appName app) buildables+#endif          -- List of buildable executables from .cabal file.         buildables :: [Executable]
cabal-macosx.cabal view
@@ -1,5 +1,5 @@ Name:                   cabal-macosx-Version:                0.2.4.0+Version:                0.2.4.1 Stability:              Alpha Synopsis:               Cabal support for creating Mac OSX application bundles. Description:@@ -25,16 +25,17 @@ Homepage:               http://github.com/danfran/cabal-macosx Build-Type:             Simple Cabal-Version:          >=1.8+Tested-With:            GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1, GHC == 7.10.2, GHC == 7.10.3, GHC == 8.0.1, GHC == 8.0.2  Source-Repository head     Type:         git     Location:     http://github.com/danfran/cabal-macosx  Library-  Build-Depends:    base >= 4 && < 5+  Build-Depends:    base == 4.*                     , Cabal >= 1.6, directory-                    , hscolour >=1.8-                    , fgl >= 5.4.2.2 && < 5.6+                    , hscolour+                    , fgl                     , filepath                     , parsec                     , process@@ -50,10 +51,10 @@  Executable macosx-app   Main-is:          macosx-app.hs-  Build-Depends:    base >= 4 && < 5+  Build-Depends:    base == 4.*                     , Cabal >= 1.6                     , directory-                    , fgl >= 5.4.2.2 && < 5.6+                    , fgl                     , filepath                     , parsec                     , process@@ -65,11 +66,13 @@   hs-source-dirs:   .,tests   Main-is:          Main.hs   Type:             exitcode-stdio-1.0-  Other-modules:    Distribution.MacOSX.Internal.Tests-  Build-depends:    base >= 4 && < 4.10-                    , HUnit >= 1.2 && < 1.4-                    , test-framework == 0.8.*-                    , test-framework-hunit == 0.3.*+  Other-modules:    Distribution.MacOSX.Internal.Tests,+                    Distribution.MacOSX.Common,+                    Distribution.MacOSX.Internal+  Build-depends:    base == 4.*+                    , HUnit+                    , test-framework+                    , test-framework-hunit                     , temporary                     , Cabal >= 1.6                     , filepath
tests/Distribution/MacOSX/Internal/Tests.hs view
@@ -1,9 +1,15 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-} module Distribution.MacOSX.Internal.Tests where  import Prelude hiding (catch) import Test.HUnit (Assertion, assertEqual) import Test.Framework (Test, mutuallyExclusive, testGroup) import Test.Framework.Providers.HUnit (testCase)++#if MIN_VERSION_Cabal(2,0,0)+import Distribution.Types.ExecutableScope+#endif import Distribution.PackageDescription (BuildInfo(..), Executable(..), emptyBuildInfo)  import Distribution.MacOSX.Internal (getMacAppsForBuildableExecutors)@@ -16,7 +22,7 @@           testCase "given nothing then should not try to build any mac-app" testBuildMacApp_noInput,           testCase "given no executables then should not try to build any mac-app" testBuildMacApp_noExecutables,           testCase "given only two executables then should try to build two mac-apps" testBuildMacApp_twoBuildableExecutables,-          testCase "given only two executables and one not executable then should try to build one mac-app" testBuildMacApp_twoExcetuablesOneBuildableandOneNot,+          testCase "given only two executables and one not executable then should try to build one mac-app" testBuildMacApp_twoExcetuablesOneBuildableAndOneNot,           testCase "given two executables and one not executable and two apps then should try to build one mac-app" testBuildMacApp_twoAppsAndTwoExecutablesOneBuildableOneNot         ]     ]@@ -36,25 +42,40 @@  testBuildMacApp_twoBuildableExecutables :: Assertion testBuildMacApp_twoBuildableExecutables = do+#if MIN_VERSION_Cabal(2,0,0)+    let execs = [ Executable "Dummy One" "/tmp" ExecutableScopeUnknown emptyBuildInfo+                  , Executable "Dummy Two" "/tmp" ExecutableScopeUnknown  emptyBuildInfo ]+#else     let execs = [ Executable "Dummy One" "/tmp" emptyBuildInfo                   , Executable "Dummy Two" "/tmp" emptyBuildInfo ]+#endif     let actual = getMacAppsForBuildableExecutors [] execs     let expected = [ MacApp "Dummy One" Nothing Nothing [] [] DoNotChase                      , MacApp "Dummy Two" Nothing Nothing [] [] DoNotChase ]     assertEqual "two mac-apps should be built" expected actual -testBuildMacApp_twoExcetuablesOneBuildableandOneNot :: Assertion-testBuildMacApp_twoExcetuablesOneBuildableandOneNot = do+testBuildMacApp_twoExcetuablesOneBuildableAndOneNot :: Assertion+testBuildMacApp_twoExcetuablesOneBuildableAndOneNot = do+#if MIN_VERSION_Cabal(2,0,0)+    let execs = [ Executable "Dummy One" "/tmp" ExecutableScopeUnknown (emptyBuildInfo { buildable = False })+                  , Executable "Dummy Two" "/tmp" ExecutableScopeUnknown  emptyBuildInfo ]+#else     let execs = [ Executable "Dummy One" "/tmp" (emptyBuildInfo { buildable = False })                   , Executable "Dummy Two" "/tmp" emptyBuildInfo ]+#endif     let actual = getMacAppsForBuildableExecutors [] execs     let expected = [ MacApp "Dummy Two" Nothing Nothing [] [] DoNotChase ]     assertEqual "two mac-apps should be built" expected actual  testBuildMacApp_twoAppsAndTwoExecutablesOneBuildableOneNot :: Assertion testBuildMacApp_twoAppsAndTwoExecutablesOneBuildableOneNot = do+#if MIN_VERSION_Cabal(2,0,0)+    let execs = [ Executable "Dummy One" "/tmp" ExecutableScopeUnknown (emptyBuildInfo { buildable = False })+                  , Executable "Dummy Two" "/tmp" ExecutableScopeUnknown  emptyBuildInfo ]+#else     let execs = [ Executable "Dummy One" "/tmp" (emptyBuildInfo { buildable = False })                   , Executable "Dummy Two" "/tmp" emptyBuildInfo ]+#endif     let apps = [ MacApp "Dummy One" Nothing Nothing [] [] DoNotChase                  , MacApp "Dummy Two" Nothing Nothing [] [] DoNotChase ]     let actual = getMacAppsForBuildableExecutors apps execs