Skip to content

Commit 9c55dbe

Browse files
[haskell-updates] stack: patch for semaphore-compat >= 2.0 (#534567)
2 parents cef090d + f479cba commit 9c55dbe

2 files changed

Lines changed: 25 additions & 53 deletions

File tree

pkgs/development/haskell-modules/configuration-common.nix

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,25 +161,42 @@ with haskellLib;
161161
hackage-db-unstable
162162
;
163163

164-
# Stack uses pure nix-shells for certain operations including HTTPS requests
165-
# This patch makes stack add pkgs.cacert, so the certificate DB is available.
166-
# https://github.com/commercialhaskell/stack/pull/6854 krank:ignore-line
167164
stack =
168165
appendPatches
169166
[
167+
# Bug fix that is also necessary for the following patches to apply
170168
(pkgs.fetchpatch {
171-
name = "stack-add-cacert-to-pure-shells.patch";
172-
url = "https://github.com/commercialhaskell/stack/commit/e869263cbd84a9e59ce1fa467e82993c8e7fb1dd.patch";
173-
hash = "sha256-O7GaNgcGBY6m6GHqVtejqOu2HCWWKWXARPnr/upT1RQ=";
174-
includes = [ "src/Stack/Nix.hs" ];
169+
name = "stack-dep-without-main-library.patch";
170+
url = "https://github.com/commercialhaskell/stack/commit/591b6eb225b4cd2cfa4d282089fdb33e86bb14ad.patch";
171+
hash = "sha256-GTUBGZ1KWQii60Yt9JpKcwMkzuIuSTdKLGd3aM0jXWw=";
172+
})
173+
# FIXME(@sternenseemann): these URLs are not stable (yet)
174+
# Pick patches to support semaphore-compat >= 2.0
175+
# from https://github.com/commercialhaskell/stack/pull/6935
176+
# c.f. https://github.com/commercialhaskell/stack/issues/693
177+
(pkgs.fetchpatch {
178+
name = "stack-semaphore-compat-2.0.patch";
179+
url = "https://github.com/commercialhaskell/stack/commit/c9e3cbc3f460de65d5abeffb583242255b41be23.patch";
180+
includes = [ "src/**" ];
181+
hash = "sha256-flf1f/QoBZAw9VRTzdNJQu+Zt1b+9q/pi7+1ukCad6c=";
182+
})
183+
(pkgs.fetchpatch {
184+
name = "stack-semaphore-compat-compiler-paths.patch";
185+
url = "https://github.com/commercialhaskell/stack/commit/02fa193245fc7210c6ce88646b2fa94ab39b9fc4.patch";
186+
hash = "sha256-oE0GfXADSYlPceurzeZbq1Ix14gOtZEBssA8ZINv2qs=";
187+
})
188+
(pkgs.fetchpatch {
189+
name = "stack-semaphore-ghc-compat-map.patch";
190+
url = "https://github.com/commercialhaskell/stack/commit/960e704b9cd61094b75fad4689f0034b4435a268.patch";
191+
hash = "sha256-zYIsttG3z4gbpfXgQsKz0PlkAEzODlLYiYdPpfBohvM=";
175192
})
176193
]
177194
(
178195
overrideCabal (drv: {
179196
# Stack's source files use CRLF
180197
prePatch = ''
181198
${drv.prePatch or ""}
182-
sed -i -e 's/\r$//' src/Stack/Nix.hs
199+
find doc src -type f -exec sed -i -e 's/\r$//' '{}' '+'
183200
'';
184201
}) super.stack
185202
);

pkgs/development/haskell-modules/configuration-ghc-9.10.x.nix

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -75,51 +75,6 @@ in
7575
# “Unfortunately we are unable to support GHC 9.10.”
7676
apply-refact = dontDistribute (markBroken super.apply-refact);
7777

78-
stack =
79-
# Setup.hs depends on Cabal-syntax >= 3.14
80-
overrideCabal
81-
(drv: {
82-
setupHaskellDepends = drv.setupHaskellDepends or [ ] ++ [
83-
self.Cabal-syntax_3_14_2_0
84-
self.Cabal_3_14_2_0
85-
];
86-
# We need to tell GHC to ignore the Cabal core libraries while
87-
# compiling Setup.hs since it depends on Cabal >= 3.14.
88-
# ATTN: This override assumes we are using GHC 9.10.3 since we need
89-
# to give an exact Cabal version at the GHC (!) command line.
90-
# FIXME(@sternenseemann): make direct argument to generic-builder.nix
91-
env = drv.env or { } // {
92-
setupCompileFlags = lib.concatStringsSep " " [
93-
"-hide-package"
94-
"Cabal-syntax-3.12.1.0"
95-
"-hide-package"
96-
"Cabal-3.12.1.0"
97-
];
98-
};
99-
})
100-
101-
# Stack itself depends on Cabal >= 3.14 which also needs to be updated for deps
102-
(
103-
super.stack.overrideScope (
104-
sself: ssuper:
105-
let
106-
upgradeCabal =
107-
drv:
108-
lib.pipe drv [
109-
(addBuildDepends [ sself.Cabal_3_14_2_0 ])
110-
(appendConfigureFlags [ "--constraint=Cabal>=3.14" ])
111-
];
112-
in
113-
{
114-
pantry = upgradeCabal ssuper.pantry;
115-
rio-prettyprint = upgradeCabal ssuper.rio-prettyprint;
116-
hackage-security = upgradeCabal ssuper.hackage-security;
117-
hpack = upgradeCabal sself.hpack_0_39_1;
118-
stack = upgradeCabal ssuper.stack;
119-
}
120-
)
121-
);
122-
12378
#
12479
# Version upgrades
12580
#

0 commit comments

Comments
 (0)