From d45e528aa56f900d372e7986c7af94a8ad95dec5 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Fri, 26 Jan 2024 22:17:03 -0800 Subject: [PATCH] stack: add more version constraints to fix build --- srcpkgs/stack/patches/fix-build-text.patch | 20 +++++++++++ srcpkgs/stack/patches/hsubparser.patch | 26 ++++++++++++++ srcpkgs/stack/patches/http-download.patch | 40 ++++++++++++++++++++++ srcpkgs/stack/patches/pantry.patch | 40 ++++++++++++++++++++++ srcpkgs/stack/patches/unix-compat.patch | 40 ++++++++++++++++++++++ srcpkgs/stack/template | 2 +- 6 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/stack/patches/fix-build-text.patch create mode 100644 srcpkgs/stack/patches/hsubparser.patch create mode 100644 srcpkgs/stack/patches/http-download.patch create mode 100644 srcpkgs/stack/patches/pantry.patch create mode 100644 srcpkgs/stack/patches/unix-compat.patch diff --git a/srcpkgs/stack/patches/fix-build-text.patch b/srcpkgs/stack/patches/fix-build-text.patch new file mode 100644 index 00000000000..bc3483640b7 --- /dev/null +++ b/srcpkgs/stack/patches/fix-build-text.patch @@ -0,0 +1,20 @@ +--- a/src/Stack/Build/Execute.hs ++++ b/src/Stack/Build/Execute.hs +@@ -26,7 +26,7 @@ import Control.Concurrent.Exec + import Control.Concurrent.STM (check) + import Stack.Prelude hiding (Display (..)) + import Crypto.Hash +-import Data.Attoparsec.Text hiding (try) ++import Data.Attoparsec.Text as P hiding (try) + import qualified Data.ByteArray as Mem (convert) + import qualified Data.ByteString as S + import qualified Data.ByteString.Builder +@@ -2160,7 +2160,7 @@ mungeBuildOutput excludeTHLoading makeAb + lineCol = char ':' + >> choice + [ num >> char ':' >> num >> optional (char '-' >> num) >> return () +- , char '(' >> num >> char ',' >> num >> string ")-(" >> num >> char ',' >> num >> char ')' >> return () ++ , char '(' >> num >> char ',' >> num >> P.string ")-(" >> num >> char ',' >> num >> char ')' >> return () + ] + >> char ':' + >> return () diff --git a/srcpkgs/stack/patches/hsubparser.patch b/srcpkgs/stack/patches/hsubparser.patch new file mode 100644 index 00000000000..3a4a389324a --- /dev/null +++ b/srcpkgs/stack/patches/hsubparser.patch @@ -0,0 +1,26 @@ +Adapted from: https://github.com/commercialhaskell/stack/commit/4afcf774d2a821e69b6a1afca67bf34341c84e85 + +--- a/src/Options/Applicative/Complicated.hs ++++ b/src/Options/Applicative/Complicated.hs +@@ -136,20 +136,9 @@ complicatedParser commandMetavar commonP + (,) <$> + commonParser <*> + case runWriter (runExceptT commandParser) of +- (Right (),d) -> hsubparser' commandMetavar d ++ (Right (), m) -> hsubparser (m <> metavar commandMetavar) + (Left b,_) -> pure (b,mempty) + +--- | Subparser with @--help@ argument. Borrowed with slight modification +--- from Options.Applicative.Extra. +-hsubparser' :: String -> Mod CommandFields a -> Parser a +-hsubparser' commandMetavar m = mkParser d g rdr +- where +- Mod _ d g = metavar commandMetavar `mappend` m +- (groupName, cmds, subs) = mkCommand m +- rdr = CmdReader groupName cmds (fmap add_helper . subs) +- add_helper pinfo = pinfo +- { infoParser = infoParser pinfo <**> helpOption } +- + -- | Non-hidden help option. + helpOption :: Parser (a -> a) + helpOption = diff --git a/srcpkgs/stack/patches/http-download.patch b/srcpkgs/stack/patches/http-download.patch new file mode 100644 index 00000000000..07061bc7fba --- /dev/null +++ b/srcpkgs/stack/patches/http-download.patch @@ -0,0 +1,40 @@ +constrain http-download to prevent build failures + +--- a/stack.cabal ++++ b/stack.cabal +@@ -267,7 +267,7 @@ library + http-client >=0.6.4.1, + http-client-tls >=0.3.5.3, + http-conduit >=2.3.8, +- http-download >=0.2.0.0, ++ http-download >=0.2.0.0 && <0.2.1, + http-types >=0.12.3, + memory >=0.15.0, + microlens >=0.4.11.2, +@@ -393,7 +393,7 @@ executable stack + http-client >=0.6.4.1, + http-client-tls >=0.3.5.3, + http-conduit >=2.3.8, +- http-download >=0.2.0.0, ++ http-download >=0.2.0.0 && <0.2.1, + http-types >=0.12.3, + memory >=0.15.0, + microlens >=0.4.11.2, +@@ -522,7 +522,7 @@ executable stack-integration-test + http-client >=0.6.4.1, + http-client-tls >=0.3.5.3, + http-conduit >=2.3.8, +- http-download >=0.2.0.0, ++ http-download >=0.2.0.0 && <0.2.1, + http-types >=0.12.3, + memory >=0.15.0, + microlens >=0.4.11.2, +@@ -658,7 +658,7 @@ test-suite stack-test + http-client >=0.6.4.1, + http-client-tls >=0.3.5.3, + http-conduit >=2.3.8, +- http-download >=0.2.0.0, ++ http-download >=0.2.0.0 && <0.2.1, + http-types >=0.12.3, + memory >=0.15.0, + microlens >=0.4.11.2, diff --git a/srcpkgs/stack/patches/pantry.patch b/srcpkgs/stack/patches/pantry.patch new file mode 100644 index 00000000000..ab967914ea0 --- /dev/null +++ b/srcpkgs/stack/patches/pantry.patch @@ -0,0 +1,40 @@ +constrain pantry to prevent build failures + +--- a/stack.cabal ++++ b/stack.cabal +@@ -279,7 +279,7 @@ library + network-uri >=2.6.4.1, + open-browser >=0.2.1.0, + optparse-applicative >=0.14.3.0, +- pantry >=0.5.3, ++ pantry >=0.5.3 && <0.6.0, + path >=0.7.0, + path-io >=1.6.3, + persistent >=2.11.0.4 && <2.14.0.0, +@@ -405,7 +405,7 @@ executable stack + network-uri >=2.6.4.1, + open-browser >=0.2.1.0, + optparse-applicative >=0.14.3.0, +- pantry >=0.5.3, ++ pantry >=0.5.3 && <0.6.0, + path >=0.7.0, + path-io >=1.6.3, + persistent >=2.11.0.4 && <2.14.0.0, +@@ -535,7 +535,7 @@ executable stack-integration-test + open-browser >=0.2.1.0, + optparse-applicative >=0.14.3.0, + optparse-generic >=1.3.1, +- pantry >=0.5.3, ++ pantry >=0.5.3 && <0.6.0, + path >=0.7.0, + path-io >=1.6.3, + persistent >=2.11.0.4 && <2.14.0.0, +@@ -670,7 +670,7 @@ test-suite stack-test + network-uri >=2.6.4.1, + open-browser >=0.2.1.0, + optparse-applicative >=0.14.3.0, +- pantry >=0.5.3, ++ pantry >=0.5.3 && <0.6.0, + path >=0.7.0, + path-io >=1.6.3, + persistent >=2.11.0.4 && <2.14.0.0, diff --git a/srcpkgs/stack/patches/unix-compat.patch b/srcpkgs/stack/patches/unix-compat.patch new file mode 100644 index 00000000000..031a20a5e08 --- /dev/null +++ b/srcpkgs/stack/patches/unix-compat.patch @@ -0,0 +1,40 @@ +constrain unix-compat version to prevent build failures + +--- a/stack.cabal ++++ b/stack.cabal +@@ -307,7 +308,7 @@ library + transformers >=0.5.6.2, + typed-process >=0.2.6.0, + unicode-transforms >=0.3.7.1, +- unix-compat >=0.5.3, ++ unix-compat >=0.5.3 && < 0.7, + unliftio >=0.2.18, + unordered-containers >=0.2.14.0, + vector >=0.12.1.2, +@@ -434,7 +435,7 @@ executable stack + transformers >=0.5.6.2, + typed-process >=0.2.6.0, + unicode-transforms >=0.3.7.1, +- unix-compat >=0.5.3, ++ unix-compat >=0.5.3 && < 0.7, + unliftio >=0.2.18, + unordered-containers >=0.2.14.0, + vector >=0.12.1.2, +@@ -563,7 +564,7 @@ executable stack-integration-test + transformers >=0.5.6.2, + typed-process >=0.2.6.0, + unicode-transforms >=0.3.7.1, +- unix-compat >=0.5.3, ++ unix-compat >=0.5.3 && < 0.7, + unliftio >=0.2.18, + unordered-containers >=0.2.14.0, + vector >=0.12.1.2, +@@ -701,7 +702,7 @@ test-suite stack-test + transformers >=0.5.6.2, + typed-process >=0.2.6.0, + unicode-transforms >=0.3.7.1, +- unix-compat >=0.5.3, ++ unix-compat >=0.5.3 && < 0.7, + unliftio >=0.2.18, + unordered-containers >=0.2.14.0, + vector >=0.12.1.2, diff --git a/srcpkgs/stack/template b/srcpkgs/stack/template index b6c1f1578ed..b77ebf0deae 100644 --- a/srcpkgs/stack/template +++ b/srcpkgs/stack/template @@ -13,7 +13,7 @@ homepage="https://haskellstack.org" distfiles="https://hackage.haskell.org/package/${pkgname}-${version}/${pkgname}-${version}.tar.gz https://www.stackage.org/${_stackage}/cabal.config>cabal.config-${_stackage}" checksum="9ddd44c2a62e9404194d69e7dc1c94e707910620316b66d6ac0b3201a8f37e80 - e1de952bb6f62573e5c211df99ce6bb684c4cae7845f16c347ce9aa503d6374f" + 2e836f769693cde2592963f200c97a3e8a87eb58777fa4289d7c3c671f971186" skip_extraction="cabal.config-${_stackage}" nocross=yes nopie_files="/usr/bin/stack"