From ff6e6b99477511c9e30a9c61b37618b53139ebca Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 3 Mar 2025 13:28:25 +0100 Subject: [PATCH] haskell.packages.ghc{981-983,9101}.cabal-install: ignore unix bound We apply a patch for the issue this bound is trying to prevent. --- .../haskell-modules/configuration-common.nix | 23 ++++++++++++++++++- ...bal-install-3.14.1.1-lift-unix-bound.patch | 11 +++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/haskell-modules/patches/cabal-install-3.14.1.1-lift-unix-bound.patch diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index f5bc4a495ab2..64eff372d304 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -58,7 +58,28 @@ self: super: { in # Some dead code is not properly eliminated on aarch64-darwin, leading # to bogus references to some dependencies. - overrideCabal (old: lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) { + overrideCabal (old: { + # Prevent DOS line endings from Hackage from breaking a patch + prePatch = old.prePatch or "" + '' + ${pkgs.buildPackages.dos2unix}/bin/dos2unix *.cabal + ''; + # Ignore unix bound intended to prevent an unix bug on 32bit systems. + # We apply a patch for this issue to the GHC core packages directly. + # See unix-fix-ctimeval-size-32-bit.patch in ../compilers/ghc/common-*.nix + patches = + old.patches or [ ] + ++ lib.optionals ( + scope.unix == null + && lib.elem self.ghc.version [ + "9.8.1" + "9.8.2" + "9.8.3" + "9.10.1" + ] + ) [ + ./patches/cabal-install-3.14.1.1-lift-unix-bound.patch + ]; + } // lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) { postInstall = '' ${old.postInstall or ""} remove-references-to -t ${scope.HTTP} "$out/bin/.cabal-wrapped" diff --git a/pkgs/development/haskell-modules/patches/cabal-install-3.14.1.1-lift-unix-bound.patch b/pkgs/development/haskell-modules/patches/cabal-install-3.14.1.1-lift-unix-bound.patch new file mode 100644 index 000000000000..ff9f1f427fac --- /dev/null +++ b/pkgs/development/haskell-modules/patches/cabal-install-3.14.1.1-lift-unix-bound.patch @@ -0,0 +1,11 @@ +--- a/cabal-install.cabal ++++ b/cabal-install.cabal +@@ -261,7 +261,7 @@ + -- newer directory for symlinks + build-depends: Win32 >= 2.8 && < 3, directory >=1.3.1.0 + else +- build-depends: unix >= 2.5 && < 2.8 || >= 2.8.6.0 && < 2.9 ++ build-depends: unix >= 2.5 && < 2.9 + + if flag(lukko) + build-depends: lukko >= 0.1 && <0.2