summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergeiTrofimovich <>2015-03-28 23:27:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2015-03-28 23:27:00 (GMT)
commita352a5da70a1012acf2372312405aad068b4b2eb (patch)
treec81d2b129c0ee5c31863661a3b4c109e8430a135
parentde64ca6e40ce1a0375855e4e7abc419618d41d1e (diff)
version 0.4.50.4.5
-rw-r--r--Cabal2Ebuild.hs5
-rw-r--r--Merge.hs31
-rw-r--r--Merge/Dependencies.hs25
-rw-r--r--Portage/EBuild.hs42
-rw-r--r--Portage/GHCCore.hs230
-rw-r--r--Portage/PackageId.hs7
-rw-r--r--hackport.cabal10
-rw-r--r--tests/resolveCat.hs2
8 files changed, 138 insertions, 214 deletions
diff --git a/Cabal2Ebuild.hs b/Cabal2Ebuild.hs
index 3731e19..4b4f07f 100644
--- a/Cabal2Ebuild.hs
+++ b/Cabal2Ebuild.hs
@@ -39,9 +39,10 @@ import qualified Portage.EBuild as E
import qualified Portage.Overlay as O
import Portage.Version
-cabal2ebuild :: Cabal.PackageDescription -> Portage.EBuild
-cabal2ebuild pkg = Portage.ebuildTemplate {
+cabal2ebuild :: Portage.Category -> Cabal.PackageDescription -> Portage.EBuild
+cabal2ebuild cat pkg = Portage.ebuildTemplate {
E.name = Portage.cabal_pn_to_PN cabal_pn,
+ E.category = display cat,
E.hackage_name= cabalPkgName,
E.version = display (Cabal.pkgVersion (Cabal.package pkg)),
E.description = if null (Cabal.synopsis pkg) then Cabal.description pkg
diff --git a/Merge.hs b/Merge.hs
index 453d99d..8e55c95 100644
--- a/Merge.hs
+++ b/Merge.hs
@@ -3,7 +3,7 @@ module Merge
, mergeGenericPackageDescription
) where
-import Control.Monad.Error
+import Control.Monad.Except
import Control.Exception
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.Function (on)
@@ -40,7 +40,7 @@ import System.Directory ( getCurrentDirectory
, createDirectoryIfMissing
, doesFileExist
)
-import System.Cmd (system)
+import System.Process (system)
import System.FilePath ((</>))
import System.Exit
@@ -52,7 +52,6 @@ import Error as E
import Network.URI
import qualified Portage.Cabal as Portage
-import qualified Portage.Dependency.Normalize as PN
import qualified Portage.PackageId as Portage
import qualified Portage.Version as Portage
import qualified Portage.Metadata as Portage
@@ -67,7 +66,6 @@ import qualified Merge.Dependencies as Merge
import qualified Util as U
-import Debug.Trace
(<.>) :: String -> String -> String
a <.> b = a ++ '.':b
@@ -358,13 +356,28 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
icalate _s [x] = [x]
icalate s (x:xs) = (x ++ s) : icalate s xs
+ gamesFlags :: [String]
+ gamesFlags = ["--prefix=\"${GAMES_PREFIX}\""]
+
+ addGamesFlags :: [String] -> [String]
+ addGamesFlags xs
+ | Portage.is_games_cat cat = xs ++ gamesFlags
+ | otherwise = xs
+
+ build_configure_call :: [String] -> [String]
+ build_configure_call [] = []
+ build_configure_call conf_args = icalate " \\" $
+ "haskell-cabal_src_configure" :
+ map ('\t':) conf_args
+
+ -- returns list USE-parameters to './setup configure'
selected_flags :: ([Cabal.FlagName], Cabal.FlagAssignment) -> [String]
selected_flags ([], []) = []
- selected_flags (active_fns, users_fas) = icalate " \\" $ "haskell-cabal_src_configure" : map snd (L.sortBy (compare `on` fst) flag_pairs)
+ selected_flags (active_fns, users_fas) = map snd (L.sortBy (compare `on` fst) flag_pairs)
where flag_pairs :: [(String, String)]
flag_pairs = active_pairs ++ users_pairs
- active_pairs = map (\fn -> (fn, "\t$(cabal_flag " ++ cfn_to_iuse fn ++ " " ++ fn ++ ")")) $ map unFlagName active_fns
- users_pairs = map (\fa -> ((unFlagName . fst) fa, "\t--flag=" ++ pp_fn fa)) users_fas
+ active_pairs = map (\fn -> (fn, "$(cabal_flag " ++ cfn_to_iuse fn ++ " " ++ fn ++ ")")) $ map unFlagName active_fns
+ users_pairs = map (\fa -> ((unFlagName . fst) fa, "--flag=" ++ pp_fn fa)) users_fas
to_iuse x = let fn = unFlagName $ Cabal.flagName x
p = if Cabal.flagDefault x then "+" else ""
in p ++ cfn_to_iuse fn
@@ -373,12 +386,12 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
. (\e -> e { E.depend_extra = S.toList $ Merge.dep_e tdeps } )
. (\e -> e { E.rdepend = Merge.rdep tdeps} )
. (\e -> e { E.rdepend_extra = S.toList $ Merge.rdep_e tdeps } )
- . (\e -> e { E.src_configure = selected_flags (active_flags, user_specified_fas) } )
+ . (\e -> e { E.src_configure = build_configure_call $ addGamesFlags $ selected_flags (active_flags, user_specified_fas) } )
. (\e -> e { E.iuse = E.iuse e ++ map to_iuse active_flag_descs })
. ( case requested_cabal_flags of
Nothing -> id
Just ucf -> (\e -> e { E.used_options = E.used_options e ++ [("flags", ucf)] }))
- $ C2E.cabal2ebuild pkgDesc
+ $ C2E.cabal2ebuild cat pkgDesc
mergeEbuild verbosity existing_meta pkgdir ebuild
when fetch $ do
diff --git a/Merge/Dependencies.hs b/Merge/Dependencies.hs
index 8cc34c8..463fac3 100644
--- a/Merge/Dependencies.hs
+++ b/Merge/Dependencies.hs
@@ -118,11 +118,6 @@ resolveDependencies overlay pkg compiler ghc_package_names merged_cabal_pkg_name
-- without slot business
raw_haskell_deps :: Portage.Dependency
raw_haskell_deps = PN.normalize_depend $ Portage.DependAllOf $ haskellDependencies overlay (buildDepends pkg)
- haskell_deps :: Portage.Dependency
- haskell_deps =
- case () of
- _ | treatAsLibrary -> Portage.set_build_slot $ add_profile $ raw_haskell_deps
- _ | otherwise -> raw_haskell_deps
test_deps :: Portage.Dependency
test_deps = Portage.mkUseDependency (True, Portage.Use "test") $
Portage.DependAllOf $
@@ -156,7 +151,7 @@ resolveDependencies overlay pkg compiler ghc_package_names merged_cabal_pkg_name
dep_e = S.singleton "${RDEPEND}",
rdep = Portage.DependAllOf
[ Portage.set_build_slot ghc_dep
- , haskell_deps
+ , Portage.set_build_slot $ add_profile $ raw_haskell_deps
, extra_libs
, Portage.DependAllOf pkg_config_libs
]
@@ -164,15 +159,15 @@ resolveDependencies overlay pkg compiler ghc_package_names merged_cabal_pkg_name
| otherwise = mempty
{
dep = Portage.DependAllOf
- [ ghc_dep
- , cabal_dep
+ [ cabal_dep
, build_tools
- , haskell_deps
, test_deps
],
dep_e = S.singleton "${RDEPEND}",
rdep = Portage.DependAllOf
- [ extra_libs
+ [ Portage.set_build_slot ghc_dep
+ , Portage.set_build_slot $ raw_haskell_deps
+ , extra_libs
, Portage.DependAllOf pkg_config_libs
]
}
@@ -341,6 +336,12 @@ staticTranslateExtraLib lib = lookup lib m
, ("dl", any_c_p "virtual" "libc")
, ("glfw", any_c_p "media-libs" "glfw")
, ("nettle", any_c_p "dev-libs" "nettle")
+ , ("Xpm", any_c_p "x11-libs" "libXpm")
+ , ("Xss", any_c_p "x11-libs" "libXScrnSaver")
+ , ("tag_c", any_c_p "media-libs" "taglib")
+ , ("magic", any_c_p "sys-apps" "file")
+ , ("crypt", any_c_p "virtual" "libc")
+ , ("Xrender", any_c_p "x11-libs" "libXrender")
]
---------------------------------------------------------------
@@ -430,6 +431,9 @@ pkgconfig_table =
,("gtk+-unix-print-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))
,("gtk+-x11-2.0", ("x11-libs", "gtk+", Portage.GivenSlot "2"))
+ ,("gtk+-3.0", ("x11-libs", "gtk+", Portage.GivenSlot "3"))
+ ,("webkitgtk-3.0", ("net-libs", "webkit-gtk", Portage.GivenSlot "3"))
+
,("cairo", ("x11-libs", "cairo", Portage.AnySlot)) -- need [svg] for dev-haskell/cairo
,("cairo-ft", ("x11-libs", "cairo", Portage.AnySlot))
,("cairo-ps", ("x11-libs", "cairo", Portage.AnySlot))
@@ -490,4 +494,5 @@ pkgconfig_table =
,("libssh2", ("net-libs", "libssh2", Portage.AnySlot))
,("SDL_image", ("media-libs", "sdl-image", Portage.AnySlot))
,("libzmq", ("net-libs", "zeromq", Portage.AnySlot))
+ ,("taglib_c", ("media-libs", "taglib", Portage.AnySlot))
]
diff --git a/Portage/EBuild.hs b/Portage/EBuild.hs
index 12576aa..3b25280 100644
--- a/Portage/EBuild.hs
+++ b/Portage/EBuild.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
module Portage.EBuild
( EBuild(..)
, ebuildTemplate
@@ -6,6 +7,7 @@ module Portage.EBuild
) where
import Portage.Dependency
+import qualified Portage.PackageId as PI
import qualified Portage.Dependency.Normalize as PN
import Data.String.Utils
@@ -16,10 +18,15 @@ import qualified Data.List as L
import Data.Version(Version(..))
import qualified Paths_hackport(version)
+#if MIN_VERSION_time(1,5,0)
+import qualified System.Locale as SL
+#else
import qualified System.Locale as TC
+#endif
data EBuild = EBuild {
name :: String,
+ category :: String,
hackage_name :: String, -- might differ a bit (we mangle case)
version :: String,
hackportVersion :: String,
@@ -49,6 +56,7 @@ getHackportVersion Version {versionBranch=[]} = ""
ebuildTemplate :: EBuild
ebuildTemplate = EBuild {
name = "foobar",
+ category = "dev-haskell",
hackage_name = "FooBar",
version = "0.1",
hackportVersion = getHackportVersion Paths_hackport.version,
@@ -73,7 +81,7 @@ ebuildTemplate = EBuild {
-- | Given an EBuild, give the URI to the tarball of the source code.
-- Assumes that the server is always hackage.haskell.org.
src_uri :: EBuild -> String
-src_uri e =
+src_uri e =
case my_pn e of
-- use standard address given that the package name has no upper
-- characters
@@ -94,7 +102,7 @@ showEBuild now ebuild =
sconcat (map (\(k, v) -> ss "#hackport: " . ss k . ss ": " . ss v . nl) $ used_options ebuild).
nl.
ss "CABAL_FEATURES=". quote' (sepBy " " $ features ebuild). nl.
- ss "inherit haskell-cabal". nl.
+ ss "inherit haskell-cabal". if_games (ss " games") . nl.
nl.
(case my_pn ebuild of
Nothing -> id
@@ -116,12 +124,34 @@ showEBuild now ebuild =
(case my_pn ebuild of
Nothing -> id
Just _ -> nl. ss "S=". quote ("${WORKDIR}/${MY_P}"). nl).
- verbatim (nl. ss "src_prepare() {" . nl)
+
+ if_games (nl . ss "pkg_setup() {" . nl.
+ ss (tabify_line " games_pkg_setup") . nl.
+ ss (tabify_line " haskell-cabal_pkg_setup") . nl.
+ ss "}" . nl).
+
+ verbatim (nl . ss "src_prepare() {" . nl)
(src_prepare ebuild)
(ss "}" . nl).
+
verbatim (nl. ss "src_configure() {" . nl)
(src_configure ebuild)
(ss "}" . nl).
+
+ if_games (nl . ss "src_compile() {" . nl.
+ ss (tabify_line " haskell-cabal_src_compile") . nl.
+ ss "}" . nl).
+
+ if_games (nl . ss "src_install() {" . nl.
+ ss (tabify_line " haskell-cabal_src_install") . nl.
+ ss (tabify_line " prepgamesdirs") . nl.
+ ss "}" . nl).
+
+ if_games (nl . ss "pkg_postinst() {" . nl.
+ ss (tabify_line " ghc-package_pkg_postinst") . nl.
+ ss (tabify_line " games_pkg_postinst") . nl.
+ ss "}" . nl).
+
id $ []
where
expandVars = replaceMultiVars [ ( name ebuild, "${PN}")
@@ -130,6 +160,10 @@ showEBuild now ebuild =
toMirror = replace "http://hackage.haskell.org/" "mirror://hackage/"
this_year :: String
this_year = TC.formatTime TC.defaultTimeLocale "%Y" now
+ if_games :: DString -> DString
+ if_games ds = if PI.is_games_cat (PI.Category (category ebuild))
+ then ds
+ else id
-- "+a" -> "a"
-- "b" -> "b"
@@ -190,7 +224,7 @@ quote str = sc '"'. ss (esc str). sc '"'
esc = concatMap esc'
esc' c =
case c of
- '"' -> "\""
+ '"' -> "\\\""
'\n' -> " "
'`' -> "'"
_ -> [c]
diff --git a/Portage/GHCCore.hs b/Portage/GHCCore.hs
index be5bc3e..0628ee7 100644
--- a/Portage/GHCCore.hs
+++ b/Portage/GHCCore.hs
@@ -29,30 +29,17 @@ import Debug.Trace
-- ghcs tried in specified order.
-- It means that first ghc in this list is a minmum default.
ghcs :: [(CompilerId, PackageIndex)]
-ghcs = modern_ghcs ++ ancient_ghcs
- where modern_ghcs = [ghc741, ghc742, ghc761, ghc762, ghc782]
- ancient_ghcs = [ghc6104, ghc6121, ghc6122, ghc6123, ghc704]
+ghcs = modern_ghcs
+ where modern_ghcs = [ghc741, ghc742, ghc761, ghc762, ghc782, ghc7101]
cabalFromGHC :: [Int] -> Maybe Version
cabalFromGHC ver = lookup ver table
where
- table = [([6,6,0], Version [1,1,6] [])
- ,([6,6,1], Version [1,1,6,2] [])
- ,([6,8,1], Version [1,2,2,0] [])
- ,([6,8,2], Version [1,2,3,0] [])
- ,([6,8,3], Version [1,2,4,0] [])
- ,([6,10,1], Version [1,6,0,1] [])
- ,([6,10,2], Version [1,6,0,3] [])
- ,([6,10,3], Version [1,6,0,3] [])
- ,([6,10,4], Version [1,6,0,3] [])
- ,([6,12,1], Version [1,8,0,2] [])
- ,([6,12,2], Version [1,8,0,4] [])
- ,([6,12,3], Version [1,8,0,6] [])
- ,([7,0,1], Version [1,10,0,0] [])
- ,([7,4,2], Version [1,14,0] [])
- ,([7,6,1], Version [1,16,0] [])
- ,([7,6,2], Version [1,16,0] [])
- ,([7,8,2], Version [1,18,1,3] [])
+ table = [ ([7,4,2], Version [1,14,0] [])
+ , ([7,6,1], Version [1,16,0] [])
+ , ([7,6,2], Version [1,16,0] [])
+ , ([7,8,2], Version [1,18,1,3] [])
+ , ([7,10,1], Version [1,22,2,0] [])
]
platform :: Platform
@@ -118,6 +105,9 @@ packageNamesFromPackageIndex pix = nub $ map fst $ allPackagesByName pix
ghc :: [Int] -> CompilerId
ghc nrs = CompilerId GHC (Version nrs [])
+ghc7101 :: (CompilerId, PackageIndex)
+ghc7101 = (ghc [7,10,1], mkIndex ghc7101_pkgs)
+
ghc782 :: (CompilerId, PackageIndex)
ghc782 = (ghc [7,8,2], mkIndex ghc782_pkgs)
@@ -133,23 +123,36 @@ ghc742 = (ghc [7,4,2], mkIndex ghc742_pkgs)
ghc741 :: (CompilerId, PackageIndex)
ghc741 = (ghc [7,4,1], mkIndex ghc741_pkgs)
-ghc704 :: (CompilerId, PackageIndex)
-ghc704 = (ghc [7,0,1], mkIndex ghc704_pkgs)
-
-ghc6123 :: (CompilerId, PackageIndex)
-ghc6123 = (ghc [6,12,3], mkIndex ghc6123_pkgs)
-
-ghc6122 :: (CompilerId, PackageIndex)
-ghc6122 = (ghc [6,12,2], mkIndex ghc6122_pkgs)
-
-ghc6121 :: (CompilerId, PackageIndex)
-ghc6121 = (ghc [6,12,1], mkIndex ghc6121_pkgs)
-
-ghc6104 :: (CompilerId, PackageIndex)
-ghc6104 = (ghc [6,10,4], mkIndex ghc6104_pkgs)
-
-- | Non-upgradeable core packages
-- Source: http://haskell.org/haskellwiki/Libraries_released_with_GHC
+-- and our binary tarballs (package.conf.d.initial subdir)
+
+ghc7101_pkgs :: [PackageIdentifier]
+ghc7101_pkgs =
+ [ p "array" [0,5,1,0]
+ , p "base" [4,8,0,0]
+-- , p "binary" [0,7,3,0] package is upgradeable
+ , p "bytestring" [0,10,6,0]
+-- , p "Cabal" [1,18,1,3] package is upgradeable
+ , p "containers" [0,5,6,2]
+ , p "deepseq" [1,4,1,1] -- used by time
+ , p "directory" [1,2,2,0]
+ , p "filepath" [1,4,0,0]
+ , p "ghc-prim" [0,4,0,0]
+ -- , p "haskell2010" [1,1,2,0] -- stopped shipping in 7.10, deprecated
+ -- , p "haskell98" [2,0,0,3] -- stopped shipping in 7.10, deprecated
+ , p "hoopl" [3,10,0,2] -- used by libghc
+ , p "hpc" [0,6,0,2] -- used by libghc
+ , p "integer-gmp" [1,0,0,0]
+ -- , p "old-locale" [1,0,0,6] -- stopped shipping in 7.10, deprecated
+ -- , p "old-time" [1,1,0,2] -- stopped shipping in 7.10, deprecated
+ , p "pretty" [1,1,2,0]
+ , p "process" [1,2,3,0]
+ , p "template-haskell" [2,10,0,0] -- used by libghc
+ , p "time" [1,5,0,1] -- used by haskell98, unix, directory, hpc, ghc. unsafe to upgrade
+-- , p "transformers" [0,4,2,0] -- used by libghc
+ , p "unix" [2,7,1,0]
+ ]
ghc782_pkgs :: [PackageIdentifier]
ghc782_pkgs =
@@ -168,8 +171,8 @@ ghc782_pkgs =
, p "hoopl" [3,10,0,1] -- used by libghc
, p "hpc" [0,6,0,1] -- used by libghc
, p "integer-gmp" [0,5,1,0]
- , p "old-locale" [1,0,0,6]
- , p "old-time" [1,1,0,2]
+ -- , p "old-locale" [1,0,0,6] -- stopped shipping in 7.10, deprecated
+ -- , p "old-time" [1,1,0,2] -- stopped shipping in 7.10, deprecated
, p "pretty" [1,1,1,1]
, p "process" [1,2,0,0]
, p "template-haskell" [2,9,0,0] -- used by libghc
@@ -195,8 +198,8 @@ ghc762_pkgs =
, p "hoopl" [3,9,0,0] -- used by libghc
, p "hpc" [0,6,0,0] -- used by libghc
, p "integer-gmp" [0,5,0,0]
- , p "old-locale" [1,0,0,5]
- , p "old-time" [1,1,0,1]
+ -- , p "old-locale" [1,0,0,5] -- stopped shipping in 7.10, deprecated
+ -- , p "old-time" [1,1,0,1] -- stopped shipping in 7.10, deprecated
, p "pretty" [1,1,1,0]
, p "process" [1,1,0,2]
, p "template-haskell" [2,8,0,0] -- used by libghc
@@ -221,8 +224,8 @@ ghc761_pkgs =
, p "hoopl" [3,9,0,0] -- used by libghc
, p "hpc" [0,6,0,0] -- used by libghc
, p "integer-gmp" [0,5,0,0]
- , p "old-locale" [1,0,0,5]
- , p "old-time" [1,1,0,1]
+ -- , p "old-locale" [1,0,0,5] -- stopped shipping in 7.10, deprecated
+ -- , p "old-time" [1,1,0,1] -- stopped shipping in 7.10, deprecated
, p "pretty" [1,1,1,0]
, p "process" [1,1,0,2]
, p "template-haskell" [2,8,0,0] -- used by libghc
@@ -248,8 +251,8 @@ ghc742_pkgs =
, p "hoopl" [3,8,7,3] -- used by libghc
, p "hpc" [0,5,1,1] -- used by libghc
, p "integer-gmp" [0,4,0,0]
- , p "old-locale" [1,0,0,4]
- , p "old-time" [1,1,0,0]
+ -- , p "old-locale" [1,0,0,4] -- stopped shipping in 7.10, deprecated
+ -- , p "old-time" [1,1,0,0] -- stopped shipping in 7.10, deprecated
, p "pretty" [1,1,1,0]
, p "process" [1,1,0,1]
, p "template-haskell" [2,7,0,0] -- used by libghc
@@ -275,8 +278,8 @@ ghc741_pkgs =
, p "hoopl" [3,8,7,3] -- used by libghc
, p "hpc" [0,5,1,1] -- used by libghc
, p "integer-gmp" [0,4,0,0]
- , p "old-locale" [1,0,0,4]
- , p "old-time" [1,1,0,0]
+ -- , p "old-locale" [1,0,0,4] -- stopped shipping in 7.10, deprecated
+ -- , p "old-time" [1,1,0,0] -- stopped shipping in 7.10, deprecated
, p "pretty" [1,1,1,0]
, p "process" [1,1,0,1]
, p "template-haskell" [2,7,0,0] -- used by libghc
@@ -284,142 +287,5 @@ ghc741_pkgs =
, p "unix" [2,5,1,0]
]
-ghc704_pkgs :: [PackageIdentifier]
-ghc704_pkgs =
- [ p "array" [0,3,0,2]
- , p "base" [4,3,1,0]
- , p "bytestring" [0,9,1,10]
--- , p "Cabal" [1,10,2,0] package is upgradeable
- , p "containers" [0,4,0,0]
- , p "directory" [1,1,0,0]
--- , p "extensible-exceptions" [0,1,1,2] -- package is upgradeable, stopped shipping in 7.6
- , p "filepath" [1,2,0,0]
- , p "ghc-binary" [0,5,0,2]
- , p "ghc-prim" [0,2,0,0]
- , p "haskell2010" [1,0,0,0]
- , p "haskell98" [1,1,0,1]
- , p "hpc" [0,5,0,6]
- , p "integer-gmp" [0,2,0,2]
- , p "old-locale" [1,0,0,2]
- , p "old-time" [1,0,0,6]
- , p "pretty" [1,0,1,2]
- , p "process" [1,0,1,5]
--- , p "random" [1,0,0,3] -- will not be shipped starting from ghc-7.2
- , p "template-haskell" [2,5,0,0]
- , p "time" [1,2,0,3]
- , p "unix" [2,4,2,0]
- ]
-
-ghc6123_pkgs :: [PackageIdentifier]
-ghc6123_pkgs =
- [ p "array" [0,3,0,1]
- , p "base" [3,0,3,2]
- , p "base" [4,2,0,2]
- , p "bytestring" [0,9,1,7]
--- , p "Cabal" [1,8,0,6] package is upgradeable
- , p "containers" [0,3,0,0]
- , p "directory" [1,0,1,1]
--- , p "extensible-exceptions" [0,1,1,1] -- package is upgradeable, stopped shipping in 7.6
- , p "filepath" [1,1,0,4]
- , p "ghc-binary" [0,5,0,2]
- , p "ghc-prim" [0,2,0,0]
- , p "haskell98" [1,0,1,1]
- , p "hpc" [0,5,0,5]
- , p "integer-gmp" [0,2,0,1]
- , p "integer-simple" [0,1,0,0]
- , p "old-locale" [1,0,0,2]
- , p "old-time" [1,0,0,5]
- , p "pretty" [1,0,1,1]
- , p "process" [1,0,1,3]
--- , p "random" [1,0,0,2] -- will not be shipped starting from ghc-7.2
--- , p "syb" [0,1,0,2] -- not distributed with ghc-7
- , p "template-haskell" [2,4,0,1]
- , p "time" [1,1,4]
- , p "unix" [2,4,0,2]
--- , p "utf8-string" [0,3,4] package is upgradeable
- ]
-
-ghc6122_pkgs :: [PackageIdentifier]
-ghc6122_pkgs =
- [ p "array" [0,3,0,0]
- , p "base" [3,0,3,2]
- , p "base" [4,2,0,1]
- , p "bytestring" [0,9,1,6]
--- , p "Cabal" [1,8,0,4] package is upgradeable
- , p "containers" [0,3,0,0]
- , p "directory" [1,0,1,1]
--- , p "extensible-exceptions" [0,1,1,1] -- package is upgradeable, stopped shipping in 7.6
- , p "filepath" [1,1,0,4]
- , p "ghc-binary" [0,5,0,2]
- , p "ghc-prim" [0,2,0,0]
- , p "haskell98" [1,0,1,1]
- , p "hpc" [0,5,0,5]
- , p "integer-gmp" [0,2,0,1]
- , p "old-locale" [1,0,0,2]
- , p "old-time" [1,0,0,4]
- , p "pretty" [1,0,1,1]
- , p "process" [1,0,1,2]
--- , p "random" [1,0,0,2] -- will not be shipped starting from ghc-7.2
--- , p "syb" [0,1,0,2] -- not distributed with ghc-7
- , p "template-haskell" [2,4,0,1]
- , p "time" [1,1,4]
- , p "unix" [2,4,0,1]
--- , p "utf8-string" [0,3,4] package is upgradeable
- ]
-
-ghc6121_pkgs :: [PackageIdentifier]
-ghc6121_pkgs =
- [ p "array" [0,3,0,0]
- , p "base" [3,0,3,2]
- , p "base" [4,2,0,0]
- , p "bytestring" [0,9,1,5]
--- , p "Cabal" [1,8,0,2] package is upgradeable
- , p "containers" [0,3,0,0]
- , p "directory" [1,0,1,0]
--- , p "extensible-exceptions" [0,1,1,1] -- package is upgradeable, stopped shipping in 7.6
- , p "filepath" [1,1,0,3]
- , p "ghc-binary" [0,5,0,2]
- , p "ghc-prim" [0,2,0,0]
- , p "haskell98" [1,0,1,1]
- , p "hpc" [0,5,0,4]
- , p "integer-gmp" [0,2,0,0]
- , p "old-locale" [1,0,0,2]
- , p "old-time" [1,0,0,3]
- , p "pretty" [1,0,1,1]
- , p "process" [1,0,1,2]
--- , p "random" [1,0,0,2] -- will not be shipped starting from ghc-7.2
--- , p "syb" [0,1,0,2] -- not distributed with ghc-7
- , p "template-haskell" [2,4,0,0]
- , p "time" [1,1,4]
- , p "unix" [2,4,0,0]
--- , p "utf8-string" [0,3,4] package is upgradeable
- ]
-
-ghc6104_pkgs :: [PackageIdentifier]
-ghc6104_pkgs =
- [ p "array" [0,2,0,0]
- , p "base" [3,0,3,1]
- , p "base" [4,1,0,0]
- , p "bytestring" [0,9,1,4]
--- , p "Cabal" [1,6,0,3] package is upgradeable
- , p "containers" [0,2,0,1]
- , p "directory" [1,0,0,3]
--- , p "extensible-exceptions" [0,1,1,0] -- package is upgradeable, stopped shipping in 7.6
- , p "filepath" [1,1,0,2]
- , p "ghc-prim" [0,1,0,0]
- , p "haskell98" [1,0,1,0]
- , p "hpc" [0,5,0,3]
- , p "integer" [0,1,0,1]
- , p "old-locale" [1,0,0,1]
- , p "old-time" [1,0,0,2]
- , p "packedstring" [0,1,0,1]
- , p "pretty" [1,0,1,0]
- , p "process" [1,0,1,1]
--- , p "random" [1,0,0,1] -- will not be shipped starting from ghc-7.2
--- , p "syb" [0,1,0,1] -- not distributed with ghc-7
- , p "template-haskell" [2,3,0,1]
- , p "unix" [2,3,2,0]
- ]
-
p :: String -> [Int] -> PackageIdentifier
p pn vs = PackageIdentifier (PackageName pn) (Version vs [])
diff --git a/Portage/PackageId.hs b/Portage/PackageId.hs
index a337b17..e1bad7d 100644
--- a/Portage/PackageId.hs
+++ b/Portage/PackageId.hs
@@ -12,10 +12,12 @@ module Portage.PackageId (
normalizeCabalPackageName,
normalizeCabalPackageId,
packageIdToFilePath,
- cabal_pn_to_PN
+ cabal_pn_to_PN,
+ is_games_cat
) where
import Data.Char
+import qualified Data.List as L
import qualified Distribution.Package as Cabal
import Distribution.Text (Text(..))
@@ -129,3 +131,6 @@ parseFriendlyPackage str =
cabal_pn_to_PN :: Cabal.PackageName -> String
cabal_pn_to_PN = map toLower . display
+
+is_games_cat :: Category -> Bool
+is_games_cat = L.isPrefixOf "games" . unCategory
diff --git a/hackport.cabal b/hackport.cabal
index 87a7fea..c2a0128 100644
--- a/hackport.cabal
+++ b/hackport.cabal
@@ -1,5 +1,5 @@
Name: hackport
-Version: 0.4.4
+Version: 0.4.5
License: GPL
License-file: LICENSE
Author: Henning G√ľnther, Duncan Coutts, Lennart Kolmodin
@@ -25,7 +25,7 @@ Executable hackport
Hs-Source-Dirs: ., cabal, cabal/Cabal, cabal/cabal-install
Build-Depends:
base >= 2.0 && < 5,
- deepseq >= 1.3 && < 1.4,
+ deepseq >= 1.3,
filepath,
parsec,
mtl,
@@ -135,7 +135,7 @@ Test-Suite test-resolve-category
Main-Is: tests/resolveCat.hs
Hs-Source-Dirs: ., cabal, cabal/Cabal, cabal/cabal-install, tests
Build-Depends: base >= 3 && < 5,
- deepseq >= 1.3 && < 1.4,
+ deepseq >= 1.3,
bytestring,
containers,
directory,
@@ -156,7 +156,7 @@ Test-Suite test-print-deps
Main-Is: tests/print_deps.hs
Hs-Source-Dirs: ., cabal, cabal/Cabal, cabal/cabal-install, tests
Build-Depends: base >= 3 && < 5,
- deepseq >= 1.3 && < 1.4,
+ deepseq >= 1.3,
bytestring,
containers,
directory,
@@ -177,7 +177,7 @@ Test-Suite test-normalize-deps
Main-Is: tests/normalize_deps.hs
Hs-Source-Dirs: ., cabal, cabal/Cabal, cabal/cabal-install, tests
Build-Depends: base >= 3 && < 5,
- deepseq >= 1.3 && < 1.4,
+ deepseq >= 1.3,
bytestring,
containers,
directory,
diff --git a/tests/resolveCat.hs b/tests/resolveCat.hs
index 03a8e0b..1be5072 100644
--- a/tests/resolveCat.hs
+++ b/tests/resolveCat.hs
@@ -13,7 +13,7 @@ tests :: Test
tests = TestList [ TestLabel "resolve cabal" (test_resolveCategory "dev-haskell" "cabal")
, TestLabel "resolve ghc" (test_resolveCategory "dev-lang" "ghc")
, TestLabel "resolve Cabal" (test_resolveCategory "dev-haskell" "Cabal")
- , TestLabel "resolve DaRsC" (test_resolveCategory "dev-vcs" "darcs")
+ , TestLabel "resolve DaRcS" (test_resolveCategory "dev-vcs" "DaRcS")
]
test_resolveCategory :: String -> String -> Test