File tree Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,35 @@ final: prev:
24
24
shift
25
25
${ final . buildPackages . nodejs-12_x } /bin/node $exe $@
26
26
'' ) + "/bin/node-wrapper" ) ] ;
27
- packages . unix . components . library . preConfigure = ''
28
- cp ${ ./patches/config.sub } config.sub
29
- cp ${ ./patches/config.guess } config.guess
30
- chmod +w config.*
31
- '' ;
27
+
28
+ # Apply the patches that came with `ghcjs`
29
+ # Also add a "Keep alive" message to prevent hydra timeouts when hsc2hs runs
30
+ packages = pkgs . lib . genAttrs [ "base" "directory" "filepath" "ghc-prim" "integer-gmp" "process" "template-haskell" "time" "unix" "Win32" ]
31
+ ( name : {
32
+ components . library . preConfigure = ''
33
+ tr -d '\r' < ${ name } .cabal > ${ name } .cabal-new
34
+ mv ${ name } .cabal-new ${ name } .cabal
35
+ patch -p3 < ${ pkgs . buildPackages . haskell-nix . compiler . ${ config . compiler . nix-name } . project . configured-src } /lib/patches/${ name } .patch
36
+ '' ;
37
+ components . library . preBuild = ''
38
+ # Avoid timeouts while unix package runs hsc2hs (it does not print anything
39
+ # for more than 900 seconds).
40
+ KEEP_ALIVE_TMP=$(mktemp -d)
41
+ (
42
+ for n in {1..300}; do
43
+ if [ ! -f $KEEP_ALIVE_TMP/done ]; then
44
+ sleep 10
45
+ if (( $n % 30 == 0 )); then
46
+ echo "Keep alive: ${ name } package build has been running for $(( n / 6 )) minute(s)"
47
+ fi
48
+ fi
49
+ done
50
+ ) &
51
+ '' ;
52
+ components . library . postBuild = ''
53
+ echo ok > $KEEP_ALIVE_TMP/done
54
+ '' ;
55
+ } ) ;
32
56
} )
33
57
) ;
34
58
} ) ;
You can’t perform that action at this time.
0 commit comments