File tree Expand file tree Collapse file tree 4 files changed +58
-3
lines changed
Expand file tree Collapse file tree 4 files changed +58
-3
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,20 @@ stdenv.mkDerivation (
296296 sha256 = "0kmhfamr16w8gch0lgln2912r8aryjky1hfcda3jkcwa5cdzgjdv" ;
297297 } )
298298
299+ # Determine size of time related types using hsc2hs instead of assuming CLong.
300+ # Prevents failures when e.g. stat(2)ing on 32bit systems with 64bit time_t etc.
301+ # https://github.com/haskell/ghcup-hs/issues/1107
302+ # https://gitlab.haskell.org/ghc/ghc/-/issues/25095
303+ # Note that in normal situations this shouldn't be the case since nixpkgs
304+ # doesn't set -D_FILE_OFFSET_BITS=64 and friends (yet).
305+ ( fetchpatch {
306+ name = "unix-fix-ctimeval-size-32-bit.patch" ;
307+ url = "https://github.com/haskell/unix/commit/8183e05b97ce870dd6582a3677cc82459ae566ec.patch" ;
308+ sha256 = "17q5yyigqr5kxlwwzb95sx567ysfxlw6bp3j4ji20lz0947aw6gv" ;
309+ stripLen = 1 ;
310+ extraPrefix = "libraries/unix/" ;
311+ } )
312+
299313 # See upstream patch at
300314 # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4885. Since we build
301315 # from source distributions, the auto-generated configure script needs to be
Original file line number Diff line number Diff line change 182182 then ./docs-sphinx-7-ghc98.patch
183183 else ./docs-sphinx-7.patch )
184184 ]
185+
186+ ++ lib . optional (
187+ # 2025-01-16: unix >= 2.8.6.0 is unaffected which is shipped by GHC 9.12.1 and 9.8.4
188+ lib . versionOlder version "9.11"
189+ && ! ( lib . versionAtLeast version "9.8.4" && lib . versionOlder version "9.9" )
190+ ) [
191+ # Determine size of time related types using hsc2hs instead of assuming CLong.
192+ # Prevents failures when e.g. stat(2)ing on 32bit systems with 64bit time_t etc.
193+ # https://github.com/haskell/ghcup-hs/issues/1107
194+ # https://gitlab.haskell.org/ghc/ghc/-/issues/25095
195+ # Note that in normal situations this shouldn't be the case since nixpkgs
196+ # doesn't set -D_FILE_OFFSET_BITS=64 and friends (yet).
197+ ( fetchpatch {
198+ name = "unix-fix-ctimeval-size-32-bit.patch" ;
199+ url = "https://github.com/haskell/unix/commit/8183e05b97ce870dd6582a3677cc82459ae566ec.patch" ;
200+ sha256 = "17q5yyigqr5kxlwwzb95sx567ysfxlw6bp3j4ji20lz0947aw6gv" ;
201+ stripLen = 1 ;
202+ extraPrefix = "libraries/unix/" ;
203+ } )
204+ ]
185205 ++ lib . optionals ( lib . versionAtLeast version "9.6" && lib . versionOlder version "9.6.6" ) [
186206 ( fetchpatch {
187207 name = "fix-fully_static.patch" ;
Original file line number Diff line number Diff line change @@ -288,7 +288,22 @@ stdenv.mkDerivation (
288288 ] ;
289289
290290 patches =
291- lib . optionals ( lib . versionOlder version "9.4" ) [
291+ [
292+ # Determine size of time related types using hsc2hs instead of assuming CLong.
293+ # Prevents failures when e.g. stat(2)ing on 32bit systems with 64bit time_t etc.
294+ # https://github.com/haskell/ghcup-hs/issues/1107
295+ # https://gitlab.haskell.org/ghc/ghc/-/issues/25095
296+ # Note that in normal situations this shouldn't be the case since nixpkgs
297+ # doesn't set -D_FILE_OFFSET_BITS=64 and friends (yet).
298+ ( fetchpatch {
299+ name = "unix-fix-ctimeval-size-32-bit.patch" ;
300+ url = "https://github.com/haskell/unix/commit/8183e05b97ce870dd6582a3677cc82459ae566ec.patch" ;
301+ sha256 = "17q5yyigqr5kxlwwzb95sx567ysfxlw6bp3j4ji20lz0947aw6gv" ;
302+ stripLen = 1 ;
303+ extraPrefix = "libraries/unix/" ;
304+ } )
305+ ]
306+ ++ lib . optionals ( lib . versionOlder version "9.4" ) [
292307 # fix hyperlinked haddock sources: https://github.com/haskell/haddock/pull/1482
293308 ( fetchpatch {
294309 url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/1482.patch" ;
Original file line number Diff line number Diff line change @@ -29,9 +29,15 @@ self: super: {
2929 Cabal_3_12_1_0 = doDistribute ( super . Cabal_3_12_1_0 . override {
3030 Cabal-syntax = self . Cabal-syntax_3_12_1_0 ;
3131 } ) ;
32- Cabal_3_14_1_1 = doDistribute ( super . Cabal_3_14_1_1 . override {
32+ Cabal_3_14_1_1 = overrideCabal ( drv : {
33+ # Revert increased lower bound on unix since we have backported
34+ # the required patch to all GHC bundled versions of unix.
35+ postPatch = drv . postPatch or "" + ''
36+ substituteInPlace Cabal.cabal --replace-fail "unix >= 2.8.6.0" "unix >= 2.6.0.0"
37+ '' ;
38+ } ) ( doDistribute ( super . Cabal_3_14_1_1 . override {
3339 Cabal-syntax = self . Cabal-syntax_3_14_1_0 ;
34- } ) ;
40+ } ) ) ;
3541
3642 # cabal-install needs most recent versions of Cabal and Cabal-syntax,
3743 # so we need to put some extra work for non-latest GHCs
You can’t perform that action at this time.
0 commit comments