Commit 8992d526 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Update Cabal submodule to tip of v1.20 branch

This corresponds to the RC of the soon-to-be Cabal 1.20 release

One noteworthy change is the removal of the `--with-ranlib` flag
requiring a small adaptation in the GHC build system.

Moreover two new licences were added, MPL and BSD2.

Due to https://github.com/haskell/cabal/issues/1622

 Cabal-1.20 now
allows to strip libraries as well, this doesn't work well with
`ghc-cabal copy` being fed a `":"` strip-command argument which was
simply ignored in the past. The current code tries to retain this
semantics as backward compat. However, this needs more investigation as
I'm not sure if/why the `test_bindist` step doesn't want the libraries
to be stripped on installation.
Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
parent a107737f
Subproject commit c226c0de042999bbe4c5c339c6c28a9be7f0c6d1
Subproject commit aaa6183dba81d77637dff84f83136639d40f268f
......@@ -132,7 +132,9 @@ instance Binary License where
put OtherLicense = do putWord8 7
put (Apache v) = do putWord8 8; put v
put (AGPL v) = do putWord8 9; put v
put (UnknownLicense str) = do putWord8 10; put str
put BSD2 = do putWord8 10
put (MPL v) = do putWord8 11; put v
put (UnknownLicense str) = do putWord8 12; put str
get = do
n <- getWord8
......@@ -147,6 +149,8 @@ instance Binary License where
7 -> return OtherLicense
8 -> do v <- get; return (Apache v)
9 -> do v <- get; return (AGPL v)
10 -> return BSD2
11 -> do v <- get; return (MPL v)
_ -> do str <- get; return (UnknownLicense str)
instance Binary Version where
......
......@@ -19,7 +19,7 @@ Library {
build-depends: base >= 4 && < 5
build-depends: binary >= 0.5 && < 0.8,
Cabal >= 1.18 && < 1.19
Cabal >= 1.20 && < 1.21
extensions: CPP
}
......@@ -94,7 +94,6 @@ endif
$1_$2_CONFIGURE_OPTS += --configure-option=--with-cc="$$(CC_STAGE$3)"
$1_$2_CONFIGURE_OPTS += --with-ar="$$(AR_STAGE$3)"
$1_$2_CONFIGURE_OPTS += --with-ranlib="$$(REAL_RANLIB_CMD)"
$1_$2_CONFIGURE_OPTS += $$(if $$(ALEX),--with-alex="$$(ALEX)")
$1_$2_CONFIGURE_OPTS += $$(if $$(HAPPY),--with-happy="$$(HAPPY)")
......
......@@ -12,6 +12,7 @@ import Distribution.Simple.Configure
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Program
import Distribution.Simple.Program.HcPkg
import Distribution.Simple.Setup (ConfigFlags(configStripLibs), fromFlag, toFlag)
import Distribution.Simple.Utils (defaultPackageDesc, writeFileAtomic, toUTF8)
import Distribution.Simple.Build (writeAutogenFiles)
import Distribution.Simple.Register
......@@ -174,8 +175,17 @@ doCopy directory distDir
let lbi' = lbi {
withPrograms = progs',
installDirTemplates = idts,
configFlags = cfg,
stripLibs = fromFlag (configStripLibs cfg),
withSharedLib = withSharedLibs
}
-- This hack allows to interpret the "strip"
-- command-line argument being set to ':' to signify
-- disabled library stripping
cfg | strip == ":" = (configFlags lbi) { configStripLibs = toFlag False }
| otherwise = configFlags lbi
f pd lbi' us flags
doRegister :: FilePath -> FilePath -> FilePath -> FilePath
......
......@@ -17,7 +17,7 @@ Executable ghc-cabal
Build-Depends: base >= 3 && < 5,
bytestring >= 0.10 && < 0.11,
Cabal >= 1.18 && < 1.19,
Cabal >= 1.20 && < 1.21,
directory >= 1.1 && < 1.3,
filepath >= 1.2 && < 1.4
......@@ -20,7 +20,6 @@ import SrcLoc
import Distribution.Simple.GHC ( componentGhcOptions )
import Distribution.Simple.Configure ( getPersistBuildConfig )
import Distribution.Simple.Compiler ( compilerVersion )
import Distribution.Simple.Program.GHC ( renderGhcOptions )
import Distribution.PackageDescription ( library, libBuildInfo )
import Distribution.Simple.LocalBuildInfo
......@@ -191,8 +190,7 @@ flagsFromCabal distPref = do
let bi = libBuildInfo lib
odir = buildDir lbi
opts = componentGhcOptions V.normal lbi bi clbi odir
version = compilerVersion (compiler lbi)
in return $ renderGhcOptions version opts
in return $ renderGhcOptions (compiler lbi) opts
_ -> error "no library"
----------------------------------------------------------------
......
......@@ -17,6 +17,6 @@ Executable ghctags
Build-Depends: base >= 4 && < 5,
containers,
Cabal,
Cabal >= 1.20 && <1.21,
ghc
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