[Git][haskell-team/DHG_packages][master] stack: Upgrading from 2.3.3 to 2.7.5
Ilias Tsitsimpis (@iliastsi)
gitlab at salsa.debian.org
Wed Oct 26 09:03:55 BST 2022
Ilias Tsitsimpis pushed to branch master at Debian Haskell Group / DHG_packages
Commits:
4ba23fdd by Ilias Tsitsimpis at 2022-10-26T11:03:28+03:00
stack: Upgrading from 2.3.3 to 2.7.5
- - - - -
6 changed files:
- p/haskell-stack/debian/changelog
- p/haskell-stack/debian/control
- + p/haskell-stack/debian/patches/lts-19
- p/haskell-stack/debian/patches/remove-mintty.patch
- p/haskell-stack/debian/patches/series
- p/haskell-stack/debian/rules
Changes:
=====================================
p/haskell-stack/debian/changelog
=====================================
@@ -1,9 +1,10 @@
-haskell-stack (2.3.3-2) UNRELEASED; urgency=medium
+haskell-stack (2.7.5-1) unstable; urgency=medium
+ * New upstream release (Closes: #1011855)
* Declare compliance with Debian policy 4.6.1
* Remove retired developer, Joachim Breitner, from Uploaders.
- -- Ilias Tsitsimpis <iliastsi at debian.org> Tue, 28 Jun 2022 15:33:08 +0300
+ -- Ilias Tsitsimpis <iliastsi at debian.org> Wed, 26 Oct 2022 10:26:25 +0300
haskell-stack (2.3.3-1) unstable; urgency=medium
=====================================
p/haskell-stack/debian/control
=====================================
@@ -8,79 +8,76 @@ Rules-Requires-Root: no
Build-Depends:
cdbs,
debhelper (>= 10),
- haskell-devscripts (>= 0.13),
- ghc (>= 8.4.3),
- libghc-aeson-dev (>= 1.4.6.0),
+ haskell-devscripts,
+ ghc,
+ libghc-aeson-dev (>= 1.5.6.0),
libghc-annotated-wl-pprint-dev (>= 0.7.0),
- libghc-ansi-terminal-dev (>= 0.9.1),
- libghc-async-dev (>= 2.2.2),
- libghc-attoparsec-dev (>= 0.13.2.3),
- libghc-base64-bytestring-dev (>= 1.0.0.3),
+ libghc-ansi-terminal-dev (>= 0.10.3),
+ libghc-async-dev (>= 2.2.3),
+ libghc-attoparsec-dev (>= 0.13.2.5),
+ libghc-base64-bytestring-dev (>= 1.1.0.0),
libghc-casa-client-dev (>= 0.0.1),
libghc-casa-types-dev (>= 0.0.1),
libghc-colour-dev (>= 2.3.5),
- libghc-conduit-dev (>= 1.3.1.2),
- libghc-conduit-extra-dev (>= 1.3.4),
- libghc-cryptonite-dev (>= 0.25),
+ libghc-conduit-dev (>= 1.3.4.1),
+ libghc-conduit-extra-dev (>= 1.3.5),
+ libghc-cryptonite-dev (>= 0.27),
libghc-cryptonite-conduit-dev (>= 0.2.2),
- libghc-echo-dev (>= 0.1.3),
- libghc-exceptions-dev (>= 0.10.4),
- libghc-extra-dev (>= 1.6.19),
- libghc-file-embed-dev (>= 0.0.11.1),
+ libghc-echo-dev (>= 0.1.4),
+ libghc-extra-dev (>= 1.7.9),
+ libghc-file-embed-dev (>= 0.0.14.0),
libghc-filelock-dev (>= 0.1.1.5),
libghc-fsnotify-dev (>= 0.3.0.1),
- libghc-generic-deriving-dev (>= 1.12.4),
- libghc-hackage-security-dev (>= 0.5.3.0),
- libghc-hashable-dev (>= 1.2.7.0),
- libghc-hi-file-parser-dev (>= 0.1.0.0),
- libghc-hpack-dev (>= 0.33.0),
- libghc-http-client-dev (>= 0.6.4),
+ libghc-generic-deriving-dev (>= 1.13.1),
+ libghc-hackage-security-dev (>= 0.6.0.1),
+ libghc-hashable-dev (>= 1.3.0.0),
+ libghc-hi-file-parser-dev (>= 0.1.2.0),
+ libghc-hpack-dev (>= 0.34.4),
+ libghc-http-client-dev (>= 0.6.4.1),
libghc-http-client-tls-dev (>= 0.3.5.3),
- libghc-http-conduit-dev (>= 2.3.7.3),
+ libghc-http-conduit-dev (>= 2.3.8),
libghc-http-download-dev (>= 0.2.0.0),
libghc-http-types-dev (>= 0.12.3),
- libghc-memory-dev (>= 0.14.18),
- libghc-microlens-dev (>= 0.4.10),
+ libghc-memory-dev (>= 0.15.0),
+ libghc-microlens-dev (>= 0.4.11.2),
libghc-mono-traversable-dev (>= 1.0.15.1),
libghc-mustache-dev (>= 2.3.1),
- libghc-neat-interpolation-dev (>= 0.3.2.6),
- libghc-network-uri-dev (>= 2.6.2.0),
+ libghc-neat-interpolation-dev (>= 0.5.1.2),
+ libghc-network-uri-dev (>= 2.6.4.1),
libghc-open-browser-dev (>= 0.2.1.0),
libghc-optparse-applicative-dev (>= 0.14.3.0),
- libghc-pantry-dev (>= 0.4),
- libghc-pantry-dev (<< 0.5),
- libghc-path-dev (>= 0.6.1),
- libghc-path-io-dev (>= 1.4.2),
- libghc-persistent-dev (>= 2.9.2),
- libghc-persistent-sqlite-dev (>= 2.9.3),
- libghc-persistent-template-dev (>= 2.6.0),
- libghc-primitive-dev (>= 0.6.4.0),
- libghc-project-template-dev (>= 0.2.0.1),
- libghc-regex-applicative-text-dev (>= 0.1.0.1),
- libghc-retry-dev (>= 0.8.1.0),
- libghc-rio-dev (>= 0.1.14.0),
- libghc-rio-prettyprint-dev (>= 0.1.0.0),
- libghc-semigroups-dev (>= 0.18.5),
- libghc-split-dev (>= 0.2.3.3),
- libghc-streaming-commons-dev (>= 0.2.1.2),
+ libghc-pantry-dev (>= 0.5.3),
+ libghc-path-dev (>= 0.7.0),
+ libghc-path-io-dev (>= 1.6.3),
+ libghc-persistent-dev (>= 2.11.0.4),
+ libghc-persistent-sqlite-dev (>= 2.11.1.0),
+ libghc-persistent-template-dev (>= 2.9.1.0),
+ libghc-primitive-dev (>= 0.7.1.0),
+ libghc-project-template-dev (>= 0.2.1.0),
+ libghc-retry-dev (>= 0.8.1.2),
+ libghc-rio-dev (>= 0.1.21.0),
+ libghc-rio-prettyprint-dev (>= 0.1.1.0),
+ libghc-semigroups-dev (>= 0.19.1),
+ libghc-split-dev (>= 0.2.3.4),
+ libghc-streaming-commons-dev (>= 0.2.2.1),
libghc-tar-dev (>= 0.5.1.1),
libghc-temporary-dev (>= 1.3),
libghc-text-metrics-dev (>= 0.3.0),
libghc-th-reify-many-dev (>= 0.1.9),
- libghc-tls-dev (>= 1.4.1),
+ libghc-tls-dev (>= 1.5.5),
libghc-typed-process-dev (>= 0.2.6.0),
- libghc-unicode-transforms-dev (>= 0.3.6),
- libghc-unix-compat-dev (>= 0.5.2),
- libghc-unliftio-dev (>= 0.2.12),
- libghc-unordered-containers-dev (>= 0.2.10.0),
+ libghc-unicode-transforms-dev (>= 0.3.7.1),
+ libghc-unix-compat-dev (>= 0.5.3),
+ libghc-unliftio-dev (>= 0.2.18),
+ libghc-unordered-containers-dev (>= 0.2.14.0),
libghc-vector-dev (>= 0.12.1.2),
- libghc-yaml-dev (>= 0.11.2.0),
+ libghc-yaml-dev (>= 0.11.5.0),
libghc-zip-archive-dev (>= 0.4.1),
- libghc-zlib-dev (>= 0.6.2.1),
- libghc-quickcheck2-dev (>= 2.13.2),
- libghc-hspec-dev (>= 2.7.1),
+ libghc-zlib-dev (>= 0.6.2.3),
+ libghc-quickcheck2-dev (>= 2.14.2),
+ libghc-hspec-dev (>= 2.7.8),
libghc-raw-strings-qq-dev (>= 1.1),
- libghc-smallcheck-dev (>= 1.1.5),
+ libghc-smallcheck-dev (>= 1.2.1),
Standards-Version: 4.6.1
Homepage: https://haskellstack.org
Vcs-Browser: https://salsa.debian.org/haskell-team/DHG_packages/tree/master/p/haskell-stack
=====================================
p/haskell-stack/debian/patches/lts-19
=====================================
@@ -0,0 +1,694 @@
+commit a9f00ffe4908b7f55af938f5a85943859f1e7af4
+Author: Mike Pilgrem <mpilgrem at users.noreply.github.com>
+Date: Fri Apr 1 01:54:03 2022 +0100
+
+ Allow stack to build with lts-19.1 (GHC 9.0.2)
+
+ Uses C pre-processor (CPP) directives to not disturb the existing code that builds with versions of GHC before 9.0.2.
+
+ Tested by building stack on Windows 11. The built stack executable was, in turn, then tested by using it to build stack on Windows 11.
+
+Index: b/src/Stack/Build.hs
+===================================================================
+--- a/src/Stack/Build.hs
++++ b/src/Stack/Build.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
+ {-# LANGUAGE ConstraintKinds #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DeriveDataTypeable #-}
+ {-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE OverloadedStrings #-}
+@@ -19,7 +20,12 @@ module Stack.Build
+
+ import Stack.Prelude hiding (loadPackage)
+ import Data.Aeson (Value (Object, Array), (.=), object)
++#if MIN_VERSION_aeson(2,0,0)
++import qualified Data.Aeson.Key as Key
++import qualified Data.Aeson.KeyMap as KeyMap
++#else
+ import qualified Data.HashMap.Strict as HM
++#endif
+ import Data.List ((\\), isPrefixOf)
+ import Data.List.Extra (groupSort)
+ import qualified Data.List.NonEmpty as NE
+@@ -293,7 +299,11 @@ queryBuildInfo selectors0 =
+ select front (sel:sels) value =
+ case value of
+ Object o ->
++#if MIN_VERSION_aeson(2,0,0)
++ case KeyMap.lookup (Key.fromText sel) o of
++#else
+ case HM.lookup sel o of
++#endif
+ Nothing -> err "Selector not found"
+ Just value' -> cont value'
+ Array v ->
+@@ -328,7 +338,11 @@ rawBuildInfo = do
+ wantedCompiler <- view $ wantedCompilerVersionL.to (utf8BuilderToText . display)
+ actualCompiler <- view $ actualCompilerVersionL.to compilerVersionText
+ return $ object
++#if MIN_VERSION_aeson(2,0,0)
++ [ "locals" .= Object (KeyMap.fromList $ map localToPair locals)
++#else
+ [ "locals" .= Object (HM.fromList $ map localToPair locals)
++#endif
+ , "compiler" .= object
+ [ "wanted" .= wantedCompiler
+ , "actual" .= actualCompiler
+@@ -336,7 +350,11 @@ rawBuildInfo = do
+ ]
+ where
+ localToPair lp =
++#if MIN_VERSION_aeson(2,0,0)
++ (Key.fromText $ T.pack $ packageNameString $ packageName p, value)
++#else
+ (T.pack $ packageNameString $ packageName p, value)
++#endif
+ where
+ p = lpPackage lp
+ value = object
+@@ -358,7 +376,11 @@ checkComponentsBuildable lps =
+ checkSubLibraryDependencies :: HasLogFunc env => [ProjectPackage] -> RIO env ()
+ checkSubLibraryDependencies proj = do
+ forM_ proj $ \p -> do
++#if MIN_VERSION_Cabal(3,4,0)
++ C.GenericPackageDescription _ _ _ lib subLibs foreignLibs exes tests benches <- liftIO $ cpGPD . ppCommon $ p
++#else
+ C.GenericPackageDescription _ _ lib subLibs foreignLibs exes tests benches <- liftIO $ cpGPD . ppCommon $ p
++#endif
+
+ let dependencies = concatMap getDeps subLibs <>
+ concatMap getDeps foreignLibs <>
+@@ -372,7 +394,7 @@ checkSubLibraryDependencies proj = do
+ (logWarn "SubLibrary dependency is not supported, this will almost certainly fail")
+ where
+ getDeps (_, C.CondNode _ dep _) = dep
+- subLibDepExist lib =
++ subLibDepExist lib =
+ any (\x ->
+ case x of
+ C.LSubLibName _ -> True
+Index: b/src/Stack/Build/Execute.hs
+===================================================================
+--- a/src/Stack/Build/Execute.hs
++++ b/src/Stack/Build/Execute.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
+ {-# LANGUAGE ConstraintKinds #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DataKinds #-}
+ {-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE MultiParamTypeClasses #-}
+@@ -1218,7 +1219,11 @@ withSingleContext ActionContext {..} ee@
+ let macroDeps = mapMaybe snd matchedDeps
+ cppMacrosFile = setupDir </> relFileSetupMacrosH
+ cppArgs = ["-optP-include", "-optP" ++ toFilePath cppMacrosFile]
++#if MIN_VERSION_Cabal(3,4,0)
++ writeBinaryFileAtomic cppMacrosFile (encodeUtf8Builder (T.pack (C.generatePackageVersionMacros (packageVersion package) macroDeps)))
++#else
+ writeBinaryFileAtomic cppMacrosFile (encodeUtf8Builder (T.pack (C.generatePackageVersionMacros macroDeps)))
++#endif
+ return (packageDBArgs ++ depsArgs ++ cppArgs)
+
+ -- This branch is usually taken for builds, and
+Index: b/src/Stack/BuildPlan.hs
+===================================================================
+--- a/src/Stack/BuildPlan.hs
++++ b/src/Stack/BuildPlan.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
+ {-# LANGUAGE ConstraintKinds #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DataKinds #-}
+ {-# LANGUAGE DeriveDataTypeable #-}
+ {-# LANGUAGE FlexibleContexts #-}
+@@ -224,7 +225,11 @@ selectPackageBuildPlan platform compiler
+ flagCombinations :: NonEmpty [(FlagName, Bool)]
+ flagCombinations = mapM getOptions (genPackageFlags gpd)
+ where
++#if MIN_VERSION_Cabal(3,4,0)
++ getOptions :: C.PackageFlag -> NonEmpty (FlagName, Bool)
++#else
+ getOptions :: C.Flag -> NonEmpty (FlagName, Bool)
++#endif
+ getOptions f
+ | flagManual f = (fname, flagDefault f) :| []
+ | flagDefault f = (fname, True) :| [(fname, False)]
+Index: b/src/Stack/ConfigCmd.hs
+===================================================================
+--- a/src/Stack/ConfigCmd.hs
++++ b/src/Stack/ConfigCmd.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
+ {-# LANGUAGE ConstraintKinds #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE OverloadedStrings #-}
+ {-# LANGUAGE ScopedTypeVariables #-}
+@@ -17,9 +18,15 @@ module Stack.ConfigCmd
+ ,cfgCmdName) where
+
+ import Stack.Prelude
++#if MIN_VERSION_aeson(2,0,0)
++import qualified Data.Aeson.Key as Key
++import qualified Data.Aeson.KeyMap as KeyMap
++#endif
+ import Data.ByteString.Builder (byteString)
+ import qualified Data.Map.Merge.Strict as Map
++#if !MIN_VERSION_aeson(2,0,0)
+ import qualified Data.HashMap.Strict as HMap
++#endif
+ import qualified Data.Text as T
+ import qualified Data.Yaml as Yaml
+ import qualified Options.Applicative as OA
+@@ -74,7 +81,11 @@ cfgCmdSet cmd = do
+ liftIO (Yaml.decodeFileEither (toFilePath configFilePath)) >>= either throwM return
+ newValue <- cfgCmdSetValue (parent configFilePath) cmd
+ let cmdKey = cfgCmdSetOptionName cmd
++#if MIN_VERSION_aeson(2,0,0)
++ config' = KeyMap.insert (Key.fromText cmdKey) newValue config
++#else
+ config' = HMap.insert cmdKey newValue config
++#endif
+ if config' == config
+ then logInfo
+ (fromString (toFilePath configFilePath) <>
+Index: b/src/Stack/Init.hs
+===================================================================
+--- a/src/Stack/Init.hs
++++ b/src/Stack/Init.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
+ {-# LANGUAGE ConstraintKinds #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE MultiParamTypeClasses #-}
+ {-# LANGUAGE OverloadedStrings #-}
+@@ -11,10 +12,15 @@ module Stack.Init
+ ) where
+
+ import Stack.Prelude
++#if MIN_VERSION_aeson(2,0,0)
++import qualified Data.Aeson.KeyMap as KeyMap
++#endif
+ import qualified Data.ByteString.Builder as B
+ import qualified Data.ByteString.Char8 as BC
+ import qualified Data.Foldable as F
++#if !MIN_VERSION_aeson(2,0,0)
+ import qualified Data.HashMap.Strict as HM
++#endif
+ import qualified Data.IntMap as IntMap
+ import Data.List.Extra (groupSortOn)
+ import qualified Data.List.NonEmpty as NonEmpty
+@@ -83,29 +89,29 @@ initProject currDir initOpts mresolver =
+ let ignored = Map.difference bundle rbundle
+ dupPkgMsg
+ | dupPkgs /= [] =
+- "Warning (added by new or init): Some packages were found to \
+- \have names conflicting with others and have been commented \
+- \out in the packages section.\n"
++ "Warning (added by new or init): Some packages were found to " <>
++ "have names conflicting with others and have been commented " <>
++ "out in the packages section.\n"
+ | otherwise = ""
+
+ missingPkgMsg
+ | Map.size ignored > 0 =
+- "Warning (added by new or init): Some packages were found to \
+- \be incompatible with the resolver and have been left commented \
+- \out in the packages section.\n"
++ "Warning (added by new or init): Some packages were found to " <>
++ "be incompatible with the resolver and have been left commented " <>
++ "out in the packages section.\n"
+ | otherwise = ""
+
+ extraDepMsg
+ | Map.size extraDeps > 0 =
+- "Warning (added by new or init): Specified resolver could not \
+- \satisfy all dependencies. Some external packages have been \
+- \added as dependencies.\n"
++ "Warning (added by new or init): Specified resolver could not " <>
++ "satisfy all dependencies. Some external packages have been " <>
++ "added as dependencies.\n"
+ | otherwise = ""
+ makeUserMsg msgs =
+ let msg = concat msgs
+ in if msg /= "" then
+- msg <> "You can omit this message by removing it from \
+- \stack.yaml\n"
++ msg <> "You can omit this message by removing it from " <>
++ "stack.yaml\n"
+ else ""
+
+ userMsg = makeUserMsg [dupPkgMsg, missingPkgMsg, extraDepMsg]
+@@ -177,12 +183,20 @@ renderStackYaml p ignoredPackages dupPac
+ B.byteString headerHelp
+ <> B.byteString "\n\n"
+ <> F.foldMap (goComment o) comments
++#if MIN_VERSION_aeson(2,0,0)
++ <> goOthers (o `KeyMap.difference` KeyMap.fromList comments)
++#else
+ <> goOthers (o `HM.difference` HM.fromList comments)
++#endif
+ <> B.byteString footerHelp
+ <> "\n"
+
+ goComment o (name, comment) =
++#if MIN_VERSION_aeson(2,0,0)
++ case (convert <$> KeyMap.lookup name o) <|> nonPresentValue name of
++#else
+ case (convert <$> HM.lookup name o) <|> nonPresentValue name of
++#endif
+ Nothing -> assert (name == "user-message") mempty
+ Just v ->
+ B.byteString comment <>
+@@ -226,7 +240,11 @@ renderStackYaml p ignoredPackages dupPac
+ | otherwise = ""
+
+ goOthers o
++#if MIN_VERSION_aeson(2,0,0)
++ | KeyMap.null o = mempty
++#else
+ | HM.null o = mempty
++#endif
+ | otherwise = assert False $ B.byteString $ Yaml.encode o
+
+ -- Per Section Help
+@@ -394,9 +412,9 @@ getWorkingResolverPlan initOpts pkgDirs0
+ Right (f, edeps)-> return (snapLoc, f, edeps, pkgDirs)
+ Left ignored
+ | Map.null available -> do
+- logWarn "*** Could not find a working plan for any of \
+- \the user packages.\nProceeding to create a \
+- \config anyway."
++ logWarn $ "*** Could not find a working plan for any of " <>
++ "the user packages.\nProceeding to create a " <>
++ "config anyway."
+ return (snapLoc, Map.empty, Map.empty, Map.empty)
+ | otherwise -> do
+ when (Map.size available == Map.size pkgDirs) $
+@@ -537,9 +555,9 @@ cabalPackagesCheck cabaldirs dupErrMsg =
+
+ when (nameMismatchPkgs /= []) $ do
+ rels <- mapM prettyPath nameMismatchPkgs
+- error $ "Package name as defined in the .cabal file must match the \
+- \.cabal file name.\n\
+- \Please fix the following packages and try again:\n"
++ error $ "Package name as defined in the .cabal file must match the " <>
++ ".cabal file name.\n" <>
++ "Please fix the following packages and try again:\n"
+ <> T.unpack (utf8BuilderToText (formatGroup rels))
+
+ let dupGroups = filter ((> 1) . length)
+Index: b/src/Stack/New.hs
+===================================================================
+--- a/src/Stack/New.hs
++++ b/src/Stack/New.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
+ {-# LANGUAGE ConstraintKinds #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE ScopedTypeVariables #-}
+ {-# LANGUAGE DeriveDataTypeable #-}
+ {-# LANGUAGE FlexibleContexts #-}
+@@ -18,6 +19,9 @@ module Stack.New
+ import Stack.Prelude
+ import Control.Monad.Trans.Writer.Strict
+ import Data.Aeson as A
++#if MIN_VERSION_aeson(2,0,0)
++import qualified Data.Aeson.KeyMap as KeyMap
++#endif
+ import qualified Data.ByteString.Base64 as B64
+ import Data.ByteString.Builder (lazyByteString)
+ import qualified Data.ByteString.Lazy as LB
+@@ -40,7 +44,9 @@ import Stack.Constants
+ import Stack.Constants.Config
+ import Stack.Types.Config
+ import Stack.Types.TemplateName
++#if !MIN_VERSION_aeson(2,0,0)
+ import qualified RIO.HashMap as HM
++#endif
+ import RIO.Process
+ import qualified Text.Mustache as Mustache
+ import qualified Text.Mustache.Render as Mustache
+@@ -139,7 +145,7 @@ loadTemplate name logIt = do
+ RepoPath rtp -> do
+ let settings = settingsFromRepoTemplatePath rtp
+ downloadFromUrl settings templateDir
+-
++
+ where
+ loadLocalFile :: Path b File -> (ByteString -> Either String Text) -> RIO env Text
+ loadLocalFile path extract = do
+@@ -209,7 +215,11 @@ settingsFromRepoTemplatePath (RepoTempla
+ , tplExtract = \bs -> do
+ decodedJson <- eitherDecode (LB.fromStrict bs)
+ case decodedJson of
++#if MIN_VERSION_aeson(2,0,0)
++ Object o | Just (String content) <- KeyMap.lookup "content" o -> do
++#else
+ Object o | Just (String content) <- HM.lookup "content" o -> do
++#endif
+ let noNewlines = T.filter (/= '\n')
+ bsContent <- B64.decode $ T.encodeUtf8 (noNewlines content)
+ mapLeft show $ decodeUtf8' bsContent
+@@ -258,8 +268,8 @@ applyTemplate project template noncePara
+
+ let isPkgSpec f = ".cabal" `isSuffixOf` f || f == "package.yaml"
+ unless (any isPkgSpec . M.keys $ files) $
+- throwM (InvalidTemplate template "Template does not contain a .cabal \
+- \or package.yaml file")
++ throwM (InvalidTemplate template
++ "Template does not contain a .cabal or package.yaml file")
+
+ -- Apply Mustache templating to a single file within the project
+ -- template.
+Index: b/src/Stack/Package.hs
+===================================================================
+--- a/src/Stack/Package.hs
++++ b/src/Stack/Package.hs
+@@ -32,6 +32,9 @@ import Data.List (find, isPref
+ import qualified Data.Map.Strict as M
+ import qualified Data.Set as S
+ import qualified Data.Text as T
++#if MIN_VERSION_Cabal(3,4,0)
++import Distribution.CabalSpecVersion
++#endif
+ import Distribution.Compiler
+ import Distribution.ModuleName (ModuleName)
+ import qualified Distribution.ModuleName as Cabal
+@@ -128,7 +131,11 @@ resolvePackage packageConfig gpkg =
+ (resolvePackageDescription packageConfig gpkg)
+
+ packageFromPackageDescription :: PackageConfig
++#if MIN_VERSION_Cabal(3,4,0)
++ -> [PackageFlag]
++#else
+ -> [D.Flag]
++#endif
+ -> PackageDescriptionPair
+ -> Package
+ packageFromPackageDescription packageConfig pkgFlags (PackageDescriptionPair pkgNoMod pkg) =
+@@ -190,7 +197,11 @@ packageFromPackageDescription packageCon
+ (library pkg)
+ , packageBuildType = buildType pkg
+ , packageSetupDeps = msetupDeps
++#if MIN_VERSION_Cabal(3,4,0)
++ , packageCabalSpec = specVersion pkg
++#else
+ , packageCabalSpec = either orLaterVersion id $ specVersionRaw pkg
++#endif
+ }
+ where
+ extraLibNames = S.union subLibNames foreignLibNames
+@@ -696,7 +707,11 @@ packageDescModulesAndFiles pkg = do
+
+ -- | Resolve globbing of files (e.g. data files) to absolute paths.
+ resolveGlobFiles
++#if MIN_VERSION_Cabal(3,4,0)
++ :: CabalSpecVersion -- ^ cabal file version
++#else
+ :: Version -- ^ cabal file version
++#endif
+ -> [String]
+ -> RIO Ctx (Set (Path Abs File))
+ resolveGlobFiles cabalFileVersion =
+@@ -862,7 +877,11 @@ data PackageDescriptionPair = PackageDes
+ resolvePackageDescription :: PackageConfig
+ -> GenericPackageDescription
+ -> PackageDescriptionPair
++#if MIN_VERSION_Cabal(3,4,0)
++resolvePackageDescription packageConfig (GenericPackageDescription desc _ defaultFlags mlib subLibs foreignLibs' exes tests benches) =
++#else
+ resolvePackageDescription packageConfig (GenericPackageDescription desc defaultFlags mlib subLibs foreignLibs' exes tests benches) =
++#endif
+ PackageDescriptionPair
+ { pdpOrigBuildable = go False
+ , pdpModifiedBuildable = go True
+@@ -935,9 +954,17 @@ resolvePackageDescription packageConfig
+ -- | Make a map from a list of flag specifications.
+ --
+ -- What is @flagManual@ for?
++#if MIN_VERSION_Cabal(3,4,0)
++flagMap :: [PackageFlag] -> Map FlagName Bool
++#else
+ flagMap :: [Flag] -> Map FlagName Bool
++#endif
+ flagMap = M.fromList . map pair
++#if MIN_VERSION_Cabal(3,4,0)
++ where pair :: PackageFlag -> (FlagName, Bool)
++#else
+ where pair :: Flag -> (FlagName, Bool)
++#endif
+ pair = flagName &&& flagDefault
+
+ data ResolveConditions = ResolveConditions
+@@ -986,7 +1013,11 @@ resolveConditions rc addDeps (CondNode l
+ case v of
+ OS os -> os == rcOS rc
+ Arch arch -> arch == rcArch rc
++#if MIN_VERSION_Cabal(3,4,0)
++ PackageFlag flag ->
++#else
+ Flag flag ->
++#endif
+ fromMaybe False $ M.lookup flag (rcFlags rc)
+ -- NOTE: ^^^^^ This should never happen, as all flags
+ -- which are used must be declared. Defaulting to
+@@ -1394,7 +1425,13 @@ applyForceCustomBuild cabalVersion packa
+ }
+ | otherwise = package
+ where
++#if MIN_VERSION_Cabal(3,4,0)
++ cabalVersionRange =
++ orLaterVersion $ mkVersion $ cabalSpecToVersionDigits $
++ packageCabalSpec package
++#else
+ cabalVersionRange = packageCabalSpec package
++#endif
+ forceCustomBuild =
+ packageBuildType package == Simple &&
+ not (cabalVersion `withinRange` cabalVersionRange)
+Index: b/src/Stack/Script.hs
+===================================================================
+--- a/src/Stack/Script.hs
++++ b/src/Stack/Script.hs
+@@ -18,6 +18,9 @@ import Distribution.Compiler
+ import Distribution.ModuleName (ModuleName)
+ import qualified Distribution.PackageDescription as PD
+ import qualified Distribution.Types.CondTree as C
++#if MIN_VERSION_Cabal(3,4,0)
++import Distribution.Types.ModuleReexport
++#endif
+ import Distribution.Types.PackageName (mkPackageName)
+ import Distribution.Types.VersionRange (withinRange)
+ import Distribution.System (Platform (..))
+@@ -280,7 +283,11 @@ allExposedModules gpd = do
+ mlibrary = snd . C.simplifyCondTree checkCond <$> PD.condLibrary gpd
+ pure $ case mlibrary of
+ Just lib -> PD.exposedModules lib ++
++#if MIN_VERSION_Cabal(3,4,0)
++ map moduleReexportName (PD.reexportedModules lib)
++#else
+ map PD.moduleReexportName (PD.reexportedModules lib)
++#endif
+ Nothing -> mempty
+
+ -- | The Stackage project introduced the concept of hidden packages,
+Index: b/src/Stack/Setup.hs
+===================================================================
+--- a/src/Stack/Setup.hs
++++ b/src/Stack/Setup.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
+ {-# LANGUAGE ConstraintKinds #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DataKinds #-}
+ {-# LANGUAGE DeriveFunctor #-}
+ {-# LANGUAGE FlexibleContexts #-}
+@@ -33,6 +34,9 @@ import Conduit
+ import Control.Applicative (empty)
+ import "cryptonite" Crypto.Hash (SHA1(..), SHA256(..))
+ import Pantry.Internal.AesonExtended
++#if MIN_VERSION_aeson(2,0,0)
++import qualified Data.Aeson.KeyMap as KeyMap
++#endif
+ import qualified Data.ByteString as S
+ import qualified Data.ByteString.Lazy as LBS
+ import qualified Data.Conduit.Binary as CB
+@@ -41,7 +45,9 @@ import qualified Data.Conduit.List as
+ import Data.Conduit.Process.Typed (createSource)
+ import Data.Conduit.Zlib (ungzip)
+ import Data.Foldable (maximumBy)
++#if !MIN_VERSION_aeson(2,0,0)
+ import qualified Data.HashMap.Strict as HashMap
++#endif
+ import Data.List hiding (concat, elem, maximumBy, any)
+ import qualified Data.Map as Map
+ import qualified Data.Set as Set
+@@ -1988,16 +1994,28 @@ downloadStackExe platforms0 archiveInfo
+
+ findArchive (SRIGithub val) pattern = do
+ Object top <- return val
++#if MIN_VERSION_aeson(2,0,0)
++ Array assets <- KeyMap.lookup "assets" top
++#else
+ Array assets <- HashMap.lookup "assets" top
++#endif
+ getFirst $ fold $ fmap (First . findMatch pattern') assets
+ where
+ pattern' = mconcat ["-", pattern, "."]
+
+ findMatch pattern'' (Object o) = do
++#if MIN_VERSION_aeson(2,0,0)
++ String name <- KeyMap.lookup "name" o
++#else
+ String name <- HashMap.lookup "name" o
++#endif
+ guard $ not $ ".asc" `T.isSuffixOf` name
+ guard $ pattern'' `T.isInfixOf` name
++#if MIN_VERSION_aeson(2,0,0)
++ String url <- KeyMap.lookup "browser_download_url" o
++#else
+ String url <- HashMap.lookup "browser_download_url" o
++#endif
+ Just url
+ findMatch _ _ = Nothing
+ findArchive (SRIHaskellStackOrg hso) _ = pure $ hsoUrl hso
+@@ -2095,7 +2113,11 @@ performPathChecking newFile executablePa
+ getDownloadVersion :: StackReleaseInfo -> Maybe Version
+ getDownloadVersion (SRIGithub val) = do
+ Object o <- Just val
++#if MIN_VERSION_aeson(2,0,0)
++ String rawName <- KeyMap.lookup "name" o
++#else
+ String rawName <- HashMap.lookup "name" o
++#endif
+ -- drop the "v" at the beginning of the name
+ parseVersion $ T.unpack (T.drop 1 rawName)
+ getDownloadVersion (SRIHaskellStackOrg hso) = Just $ hsoVersion hso
+Index: b/src/Stack/Types/Package.hs
+===================================================================
+--- a/src/Stack/Types/Package.hs
++++ b/src/Stack/Types/Package.hs
+@@ -1,4 +1,5 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DeriveFunctor #-}
+ {-# LANGUAGE DeriveGeneric #-}
+ {-# LANGUAGE DeriveDataTypeable #-}
+@@ -15,6 +16,9 @@ import qualified RIO.Text as T
+ import Data.Aeson (ToJSON (..), FromJSON (..), (.=), (.:), object, withObject)
+ import qualified Data.Map as M
+ import qualified Data.Set as Set
++#if MIN_VERSION_Cabal(3,4,0)
++import Distribution.CabalSpecVersion
++#endif
+ import Distribution.Parsec (PError (..), PWarning (..), showPos)
+ import qualified Distribution.SPDX.License as SPDX
+ import Distribution.License (License)
+@@ -114,7 +118,11 @@ data Package =
+ ,packageBuildType :: !BuildType -- ^ Package build-type.
+ ,packageSetupDeps :: !(Maybe (Map PackageName VersionRange))
+ -- ^ If present: custom-setup dependencies
++#if MIN_VERSION_Cabal(3,4,0)
++ ,packageCabalSpec :: !CabalSpecVersion -- ^ Cabal spec range
++#else
+ ,packageCabalSpec :: !VersionRange -- ^ Cabal spec range
++#endif
+ }
+ deriving (Show,Typeable)
+
+Index: b/src/Stack/Types/Resolver.hs
+===================================================================
+--- a/src/Stack/Types/Resolver.hs
++++ b/src/Stack/Types/Resolver.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE NoImplicitPrelude #-}
+ {-# LANGUAGE ConstraintKinds #-}
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DeriveDataTypeable #-}
+ {-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE FlexibleInstances #-}
+@@ -19,7 +20,12 @@ module Stack.Types.Resolver
+ import Pantry.Internal.AesonExtended
+ (FromJSON, parseJSON,
+ withObject, (.:), withText)
++#if MIN_VERSION_aeson(2,0,0)
++import qualified Data.Aeson.Key as Key
++import qualified Data.Aeson.KeyMap as KeyMap
++#else
+ import qualified Data.HashMap.Strict as HashMap
++#endif
+ import qualified Data.IntMap.Strict as IntMap
+ import qualified Data.Text as T
+ import Data.Text.Read (decimal)
+@@ -86,8 +92,13 @@ instance FromJSON Snapshots where
+ parseJSON = withObject "Snapshots" $ \o -> Snapshots
+ <$> (o .: "nightly" >>= parseNightly)
+ <*> fmap IntMap.unions (mapM (parseLTS . snd)
++#if MIN_VERSION_aeson(2,0,0)
++ $ filter (isLTS . Key.toText . fst)
++ $ KeyMap.toList o)
++#else
+ $ filter (isLTS . fst)
+ $ HashMap.toList o)
++#endif
+ where
+ parseNightly t =
+ case parseSnapName t of
+Index: b/stack-ghc-902.yaml
+===================================================================
+--- /dev/null
++++ b/stack-ghc-902.yaml
+@@ -0,0 +1,27 @@
++resolver: lts-19.1
++
++packages:
++- .
++
++docker:
++ enable: false
++ repo: fpco/alpine-haskell-stack:8.10.4
++
++nix:
++ # --nix on the command-line to enable.
++ packages:
++ - zlib
++ - unzip
++flags:
++ stack:
++ developer-mode: true
++
++ghc-options:
++ "$locals": -fhide-source-paths
++
++extra-deps:
++- mustache-2.4.0 at sha256:09a2eac7b8d093231cd8c5355dc87d7f882be77aebf88de18c4d9e612beca453,3345
++- unordered-containers-0.2.16.0 at sha256:859ec9a017e51194755cb8a445b767afc5ce0ac991cd50b0f96abd31b3687aab,5217
++drop-packages:
++# See https://github.com/commercialhaskell/stack/pull/4712
++- cabal-install
+Index: b/stack.cabal
+===================================================================
+--- a/stack.cabal
++++ b/stack.cabal
+@@ -474,6 +474,8 @@ executable stack-integration-test
+ other-modules:
+ StackTest
+ Paths_stack
++ autogen-modules:
++ Paths_stack
+
+ default-language: Haskell2010
+ ghc-options:
+@@ -608,6 +610,8 @@ test-suite stack-test
+ Stack.Types.TemplateNameSpec
+ Stack.UploadSpec
+ Paths_stack
++ autogen-modules:
++ Paths_stack
+
+ default-language: Haskell2010
+ ghc-options:
=====================================
p/haskell-stack/debian/patches/remove-mintty.patch
=====================================
@@ -2,36 +2,38 @@ Description: Remove windows-used mintty dependency
Author: Gianfranco Costamagna <locutusofborg at debian.org>
Last-Update: 2018-01-03
+Index: b/stack.cabal
+===================================================================
--- a/stack.cabal
+++ b/stack.cabal
-@@ -268,7 +268,6 @@
+@@ -270,7 +270,6 @@ library
http-types >=0.12.3,
- memory >=0.14.18,
- microlens >=0.4.10,
+ memory >=0.15.0,
+ microlens >=0.4.11.2,
- mintty >=0.1.2,
mono-traversable >=1.0.15.1,
mtl >=2.2.2,
mustache >=2.3.1,
-@@ -395,7 +394,6 @@
+@@ -396,7 +395,6 @@ executable stack
http-types >=0.12.3,
- memory >=0.14.18,
- microlens >=0.4.10,
+ memory >=0.15.0,
+ microlens >=0.4.11.2,
- mintty >=0.1.2,
mono-traversable >=1.0.15.1,
mtl >=2.2.2,
mustache >=2.3.1,
-@@ -525,7 +523,6 @@
+@@ -525,7 +523,6 @@ executable stack-integration-test
http-types >=0.12.3,
- memory >=0.14.18,
- microlens >=0.4.10,
+ memory >=0.15.0,
+ microlens >=0.4.11.2,
- mintty >=0.1.2,
mono-traversable >=1.0.15.1,
mtl >=2.2.2,
mustache >=2.3.1,
-@@ -661,7 +658,6 @@
+@@ -661,7 +658,6 @@ test-suite stack-test
http-types >=0.12.3,
- memory >=0.14.18,
- microlens >=0.4.10,
+ memory >=0.15.0,
+ microlens >=0.4.11.2,
- mintty >=0.1.2,
mono-traversable >=1.0.15.1,
mtl >=2.2.2,
=====================================
p/haskell-stack/debian/patches/series
=====================================
@@ -1 +1,2 @@
remove-mintty.patch
+lts-19
=====================================
p/haskell-stack/debian/rules
=====================================
@@ -9,3 +9,6 @@ include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/hlibrary.mk
build/haskell-stack :: build-ghc-stamp
+
+# Tests need a HOME
+check-ghc-stamp: export HOME := $(CURDIR)/debian/fake-home
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/4ba23fdd5d2e3f201154b92aea835d2b4f644740
--
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/4ba23fdd5d2e3f201154b92aea835d2b4f644740
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20221026/c9b5c290/attachment-0001.htm>
More information about the Pkg-haskell-commits
mailing list