From 44f30edf5661d86fb3a95841c35127f3d0ea8b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Tue, 2 May 2023 11:46:08 +0200 Subject: [PATCH] haskell.compiler.ghcjs: fix build (#228749) Apply a patch from upstream `ghcjs/ghcjs/ghc-8.10` (not yet present in the obsidiansystems fork we follow) to fix a build failure caused by an emscripten update. As the patch itself modifies patches that are used during configuration (by `makePackages.sh`), it must be applied in the configured source derivation. --- .../compilers/ghcjs/8.10/configured-ghcjs-src.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/ghcjs/8.10/configured-ghcjs-src.nix b/pkgs/development/compilers/ghcjs/8.10/configured-ghcjs-src.nix index 4ea2de99fc9a..c9e6d2f09cf7 100644 --- a/pkgs/development/compilers/ghcjs/8.10/configured-ghcjs-src.nix +++ b/pkgs/development/compilers/ghcjs/8.10/configured-ghcjs-src.nix @@ -5,8 +5,7 @@ , gcc , cabal-install , runCommand -, lib -, stdenv +, fetchpatch , ghc , happy @@ -28,7 +27,14 @@ runCommand "configured-ghcjs-src" { cabal-install gcc ]; + inherit ghcjsSrc; + + ctimePatch = fetchpatch { + name = "ghcjs-base-ctime-64-bit.patch"; + url = "https://github.com/ghcjs/ghcjs/commit/b7711fbca7c3f43a61f1dba526e6f2a2656ef44c.patch"; + hash = "sha256-zZ3l8/5gbIGtvu0s2Xl92fEDhkhJ2c2w+5Ql5qkvr3s="; + }; } '' export HOME=$(pwd) mkdir $HOME/.cabal @@ -37,6 +43,8 @@ runCommand "configured-ghcjs-src" { chmod -R +w "$out" cd "$out" + patch -p1 -i "$ctimePatch" + # TODO: Find a better way to avoid impure version numbers sed -i 's/RELEASE=NO/RELEASE=YES/' ghc/configure.ac