summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/configuration-common.nix
diff options
context:
space:
mode:
authorDennis Gosnell <cdep.illabout@gmail.com>2023-07-24 10:25:28 +0900
committerDennis Gosnell <cdep.illabout@gmail.com>2023-07-24 10:29:50 +0900
commit7dd4145f59d69554fa80dfe821b53689bec0bcec (patch)
treefeb41ccf624df629e68a7bd46f19c17573f55303 /pkgs/development/haskell-modules/configuration-common.nix
parent5c99452faaf5f0d6e456407abc2ef810cccd5d8b (diff)
downloadnixpkgs-7dd4145f59d69554fa80dfe821b53689bec0bcec.tar
nixpkgs-7dd4145f59d69554fa80dfe821b53689bec0bcec.tar.gz
nixpkgs-7dd4145f59d69554fa80dfe821b53689bec0bcec.tar.bz2
nixpkgs-7dd4145f59d69554fa80dfe821b53689bec0bcec.tar.lz
nixpkgs-7dd4145f59d69554fa80dfe821b53689bec0bcec.tar.xz
nixpkgs-7dd4145f59d69554fa80dfe821b53689bec0bcec.tar.zst
nixpkgs-7dd4145f59d69554fa80dfe821b53689bec0bcec.zip
stack: make sure it is pointing at stack-2.11.1
Diffstat (limited to 'pkgs/development/haskell-modules/configuration-common.nix')
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index bff27fc7775..ff552740a6b 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -1164,6 +1164,35 @@ self: super: {
       jailbreak = assert drv.version == "1.0.9" && drv.revision == "1"; true;
     }) super.dhall-nixpkgs);
 
+  stack_2_11_1 =
+    lib.pipe
+      super.stack_2_11_1
+      [
+        (self.generateOptparseApplicativeCompletions [ "stack" ])
+
+        # Seems to be an unnecessarily strict dep on ansi-terminal
+        doJailbreak
+
+        # The below patch has unix line endings, but the actual file
+        # has CRLF line endings.  The following override changes the
+        # file to unix line endings before applying the patch.
+        (overrideCabal (oldAttrs: {
+          prePatch = oldAttrs.prePatch or "" + ''
+            "${lib.getBin pkgs.buildPackages.dos2unix}/bin/dos2unix" src/main/BuildInfo.hs
+          '';
+        }))
+        # stack-2.11.1 has a bug when building without git.
+        # https://github.com/commercialhaskell/stack/pull/6127
+        (appendPatch
+          (fetchpatch {
+            name = "stack-fix-building-without-git.patch";
+            url = "https://github.com/commercialhaskell/stack/pull/6127/commits/086f93933d547736a7007fc4110f7816ef21f691.patch";
+            hash = "sha256-1nwzMoumWceVu8RNnH2mmSxYT24G1FAnFRJvUMeD3po=";
+            includes = [ "src/main/BuildInfo.hs" ];
+          })
+        )
+      ];
+
   stack =
     lib.pipe
       (super.stack.override {