Strip out two dead package api modules
This commit is contained in:
		| @ -1,5 +1,5 @@ | |||||||
| name:               plugins | name:               plugins | ||||||
| version:            1.5.1.1 | version:            1.5.1.2 | ||||||
| homepage:           http://code.haskell.org/~dons/code/hs-plugins | homepage:           http://code.haskell.org/~dons/code/hs-plugins | ||||||
| synopsis:           Dynamic linking for Haskell and C objects | synopsis:           Dynamic linking for Haskell and C objects | ||||||
| description:        Dynamic linking and runtime evaluation of Haskell, | description:        Dynamic linking and runtime evaluation of Haskell, | ||||||
| @ -32,8 +32,6 @@ library | |||||||
|             System.Plugins.Load, |             System.Plugins.Load, | ||||||
|             System.Plugins.LoadTypes, |             System.Plugins.LoadTypes, | ||||||
|             System.Plugins.Make, |             System.Plugins.Make, | ||||||
|             System.Plugins.Package, |  | ||||||
|             System.Plugins.PackageAPI, |  | ||||||
|             System.Plugins.Parser, |             System.Plugins.Parser, | ||||||
|             System.Plugins.Process, |             System.Plugins.Process, | ||||||
|             System.Plugins.Utils |             System.Plugins.Utils | ||||||
|  | |||||||
| @ -52,7 +52,6 @@ module System.Plugins.Env ( | |||||||
| #include "../../../config.h" | #include "../../../config.h" | ||||||
|  |  | ||||||
| import System.Plugins.LoadTypes (Module) | import System.Plugins.LoadTypes (Module) | ||||||
| import System.Plugins.PackageAPI  {- everything -} |  | ||||||
| import System.Plugins.Consts           ( sysPkgSuffix ) | import System.Plugins.Consts           ( sysPkgSuffix ) | ||||||
|  |  | ||||||
| import Control.Monad            ( liftM ) | import Control.Monad            ( liftM ) | ||||||
| @ -70,13 +69,15 @@ import System.IO.Error          ( catch, ioError, isDoesNotExistError ) | |||||||
|  |  | ||||||
| import Control.Concurrent.MVar  ( MVar(), newMVar, withMVar ) | import Control.Concurrent.MVar  ( MVar(), newMVar, withMVar ) | ||||||
|  |  | ||||||
|  | import Distribution.Package hiding (depends, packageName, PackageName(..)) | ||||||
|  | import Distribution.Text | ||||||
|  |  | ||||||
| import Distribution.InstalledPackageInfo | import Distribution.InstalledPackageInfo | ||||||
| -- import Distribution.Package hiding (packageName, PackageName(..)) | -- import Distribution.Package hiding (packageName, PackageName(..)) | ||||||
| import Distribution.Simple.Compiler | import Distribution.Simple.Compiler | ||||||
| import Distribution.Simple.GHC | import Distribution.Simple.GHC | ||||||
| import Distribution.Simple.PackageIndex | import Distribution.Simple.PackageIndex | ||||||
| import Distribution.Simple.Program | import Distribution.Simple.Program | ||||||
| import Distribution.Text |  | ||||||
| import Distribution.Verbosity | import Distribution.Verbosity | ||||||
|  |  | ||||||
| import qualified Data.Map as M | import qualified Data.Map as M | ||||||
| @ -519,3 +520,33 @@ addMerge a b z = modifyMerged env $ \fm -> return $ addToFM fm (a,b) z | |||||||
| [] </> b = b | [] </> b = b | ||||||
| a  </> b = a ++ "/" ++ b | a  </> b = a ++ "/" ++ b | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ------------------------------------------------------------------------ | ||||||
|  |  | ||||||
|  | -- | ||||||
|  | -- We export an abstract interface to package conf`s because we have | ||||||
|  | -- to handle either traditional or Cabal style package conf`s. | ||||||
|  | -- | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | packageName    :: PackageConfig -> PackageName  | ||||||
|  | packageDeps    :: PackageConfig -> [PackageName] | ||||||
|  | -- updImportDirs  :: ([FilePath] -> [FilePath]) -> PackageConfig -> PackageConfig | ||||||
|  | -- updLibraryDirs :: ([FilePath] -> [FilePath]) -> PackageConfig -> PackageConfig | ||||||
|  |  | ||||||
|  |  | ||||||
|  | type PackageName = String | ||||||
|  |  | ||||||
|  | type PackageConfig = InstalledPackageInfo | ||||||
|  |  | ||||||
|  | packageName = display . pkgName . sourcePackageId | ||||||
|  | -- packageName_ = pkgName . sourcePackageId | ||||||
|  | packageDeps = (map display) . depends | ||||||
|  |  | ||||||
|  | {- | ||||||
|  | updImportDirs f pk@(InstalledPackageInfo { importDirs = idirs }) = | ||||||
|  |         pk { importDirs = f idirs } | ||||||
|  | updLibraryDirs f pk@(InstalledPackageInfo { libraryDirs = ldirs }) = | ||||||
|  |         pk { libraryDirs = f ldirs } | ||||||
|  | -} | ||||||
|  | |||||||
| @ -1,67 +0,0 @@ | |||||||
| -- |  | ||||||
| -- Copyright (C) 2004 Sean Seefried - http://www.cse.unsw.edu.au/~sseefried |  | ||||||
| --  |  | ||||||
| -- This library is free software; you can redistribute it and/or |  | ||||||
| -- modify it under the terms of the GNU Lesser General Public |  | ||||||
| -- License as published by the Free Software Foundation; either |  | ||||||
| -- version 2.1 of the License, or (at your option) any later version. |  | ||||||
| --  |  | ||||||
| -- This library is distributed in the hope that it will be useful, |  | ||||||
| -- but WITHOUT ANY WARRANTY; without even the implied warranty of |  | ||||||
| -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU |  | ||||||
| -- Lesser General Public License for more details. |  | ||||||
| --  |  | ||||||
| -- You should have received a copy of the GNU Lesser General Public |  | ||||||
| -- License along with this library; if not, write to the Free Software |  | ||||||
| -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 |  | ||||||
| -- USA |  | ||||||
|  |  | ||||||
| -- |  | ||||||
| -- Read information from a package.conf |  | ||||||
| -- |  | ||||||
|  |  | ||||||
| module System.Plugins.Package {-everything-} where |  | ||||||
|  |  | ||||||
| type PackageName = String |  | ||||||
|  |  | ||||||
| -- |  | ||||||
| -- Take directly from ghc/utils/ghc-pkg/Package.hs |  | ||||||
| -- |  | ||||||
|  |  | ||||||
| data PackageConfig = Package { |  | ||||||
| 	name            :: PackageName, |  | ||||||
| 	auto		:: Bool, |  | ||||||
| 	import_dirs     :: [FilePath], |  | ||||||
| 	source_dirs     :: [FilePath], |  | ||||||
| 	library_dirs    :: [FilePath], |  | ||||||
| 	hs_libraries    :: [String], |  | ||||||
| 	extra_libraries :: [String], |  | ||||||
| 	include_dirs    :: [FilePath], |  | ||||||
| 	c_includes      :: [String], |  | ||||||
| 	package_deps    :: [String], |  | ||||||
| 	extra_ghc_opts  :: [String], |  | ||||||
| 	extra_cc_opts   :: [String], |  | ||||||
| 	extra_ld_opts   :: [String], |  | ||||||
| 	framework_dirs  :: [FilePath], -- ignored everywhere but on Darwin/MacOS X |  | ||||||
| 	extra_frameworks:: [String]  -- ignored everywhere but on Darwin/MacOS X |  | ||||||
|      } deriving Show |  | ||||||
|  |  | ||||||
|  |  | ||||||
| defaultPackageConfig = Package { |  | ||||||
| 	name = error "defaultPackage", |  | ||||||
| 	auto = False, |  | ||||||
| 	import_dirs     = [], |  | ||||||
| 	source_dirs     = [], |  | ||||||
| 	library_dirs    = [], |  | ||||||
| 	hs_libraries    = [], |  | ||||||
| 	extra_libraries = [], |  | ||||||
| 	include_dirs    = [], |  | ||||||
| 	c_includes      = [], |  | ||||||
| 	package_deps    = [], |  | ||||||
| 	extra_ghc_opts  = [], |  | ||||||
| 	extra_cc_opts   = [], |  | ||||||
| 	extra_ld_opts   = [], |  | ||||||
| 	framework_dirs  = [], |  | ||||||
| 	extra_frameworks= [] |  | ||||||
|     } |  | ||||||
|  |  | ||||||
| @ -1,97 +0,0 @@ | |||||||
| {-# LANGUAGE CPP #-} |  | ||||||
| -- |  | ||||||
| -- Copyright (C) 2005 Sean Seefried - http://www.cse.unsw.edu.au/~sseefried |  | ||||||
| --  |  | ||||||
| -- This library is free software; you can redistribute it and/or |  | ||||||
| -- modify it under the terms of the GNU Lesser General Public |  | ||||||
| -- License as published by the Free Software Foundation; either |  | ||||||
| -- version 2.1 of the License, or (at your option) any later version. |  | ||||||
| --  |  | ||||||
| -- This library is distributed in the hope that it will be useful, |  | ||||||
| -- but WITHOUT ANY WARRANTY; without even the implied warranty of |  | ||||||
| -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU |  | ||||||
| -- Lesser General Public License for more details. |  | ||||||
| --  |  | ||||||
| -- You should have received a copy of the GNU Lesser General Public |  | ||||||
| -- License along with this library; if not, write to the Free Software |  | ||||||
| -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 |  | ||||||
| -- USA |  | ||||||
|  |  | ||||||
| -- |  | ||||||
| -- We export an abstract interface to package conf`s because we have |  | ||||||
| -- to handle either traditional or Cabal style package conf`s. |  | ||||||
| -- |  | ||||||
|  |  | ||||||
| module System.Plugins.PackageAPI ( |  | ||||||
|          PackageName |  | ||||||
|        , PackageConfig |  | ||||||
|        , packageName |  | ||||||
|        , packageName_ |  | ||||||
|        , importDirs |  | ||||||
|        , hsLibraries |  | ||||||
|        , libraryDirs |  | ||||||
|        , extraLibraries |  | ||||||
|        , ldOptions |  | ||||||
|        , packageDeps |  | ||||||
|        , updImportDirs |  | ||||||
|        , updLibraryDirs  |  | ||||||
|    ) where |  | ||||||
|  |  | ||||||
| #include "../../../config.h" |  | ||||||
|  |  | ||||||
| #if CABAL == 1 || __GLASGOW_HASKELL__ >= 604 |  | ||||||
| import Distribution.InstalledPackageInfo |  | ||||||
| import Distribution.Package hiding (depends, packageName, PackageName(..)) |  | ||||||
| import Distribution.Text |  | ||||||
| #else |  | ||||||
| import System.Plugins.Package |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| packageName    :: PackageConfig -> PackageName  |  | ||||||
| packageDeps    :: PackageConfig -> [PackageName] |  | ||||||
| updImportDirs  :: ([FilePath] -> [FilePath]) -> PackageConfig -> PackageConfig |  | ||||||
| updLibraryDirs :: ([FilePath] -> [FilePath]) -> PackageConfig -> PackageConfig |  | ||||||
|  |  | ||||||
| -- We use different package.conf parsers when running on 6.2.x or 6.4 |  | ||||||
| #if CABAL == 1 || __GLASGOW_HASKELL__ >= 604 |  | ||||||
|  |  | ||||||
| type PackageName = String |  | ||||||
|  |  | ||||||
| type PackageConfig = InstalledPackageInfo |  | ||||||
|  |  | ||||||
| packageName = display . pkgName . sourcePackageId |  | ||||||
| packageName_ = pkgName . sourcePackageId |  | ||||||
| packageDeps = (map display) . depends |  | ||||||
|  |  | ||||||
| updImportDirs f pk@(InstalledPackageInfo { importDirs = idirs }) = |  | ||||||
|         pk { importDirs = f idirs } |  | ||||||
| updLibraryDirs f pk@(InstalledPackageInfo { libraryDirs = ldirs }) = |  | ||||||
|         pk { libraryDirs = f ldirs } |  | ||||||
| #else |  | ||||||
|  |  | ||||||
| packageName    = name |  | ||||||
| packageName_   = name |  | ||||||
| packageDeps    = package_deps |  | ||||||
|  |  | ||||||
| updImportDirs f pk@(Package {import_dirs = idirs})  |  | ||||||
|         = pk {import_dirs = f idirs} |  | ||||||
|  |  | ||||||
| updLibraryDirs f pk@(Package {library_dirs = ldirs})  |  | ||||||
|         = pk {library_dirs = f ldirs} |  | ||||||
|  |  | ||||||
| importDirs     :: PackageConfig -> [FilePath] |  | ||||||
| importDirs     = import_dirs |  | ||||||
|  |  | ||||||
| hsLibraries    :: PackageConfig -> [String] |  | ||||||
| hsLibraries    = hs_libraries |  | ||||||
|  |  | ||||||
| libraryDirs    :: PackageConfig -> [FilePath] |  | ||||||
| libraryDirs    = library_dirs |  | ||||||
|  |  | ||||||
| extraLibraries :: PackageConfig -> [String] |  | ||||||
| extraLibraries = extra_libraries |  | ||||||
|  |  | ||||||
| ldOptions :: PackageConfig -> [String] |  | ||||||
| ldOptions = extra_ld_opts |  | ||||||
|  |  | ||||||
| #endif |  | ||||||
		Reference in New Issue
	
	Block a user