Permalink
Browse files

Add support for a "platform package list" : this list is passed to the

Cabal library, it can be used to favour a particular dependency
version in the resulting PKGBUILD.
  • Loading branch information...
Rémy Oudompheng
Rémy Oudompheng committed Jan 8, 2011
1 parent b20f686 commit 7b9e1e1ec13ae4a393339928b0432ebde1b1f832
Showing with 10 additions and 6 deletions.
  1. +1 −1 Distribution/ArchLinux/CabalTranslation.hs
  2. +9 −5 Distribution/ArchLinux/SystemProvides.lhs
@@ -46,7 +46,7 @@ preprocessCabal cabalsrc systemContext =
(CompilerId GHC (Version [6,12,3] []))
-- now constrain it to solve in the context of a modern ghc only
- (corePackages systemContext)
+ (corePackages systemContext ++ platformPackages systemContext)
cabalsrc
of
Left deps -> trace ("Unresolved dependencies: " ++show deps) Nothing
@@ -30,6 +30,9 @@ A big structure holding data about ArchLinux
> -- ^
> -- A list of Dependencies which are automatically satified
> -- when GHC is installed.
+> , platformPackages :: [Dependency]
+> -- ^
+> -- A list of packages to preferably use (e.g. Haskell Platform)
> , translationTable :: M.Map String String
> -- ^
> -- A hash-map where keys are library names and values are
@@ -39,23 +42,24 @@ A big structure holding data about ArchLinux
Empty SystemProvides
-> emptySystemProvides = SystemProvides [] M.empty
+> emptySystemProvides = SystemProvides [] [] M.empty
Get SystemProvides from files.
-> parseSystemProvides :: String -> String -> SystemProvides
-> parseSystemProvides sPkg sTranslation =
+> parseSystemProvides :: String -> String -> String -> SystemProvides
+> parseSystemProvides sPkg sPlat sTranslation =
> SystemProvides { corePackages = parseDeplist sPkg
+> , platformPackages = parseDeplist sPlat
> , translationTable = parseTranslationTable sTranslation }
-Extract GHC-provided dependencies from a file
+Extract a list of dependency descriptions from a file
> depstr2hs :: String -> Maybe Dependency
> depstr2hs s | s == "" || head s == '#' = Nothing
> | otherwise = simpleParse s
> parseDeplist :: String -> [Dependency]
-> parseDeplist srcfile1 = mapMaybe depstr2hs $ lines srcfile1
+> parseDeplist srcfile = mapMaybe depstr2hs $ lines srcfile
Now we translate the "library-providers" file. Any line beginning with "# "
or lines with something else than two words are discarded. Lines should have

0 comments on commit 7b9e1e1

Please sign in to comment.