Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -161,25 +161,42 @@ with haskellLib;
hackage-db-unstable
;

# Stack uses pure nix-shells for certain operations including HTTPS requests
# This patch makes stack add pkgs.cacert, so the certificate DB is available.
# https://github.com/commercialhaskell/stack/pull/6854 krank:ignore-line
stack =
appendPatches
[
# Bug fix that is also necessary for the following patches to apply
(pkgs.fetchpatch {
name = "stack-add-cacert-to-pure-shells.patch";
url = "https://github.com/commercialhaskell/stack/commit/e869263cbd84a9e59ce1fa467e82993c8e7fb1dd.patch";
hash = "sha256-O7GaNgcGBY6m6GHqVtejqOu2HCWWKWXARPnr/upT1RQ=";
includes = [ "src/Stack/Nix.hs" ];
name = "stack-dep-without-main-library.patch";
url = "https://github.com/commercialhaskell/stack/commit/591b6eb225b4cd2cfa4d282089fdb33e86bb14ad.patch";
hash = "sha256-GTUBGZ1KWQii60Yt9JpKcwMkzuIuSTdKLGd3aM0jXWw=";
})
# FIXME(@sternenseemann): these URLs are not stable (yet)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these PRs will only be merged once a new stackage LTS release is made, I think we should probably not wait before merging this into, at least, haskell-updates.

# Pick patches to support semaphore-compat >= 2.0
# from https://github.com/commercialhaskell/stack/pull/6935
# c.f. https://github.com/commercialhaskell/stack/issues/693
(pkgs.fetchpatch {
name = "stack-semaphore-compat-2.0.patch";
url = "https://github.com/commercialhaskell/stack/commit/c9e3cbc3f460de65d5abeffb583242255b41be23.patch";
includes = [ "src/**" ];
hash = "sha256-flf1f/QoBZAw9VRTzdNJQu+Zt1b+9q/pi7+1ukCad6c=";
})
(pkgs.fetchpatch {
name = "stack-semaphore-compat-compiler-paths.patch";
url = "https://github.com/commercialhaskell/stack/commit/02fa193245fc7210c6ce88646b2fa94ab39b9fc4.patch";
hash = "sha256-oE0GfXADSYlPceurzeZbq1Ix14gOtZEBssA8ZINv2qs=";
})
(pkgs.fetchpatch {
name = "stack-semaphore-ghc-compat-map.patch";
url = "https://github.com/commercialhaskell/stack/commit/960e704b9cd61094b75fad4689f0034b4435a268.patch";
hash = "sha256-zYIsttG3z4gbpfXgQsKz0PlkAEzODlLYiYdPpfBohvM=";
})
]
(
overrideCabal (drv: {
# Stack's source files use CRLF
prePatch = ''
${drv.prePatch or ""}
sed -i -e 's/\r$//' src/Stack/Nix.hs
find doc src -type f -exec sed -i -e 's/\r$//' '{}' '+'
'';
}) super.stack
);
Expand Down
45 changes: 0 additions & 45 deletions pkgs/development/haskell-modules/configuration-ghc-9.10.x.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,51 +75,6 @@ in
# “Unfortunately we are unable to support GHC 9.10.”
apply-refact = dontDistribute (markBroken super.apply-refact);

stack =
# Setup.hs depends on Cabal-syntax >= 3.14
overrideCabal
(drv: {
setupHaskellDepends = drv.setupHaskellDepends or [ ] ++ [
self.Cabal-syntax_3_14_2_0
self.Cabal_3_14_2_0
];
# We need to tell GHC to ignore the Cabal core libraries while
# compiling Setup.hs since it depends on Cabal >= 3.14.
# ATTN: This override assumes we are using GHC 9.10.3 since we need
# to give an exact Cabal version at the GHC (!) command line.
# FIXME(@sternenseemann): make direct argument to generic-builder.nix
env = drv.env or { } // {
setupCompileFlags = lib.concatStringsSep " " [
"-hide-package"
"Cabal-syntax-3.12.1.0"
"-hide-package"
"Cabal-3.12.1.0"
];
};
})

# Stack itself depends on Cabal >= 3.14 which also needs to be updated for deps
(
super.stack.overrideScope (
sself: ssuper:
let
upgradeCabal =
drv:
lib.pipe drv [
(addBuildDepends [ sself.Cabal_3_14_2_0 ])
(appendConfigureFlags [ "--constraint=Cabal>=3.14" ])
];
in
{
pantry = upgradeCabal ssuper.pantry;
rio-prettyprint = upgradeCabal ssuper.rio-prettyprint;
hackage-security = upgradeCabal ssuper.hackage-security;
hpack = upgradeCabal sself.hpack_0_39_1;
stack = upgradeCabal ssuper.stack;
}
)
);

#
# Version upgrades
#
Expand Down
Loading