diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix index 6e347a76db0e7..3fd9707f5ebd2 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix @@ -182,4 +182,12 @@ self: super: { # Needs OneTuple for ghc < 9.2 binary-orphans = addBuildDepends [ self.OneTuple ] super.binary-orphans; + + # fix build with avx, see https://github.com/haskell-crypto/cryptonite/issues/347 + # https://github.com/haskell-crypto/cryptonite/pull/373 + cryptonite = appendPatch (pkgs.fetchpatch { + url = "https://github.com/haskell-crypto/cryptonite/commit/1da7efd7ffac8b8b3ea325da79cd73a2e4a39085.patch"; + excludes = [ "cbits/decaf/tools/generate.sh" ]; + sha256 = "sha256-fgu8D9z3lFfVNz5GJqsbWApG+T2PPZyXJ+AkFXArwH0="; + }) (doDistribute super.cryptonite); } diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix index 9fbeec03e4b55..623bac8755f21 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix @@ -52,6 +52,14 @@ self: super: { # weeder == 2.5.* requires GHC 9.4 weeder = doDistribute self.weeder_2_4_1; + # fix build with avx, see https://github.com/haskell-crypto/cryptonite/issues/347 + # https://github.com/haskell-crypto/cryptonite/pull/373 + cryptonite = appendPatch (pkgs.fetchpatch { + url = "https://github.com/haskell-crypto/cryptonite/commit/1da7efd7ffac8b8b3ea325da79cd73a2e4a39085.patch"; + excludes = [ "cbits/decaf/tools/generate.sh" ]; + sha256 = "sha256-fgu8D9z3lFfVNz5GJqsbWApG+T2PPZyXJ+AkFXArwH0="; + }) super.cryptonite; + # Jailbreaks & Version Updates hashable-time = doJailbreak super.hashable-time; diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix index c95f0645b664b..362bbb8237959 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix @@ -55,6 +55,14 @@ in { # still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463 xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_2_2_1; + # fix build with avx, see https://github.com/haskell-crypto/cryptonite/issues/347 + # https://github.com/haskell-crypto/cryptonite/pull/373 + cryptonite = appendPatch (pkgs.fetchpatch { + url = "https://github.com/haskell-crypto/cryptonite/commit/1da7efd7ffac8b8b3ea325da79cd73a2e4a39085.patch"; + excludes = [ "cbits/decaf/tools/generate.sh" ]; + sha256 = "sha256-fgu8D9z3lFfVNz5GJqsbWApG+T2PPZyXJ+AkFXArwH0="; + }) super.cryptonite; + # Tests fail because of typechecking changes conduit = dontCheck super.conduit; diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.8.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.8.x.nix index b96526640bb00..c87b280d825c6 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.8.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.8.x.nix @@ -85,4 +85,12 @@ self: super: { inline-c-cpp = (if isDarwin then appendConfigureFlags ["--ghc-option=-fcompact-unwind"] else x: x) super.inline-c-cpp; + + # fix build with avx, see https://github.com/haskell-crypto/cryptonite/issues/347 + # https://github.com/haskell-crypto/cryptonite/pull/373 + cryptonite = appendPatch (pkgs.fetchpatch { + url = "https://github.com/haskell-crypto/cryptonite/commit/1da7efd7ffac8b8b3ea325da79cd73a2e4a39085.patch"; + excludes = [ "cbits/decaf/tools/generate.sh" ]; + sha256 = "sha256-fgu8D9z3lFfVNz5GJqsbWApG+T2PPZyXJ+AkFXArwH0="; + }) (doDistribute super.cryptonite); }