From 1da9b3533e6a0fae8692fa0f4f532ea63d43ccc8 Mon Sep 17 00:00:00 2001 From: Robin KAY Date: Tue, 16 Feb 2016 23:26:13 +0000 Subject: [PATCH 1/2] Add field for setting framework search path (fixes #182). --- Cabal/Distribution/PackageDescription.hs | 3 +++ .../Distribution/PackageDescription/Parse.hs | 3 +++ Cabal/Distribution/Simple/GHC.hs | 23 ++++++++++++------- Cabal/Distribution/Simple/Program/GHC.hs | 7 ++++++ Cabal/Distribution/Simple/Register.hs | 2 +- Cabal/doc/developing-packages.markdown | 4 ++++ 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Cabal/Distribution/PackageDescription.hs b/Cabal/Distribution/PackageDescription.hs index 996fdc45a10..eed931ee79d 100644 --- a/Cabal/Distribution/PackageDescription.hs +++ b/Cabal/Distribution/PackageDescription.hs @@ -812,6 +812,7 @@ data BuildInfo = BuildInfo { ldOptions :: [String], -- ^ options for linker pkgconfigDepends :: [Dependency], -- ^ pkg-config packages that are used frameworks :: [String], -- ^support frameworks for Mac OS X + frameworkDirs :: [String], cSources :: [FilePath], jsSources :: [FilePath], hsSourceDirs :: [FilePath], -- ^ where to look for the Haskell module hierarchy @@ -851,6 +852,7 @@ instance Monoid BuildInfo where ldOptions = [], pkgconfigDepends = [], frameworks = [], + frameworkDirs = [], cSources = [], jsSources = [], hsSourceDirs = [], @@ -884,6 +886,7 @@ instance Semigroup BuildInfo where ldOptions = combine ldOptions, pkgconfigDepends = combine pkgconfigDepends, frameworks = combineNub frameworks, + frameworkDirs = combineNub frameworkDirs, cSources = combineNub cSources, jsSources = combineNub jsSources, hsSourceDirs = combineNub hsSourceDirs, diff --git a/Cabal/Distribution/PackageDescription/Parse.hs b/Cabal/Distribution/PackageDescription/Parse.hs index 88c7a3839cf..73aca2aea82 100644 --- a/Cabal/Distribution/PackageDescription/Parse.hs +++ b/Cabal/Distribution/PackageDescription/Parse.hs @@ -405,6 +405,9 @@ binfoFieldDescrs = , listField "frameworks" showToken parseTokenQ frameworks (\val binfo -> binfo{frameworks=val}) + , listField "framework-dirs" + showToken parseFilePathQ + frameworkDirs (\val binfo -> binfo{frameworkDirs=val}) , listFieldWithSep vcat "c-sources" showFilePath parseFilePathQ cSources (\paths binfo -> binfo{cSources=paths}) diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs index fc12d9632ff..5544e6ad29d 100644 --- a/Cabal/Distribution/Simple/GHC.hs +++ b/Cabal/Distribution/Simple/GHC.hs @@ -546,10 +546,13 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do ghcOptHPCDir = hpcdir Hpc.Dyn } linkerOpts = mempty { - ghcOptLinkOptions = toNubListR $ PD.ldOptions libBi, - ghcOptLinkLibs = toNubListR $ extraLibs libBi, - ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi, - ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi, + ghcOptLinkOptions = toNubListR $ PD.ldOptions libBi, + ghcOptLinkLibs = toNubListR $ extraLibs libBi, + ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi, + ghcOptLinkFrameworks = toNubListR $ + PD.frameworks libBi, + ghcOptLinkFrameworkDirs = toNubListR $ + PD.frameworkDirs libBi, ghcOptInputFiles = toNubListR [libTargetDir x | x <- cObjs] } @@ -724,6 +727,7 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do ghcOptLinkLibs = toNubListR $ extraLibs libBi, ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi, ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi, + ghcOptLinkFrameworkDirs = toNubListR $ PD.frameworkDirs libBi, ghcOptRPaths = rpaths } @@ -846,10 +850,13 @@ buildOrReplExe forRepl verbosity numJobs _pkg_descr lbi ghcOptHPCDir = hpcdir Hpc.Dyn } linkerOpts = mempty { - ghcOptLinkOptions = toNubListR $ PD.ldOptions exeBi, - ghcOptLinkLibs = toNubListR $ extraLibs exeBi, - ghcOptLinkLibPath = toNubListR $ extraLibDirs exeBi, - ghcOptLinkFrameworks = toNubListR $ PD.frameworks exeBi, + ghcOptLinkOptions = toNubListR $ PD.ldOptions exeBi, + ghcOptLinkLibs = toNubListR $ extraLibs exeBi, + ghcOptLinkLibPath = toNubListR $ extraLibDirs exeBi, + ghcOptLinkFrameworks = toNubListR $ + PD.frameworks exeBi, + ghcOptLinkFrameworkDirs = toNubListR $ + PD.frameworkDirs exeBi, ghcOptInputFiles = toNubListR [exeDir x | x <- cObjs] } diff --git a/Cabal/Distribution/Simple/Program/GHC.hs b/Cabal/Distribution/Simple/Program/GHC.hs index e359e0f8215..db6ae049fa7 100644 --- a/Cabal/Distribution/Simple/Program/GHC.hs +++ b/Cabal/Distribution/Simple/Program/GHC.hs @@ -107,6 +107,10 @@ data GhcOptions = GhcOptions { -- | OSX only: frameworks to link in; the @ghc -framework@ flag. ghcOptLinkFrameworks :: NubListR String, + -- | OSX only: Search path for frameworks to link in; the + -- @ghc -framework-path@ flag. + ghcOptLinkFrameworkDirs :: NubListR String, + -- | Don't do the link step, useful in make mode; the @ghc -no-link@ flag. ghcOptNoLink :: Flag Bool, @@ -363,6 +367,7 @@ renderGhcOptions comp opts , ["-l" ++ lib | lib <- flags ghcOptLinkLibs ] , ["-L" ++ dir | dir <- flags ghcOptLinkLibPath ] , concat [ ["-framework", fmwk] | fmwk <- flags ghcOptLinkFrameworks ] + , concat [ ["-framework-path", path] | path <- flags ghcOptLinkFrameworkDirs ] , [ "-no-hs-main" | flagBool ghcOptLinkNoHsMain ] , [ "-dynload deploy" | not (null (flags ghcOptRPaths)) ] , concat [ [ "-optl-Wl,-rpath," ++ dir] @@ -500,6 +505,7 @@ instance Monoid GhcOptions where ghcOptLinkLibPath = mempty, ghcOptLinkOptions = mempty, ghcOptLinkFrameworks = mempty, + ghcOptLinkFrameworkDirs = mempty, ghcOptNoLink = mempty, ghcOptLinkNoHsMain = mempty, ghcOptCcOptions = mempty, @@ -556,6 +562,7 @@ instance Semigroup GhcOptions where ghcOptLinkLibPath = combine ghcOptLinkLibPath, ghcOptLinkOptions = combine ghcOptLinkOptions, ghcOptLinkFrameworks = combine ghcOptLinkFrameworks, + ghcOptLinkFrameworkDirs = combine ghcOptLinkFrameworkDirs, ghcOptNoLink = combine ghcOptNoLink, ghcOptLinkNoHsMain = combine ghcOptLinkNoHsMain, ghcOptCcOptions = combine ghcOptCcOptions, diff --git a/Cabal/Distribution/Simple/Register.hs b/Cabal/Distribution/Simple/Register.hs index b438b6cecad..d4c4ecce64b 100644 --- a/Cabal/Distribution/Simple/Register.hs +++ b/Cabal/Distribution/Simple/Register.hs @@ -339,7 +339,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi -- We don't want cc-options to be propagated -- to C compilations in other packages. IPI.ldOptions = ldOptions bi, - IPI.frameworkDirs = [], + IPI.frameworkDirs = frameworkDirs bi, IPI.frameworks = frameworks bi, IPI.haddockInterfaces = [haddockdir installDirs haddockName pkg], IPI.haddockHTMLs = [htmldir installDirs], diff --git a/Cabal/doc/developing-packages.markdown b/Cabal/doc/developing-packages.markdown index d73478d96b0..0ab39e9f2c9 100644 --- a/Cabal/doc/developing-packages.markdown +++ b/Cabal/doc/developing-packages.markdown @@ -1467,6 +1467,10 @@ values for these fields. developer documentation for more details on frameworks. This entry is ignored on all other platforms. +`frameworks-dirs:` _directory list_ +: On Darwin/MacOS X, a list of directories to search for frameworks. + This entry is ignored on all other platforms. + ### Configurations ### Library and executable sections may include conditional From b9571abc84599cee0c5854ee6ba78a7091b844d6 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Sat, 20 Feb 2016 20:23:09 +0100 Subject: [PATCH 2/2] Address review comments in #3158. * Renamed to 'extra-framework-dirs'. * Added 'extra-framework-dirs' to ConfigFlags. * Added some checks. * Updated changelog. --- Cabal/Distribution/PackageDescription.hs | 114 +++++++++--------- .../Distribution/PackageDescription/Check.hs | 19 ++- .../Distribution/PackageDescription/Parse.hs | 4 +- Cabal/Distribution/Simple/Configure.hs | 1 + Cabal/Distribution/Simple/GHC.hs | 7 +- Cabal/Distribution/Simple/Register.hs | 2 +- Cabal/Distribution/Simple/Setup.hs | 10 ++ Cabal/Distribution/Simple/Utils.hs | 6 + Cabal/changelog | 4 + Cabal/doc/developing-packages.markdown | 10 +- Cabal/doc/installing-packages.markdown | 4 + cabal-install/Distribution/Client/Config.hs | 2 + cabal-install/changelog | 3 + 13 files changed, 117 insertions(+), 69 deletions(-) diff --git a/Cabal/Distribution/PackageDescription.hs b/Cabal/Distribution/PackageDescription.hs index eed931ee79d..3bd06b6bfbc 100644 --- a/Cabal/Distribution/PackageDescription.hs +++ b/Cabal/Distribution/PackageDescription.hs @@ -812,7 +812,7 @@ data BuildInfo = BuildInfo { ldOptions :: [String], -- ^ options for linker pkgconfigDepends :: [Dependency], -- ^ pkg-config packages that are used frameworks :: [String], -- ^support frameworks for Mac OS X - frameworkDirs :: [String], + extraFrameworkDirs:: [String], -- ^ extra locations to find frameworks. cSources :: [FilePath], jsSources :: [FilePath], hsSourceDirs :: [FilePath], -- ^ where to look for the Haskell module hierarchy @@ -845,68 +845,68 @@ instance Binary BuildInfo instance Monoid BuildInfo where mempty = BuildInfo { - buildable = True, - buildTools = [], - cppOptions = [], - ccOptions = [], - ldOptions = [], - pkgconfigDepends = [], - frameworks = [], - frameworkDirs = [], - cSources = [], - jsSources = [], - hsSourceDirs = [], - otherModules = [], - defaultLanguage = Nothing, - otherLanguages = [], - defaultExtensions = [], - otherExtensions = [], - oldExtensions = [], - extraLibs = [], - extraGHCiLibs = [], - extraLibDirs = [], - includeDirs = [], - includes = [], - installIncludes = [], - options = [], - profOptions = [], - sharedOptions = [], - customFieldsBI = [], - targetBuildDepends = [], + buildable = True, + buildTools = [], + cppOptions = [], + ccOptions = [], + ldOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + cSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraGHCiLibs = [], + extraLibDirs = [], + includeDirs = [], + includes = [], + installIncludes = [], + options = [], + profOptions = [], + sharedOptions = [], + customFieldsBI = [], + targetBuildDepends = [], targetBuildRenaming = Map.empty } mappend = (Semi.<>) instance Semigroup BuildInfo where a <> b = BuildInfo { - buildable = buildable a && buildable b, - buildTools = combine buildTools, - cppOptions = combine cppOptions, - ccOptions = combine ccOptions, - ldOptions = combine ldOptions, - pkgconfigDepends = combine pkgconfigDepends, - frameworks = combineNub frameworks, - frameworkDirs = combineNub frameworkDirs, - cSources = combineNub cSources, - jsSources = combineNub jsSources, - hsSourceDirs = combineNub hsSourceDirs, - otherModules = combineNub otherModules, - defaultLanguage = combineMby defaultLanguage, - otherLanguages = combineNub otherLanguages, - defaultExtensions = combineNub defaultExtensions, - otherExtensions = combineNub otherExtensions, - oldExtensions = combineNub oldExtensions, - extraLibs = combine extraLibs, - extraGHCiLibs = combine extraGHCiLibs, - extraLibDirs = combineNub extraLibDirs, - includeDirs = combineNub includeDirs, - includes = combineNub includes, - installIncludes = combineNub installIncludes, - options = combine options, - profOptions = combine profOptions, - sharedOptions = combine sharedOptions, - customFieldsBI = combine customFieldsBI, - targetBuildDepends = combineNub targetBuildDepends, + buildable = buildable a && buildable b, + buildTools = combine buildTools, + cppOptions = combine cppOptions, + ccOptions = combine ccOptions, + ldOptions = combine ldOptions, + pkgconfigDepends = combine pkgconfigDepends, + frameworks = combineNub frameworks, + extraFrameworkDirs = combineNub extraFrameworkDirs, + cSources = combineNub cSources, + jsSources = combineNub jsSources, + hsSourceDirs = combineNub hsSourceDirs, + otherModules = combineNub otherModules, + defaultLanguage = combineMby defaultLanguage, + otherLanguages = combineNub otherLanguages, + defaultExtensions = combineNub defaultExtensions, + otherExtensions = combineNub otherExtensions, + oldExtensions = combineNub oldExtensions, + extraLibs = combine extraLibs, + extraGHCiLibs = combine extraGHCiLibs, + extraLibDirs = combineNub extraLibDirs, + includeDirs = combineNub includeDirs, + includes = combineNub includes, + installIncludes = combineNub installIncludes, + options = combine options, + profOptions = combine profOptions, + sharedOptions = combine sharedOptions, + customFieldsBI = combine customFieldsBI, + targetBuildDepends = combineNub targetBuildDepends, targetBuildRenaming = combineMap targetBuildRenaming } where diff --git a/Cabal/Distribution/PackageDescription/Check.hs b/Cabal/Distribution/PackageDescription/Check.hs index 3bf62d6dce2..e492b9aee41 100644 --- a/Cabal/Distribution/PackageDescription/Check.hs +++ b/Cabal/Distribution/PackageDescription/Check.hs @@ -91,7 +91,7 @@ data PackageCheck = | PackageDistSuspicious { explanation :: String } -- | Like PackageDistSuspicious but will only display warnings - -- rather than causing abnormal exit. + -- rather than causing abnormal exit when you run 'cabal check'. | PackageDistSuspiciousWarn { explanation :: String } -- | An issue that is OK in the author's environment but is almost @@ -669,6 +669,14 @@ checkGhcOptions pkg = , checkAlternatives "ghc-options" "extra-lib-dirs" [ (flag, dir) | flag@('-':'L':dir) <- all_ghc_options ] + + , checkAlternatives "ghc-options" "frameworks" + [ (flag, fmwk) | (flag@"-framework", fmwk) <- + zip all_ghc_options (safeTail all_ghc_options) ] + + , checkAlternatives "ghc-options" "extra-framework-dirs" + [ (flag, dir) | (flag@"-framework-path", dir) <- + zip all_ghc_options (safeTail all_ghc_options) ] ] where @@ -912,6 +920,13 @@ checkCabalVersion pkg = ++ ". To use this new syntax, the package needs to specify at least" ++ "'cabal-version: >= 1.21'." + -- check use of 'extra-framework-dirs' field + , checkVersion [1,23] (any (not . null) (buildInfoField extraFrameworkDirs)) $ + -- Just a warning, because this won't break on old Cabal versions. + PackageDistSuspiciousWarn $ + "To use the 'extra-framework-dirs' field the package needs to specify" + ++ " at least 'cabal-version: >= 1.23'." + -- check use of default-extensions field -- don't need to do the equivalent check for other-extensions , checkVersion [1,10] (any (not . null) (buildInfoField defaultExtensions)) $ @@ -1568,6 +1583,8 @@ checkLocalPathsExist ops pkg = do | bi <- allBuildInfo pkg , (dir, kind) <- [ (dir, "extra-lib-dirs") | dir <- extraLibDirs bi ] + ++ [ (dir, "extra-framework-dirs") + | dir <- extraFrameworkDirs bi ] ++ [ (dir, "include-dirs") | dir <- includeDirs bi ] ++ [ (dir, "hs-source-dirs") | dir <- hsSourceDirs bi ] , isRelative dir ] diff --git a/Cabal/Distribution/PackageDescription/Parse.hs b/Cabal/Distribution/PackageDescription/Parse.hs index 73aca2aea82..39fa1f0c0ee 100644 --- a/Cabal/Distribution/PackageDescription/Parse.hs +++ b/Cabal/Distribution/PackageDescription/Parse.hs @@ -405,9 +405,9 @@ binfoFieldDescrs = , listField "frameworks" showToken parseTokenQ frameworks (\val binfo -> binfo{frameworks=val}) - , listField "framework-dirs" + , listField "extra-framework-dirs" showToken parseFilePathQ - frameworkDirs (\val binfo -> binfo{frameworkDirs=val}) + extraFrameworkDirs (\val binfo -> binfo{extraFrameworkDirs=val}) , listFieldWithSep vcat "c-sources" showFilePath parseFilePathQ cSources (\paths binfo -> binfo{cSources=paths}) diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs index b749034d94d..fd10872ba4f 100644 --- a/Cabal/Distribution/Simple/Configure.hs +++ b/Cabal/Distribution/Simple/Configure.hs @@ -864,6 +864,7 @@ configureFinalizedPackage verbosity cfg where addExtraIncludeLibDirs pkg_descr = let extraBi = mempty { extraLibDirs = configExtraLibDirs cfg + , extraFrameworkDirs = configExtraFrameworkDirs cfg , PD.includeDirs = configExtraIncludeDirs cfg} modifyLib l = l{ libBuildInfo = libBuildInfo l `mappend` extraBi } diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs index 5544e6ad29d..8c20cf53f28 100644 --- a/Cabal/Distribution/Simple/GHC.hs +++ b/Cabal/Distribution/Simple/GHC.hs @@ -552,7 +552,7 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi, ghcOptLinkFrameworkDirs = toNubListR $ - PD.frameworkDirs libBi, + PD.extraFrameworkDirs libBi, ghcOptInputFiles = toNubListR [libTargetDir x | x <- cObjs] } @@ -727,7 +727,8 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do ghcOptLinkLibs = toNubListR $ extraLibs libBi, ghcOptLinkLibPath = toNubListR $ extraLibDirs libBi, ghcOptLinkFrameworks = toNubListR $ PD.frameworks libBi, - ghcOptLinkFrameworkDirs = toNubListR $ PD.frameworkDirs libBi, + ghcOptLinkFrameworkDirs = + toNubListR $ PD.extraFrameworkDirs libBi, ghcOptRPaths = rpaths } @@ -856,7 +857,7 @@ buildOrReplExe forRepl verbosity numJobs _pkg_descr lbi ghcOptLinkFrameworks = toNubListR $ PD.frameworks exeBi, ghcOptLinkFrameworkDirs = toNubListR $ - PD.frameworkDirs exeBi, + PD.extraFrameworkDirs exeBi, ghcOptInputFiles = toNubListR [exeDir x | x <- cObjs] } diff --git a/Cabal/Distribution/Simple/Register.hs b/Cabal/Distribution/Simple/Register.hs index d4c4ecce64b..d1bd0abcdbc 100644 --- a/Cabal/Distribution/Simple/Register.hs +++ b/Cabal/Distribution/Simple/Register.hs @@ -339,8 +339,8 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi -- We don't want cc-options to be propagated -- to C compilations in other packages. IPI.ldOptions = ldOptions bi, - IPI.frameworkDirs = frameworkDirs bi, IPI.frameworks = frameworks bi, + IPI.frameworkDirs = extraFrameworkDirs bi, IPI.haddockInterfaces = [haddockdir installDirs haddockName pkg], IPI.haddockHTMLs = [htmldir installDirs], IPI.pkgRoot = Nothing diff --git a/Cabal/Distribution/Simple/Setup.hs b/Cabal/Distribution/Simple/Setup.hs index 9f10f30f7d0..07979c325d7 100644 --- a/Cabal/Distribution/Simple/Setup.hs +++ b/Cabal/Distribution/Simple/Setup.hs @@ -346,6 +346,8 @@ data ConfigFlags = ConfigFlags { -- paths configScratchDir :: Flag FilePath, configExtraLibDirs :: [FilePath], -- ^ path to search for extra libraries + configExtraFrameworkDirs :: [FilePath], -- ^ path to search for extra + -- frameworks (OS X only) configExtraIncludeDirs :: [FilePath], -- ^ path to search for header files configIPID :: Flag String, -- ^ explicit IPID to be used @@ -624,6 +626,12 @@ configureOptions showOrParseArgs = configExtraLibDirs (\v flags -> flags {configExtraLibDirs = v}) (reqArg' "PATH" (\x -> [x]) id) + ,option "" ["extra-framework-dirs"] + "A list of directories to search for external frameworks (OS X only)" + configExtraFrameworkDirs + (\v flags -> flags {configExtraFrameworkDirs = v}) + (reqArg' "PATH" (\x -> [x]) id) + ,option "" ["extra-prog-path"] "A list of directories to search for required programs (in addition to the normal search locations)" configProgramPathExtra (\v flags -> flags {configProgramPathExtra = v}) @@ -818,6 +826,7 @@ instance Monoid ConfigFlags where configStripExes = mempty, configStripLibs = mempty, configExtraLibDirs = mempty, + configExtraFrameworkDirs = mempty, configConstraints = mempty, configDependencies = mempty, configExtraIncludeDirs = mempty, @@ -867,6 +876,7 @@ instance Semigroup ConfigFlags where configStripExes = combine configStripExes, configStripLibs = combine configStripLibs, configExtraLibDirs = combine configExtraLibDirs, + configExtraFrameworkDirs = combine configExtraFrameworkDirs, configConstraints = combine configConstraints, configDependencies = combine configDependencies, configExtraIncludeDirs = combine configExtraIncludeDirs, diff --git a/Cabal/Distribution/Simple/Utils.hs b/Cabal/Distribution/Simple/Utils.hs index db9166d9ba4..87338e8d4c3 100644 --- a/Cabal/Distribution/Simple/Utils.hs +++ b/Cabal/Distribution/Simple/Utils.hs @@ -137,6 +137,7 @@ module Distribution.Simple.Utils ( listUnionRight, ordNub, ordNubRight, + safeTail, wrapText, wrapLine, ) where @@ -1473,6 +1474,11 @@ listUnionRight a b = ordNubRight (filter (`Set.notMember` bSet) a) ++ b where bSet = Set.fromList b +-- | A total variant of 'tail'. +safeTail :: [a] -> [a] +safeTail [] = [] +safeTail (_:xs) = xs + equating :: Eq a => (b -> a) -> b -> b -> Bool equating p x y = p x == p y diff --git a/Cabal/changelog b/Cabal/changelog index 979ea1e0bc1..9374de31531 100644 --- a/Cabal/changelog +++ b/Cabal/changelog @@ -1,6 +1,7 @@ -*-change-log-*- 1.23.x.x (current development version) + * Support GHC 8. * Deal with extra C sources from preprocessors (#238). * Include cabal_macros.h when running c2hs (#2600). * Don't recompile C sources unless needed (#2601). @@ -21,6 +22,9 @@ * Improved the './Setup configure' solver (#3082, #3076). * The '--allow-newer' option can be now used with './Setup configure' (#3163). + * Added a way to specify extra locations to find OS X frameworks + in ('extra-framework-dirs'). Can be used both in .cabal files and + as an argument to './Setup configure' (#3158). 1.22.0.0 Johan Tibell January 2015 * Support GHC 7.10. diff --git a/Cabal/doc/developing-packages.markdown b/Cabal/doc/developing-packages.markdown index 0ab39e9f2c9..b76e22620bf 100644 --- a/Cabal/doc/developing-packages.markdown +++ b/Cabal/doc/developing-packages.markdown @@ -1255,12 +1255,12 @@ pass to `cabal bench`. ### Build information ### -The following fields may be optionally present in a library or -executable section, and give information for the building of the +The following fields may be optionally present in a library, executable, test +suite or benchmark section, and give information for the building of the corresponding library or executable. See also the sections on [system-dependent parameters](#system-dependent-parameters) and -[configurations](#configurations) for a way to supply system-dependent -values for these fields. +[configurations](#configurations) for a way to supply system-dependent values +for these fields. `build-depends:` _package list_ : A list of packages needed to build this one. Each package can be @@ -1467,7 +1467,7 @@ values for these fields. developer documentation for more details on frameworks. This entry is ignored on all other platforms. -`frameworks-dirs:` _directory list_ +`extra-frameworks-dirs:` _directory list_ : On Darwin/MacOS X, a list of directories to search for frameworks. This entry is ignored on all other platforms. diff --git a/Cabal/doc/installing-packages.markdown b/Cabal/doc/installing-packages.markdown index a4184572ecb..d24c4bf33e0 100644 --- a/Cabal/doc/installing-packages.markdown +++ b/Cabal/doc/installing-packages.markdown @@ -932,6 +932,10 @@ be controlled with the following command line options. : An extra directory to search for system libraries files. You can use this flag multiple times to get a list of directories. +`--extra-framework-dirs`[=_dir_] +: An extra directory to search for frameworks (OS X only). You can use this + flag multiple times to get a list of directories. + You might need to use this flag if you have standard system libraries in a non-standard location that is not mentioned in the package's `.cabal` file. Using this option has the same affect as diff --git a/cabal-install/Distribution/Client/Config.hs b/cabal-install/Distribution/Client/Config.hs index c1b4de5fabc..0cd8541cfb8 100644 --- a/cabal-install/Distribution/Client/Config.hs +++ b/cabal-install/Distribution/Client/Config.hs @@ -306,6 +306,8 @@ instance Semigroup SavedConfig where -- TODO: NubListify configExtraLibDirs = lastNonEmpty configExtraLibDirs, -- TODO: NubListify + configExtraFrameworkDirs = lastNonEmpty configExtraFrameworkDirs, + -- TODO: NubListify configExtraIncludeDirs = lastNonEmpty configExtraIncludeDirs, configIPID = combine configIPID, configDistPref = combine configDistPref, diff --git a/cabal-install/changelog b/cabal-install/changelog index 7514923e5c7..aa1f2ff65aa 100644 --- a/cabal-install/changelog +++ b/cabal-install/changelog @@ -44,6 +44,9 @@ (#2877). * The '--allow-newer' option now works as expected when specified multiple times (#2588). + * New config file field: 'extra-framework-dirs' (extra locations + to find OS X frameworks in). Can be also specified as an argument + for 'install' and 'configure' commands (#3158). 1.22.0.0 Johan Tibell January 2015 * New command: user-config (#2159).