Commit 795fe083 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Sync Cabal to upstream version 1.18 pre-release

Apart from bumping build-dep version bounds, `ghc-cabal` is adapted to
some minor Cabal API changes, and `bin-package-db` is made aware of
Cabal's recently added AGPL licence support.
parent 4b5238a4
Cabal @ 85cb83d7
Subproject commit 5fa5c41cd9d2c9b4b543312af6919fe3d8588654 Subproject commit 85cb83d7d8dbc8e59e20d31323e660608eb52557
...@@ -131,7 +131,8 @@ instance Binary License where ...@@ -131,7 +131,8 @@ instance Binary License where
put AllRightsReserved = do putWord8 6 put AllRightsReserved = do putWord8 6
put OtherLicense = do putWord8 7 put OtherLicense = do putWord8 7
put (Apache v) = do putWord8 8; put v put (Apache v) = do putWord8 8; put v
put (UnknownLicense str) = do putWord8 9; put str put (AGPL v) = do putWord8 9; put v
put (UnknownLicense str) = do putWord8 10; put str
get = do get = do
n <- getWord8 n <- getWord8
...@@ -145,6 +146,7 @@ instance Binary License where ...@@ -145,6 +146,7 @@ instance Binary License where
6 -> return AllRightsReserved 6 -> return AllRightsReserved
7 -> return OtherLicense 7 -> return OtherLicense
8 -> do v <- get; return (Apache v) 8 -> do v <- get; return (Apache v)
9 -> do v <- get; return (AGPL v)
_ -> do str <- get; return (UnknownLicense str) _ -> do str <- get; return (UnknownLicense str)
instance Binary Version where instance Binary Version where
......
...@@ -18,7 +18,7 @@ Library { ...@@ -18,7 +18,7 @@ Library {
build-depends: base >= 4 && < 5 build-depends: base >= 4 && < 5
build-depends: binary >= 0.5 && < 0.8, build-depends: binary >= 0.5 && < 0.8,
Cabal >= 1.8 && < 1.18 Cabal >= 1.18 && < 1.19
extensions: CPP extensions: CPP
} }
...@@ -167,7 +167,7 @@ doCopy directory distDir ...@@ -167,7 +167,7 @@ doCopy directory distDir
(installDirTemplates lbi) (installDirTemplates lbi)
progs = withPrograms lbi progs = withPrograms lbi
stripProgram' = stripProgram { stripProgram' = stripProgram {
programFindLocation = \_ -> return (Just strip) } programFindLocation = \_ _ -> return (Just strip) }
progs' <- configureProgram verbosity stripProgram' progs progs' <- configureProgram verbosity stripProgram' progs
let lbi' = lbi { let lbi' = lbi {
...@@ -205,12 +205,13 @@ doRegister directory distDir ghc ghcpkg topdir ...@@ -205,12 +205,13 @@ doRegister directory distDir ghc ghcpkg topdir
progs = withPrograms lbi progs = withPrograms lbi
ghcpkgconf = topdir </> "package.conf.d" ghcpkgconf = topdir </> "package.conf.d"
ghcProgram' = ghcProgram { ghcProgram' = ghcProgram {
programPostConf = \_ _ -> return ["-B" ++ topdir], programPostConf = \_ cp -> return cp { programDefaultArgs = ["-B" ++ topdir] },
programFindLocation = \_ -> return (Just ghc) } programFindLocation = \_ _ -> return (Just ghc) }
ghcPkgProgram' = ghcPkgProgram { ghcPkgProgram' = ghcPkgProgram {
programPostConf = \_ _ -> return $ ["--global-package-db", ghcpkgconf] programPostConf = \_ cp -> return cp { programDefaultArgs =
++ ["--force" | not (null myDestDir) ], ["--global-package-db", ghcpkgconf]
programFindLocation = \_ -> return (Just ghcpkg) } ++ ["--force" | not (null myDestDir) ] },
programFindLocation = \_ _ -> return (Just ghcpkg) }
configurePrograms ps conf = foldM (flip (configureProgram verbosity)) conf ps configurePrograms ps conf = foldM (flip (configureProgram verbosity)) conf ps
progs' <- configurePrograms [ghcProgram', ghcPkgProgram'] progs progs' <- configurePrograms [ghcProgram', ghcPkgProgram'] progs
......
...@@ -17,7 +17,7 @@ Executable ghc-cabal ...@@ -17,7 +17,7 @@ Executable ghc-cabal
Build-Depends: base >= 3 && < 5, Build-Depends: base >= 3 && < 5,
bytestring >= 0.10 && < 0.11, bytestring >= 0.10 && < 0.11,
Cabal >= 1.10 && < 1.18, Cabal >= 1.18 && < 1.19,
directory >= 1.1 && < 1.3, directory >= 1.1 && < 1.3,
filepath >= 1.2 && < 1.4 filepath >= 1.2 && < 1.4
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment