on ce04788 help sign in
29 files changed+33−1246
since splitsnapshots
unifiedsplit
.github/workflows/rebase.yaml−28 README.md−16 compiler/ghc/default.nix+2−24 compiler/ghcjs/ghcjs.nix+1−8 compiler/ghcjs/ghcjs810-patched-boot-packages/aeson.patch−13 compiler/ghcjs/ghcjs810-patched-boot-packages/default.nix−176 compiler/ghcjs/ghcjs810-patched-boot-packages/ghcjs-base.patch−471 compiler/ghcjs/ghcjs810-patched-boot-packages/hashable.patch−99 compiler/ghcjs/patches/810/boot-optimization-flags.patch−14 compiler/ghcjs/patches/810/fast-weak.patch−87 flake.lock+6−6 lib/ghcjs-project.nix+2−26 lib/project-overlays.nix+2−2 overlays/bootstrap.nix−3 overlays/ghc.nix+8−12 overlays/ghcjs.nix+3−4 overlays/haskell.nix+3−10 patches/default.nix−1 patches/ghc862/default.nix+1−1 patches/ghc863/default.nix+1−1 patches/ghc864/default.nix+1−1 patches/ghc865/default.nix+1−1 patches/js-ghc8107/buffer-builder.patch−79 patches/js-ghc8107/conduit-extra.patch−48 patches/js-ghc8107/default.nix−7 patches/js-ghc8107/double-conversion.patch−64 patches/js-ghc8107/network.patch−16 patches/js-ghc8107/say.patch−22 patches/update-patches.sh+2−6
.github/workflows/rebase.yamldeleted−28
@@ -1,28 +0,0 @@
1−name: Rebase on iohk/haskell.nix
2−
3−on:
4− schedule:
5− - cron: 0 0 * * *
6−
7−jobs:
8− Linux:
9− runs-on: ubuntu-latest
10− steps:
11− - uses: actions/checkout@v2.4.0
12− with:
13− fetch-depth: 0
14− - name: Rebase and push
15− run: |
16− git config --global user.name "GitHub Actions"
17−
18−
19− git remote add iohk https://github.com/input-output-hk/haskell.nix.git
20− git fetch iohk
21−
22− git checkout iko/ghcjs-patch-master
23− git rebase iohk/master
24− git push --force
25−
26− git checkout --track origin/master
27− git reset --hard iohk/master
28− git push --force
README.md−16
@@ -1,19 +1,3 @@
1−# What is this fork?
2−
3−This fork contains a patched version of GHCJS 8.10 which improves performance and memory usage.
4−
5−For more info see this PR: https://github.com/input-output-hk/haskell.nix/pull/1306
6−
7−## Package versions
8−
9−This branch is updated every day with commits from https://github.com/input-output-hk/haskell.nix/tree/master. This means that it receives all of the updates the initial project does.
10−
11−## Caching
12−
13−Building the patched compiler itself takes around 2-3 hours. The [Typeable](https://typeable.io) public nix cache probably has a cached version of the compiler. You can follow these instruction to set it up: [app.cachix.org/organization/typeable/cache/typeable](https://app.cachix.org/organization/typeable/cache/typeable).
14−
15−---
16−
171# `haskell.nix` is infrastructure for building Haskell packages with Nix
182
193[![](https://badge.buildkite.com/d453edcd29bd2f8f3f3b32c9b7d6777a33773d9671c37a6ccc.svg?branch=master)](https://buildkite.com/input-output-hk/haskell-dot-nix)
compiler/ghc/default.nix+2−24
@@ -31,9 +31,6 @@ let self =
3131, # If enabled, GHC will be built with the GPL-free but slower integer-simple
3232 # library instead of the faster but GPLed integer-gmp library.
3333 enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
34−, # If enabled, GHC will be built with the GPL-free native backend of the
35− # bignum library that is nearly as fast as GMP
36− enableNativeBignum ? !((lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms) || enableIntegerSimple)
3734
3835, # If enabled, use -fPIC when compiling static libs.
3936 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform && !stdenv.targetPlatform.isAarch32
@@ -74,11 +71,7 @@ let self =
7471, extra-passthru ? {}
7572}@args:
7673
77−assert !(enableIntegerSimple || enableNativeBignum) -> gmp != null;
78−
79−# Early check to make sure only one of these is enabled
80−assert enableNativeBignum -> !enableIntegerSimple;
81−assert enableIntegerSimple -> !enableNativeBignum;
74+assert !enableIntegerSimple -> gmp != null;
8275
8376let
8477 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
@@ -86,17 +79,6 @@ let
8679
8780 inherit (bootPkgs) ghc;
8881
89− ghcHasNativeBignum = builtins.compareVersions ghc-version "9.0" >= 0;
90−
91− bignumSpec =
92− assert ghcHasNativeBignum -> !enableIntegerSimple;
93− assert !ghcHasNativeBignum -> !enableNativeBignum;
94− if ghcHasNativeBignum then ''
95− BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"}
96− '' else ''
97− INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
98− '';
99−
10082 # TODO check if this possible fix for segfaults works or not.
10183 targetLibffi =
10284 # on native platforms targetPlatform.{libffi, gmp} do not exist; thus fall back
@@ -124,7 +106,7 @@ let
124106 include mk/flavours/\$(BuildFlavour).mk
125107 endif
126108 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
127− '' + bignumSpec + ''
109+ INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
128110 EXTRA_HADDOCK_OPTS += --quickjump --hyperlinked-source
129111 '' + lib.optionalString (targetPlatform != hostPlatform) ''
130112 CrossCompilePrefix = ${targetPrefix}
@@ -139,10 +121,6 @@ let
139121 '' + lib.optionalString enableRelocatedStaticLibs ''
140122 GhcLibHcOpts += -fPIC
141123 GhcRtsHcOpts += -fPIC
142− GhcRtsCcOpts += -fPIC
143− '' + lib.optionalString (enableRelocatedStaticLibs && targetPlatform.isx86_64 && !targetPlatform.isWindows) ''
144− GhcLibHcOpts += -fexternal-dynamic-refs
145− GhcRtsHcOpts += -fexternal-dynamic-refs
146124 '' + lib.optionalString enableDWARF ''
147125 GhcLibHcOpts += -g3
148126 GhcRtsHcOpts += -g3
compiler/ghcjs/ghcjs.nix+1−8
@@ -7,7 +7,6 @@
77 then "ghc884"
88 else "ghc865"
99, ghc ? pkgs.buildPackages.ghc
10−, overrideBootPackages ? [] # adds if not present, overrides if present.
1110}:
1211let
1312 isGhcjs88 = builtins.compareVersions ghcjsVersion "8.8.0.0" >= 0;
@@ -15,14 +14,8 @@ let
1514
1615 project = pkgs.buildPackages.haskell-nix.ghcjsProject {
1716 src = ghcjsSrc;
18− inherit ghcjsVersion compiler-nix-name overrideBootPackages;
17+ inherit ghcjsVersion compiler-nix-name;
1918 index-state = "2020-04-25T00:00:00Z";
20− patches = if isGhcjs810
21− then [
22− ./patches/810/fast-weak.patch
23− ./patches/810/boot-optimization-flags.patch
24− ]
25− else [];
2619# plan-sha256 = "1wy2lr08maxyi7r8jiwf2gj6pdayk5vxxwh42bj4s2gg4035z0yc";
2720# materialized = ../../materialized/ghcjs;
2821 };
compiler/ghcjs/ghcjs810-patched-boot-packages/aeson.patchdeleted−13
@@ -1,13 +0,0 @@
1−diff --git a/aeson.cabal b/aeson.cabal
2−index a0ebd59..552f160 100755
3−--- a/aeson.cabal
4−+++ b/aeson.cabal
5−@@ -150,7 +150,7 @@ library
6− dlist >= 0.8.0.4 && < 0.9,
7− hashable >= 1.2.7.0 && < 1.4,
8− scientific >= 0.3.6.2 && < 0.4,
9−- th-abstraction >= 0.2.8.0 && < 0.4,
10−+ th-abstraction >= 0.2.8.0 && < 0.5,
11− uuid-types >= 1.0.3 && < 1.1,
12− vector >= 0.12.0.1 && < 0.13
13−
compiler/ghcjs/ghcjs810-patched-boot-packages/default.nixdeleted−176
@@ -1,176 +0,0 @@
1−{ pkgs
2−, ...
3−}:
4−let
5− patch = p: path: pkgs.runCommand "patched" { buildInputs = [ pkgs.gnupatch ]; } ''
6− cp -r ${path} $out
7− chmod -R +w $out
8− cd $out
9− patch -p1 <${p}
10− '';
11− getSubdir = d: path: pkgs.runCommand "subdir" { } ''
12− cp -r ${path}/${d} $out
13− '';
14−in
15−[
16− {
17− name = "primitive";
18− src = pkgs.fetchgit {
19− url = "https://github.com/haskell/primitive.git";
20− rev = "11ff865fd2157a1dfd7dfd525b1cf27e1a300633";
21− sha256 = "1skim1vlmf0v4ixm8h8ja3m1pz0h10xrfdh1rfzawsy8rvrp2cc0";
22− };
23− }
24− {
25− name = "dlist";
26− src = pkgs.fetchgit {
27− url = "https://github.com/spl/dlist.git";
28− rev = "567cfeb2f5da30f2e5faf167895b3ee04c698ca0";
29− sha256 = "0b8ij3ls7bccbp9rlm8dnflnf1wim9xsg42wmirvwxwmh2c0r0hg";
30− };
31− }
32− {
33− name = "vector";
34− src = pkgs.fetchgit {
35− url = "https://github.com/haskell/vector.git";
36− rev = "de10fd281fa5d8beee3623e809a71385a5ef6864";
37− sha256 = "09vhbvrkw90xgqfrybmhy120rwcy4snw2f97004alr3n96lwpg1q";
38− };
39− }
40− {
41− name = "ghcjs-base";
42− src = patch ./ghcjs-base.patch (pkgs.fetchgit {
43− url = "https://github.com/ghcjs/ghcjs-base.git";
44− rev = "85e31beab9beffc3ea91b954b61a5d04e708b8f2";
45− sha256 = "15fdkjv0l7hpbbsn5238xxgzfdg61g666nzbv2sgxkwryn5rycv0";
46− });
47− }
48− {
49− name = "text";
50− src = pkgs.fetchgit {
51− url = "https://github.com/dfordivam/text.git";
52− rev = "126174753ea8e5f45df8fcbba609e3f1c453bf27";
53− sha256 = "0l7nbln2w77s12fm4ybhi0jsfnxkyiwskfx3b682pfisa6n32rgm";
54− };
55− }
56− {
57− name = "hashable";
58− src = patch ./hashable.patch (pkgs.fetchgit {
59− url = "https://github.com/haskell-unordered-containers/hashable.git";
60− rev = "819fdbeaeeb62ed1344fb057de17fa29b10fa3e1";
61− sha256 = "0xnwfwnnh0bxq16wx0qmdakvgvj8i22km3bhvvki15rd9jil04cc";
62− });
63− }
64− {
65− name = "integer-logarithms";
66− src = pkgs.fetchgit {
67− url = "https://github.com/haskellari/integer-logarithms.git";
68− rev = "df09cef2c8eb0d5899e2bcccee2a4fad413bdc11";
69− sha256 = "1k17hjnjmy44dfywx9nr804qiqmjjhkpfpll5bsfvzvpnl5r75nj";
70− };
71− }
72− {
73− name = "scientific";
74− src = pkgs.fetchgit {
75− url = "https://github.com/basvandijk/scientific.git";
76− rev = "1d049cdf04e2d92ab187754044b0df933c5e6b0d";
77− sha256 = "1v4fmfq8hyhdb5ck5r2b45s1izr7hx97v4g7s597ajbv72ldvilq";
78− };
79− }
80− {
81− name = "attoparsec";
82− src = pkgs.fetchgit {
83− url = "https://github.com/dfordivam/attoparsec.git";
84− rev = "cbfb944aeff61144059a28ada93c579e93ccf7d2";
85− sha256 = "0bbr4943439sy3grwpwbna4mk7iv87ijaiv3jjfhxhp7y67z51h8";
86− };
87− }
88− {
89− name = "splitmix";
90− src = pkgs.fetchgit {
91− url = "https://github.com/haskellari/splitmix.git";
92− rev = "d8c1b57bb75178675423f87b1ff58429f37bc9fe";
93− sha256 = "1m8v439vlwqpqw28dbr04n6m0j2cfb169ly285lp0bjmzcwlr289";
94− };
95− }
96− {
97− name = "random";
98− src = pkgs.fetchgit {
99− url = "https://github.com/haskell/random.git";
100− rev = "8c59bd0fda84fa581d53069b45100d810f5a778f";
101− sha256 = "1drdipfbmpg2g2cdrnq1k8yysh86i7ljwm6zkrrs3g8l47n4ha4d";
102− };
103− }
104− {
105− name = "uuid-types";
106− src = getSubdir "uuid-types" (pkgs.fetchgit {
107− url = "https://github.com/haskell-hvr/uuid.git";
108− rev = "e8dc7126582ba4d3abc5e0f26dc1d8477caab01e";
109− sha256 = "037cnfz7rhkw383rn117b994jzs93i3bwdv47x5qiza5h5syd76f";
110− });
111− }
112− {
113− name = "unordered-containers";
114− src = pkgs.fetchgit {
115− url = "https://github.com/haskell-unordered-containers/unordered-containers.git";
116− rev = "db9ddde2b243366976a1bdfbb12a5e257ca762c3";
117− sha256 = "1wd5hxppj1gg9fa1ihcn3s2y0i70ykv2sf8sym6dlf3r4snda9zi";
118− };
119− }
120− {
121− name = "base-orphans";
122− src = pkgs.fetchgit {
123− url = "https://github.com/haskell-compat/base-orphans.git";
124− rev = "1af3a3512efbcc12e0c34637a0e433ab6e195932";
125− sha256 = "14b6qwc3dbnmrhqk66a2cn4pvv3nf6kb3h7ym1hjn5xs7n62zhw1";
126− };
127− }
128− {
129− name = "time-compat";
130− src = pkgs.fetchgit {
131− url = "https://github.com/haskellari/time-compat.git";
132− rev = "67b8b063295601fb1db185baad363a3f33ed63a9";
133− sha256 = "0nbjsn7yrygv4i1fd8x90mnf4janq536ffvkjd5zsnyzm8qk8k3j";
134− };
135− }
136− {
137− name = "th-abstraction";
138− src = pkgs.fetchgit {
139− url = "https://github.com/glguy/th-abstraction.git";
140− rev = "d75761bc5a0f912aeeb508e2c227b9fd830153fd";
141− sha256 = "070ihxncymzsbrgvwmrm717n0qq5bf9nvc2k210nkil1cwrsnhvc";
142− };
143− }
144− {
145− name = "tagged";
146− src = pkgs.fetchgit {
147− url = "https://github.com/ekmett/tagged.git";
148− rev = "15fcfe90c779efea951ecf4d451d709aed5f7d32";
149− sha256 = "1x1wr4zf7k1kvd6rj06h9shw7p5di1jra9fysyw0jx7riiq0v3ch";
150− };
151− }
152− {
153− name = "base-compat";
154− src = getSubdir "base-compat" (pkgs.fetchgit {
155− url = "https://github.com/haskell-compat/base-compat.git";
156− rev = "e8dbac72251e898fc4b1c1abb34d6578da12f476";
157− sha256 = "1gs15g8h7p8gab9j5fjvjlhrfv112w91plraf9chq80c5slvk016";
158− });
159− }
160− {
161− name = "base-compat-batteries";
162− src = getSubdir "base-compat-batteries" (pkgs.fetchgit {
163− url = "https://github.com/haskell-compat/base-compat.git";
164− rev = "e8dbac72251e898fc4b1c1abb34d6578da12f476";
165− sha256 = "1gs15g8h7p8gab9j5fjvjlhrfv112w91plraf9chq80c5slvk016";
166− });
167− }
168− {
169− name = "aeson";
170− src = patch ./aeson.patch (pkgs.fetchgit {
171− url = "https://github.com/dfordivam/aeson.git";
172− rev = "9a8f57a52eb748a030bc2bcf5c3159a5e2e696b2";
173− sha256 = "1y8j3ddxxddpnb7c0vi73ijb08sr09z1gdzfg1rfyzn82d6i38zv";
174− });
175− }
176−]
compiler/ghcjs/ghcjs810-patched-boot-packages/ghcjs-base.patchdeleted−471
@@ -1,471 +0,0 @@
1−diff --git a/Data/JSString.hs b/Data/JSString.hs
2−index 176aad4..9ca6693 100644
3−--- a/Data/JSString.hs
4−+++ b/Data/JSString.hs
5−@@ -99,6 +99,7 @@ module Data.JSString ( JSString
6− , breakOnEnd
7− , break
8− , span
9−+ , span_
10− , group
11− , group'
12− , groupBy
13−@@ -1231,19 +1232,23 @@ splitAt (I# n) x = case js_splitAt n x of (# y, z #) -> (y, z)
14− -- of @t@ of elements that satisfy @p@, and whose second is the
15− -- remainder of the list.
16− span :: (Char -> Bool) -> JSString -> (JSString, JSString)
17−-span p x = case js_length x of
18−- 0# -> (empty, empty)
19−- l -> let c0 = js_uncheckedIndex 0# x
20−- in if p (C# (chr# c0)) then loop 0# l else (empty, x)
21−+span p x = let (# a, b #) = span_ p x in (a, b)
22−+{-# INLINE span #-}
23−+
24−+span_ :: (Char -> Bool) -> JSString -> (# JSString, JSString #)
25−+span_ p x = case js_length x of
26−+ 0# -> (# empty, empty #)
27−+ l -> let c0 = js_uncheckedIndex 0# x
28−+ in if p (C# (chr# c0)) then loop 0# l else (# empty, x #)
29− where
30− loop i l
31−- | isTrue# (i >=# l) = (x, empty)
32−+ | isTrue# (i >=# l) = (# x, empty #)
33− | otherwise =
34− let c = js_uncheckedIndex i x
35− in if p (C# (chr# c))
36− then loop (i +# charWidth c) l
37−- else (js_substr 0# i x, js_substr1 i x)
38−-{-# INLINE span #-}
39−+ else (# js_substr 0# i x, js_substr1 i x #)
40−+{-# INLINE span_ #-}
41−
42− -- | /O(n)/ 'break' is like 'span', but the prefix returned is
43− -- over elements that fail the predicate @p@.
44−diff --git a/GHCJS/Foreign.hs b/GHCJS/Foreign.hs
45−index 5bbc5c5..b128f24 100644
46−--- a/GHCJS/Foreign.hs
47−+++ b/GHCJS/Foreign.hs
48−@@ -82,7 +82,7 @@ import GHCJS.Marshal
49− import GHCJS.Marshal.Pure
50− -}
51− import Data.String (IsString(..))
52−-import qualified Data.Text as T
53−+-- import qualified Data.Text as T
54−
55−
56− class ToJSString a where
57−diff --git a/GHCJS/Foreign/Internal.hs b/GHCJS/Foreign/Internal.hs
58−index 5ac81f0..449bfe4 100644
59−--- a/GHCJS/Foreign/Internal.hs
60−+++ b/GHCJS/Foreign/Internal.hs
61−@@ -100,10 +100,10 @@ import Data.Typeable (Typeable)
62− import Data.ByteString (ByteString)
63− import Data.ByteString.Unsafe (unsafePackAddressLen)
64−
65−-import qualified Data.Text.Array as A
66−-import qualified Data.Text as T
67−-import qualified Data.Text.Internal as T
68−-import qualified Data.Text.Lazy as TL (Text, toStrict, fromStrict)
69−+-- import qualified Data.Text.Array as A
70−+-- import qualified Data.Text as T
71−+-- import qualified Data.Text.Internal as T
72−+-- import qualified Data.Text.Lazy as TL (Text, toStrict, fromStrict)
73−
74− import Unsafe.Coerce
75−
76−diff --git a/GHCJS/Marshal.hs b/GHCJS/Marshal.hs
77−index a36aca2..6256a73 100644
78−--- a/GHCJS/Marshal.hs
79−+++ b/GHCJS/Marshal.hs
80−@@ -16,7 +16,7 @@
81−
82− module GHCJS.Marshal ( FromJSVal(..)
83− , ToJSVal(..)
84−- , toJSVal_aeson
85−+ -- , toJSVal_aeson
86− , toJSVal_pure
87− ) where
88−
89−@@ -24,17 +24,17 @@ import Control.Applicative
90− import Control.Monad
91− import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
92−
93−-import qualified Data.Aeson as AE
94−-import Data.Attoparsec.Number (Number(..))
95−+-- import qualified Data.Aeson as AE
96−+-- import Data.Attoparsec.Number (Number(..))
97− import Data.Bits ((.&.))
98− import Data.Char (chr, ord)
99−-import qualified Data.HashMap.Strict as H
100−+-- import qualified Data.HashMap.Strict as H
101− import Data.Int (Int8, Int16, Int32)
102− import qualified Data.JSString as JSS
103−-import qualified Data.JSString.Text as JSS
104−+-- import qualified Data.JSString.Text as JSS
105− import Data.Maybe
106−-import Data.Scientific (Scientific, scientific, fromFloatDigits)
107−-import Data.Text (Text)
108−+-- import Data.Scientific (Scientific, scientific, fromFloatDigits)
109−+-- import Data.Text (Text)
110− import qualified Data.Vector as V
111− import Data.Word (Word8, Word16, Word32, Word)
112− import Data.Primitive.ByteArray
113−@@ -85,11 +85,11 @@ instance FromJSVal JSString where
114− {-# INLINE fromJSValUnchecked #-}
115− fromJSVal = fromJSVal_pure
116− {-# INLINE fromJSVal #-}
117−-instance FromJSVal Text where
118−- fromJSValUnchecked = fromJSValUnchecked_pure
119−- {-# INLINE fromJSValUnchecked #-}
120−- fromJSVal = fromJSVal_pure
121−- {-# INLINE fromJSVal #-}
122−+-- instance FromJSVal Text where
123−+-- fromJSValUnchecked = fromJSValUnchecked_pure
124−+-- {-# INLINE fromJSValUnchecked #-}
125−+-- fromJSVal = fromJSVal_pure
126−+-- {-# INLINE fromJSVal #-}
127− instance FromJSVal Char where
128− fromJSValUnchecked = fromJSValUnchecked_pure
129− {-# INLINE fromJSValUnchecked #-}
130−@@ -154,24 +154,24 @@ instance FromJSVal Double where
131− {-# INLINE fromJSValUnchecked #-}
132− fromJSVal = fromJSVal_pure
133− {-# INLINE fromJSVal #-}
134−-instance FromJSVal AE.Value where
135−- fromJSVal r = case jsonTypeOf r of
136−- JSONNull -> return (Just AE.Null)
137−- JSONInteger -> liftM (AE.Number . flip scientific 0 . (toInteger :: Int -> Integer))
138−- <$> fromJSVal r
139−- JSONFloat -> liftM (AE.Number . (fromFloatDigits :: Double -> Scientific))
140−- <$> fromJSVal r
141−- JSONBool -> liftM AE.Bool <$> fromJSVal r
142−- JSONString -> liftM AE.String <$> fromJSVal r
143−- JSONArray -> liftM (AE.Array . V.fromList) <$> fromJSVal r
144−- JSONObject -> do
145−- props <- OI.listProps (OI.Object r)
146−- runMaybeT $ do
147−- propVals <- forM props $ \p -> do
148−- v <- MaybeT (fromJSVal =<< OI.getProp p (OI.Object r))
149−- return (JSS.textFromJSString p, v)
150−- return (AE.Object (H.fromList propVals))
151−- {-# INLINE fromJSVal #-}
152−+-- instance FromJSVal AE.Value where
153−+-- fromJSVal r = case jsonTypeOf r of
154−+-- JSONNull -> return (Just AE.Null)
155−+-- JSONInteger -> liftM (AE.Number . flip scientific 0 . (toInteger :: Int -> Integer))
156−+-- <$> fromJSVal r
157−+-- JSONFloat -> liftM (AE.Number . (fromFloatDigits :: Double -> Scientific))
158−+-- <$> fromJSVal r
159−+-- JSONBool -> liftM AE.Bool <$> fromJSVal r
160−+-- JSONString -> liftM AE.String <$> fromJSVal r
161−+-- JSONArray -> liftM (AE.Array . V.fromList) <$> fromJSVal r
162−+-- JSONObject -> do
163−+-- props <- OI.listProps (OI.Object r)
164−+-- runMaybeT $ do
165−+-- propVals <- forM props $ \p -> do
166−+-- v <- MaybeT (fromJSVal =<< OI.getProp p (OI.Object r))
167−+-- return (JSS.textFromJSString p, v)
168−+-- return (AE.Object (H.fromList propVals))
169−+-- {-# INLINE fromJSVal #-}
170− instance (FromJSVal a, FromJSVal b) => FromJSVal (a,b) where
171− fromJSVal r = runMaybeT $ (,) <$> jf r 0 <*> jf r 1
172− {-# INLINE fromJSVal #-}
173−@@ -204,15 +204,15 @@ jf r n = MaybeT $ do
174− instance ToJSVal JSVal where
175− toJSVal = toJSVal_pure
176− {-# INLINE toJSVal #-}
177−-instance ToJSVal AE.Value where
178−- toJSVal = toJSVal_aeson
179−- {-# INLINE toJSVal #-}
180−+-- instance ToJSVal AE.Value where
181−+-- toJSVal = toJSVal_aeson
182−+-- {-# INLINE toJSVal #-}
183− instance ToJSVal JSString where
184− toJSVal = toJSVal_pure
185− {-# INLINE toJSVal #-}
186−-instance ToJSVal Text where
187−- toJSVal = toJSVal_pure
188−- {-# INLINE toJSVal #-}
189−+-- instance ToJSVal Text where
190−+-- toJSVal = toJSVal_pure
191−+-- {-# INLINE toJSVal #-}
192− instance ToJSVal Char where
193− toJSVal = return . pToJSVal
194− {-# INLINE toJSVal #-}
195−@@ -285,21 +285,21 @@ foreign import javascript unsafe "[$1,$2,$3,$4,$5]" arr5 :: JSVal -> J
196− foreign import javascript unsafe "[$1,$2,$3,$4,$5,$6]" arr6 :: JSVal -> JSVal -> JSVal -> JSVal -> JSVal -> JSVal -> IO JSVal
197− foreign import javascript unsafe "[$1,$2,$3,$4,$5,$6,$7]" arr7 :: JSVal -> JSVal -> JSVal -> JSVal -> JSVal -> JSVal -> JSVal -> IO JSVal
198−
199−-toJSVal_aeson :: AE.ToJSON a => a -> IO JSVal
200−-toJSVal_aeson x = cv (AE.toJSON x)
201−- where
202−- cv = convertValue
203−+-- toJSVal_aeson :: AE.ToJSON a => a -> IO JSVal
204−+-- toJSVal_aeson x = cv (AE.toJSON x)
205−+-- where
206−+-- cv = convertValue
207−
208−- convertValue :: AE.Value -> IO JSVal
209−- convertValue AE.Null = return jsNull
210−- convertValue (AE.String t) = return (pToJSVal t)
211−- convertValue (AE.Array a) = (\(AI.SomeJSArray x) -> x) <$>
212−- (AI.fromListIO =<< mapM convertValue (V.toList a))
213−- convertValue (AE.Number n) = toJSVal (realToFrac n :: Double)
214−- convertValue (AE.Bool b) = return (toJSBool b)
215−- convertValue (AE.Object o) = do
216−- obj@(OI.Object obj') <- OI.create
217−- mapM_ (\(k,v) -> convertValue v >>= \v' -> OI.setProp (JSS.textToJSString k) v' obj) (H.toList o)
218−- return obj'
219−+-- convertValue :: AE.Value -> IO JSVal
220−+-- convertValue AE.Null = return jsNull
221−+-- convertValue (AE.String t) = return (pToJSVal t)
222−+-- convertValue (AE.Array a) = (\(AI.SomeJSArray x) -> x) <$>
223−+-- (AI.fromListIO =<< mapM convertValue (V.toList a))
224−+-- convertValue (AE.Number n) = toJSVal (realToFrac n :: Double)
225−+-- convertValue (AE.Bool b) = return (toJSBool b)
226−+-- convertValue (AE.Object o) = do
227−+-- obj@(OI.Object obj') <- OI.create
228−+-- mapM_ (\(k,v) -> convertValue v >>= \v' -> OI.setProp (JSS.textToJSString k) v' obj) (H.toList o)
229−+-- return obj'
230−
231−
232−diff --git a/GHCJS/Marshal/Pure.hs b/GHCJS/Marshal/Pure.hs
233−index 902fa20..268489d 100644
234−--- a/GHCJS/Marshal/Pure.hs
235−+++ b/GHCJS/Marshal/Pure.hs
236−@@ -28,11 +28,11 @@ import Data.Data
237− import Data.Int (Int8, Int16, Int32)
238− import Data.JSString.Internal.Type
239− import Data.Maybe
240−-import Data.Text (Text)
241−+-- import Data.Text (Text)
242− import Data.Typeable
243− import Data.Word (Word8, Word16, Word32, Word)
244− import Data.JSString
245−-import Data.JSString.Text
246−+-- import Data.JSString.Text
247− import Data.Bits ((.&.))
248− import Unsafe.Coerce (unsafeCoerce)
249− import GHC.Int
250−@@ -65,8 +65,8 @@ instance PFromJSVal JSString where pFromJSVal = JSString
251− {-# INLINE pFromJSVal #-}
252− instance PFromJSVal [Char] where pFromJSVal = Prim.fromJSString
253− {-# INLINE pFromJSVal #-}
254−-instance PFromJSVal Text where pFromJSVal = textFromJSVal
255−- {-# INLINE pFromJSVal #-}
256−+-- instance PFromJSVal Text where pFromJSVal = textFromJSVal
257−+-- {-# INLINE pFromJSVal #-}
258− instance PFromJSVal Char where pFromJSVal x = C# (jsvalToChar x)
259− {-# INLINE pFromJSVal #-}
260− instance PFromJSVal Bool where pFromJSVal = isTruthy
261−@@ -103,8 +103,8 @@ instance PToJSVal JSString where pToJSVal = jsval
262− {-# INLINE pToJSVal #-}
263− instance PToJSVal [Char] where pToJSVal = Prim.toJSString
264− {-# INLINE pToJSVal #-}
265−-instance PToJSVal Text where pToJSVal = jsval . textToJSString
266−- {-# INLINE pToJSVal #-}
267−+-- instance PToJSVal Text where pToJSVal = jsval . textToJSString
268−+-- {-# INLINE pToJSVal #-}
269− instance PToJSVal Char where pToJSVal (C# c) = charToJSVal c
270− {-# INLINE pToJSVal #-}
271− instance PToJSVal Bool where pToJSVal True = jsTrue
272−diff --git a/JavaScript/JSON/Types/Instances.hs b/JavaScript/JSON/Types/Instances.hs
273−index 2b288ec..6d7074c 100644
274−--- a/JavaScript/JSON/Types/Instances.hs
275−+++ b/JavaScript/JSON/Types/Instances.hs
276−@@ -57,7 +57,7 @@ import Control.Applicative ((<$>), (<*>), (<|>), pure, empty)
277−
278− import Data.JSString (JSString)
279− import qualified Data.JSString as JSS
280−-import qualified Data.JSString.Text as JSS
281−+-- import qualified Data.JSString.Text as JSS
282−
283− import JavaScript.Array (JSArray)
284− import qualified JavaScript.Array as JSA
285−@@ -335,21 +335,21 @@ instance FromJSON JSString where
286− parseJSON = withJSString "JSString" pure
287− {-# INLINE parseJSON #-}
288−
289−-instance ToJSON Text where
290−- toJSON = stringValue . JSS.textToJSString
291−- {-# INLINE toJSON #-}
292−+-- instance ToJSON Text where
293−+-- toJSON = stringValue . JSS.textToJSString
294−+-- {-# INLINE toJSON #-}
295−
296−-instance FromJSON Text where
297−- parseJSON = withJSString "Text" ( pure . JSS.textFromJSString )
298−- {-# INLINE parseJSON #-}
299−+-- instance FromJSON Text where
300−+-- parseJSON = withJSString "Text" ( pure . JSS.textFromJSString )
301−+-- {-# INLINE parseJSON #-}
302−
303−-instance ToJSON LT.Text where
304−- toJSON = stringValue . JSS.textToJSString . LT.toStrict
305−- {-# INLINE toJSON #-}
306−+-- instance ToJSON LT.Text where
307−+-- toJSON = stringValue . JSS.textToJSString . LT.toStrict
308−+-- {-# INLINE toJSON #-}
309−
310−-instance FromJSON LT.Text where
311−- parseJSON = withJSString "Lazy Text" $ pure . LT.fromStrict . JSS.textFromJSString
312−- {-# INLINE parseJSON #-}
313−+-- instance FromJSON LT.Text where
314−+-- parseJSON = withJSString "Lazy Text" $ pure . LT.fromStrict . JSS.textFromJSString
315−+-- {-# INLINE parseJSON #-}
316−
317− instance (ToJSON a) => ToJSON [a] where
318− toJSON = arrayValue . arrayValueList . map toJSON
319−diff --git a/JavaScript/Web/Canvas.hs b/JavaScript/Web/Canvas.hs
320−index 0a7684c..74490c2 100644
321−--- a/JavaScript/Web/Canvas.hs
322−+++ b/JavaScript/Web/Canvas.hs
323−@@ -69,7 +69,7 @@ import Control.Monad
324−
325− import Data.Data
326− import Data.Maybe (fromJust)
327−-import Data.Text (Text)
328−+-- import Data.Text (Text)
329− import Data.Typeable
330−
331− import GHCJS.Foreign
332−diff --git a/ghcjs-base.cabal b/ghcjs-base.cabal
333−index 4a64694..acf8806 100644
334−--- a/ghcjs-base.cabal
335−+++ b/ghcjs-base.cabal
336−@@ -55,7 +55,7 @@ library
337− Data.JSString.RealFloat
338− Data.JSString.RegExp
339− Data.JSString.Internal
340−- Data.JSString.Text
341−+ -- Data.JSString.Text
342− Data.JSString.Internal.Fusion
343− Data.JSString.Internal.Fusion.Types
344− Data.JSString.Internal.Fusion.Common
345−@@ -78,12 +78,12 @@ library
346− JavaScript.Array.Internal
347− JavaScript.Array.ST
348− JavaScript.Cast
349−- JavaScript.JSON
350−- JavaScript.JSON.Types
351−- JavaScript.JSON.Types.Class
352−- JavaScript.JSON.Types.Generic
353−- JavaScript.JSON.Types.Instances
354−- JavaScript.JSON.Types.Internal
355−+ -- JavaScript.JSON
356−+ -- JavaScript.JSON.Types
357−+ -- JavaScript.JSON.Types.Class
358−+ -- JavaScript.JSON.Types.Generic
359−+ -- JavaScript.JSON.Types.Instances
360−+ -- JavaScript.JSON.Types.Internal
361− JavaScript.Number
362− JavaScript.Object
363− JavaScript.Object.Internal
364−@@ -115,11 +115,11 @@ library
365− JavaScript.Web.Storage
366− JavaScript.Web.Storage.Internal
367− JavaScript.Web.StorageEvent
368−- JavaScript.Web.XMLHttpRequest
369−+ -- JavaScript.Web.XMLHttpRequest
370− JavaScript.Web.WebSocket
371− JavaScript.Web.Worker
372−- other-modules: GHCJS.Internal.Types
373− Data.JSString.Internal.Type
374−+ other-modules: GHCJS.Internal.Types
375− JavaScript.TypedArray.Internal.Types
376− JavaScript.TypedArray.ArrayBuffer.Internal
377− JavaScript.TypedArray.DataView.Internal
378−@@ -144,15 +144,15 @@ library
379− integer-gmp,
380− binary >= 0.8 && < 0.11,
381− bytestring >= 0.10 && < 0.11,
382−- text >= 1.1 && < 1.3,
383−- aeson >= 0.8 && < 1.6,
384−- scientific >= 0.3 && < 0.4,
385−+ -- text >= 1.1 && < 1.3,
386−+ -- aeson >= 0.8 && < 1.6,
387−+ -- scientific >= 0.3 && < 0.4,
388− vector >= 0.10 && < 0.13,
389− containers >= 0.5 && < 0.7,
390− time >= 1.5 && < 1.10,
391−- hashable >= 1.2 && < 1.4,
392−- unordered-containers >= 0.2 && < 0.3,
393−- attoparsec >= 0.11 && < 0.15,
394−+ -- hashable >= 1.2 && < 1.4,
395−+ -- unordered-containers >= 0.2 && < 0.3,
396−+ -- attoparsec >= 0.11 && < 0.15,
397− transformers >= 0.3 && < 0.6,
398− primitive >= 0.5 && < 0.8,
399− deepseq >= 1.3 && < 1.5,
400−@@ -161,37 +161,37 @@ library
401− if !impl(ghcjs) && !os(ghcjs)
402− buildable: False
403−
404−-test-suite tests
405−- type: exitcode-stdio-1.0
406−- hs-source-dirs: test
407−- main-is: Tests.hs
408−- other-modules: Tests.Marshal
409−- Tests.Properties
410−- Tests.Properties.Numeric
411−- Tests.SlowFunctions
412−- Tests.QuickCheckUtils
413−- Tests.Regressions
414−- Tests.Utils
415−- ghc-options:
416−- -Wall -rtsopts
417−- build-depends:
418−- HUnit >= 1.2,
419−- QuickCheck >= 2.7,
420−- array,
421−- text,
422−- base,
423−- bytestring,
424−- deepseq,
425−- directory,
426−- ghc-prim,
427−- ghcjs-prim,
428−- ghcjs-base,
429−- primitive,
430−- quickcheck-unicode,
431−- random,
432−- test-framework >= 0.4,
433−- test-framework-hunit >= 0.2,
434−- test-framework-quickcheck2 >= 0.2
435−- default-language: Haskell2010
436−- if !impl(ghcjs) && !os(ghcjs)
437−- buildable: False
438−+-- test-suite tests
439−+-- type: exitcode-stdio-1.0
440−+-- hs-source-dirs: test
441−+-- main-is: Tests.hs
442−+-- other-modules: Tests.Marshal
443−+-- Tests.Properties
444−+-- Tests.Properties.Numeric
445−+-- Tests.SlowFunctions
446−+-- Tests.QuickCheckUtils
447−+-- Tests.Regressions
448−+-- Tests.Utils
449−+-- ghc-options:
450−+-- -Wall -rtsopts
451−+-- build-depends:
452−+-- HUnit >= 1.2,
453−+-- QuickCheck >= 2.7,
454−+-- array,
455−+-- text,
456−+-- base,
457−+-- bytestring,
458−+-- deepseq,
459−+-- directory,
460−+-- ghc-prim,
461−+-- ghcjs-prim,
462−+-- ghcjs-base,
463−+-- primitive,
464−+-- quickcheck-unicode,
465−+-- random,
466−+-- test-framework >= 0.4,
467−+-- test-framework-hunit >= 0.2,
468−+-- test-framework-quickcheck2 >= 0.2
469−+-- default-language: Haskell2010
470−+-- if !impl(ghcjs) && !os(ghcjs)
471−+-- buildable: False
compiler/ghcjs/ghcjs810-patched-boot-packages/hashable.patchdeleted−99
@@ -1,99 +0,0 @@
1−diff --git a/hashable.cabal b/hashable.cabal
2−index 4197060..8c339b1 100755
3−--- a/hashable.cabal
4−+++ b/hashable.cabal
5−@@ -88,6 +88,8 @@ library
6− build-depends: ghc-bignum ==1.0.* || ==1.2.*
7−
8− else
9−+ if impl(ghcjs)
10−+ build-depends: ghcjs-base
11− if flag(integer-gmp)
12− build-depends: integer-gmp >=0.4 && <1.1
13−
14−diff --git a/src/Data/Hashable/Class.hs b/src/Data/Hashable/Class.hs
15−index c7dd8c5..0e3bbe7 100755
16−--- a/src/Data/Hashable/Class.hs
17−+++ b/src/Data/Hashable/Class.hs
18−@@ -5,6 +5,10 @@
19−
20− {-# LANGUAGE Trustworthy #-}
21−
22−+#ifdef __GHCJS__
23−+{-# LANGUAGE JavaScriptFFI, UnboxedTuples, GHCForeignImportPrim #-}
24−+#endif
25−+
26− #if __GLASGOW_HASKELL__ >= 801
27− {-# LANGUAGE PolyKinds #-} -- For TypeRep instances
28− #endif
29−@@ -72,7 +76,9 @@ import Data.Int (Int8, Int16, Int32, Int64)
30− import Data.List (foldl')
31− import Data.Ratio (Ratio, denominator, numerator)
32− import qualified Data.Text as T
33−+#ifndef __GHCJS__
34− import qualified Data.Text.Array as TA
35−+#endif
36− import qualified Data.Text.Internal as T
37− import qualified Data.Text.Lazy as TL
38− import Data.Version (Version(..))
39−@@ -152,7 +158,11 @@ import GHC.Exts (Int (..), sizeofByteArray#)
40− # define MIN_VERSION_integer_gmp_1_0_0
41− # endif
42−
43−+#ifndef __GHCJS__
44− import GHC.Exts (Int(..))
45−+#else
46−+import GHC.Exts (Int(..), Int#)
47−+#endif
48− import GHC.Integer.GMP.Internals (Integer(..))
49− # if defined(MIN_VERSION_integer_gmp_1_0_0)
50− import GHC.Exts (sizeofByteArray#)
51−@@ -195,6 +205,10 @@ import Data.Kind (Type)
52− import Data.Hashable.Imports
53− import Data.Hashable.LowLevel
54−
55−+#ifdef __GHCJS__
56−+import Data.JSString (JSString)
57−+#endif
58−+
59− #include "MachDeps.h"
60−
61− infixl 0 `hashWithSalt`
62−@@ -676,17 +690,18 @@ instance Hashable BSI.ShortByteString where
63− #endif
64−
65− instance Hashable T.Text where
66−+#ifndef __GHCJS__
67− hashWithSalt salt (T.Text arr off len) =
68− hashByteArrayWithSalt (TA.aBA arr) (off `shiftL` 1) (len `shiftL` 1)
69− (hashWithSalt salt len)
70−+#else
71−+ hashWithSalt salt (T.Text txt) =
72−+ let (# ba, len #) = js_textFromJSString txt
73−+ in hashByteArrayWithSalt ba (0 `shiftL` 1) (I# len `shiftL` 1) salt
74−+#endif
75−
76− instance Hashable TL.Text where
77−- hashWithSalt salt = finalise . TL.foldlChunks step (SP salt 0)
78−- where
79−- finalise (SP s l) = hashWithSalt s l
80−- step (SP s l) (T.Text arr off len) = SP
81−- (hashByteArrayWithSalt (TA.aBA arr) (off `shiftL` 1) (len `shiftL` 1) s)
82−- (l + len)
83−+ hashWithSalt = TL.foldlChunks hashWithSalt
84−
85− -- | Compute the hash of a ThreadId.
86− hashThreadId :: ThreadId -> Int
87−@@ -880,6 +895,12 @@ instance Hashable1 Option where liftHashWithSalt h salt (Option a) = liftHashWit
88− #endif
89− #endif
90−
91−+#ifdef __GHCJS__
92−+foreign import javascript unsafe
93−+ "h$textFromString"
94−+ js_textFromJSString :: JSString -> (# ByteArray#, Int# #)
95−+#endif
96−+
97− -- instances for @Data.Functor.{Product,Sum,Compose}@, present
98− -- in base-4.9 and onward.
99− #if MIN_VERSION_base(4,9,0)
compiler/ghcjs/patches/810/boot-optimization-flags.patchdeleted−14
@@ -1,14 +0,0 @@
1−diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
2−index 2e35a26..5db2f9b 100755
3−--- a/src-bin/Boot.hs
4−+++ b/src-bin/Boot.hs
5−@@ -721,6 +721,9 @@ cabalConfigureFlags = do
6− , "--prefix", T.pack (locs ^. blGhcjsTopDir)
7− , "--configure-option", "--host=js-unknown-ghcjs"
8− , "--ghcjs-options=-fwrite-ide-info"
9−+ , "--ghcjs-options=-O2"
10−+ , "--ghcjs-options=-fexpose-all-unfoldings"
11−+ , "--ghcjs-options=-fspecialise-aggressively"
12− , "--enable-debug-info"
13− , "--disable-library-stripping"
14− , "--disable-executable-stripping"
compiler/ghcjs/patches/810/fast-weak.patchdeleted−87
@@ -1,87 +0,0 @@
1−diff --git a/lib/boot/shims/src/gc.js.pp b/lib/boot/shims/src/gc.js.pp
2−index 76321b2..a2cf416 100644
3−--- a/lib/boot/shims/src/gc.js.pp
4−+++ b/lib/boot/shims/src/gc.js.pp
5−@@ -444,6 +444,50 @@ function h$follow(obj, sp) {
6− } else if(typeof c.len === 'number' && c.buf instanceof ArrayBuffer) {
7− TRACE_GC("marking ByteArray");
8− MARK_OBJ(c);
9−+ } else if(c instanceof h$FastWeak) {
10−+ MARK_OBJ(c);
11−+ if(c.ticket !== null && !IS_MARKED(c.ticket)) {
12−+ c.ticket = null; // If the ticket isn't reachable, this will let it get cleaned up by the JS gc; if it is reachable, it'll fill this back in
13−+ }
14−+ } else if(c instanceof h$FastWeakTicket) {
15−+ MARK_OBJ(c);
16−+ if(!IS_MARKED(c.val)) {
17−+ ADDW(c.val);
18−+ }
19−+ if(IS_MARKED(c.weak)) {
20−+ // In this case, the weak side has been marked first, which means it's been cleared; restore it
21−+ c.weak.ticket = c;
22−+ }
23−+ } else if(c instanceof h$FastWeakBag) {
24−+ MARK_OBJ(c);
25−+ var j = 0; // j should always be equal to the number of not-yet-necessarily-dead tickets that have been traversed; this should always be less than or equal to i
26−+ for(i = 0; i < c.tickets.length; i++) {
27−+ // Any nulls left in the array prior to checking on the tickets must be tickets that died in the last GC, so we ignore them
28−+ if(c.tickets[i] !== null) {
29−+ if(j !== i) {
30−+ c.tickets[i].pos = j;
31−+ }
32−+ if(!IS_MARKED(c.tickets[i])) {
33−+ // If the ticket isn't reachable, this will let it get cleaned up by the JS gc; if it is reachable, it'll fill this back in
34−+ c.tickets[j] = null;
35−+ } else if(j !== i) {
36−+ // We need to move the item
37−+ c.tickets[j] = c.tickets[i];
38−+ } // If it's marked and not moving, don't do anything
39−+ j++;
40−+ }
41−+ }
42−+ c.tickets.length = j; // Shrink the array if any nulls have been dropped
43−+ } else if(c instanceof h$FastWeakBagTicket) {
44−+ MARK_OBJ(c);
45−+ if(!IS_MARKED(c.val)) {
46−+ ADDW(c.val);
47−+ }
48−+ if(IS_MARKED(c.bag)) {
49−+ // In this case, the weak side has been marked first, which means it's been cleared; restore it
50−+ c.bag.tickets[c.pos] = c;
51−+ }
52−+
53− } else if(c instanceof h$Weak) {
54− MARK_OBJ(c);
55− } else if(c instanceof h$MVar) {
56−diff --git a/lib/boot/shims/src/weak.js.pp b/lib/boot/shims/src/weak.js.pp
57−index 8df313b..d537027 100644
58−--- a/lib/boot/shims/src/weak.js.pp
59−+++ b/lib/boot/shims/src/weak.js.pp
60−@@ -87,3 +87,27 @@ function h$finalizeWeak(w) {
61− RETURN_UBX_TUP2(r, 1);
62− }
63− }
64−+
65−+function h$FastWeak(ticket) {
66−+ this.ticket = ticket;
67−+ this.m = 0;
68−+}
69−+
70−+function h$FastWeakTicket(val) {
71−+ this.val = val;
72−+ this.weak = new h$FastWeak(this);
73−+ this.m = 0;
74−+}
75−+
76−+function h$FastWeakBag() {
77−+ this.tickets = [];
78−+ this.m = 0;
79−+}
80−+
81−+function h$FastWeakBagTicket(bag, val) {
82−+ this.val = val;
83−+ this.bag = bag;
84−+ this.pos = bag.tickets.length;
85−+ bag.tickets.push(this);
86−+ this.m = 0;
87−+};
flake.lock+6−6
@@ -118,11 +118,11 @@
118118 "hackage": {
119119 "flake": false,
120120 "locked": {
121− "lastModified": 1659402819,
122− "narHash": "sha256-1ghmulyIk+obGnyFeouVHBQXxUHMBmgCIRazLfEoT34=",
121+ "lastModified": 1659316492,
122+ "narHash": "sha256-TBcC0P/0jBiblp/n3UB/wNOJFRHzv9Ne2rJukxoElb4=",
123123 "owner": "input-output-hk",
124124 "repo": "hackage.nix",
125− "rev": "2f6f97ca3db96f91eea674ef46f4a0785d1e9d9c",
125+ "rev": "ad4151dc827d561b7a3c8bed1324117ed3daa814",
126126 "type": "github"
127127 },
128128 "original": {
@@ -377,11 +377,11 @@
377377 "stackage": {
378378 "flake": false,
379379 "locked": {
380− "lastModified": 1659402917,
381− "narHash": "sha256-zRDOtN4A2KmfzmZiqqxOAIw1YVPhnoIaszKKd+qCEcQ=",
380+ "lastModified": 1659316585,
381+ "narHash": "sha256-vZ0rSn8tibAa1PrIVpqXoJRekKRnF1CKnfsEOQYjzr0=",
382382 "owner": "input-output-hk",
383383 "repo": "stackage.nix",
384− "rev": "778df3c4b35eac853d57fac7bafc7c9f2dde917f",
384+ "rev": "f0b15d7ee8f4f8f2f16d60287afcaebcf0ed7d36",
385385 "type": "github"
386386 },
387387 "original": {
lib/ghcjs-project.nix+2−26
@@ -52,8 +52,6 @@
5252 '';
5353 materialized = ../materialized/ghcjs/cabal + "/${compiler-nix-name}";
5454 }
55−, overrideBootPackages ? []
56−, patches ? []
5755, ...
5856}@args:
5957let
@@ -91,7 +89,7 @@ let
9189 # Configured the GHCJS source
9290 configured-src = (pkgs.runCommandCC "configured-ghcjs-src" {
9391 buildInputs = configureInputs;
94− inherit src patches;
92+ inherit src;
9593 } ''
9694 export HOME=$(pwd)
9795 mkdir $HOME/.cabal
@@ -100,11 +98,6 @@ let
10098 chmod -R +w "$out"
10199 cd "$out"
102100
103− for p in $patches
104− do
105− patch -p1 <$p
106− done
107−
108101 # TODO: Find a better way to avoid impure version numbers
109102 sed -i 's/RELEASE=NO/RELEASE=YES/' ghc/configure.ac
110103 sed -i 's/${ghcjsVersion}/${ghcVersion}/' ghcjs.cabal
@@ -137,21 +130,6 @@ let
137130 for a in integer-gmp base unix; do
138131 cp ${../overlays/patches/config.sub} lib/boot/pkg/$a/config.sub
139132 done
140− ${ # it just so happens that all existing uses of overriding boot packages
141− # need to be installed right after template-haskell
142− # if at some point we would need to insert them at different points
143− # then we will have gto come up with something more clever
144− builtins.concatStringsSep "\n" (map ({name, src}: ''
145− rm -rf $out/lib/boot/pkg/${name}
146− cp -r ${src} $out/lib/boot/pkg/${name}
147− sed -i 's/^ - ${name}$//g' $out/lib/boot/boot.yaml
148− sed -i 's/^ - template-haskell$/ - template-haskell\n - ${name}/g' $out/lib/boot/boot.yaml
149− echo "Added ${name} to boot.yaml"
150− ''
151− ) (pkgs.lib.reverseList overrideBootPackages))
152− }
153−
154− chmod -R +w $out/lib/boot/pkg
155133 '') // {
156134 # The configured source includes /nix/store paths and so filtering can fail.
157135 filterPath = { path, ... }: path;
@@ -161,8 +139,7 @@ let
161139 ghcjsProject = pkgs.haskell-nix.cabalProject' (
162140 (pkgs.lib.filterAttrs
163141 (n: _: !(builtins.any (x: x == n)
164− [ "src" "ghcjsVersion" "ghcVersion" "happy" "alex" "cabal-install"
165− "overrideBootPackages" "patches"])) args) // {
142+ ["src" "ghcjsVersion" "ghcVersion" "happy" "alex" "cabal-install"])) args) // {
166143 src = configured-src;
167144 index-state = "2021-03-20T00:00:00Z";
168145 inherit compiler-nix-name;
@@ -186,7 +163,6 @@ let
186163 packages.Cabal.patches = [ ./../overlays/patches/Cabal/fix-data-dir.patch ];
187164 })
188165 {
189− ghcOptions = ["-O2"];
190166 packages.ghcjs.doHaddock = false;
191167 packages.haddock-ghcjs.doHaddock = false;
192168 packages.haddock-api-ghcjs.doHaddock = false;
lib/project-overlays.nix+2−2
@@ -11,8 +11,8 @@
1111 # devshell does not use pkgs.mkShell / pkgs.stdenv.mkDerivation,
1212 # so we need to explicit required dependencies which
1313 # are provided implicitely by stdenv when using the normal shell:
14− ++ (lib.filter lib.isDerivation final.shell.stdenv.defaultNativeBuildInputs)
15− ++ [ final.pkgs.buildPackages.binutils ];
14+ ++ final.shell.stdenv.defaultNativeBuildInputs
15+ ++ final.shell.stdenv.extraNativeBuildInputs;
1616 env = lib.mapAttrsToList lib.nameValuePair {
1717 inherit (final.shell) CABAL_CONFIG NIX_GHC_LIBDIR;
1818 };
overlays/bootstrap.nix−3
@@ -795,7 +795,6 @@ in {
795795 ghc = buildGHC;
796796 ghcVersion = "8.10.5";
797797 compiler-nix-name = "ghc8105";
798− overrideBootPackages = final.callPackage ../compiler/ghcjs/ghcjs810-patched-boot-packages {};
799798 }; in let targetPrefix = "js-unknown-ghcjs-"; in final.runCommand "${targetPrefix}ghc-8.10.5" {
800799 nativeBuildInputs = [ final.xorg.lndir ];
801800 passthru = {
@@ -830,7 +829,6 @@ in {
830829 ghc = buildGHC;
831830 ghcVersion = "8.10.6";
832831 compiler-nix-name = "ghc8106";
833− overrideBootPackages = final.callPackage ../compiler/ghcjs/ghcjs810-patched-boot-packages {};
834832 }; in let targetPrefix = "js-unknown-ghcjs-"; in final.runCommand "${targetPrefix}ghc-8.10.6" {
835833 nativeBuildInputs = [ final.xorg.lndir ];
836834 passthru = {
@@ -865,7 +863,6 @@ in {
865863 ghc = buildGHC;
866864 ghcVersion = "8.10.7";
867865 compiler-nix-name = "ghc8107";
868− overrideBootPackages = final.callPackage ../compiler/ghcjs/ghcjs810-patched-boot-packages {};
869866 }; in let targetPrefix = "js-unknown-ghcjs-"; in final.runCommand "${targetPrefix}ghc-8.10.7" {
870867 nativeBuildInputs = [ final.xorg.lndir ];
871868 passthru = {
overlays/ghc.nix+8−12
@@ -1,13 +1,9 @@
11final: prev: with prev;
22 # sadly we need to patch GHC a bit.
3− let
4− # The new implementation appeared in GHC 9.0
5− hasNativeBignum = name: !lib.hasPrefix "ghc8" name;
6−
7− ghcPkgOverrides = name: { enableIntegerSimple = false; } // lib.optionalAttrs (hasNativeBignum name) {
8− enableNativeBignum = false;
9− };
10−
3+ let
4+ ghcPkgOverrides = {
5+ enableIntegerSimple = false;
6+ };
117 ghcDrvOverrides = drv: {
128 hardeningDisable = (drv.hardeningDisable or []) ++ [ "stackprotector" "format" ] ++ lib.optionals prev.stdenv.hostPlatform.isAarch32 [ "pic" "pie" ];
139 };
@@ -24,13 +20,13 @@ final: prev: with prev;
2420 && !lib.hasPrefix "ghc82" name
2521 && !lib.hasPrefix "ghcjs" name
2622 && !lib.hasSuffix "Binary" name;
27− overrideCompiler = name: compiler:
28− ((compiler.override (ghcPkgOverrides name)).overrideAttrs ghcDrvOverrides) // {
29− dwarf = overrideCompiler name compiler.dwarf;
23+ overrideCompiler = compiler:
24+ ((compiler.override ghcPkgOverrides).overrideAttrs ghcDrvOverrides) // {
25+ dwarf = overrideCompiler compiler.dwarf;
3026 };
3127 in
3228 lib.recursiveUpdate prev.haskell-nix {
33− compiler = lib.mapAttrs overrideCompiler
29+ compiler = lib.mapAttrs (_name: overrideCompiler)
3430 (lib.filterAttrs (name: _value: needsPatches name) prev.haskell-nix.compiler);
3531 };
3632 }
overlays/ghcjs.nix+3−4
@@ -1,6 +1,6 @@
11final: prev:
22{
3− haskell-nix = prev.haskell-nix // {
3+ haskell-nix = prev.haskell-nix // ({
44 defaultModules = prev.haskell-nix.defaultModules ++ final.lib.optional final.stdenv.hostPlatform.isGhcjs (
55 ({ pkgs, buildModules, config, lib, ... }: {
66 # Allow Cabal to be reinstalled so that custom setups will use a Cabal
@@ -17,8 +17,7 @@ final: prev:
1717 "hpc"
1818 "mtl" "parsec" "process" "text" "time" "transformers"
1919 "unix" "xhtml" "terminfo"
20− ] ++ lib.optionals (builtins.compareVersions config.compiler.version "8.10.0.0" >= 0)
21− (map ({name, ...}: name) (import ../compiler/ghcjs/ghcjs810-patched-boot-packages { inherit pkgs; }));
20+ ];
2221 testWrapper = [((final.writeScriptBin "node-wrapper" ''
2322 set -euo pipefail
2423 exe=$1
@@ -56,5 +55,5 @@ final: prev:
5655 });
5756 })
5857 );
59− };
58+ });
6059}
overlays/haskell.nix+3−10
@@ -145,17 +145,11 @@ final: prev: {
145145 if compiler-nix-name != null
146146 then compiler-nix-name
147147 else ((plan-pkgs.extras hackage).compiler or (plan-pkgs.pkgs hackage).compiler).nix-name;
148− compiler-nix-name-with-js-prefix =
149− if final.stdenv.hostPlatform.isGhcjs
150− then "js-" + compiler-nix-name'
151− else compiler-nix-name';
152148 pkg-def = excludeBootPackages compiler-nix-name plan-pkgs.pkgs;
153− patchesModule = ghcHackagePatches.${compiler-nix-name-with-js-prefix} or {};
154− compilerVersion = final.buildPackages.haskell-nix.compiler.${compiler-nix-name'}.version;
155− package.compiler-nix-name.version = compilerVersion;
149+ patchesModule = ghcHackagePatches.${compiler-nix-name'} or {};
150+ package.compiler-nix-name.version = final.buildPackages.haskell-nix.compiler.${compiler-nix-name'}.version;
156151 plan.compiler-nix-name.version = final.buildPackages.haskell-nix.compiler.${(plan-pkgs.pkgs hackage).compiler.nix-name}.version;
157152 withMsg = final.lib.assertMsg;
158− isPatchedGHCJS = final.stdenv.hostPlatform.isGhcjs && builtins.compareVersions compilerVersion "8.10.0.0" >= 0;
159153 in
160154 # Check that the GHC version of the selected compiler matches the one of the plan
161155 assert (withMsg
@@ -177,8 +171,7 @@ final: prev: {
177171 # the plan.
178172 modules = [ { doExactConfig = true; } patchesModule ]
179173 ++ modules
180− ++ (plan-pkgs.modules or [])
181− ++ final.lib.optional isPatchedGHCJS { packages.reflex.flags.fast-weak = true; };
174+ ++ plan-pkgs.modules or [];
182175 inherit extra-hackages;
183176 };
184177
patches/default.nix−1
@@ -8,5 +8,4 @@
88 ghc863 = import ./ghc863;
99 ghc864 = import ./ghc864;
1010 ghc865 = import ./ghc865;
11− js-ghc8107 = import ./js-ghc8107;
1211}
patches/ghc862/default.nix+1−1
@@ -4,8 +4,8 @@
44 packages.hpc.patches = [ ({ version, revision }: if version == "0.6.0.3" && revision == 0 then ./hpc-0.6.0.3.patch else null) ];
55 packages.parsec.patches = [ ({ version, revision }: if version == "3.1.13.0" && revision == 0 then ./parsec-3.1.13.0.patch else null) ];
66 packages.process.patches = [ ({ version, revision }: if version == "1.6.3.0" && revision == 0 then ./process-1.6.3.0.patch else null) ];
7− packages.singletons.patches = [ ({ version, revision }: if version == "2.5.1" && revision == 0 then ./singletons-2.5.1.patch else null) ];
87 packages.time.patches = [ ({ version, revision }: if version == "1.8.0.2" && revision == 0 then ./time-1.8.0.2.patch else null) ];
98 packages.transformers.patches = [ ({ version, revision }: if version == "0.5.5.0" && revision == 0 then ./transformers-0.5.5.0.patch else null) ];
109 packages.unix.patches = [ ({ version, revision }: if version == "2.7.2.2" && revision == 0 then ./unix-2.7.2.2.patch else null) ];
10+ packages.singletons.patches = [ ({ version, revision }: if version == "2.5.1" && revision == 0 then ./singletons-2.5.1.patch else null) ];
1111}
patches/ghc863/default.nix+1−1
@@ -4,8 +4,8 @@
44 packages.hpc.patches = [ ({ version, revision }: if version == "0.6.0.3" && revision == 0 then ./hpc-0.6.0.3.patch else null) ];
55 packages.parsec.patches = [ ({ version, revision }: if version == "3.1.13.0" && revision == 0 then ./parsec-3.1.13.0.patch else null) ];
66 packages.process.patches = [ ({ version, revision }: if version == "1.6.3.0" && revision == 0 then ./process-1.6.3.0.patch else null) ];
7− packages.singletons.patches = [ ({ version, revision }: if version == "2.5.1" && revision == 0 then ./singletons-2.5.1.patch else null) ];
87 packages.time.patches = [ ({ version, revision }: if version == "1.8.0.2" && revision == 0 then ./time-1.8.0.2.patch else null) ];
98 packages.transformers.patches = [ ({ version, revision }: if version == "0.5.5.0" && revision == 0 then ./transformers-0.5.5.0.patch else null) ];
109 packages.unix.patches = [ ({ version, revision }: if version == "2.7.2.2" && revision == 0 then ./unix-2.7.2.2.patch else null) ];
10+ packages.singletons.patches = [ ({ version, revision }: if version == "2.5.1" && revision == 0 then ./singletons-2.5.1.patch else null) ];
1111}
patches/ghc864/default.nix+1−1
@@ -3,6 +3,6 @@
33 packages.containers.patches = [ ({ version, revision }: if version == "0.6.0.1" && revision == 0 then ./containers-0.6.0.1.patch else null) ];
44 packages.hpc.patches = [ ({ version, revision }: if version == "0.6.0.3" && revision == 0 then ./hpc-0.6.0.3.patch else null) ];
55 packages.parsec.patches = [ ({ version, revision }: if version == "3.1.13.0" && revision == 0 then ./parsec-3.1.13.0.patch else null) ];
6− packages.singletons.patches = [ ({ version, revision }: if version == "2.5.1" && revision == 0 then ./singletons-2.5.1.patch else null) ];
76 packages.unix.patches = [ ({ version, revision }: if version == "2.7.2.2" && revision == 0 then ./unix-2.7.2.2.patch else null) ];
7+ packages.singletons.patches = [ ({ version, revision }: if version == "2.5.1" && revision == 0 then ./singletons-2.5.1.patch else null) ];
88}
patches/ghc865/default.nix+1−1
@@ -3,6 +3,6 @@
33 packages.containers.patches = [ ({ version, revision }: if version == "0.6.0.1" && revision == 0 then ./containers-0.6.0.1.patch else null) ];
44 packages.hpc.patches = [ ({ version, revision }: if version == "0.6.0.3" && revision == 0 then ./hpc-0.6.0.3.patch else null) ];
55 packages.parsec.patches = [ ({ version, revision }: if version == "3.1.13.0" && revision == 0 then ./parsec-3.1.13.0.patch else null) ];
6− packages.singletons.patches = [ ({ version, revision }: if version == "2.5.1" && revision == 0 then ./singletons-2.5.1.patch else null) ];
76 packages.unix.patches = [ ({ version, revision }: if version == "2.7.2.2" && revision == 0 then ./unix-2.7.2.2.patch else null) ];
7+ packages.singletons.patches = [ ({ version, revision }: if version == "2.5.1" && revision == 0 then ./singletons-2.5.1.patch else null) ];
88}
patches/js-ghc8107/buffer-builder.patchdeleted−79
@@ -1,79 +0,0 @@
1−From ece29d689b56e51b22b39c8d0b8740e325830f23 Mon Sep 17 00:00:00 2001
2−From: Luigy Leon <luigy@outlook.com>
3−Date: Fri, 6 Oct 2017 18:39:35 -0400
4−Subject: [PATCH] text-jsstring
5−
6−---
7− buffer-builder.cabal | 3 +++
8− src/Data/BufferBuilder.hs | 25 +++++++++++++++++++++++--
9− 2 files changed, 26 insertions(+), 2 deletions(-)
10−
11−diff --git a/buffer-builder.cabal b/buffer-builder.cabal
12−index fe24f73..868d3c1 100644
13−--- a/buffer-builder.cabal
14−+++ b/buffer-builder.cabal
15−@@ -65,6 +65,9 @@ library
16− if !impl(ghc >= 8.0)
17− build-depends: semigroups
18−
19−+ if impl(ghcjs)
20−+ build-depends: ghcjs-base
21−+
22− default-language: Haskell2010
23− ghc-options: -O2 -Wall
24− --ghc-options: -ddump-ds -ddump-simpl -ddump-stg -ddump-opt-cmm -ddump-asm -ddump-to-file
25−diff --git a/src/Data/BufferBuilder.hs b/src/Data/BufferBuilder.hs
26−index 30b39ce..0468afb 100644
27−--- a/src/Data/BufferBuilder.hs
28−+++ b/src/Data/BufferBuilder.hs
29−@@ -1,4 +1,7 @@
30−-{-# LANGUAGE OverloadedStrings, MagicHash, BangPatterns, RecordWildCards, DeriveDataTypeable #-}
31−+{-# LANGUAGE OverloadedStrings, MagicHash, BangPatterns, RecordWildCards, DeriveDataTypeable, CPP #-}
32−+#ifdef ghcjs_HOST_OS
33−+{-# LANGUAGE UnboxedTuples, ForeignFunctionInterface, UnliftedFFITypes #-}
34−+#endif
35−
36− {-|
37− A library for efficiently building up a buffer of data. When given data
38−@@ -71,6 +74,9 @@ import Data.Typeable (Typeable)
39− import Data.Text () -- Show
40− import Data.Text.Internal (Text (..))
41− import Data.Text.Array (Array (..))
42−+#ifdef ghcjs_HOST_OS
43−+import Data.JSString
44−+#endif
45−
46− data Handle'
47− type Handle = Ptr Handle'
48−@@ -349,8 +355,17 @@ appendEscapedJsonLiteral addr =
49− {-# INLINE appendEscapedJsonLiteral #-}
50−
51− appendEscapedJsonText :: Text -> BufferBuilder ()
52−+#ifndef ghcjs_HOST_OS
53− appendEscapedJsonText !(Text arr ofs len) =
54−- let byteArray = aBA arr
55−+ let
56−+#else
57−+appendEscapedJsonText !(Text t) =
58−+ let (# ba#, len# #) = js_fromString t
59−+ len = I# len#
60−+ arr = Array ba#
61−+ ofs = 0
62−+#endif
63−+ byteArray = aBA arr
64− in withHandle $ \h ->
65− bw_append_json_escaped_utf16 h len (Ptr (byteArrayContents# byteArray) `plusPtr` (2 * ofs))
66− {-# INLINE appendEscapedJsonText #-}
67−@@ -364,3 +379,9 @@ appendUrlEncoded !(BS.PS (ForeignPtr addr _) offset len) =
68− withHandle $ \h ->
69− bw_append_url_encoded h len (plusPtr (Ptr addr) offset)
70− {-# INLINE appendUrlEncoded #-}
71−+
72−+#ifdef ghcjs_HOST_OS
73−+foreign import javascript unsafe
74−+ "h$textFromString"
75−+ js_fromString :: JSString -> (# ByteArray#, Int# #)
76−+#endif
77−--
78−2.31.1
79−
patches/js-ghc8107/conduit-extra.patchdeleted−48
@@ -1,48 +0,0 @@
1−diff --git a/Data/Conduit/Attoparsec.hs b/Data/Conduit/Attoparsec.hs
2−index bd889f8..a620675 100644
3−--- a/Data/Conduit/Attoparsec.hs
4−+++ b/Data/Conduit/Attoparsec.hs
5−@@ -1,4 +1,5 @@
6− {-# LANGUAGE BangPatterns #-}
7−+{-# LANGUAGE CPP #-}
8− {-# LANGUAGE DeriveDataTypeable #-}
9− {-# LANGUAGE FlexibleContexts #-}
10− {-# LANGUAGE RankNTypes #-}
11−@@ -33,6 +34,9 @@ import qualified Data.Text as T
12− import qualified Data.Text.Internal as TI
13− import Data.Typeable (Typeable)
14− import Prelude hiding (lines)
15−+#ifdef __GHCJS__
16−+import qualified Data.JSString.Raw as JSS
17−+#endif
18−
19− import qualified Data.Attoparsec.ByteString
20− import qualified Data.Attoparsec.Text
21−@@ -105,8 +109,13 @@ instance AttoparsecInput T.Text where
22− f (Position l c o) ch
23− | ch == '\n' = Position (l + 1) 0 (o + 1)
24− | otherwise = Position l (c + 1) (o + 1)
25−+#ifndef __GHCJS__
26− stripFromEnd (TI.Text arr1 off1 len1) (TI.Text _ _ len2) =
27− TI.text arr1 off1 (len1 - len2)
28−+#else
29−+ stripFromEnd (TI.Text str1) (TI.Text str2) =
30−+ TI.Text $ JSS.rawDropEnd (JSS.rawLength str1 - JSS.rawLength str2) str1
31−+#endif
32−
33− -- | Convert an Attoparsec 'A.Parser' into a 'Sink'. The parser will
34− -- be streamed bytes until it returns 'A.Done' or 'A.Fail'.
35−diff --git a/conduit-extra.cabal b/conduit-extra.cabal
36−index f6dfe7a..b5b2515 100644
37−--- a/conduit-extra.cabal
38−+++ b/conduit-extra.cabal
39−@@ -58,6 +58,9 @@ Library
40− , unliftio-core
41− , typed-process >= 0.2
42−
43−+ if impl(ghcjs)
44−+ Build-depends: ghcjs-base
45−+
46− ghc-options: -Wall
47−
48− test-suite test
patches/js-ghc8107/default.nixdeleted−7
@@ -1,7 +0,0 @@
1−{
2− packages.buffer-builder.patches = [ ({ version, revision }: ./buffer-builder.patch) ];
3− packages.conduit-extra.patches = [ ({ version, revision }: ./conduit-extra.patch) ];
4− packages.double-conversion.patches = [ ({ version, revision }: ./double-conversion.patch) ];
5− packages.network.patches = [ ({ version, revision }: ./network.patch) ];
6− packages.say.patches = [ ({ version, revision }: ./say.patch) ];
7−}
patches/js-ghc8107/double-conversion.patchdeleted−64
@@ -1,64 +0,0 @@
1−From 0f9ddde468687d25fa6c4c9accb02a034bc2f9c3 Mon Sep 17 00:00:00 2001
2−From: Luigy Leon <luigy@outlook.com>
3−Date: Thu, 1 Dec 2016 12:43:59 -0500
4−Subject: [PATCH] Add text jsstring support for ghcjs.
5−
6−---
7− Data/Double/Conversion/Text.hs | 17 +++++++++++++++--
8− double-conversion.cabal | 4 ++++
9− 2 files changed, 19 insertions(+), 2 deletions(-)
10−
11−diff --git a/Data/Double/Conversion/Text.hs b/Data/Double/Conversion/Text.hs
12−index 2e89705..3b315a7 100644
13−--- a/Data/Double/Conversion/Text.hs
14−+++ b/Data/Double/Conversion/Text.hs
15−@@ -1,4 +1,4 @@
16−-{-# LANGUAGE CPP, MagicHash, Rank2Types #-}
17−+{-# LANGUAGE CPP, MagicHash, Rank2Types, ForeignFunctionInterface, UnliftedFFITypes #-}
18−
19− -- |
20− -- Module : Data.Double.Conversion.Text
21−@@ -33,7 +33,12 @@ import Control.Monad.ST (runST)
22− import Data.Double.Conversion.FFI
23− import Data.Text.Internal (Text(Text))
24− import Foreign.C.Types (CDouble, CInt)
25−-import GHC.Prim (MutableByteArray#)
26−+#ifndef __GHCJS__
27−+import GHC.Prim (MutableByteArray#, ByteArray#)
28−+#else
29−+import GHC.Prim (MutableByteArray#, Int#, ByteArray#)
30−+import Data.JSString
31−+#endif
32− import qualified Data.Text.Array as A
33−
34− -- | Compute a representation in exponential format with the requested
35−@@ -81,4 +86,12 @@ convert func len act val = runST go
36− fail $ "Data.Double.Conversion.Text." ++ func ++
37− ": conversion failed (invalid precision requested)"
38− frozen <- A.unsafeFreeze buf
39−+#ifndef __GHCJS__
40− return $ Text frozen 0 (fromIntegral size)
41−+#else
42−+ return $ Text $ js_toString (A.aBA frozen) 0# (fromIntegral size)
43−+
44−+foreign import javascript unsafe
45−+ "h$textToString"
46−+ js_toString :: ByteArray# -> Int# -> Int -> JSString
47−+#endif
48−diff --git a/double-conversion.cabal b/double-conversion.cabal
49−index d177d3f..5f0527f 100644
50−--- a/double-conversion.cabal
51−+++ b/double-conversion.cabal
52−@@ -90,6 +90,10 @@ library
53− ghc-prim,
54− text >= 0.11.0.8
55−
56−+ if impl(ghcjs)
57−+ build-depends:
58−+ ghcjs-base
59−+
60− if flag(developer)
61− ghc-options: -Werror
62− ghc-prof-options: -auto-all
63−--
64−2.31.1
patches/js-ghc8107/network.patchdeleted−16
@@ -1,16 +0,0 @@
1−diff --git a/Network/Socket.hsc b/Network/Socket.hsc
2−index 4edebd4..43ecdb7 100644
3−--- a/Network/Socket.hsc
4−+++ b/Network/Socket.hsc
5−@@ -479,11 +479,7 @@ setNonBlockIfNeeded fd =
6− --
7− -- Since 2.7.0.0.
8− setCloseOnExecIfNeeded :: CInt -> IO ()
9−-#if defined(mingw32_HOST_OS)
10− setCloseOnExecIfNeeded _ = return ()
11−-#else
12−-setCloseOnExecIfNeeded fd = System.Posix.Internals.setCloseOnExec fd
13−-#endif
14−
15− #if !defined(mingw32_HOST_OS)
16− foreign import ccall unsafe "fcntl"
patches/js-ghc8107/say.patchdeleted−22
@@ -1,22 +0,0 @@
1−diff --git a/src/Say.hs b/src/Say.hs
2−index a1f6802..fd9145d 100644
3−--- a/src/Say.hs
4−+++ b/src/Say.hs
5−@@ -146,7 +146,7 @@ hSay h msg =
6− return new_buf
7−
8− writeBlocksRaw :: Buffer CharBufElem -> Stream Char -> IO ()
9−- writeBlocksRaw buf0 (Stream next0 s0 _len) =
10−+ writeBlocksRaw buf0 (Stream next0 s0) =
11− outer s0 buf0
12− where
13− outer s1 Buffer{bufRaw=raw, bufSize=len} =
14−@@ -168,7 +168,7 @@ hSay h msg =
15− flush = commit n True{-needs flush-} False{-don't release-} >>= outer s
16−
17− writeBlocksCRLF :: Buffer CharBufElem -> Stream Char -> IO ()
18−- writeBlocksCRLF buf0 (Stream next0 s0 _len) =
19−+ writeBlocksCRLF buf0 (Stream next0 s0) =
20− outer s0 buf0
21− where
22− outer s1 Buffer{bufRaw=raw, bufSize=len} =
patches/update-patches.sh+2−6
@@ -1,15 +1,11 @@
11#!/usr/bin/env bash
2−for ghc in $(find . -maxdepth 1 -mindepth 1 -type d | sort); do
2+for ghc in $(find . -name "ghc*" -type d | sort); do
33 (cd $ghc
44 echo "{" > default.nix
55 (for a in $(find . -name "*.patch" -type f | sort); do
66 b=${a%%.patch};
77 b=${b##./};
8− if [[ "$ghc" =~ js- ]]; then
9− echo " packages.$b.patches = [ ({ version, revision }: $a) ];" >> default.nix
10− else
11− echo " packages.${b%%-*}.patches = [ ({ version, revision }: if version == \"${b##*-}\" && revision == 0 then $a else null) ];" >> default.nix
12− fi
8+ echo " packages.${b%%-*}.patches = [ ({ version, revision }: if version == \"${b##*-}\" && revision == 0 then $a else null) ];" >> default.nix
139 done) || true
1410 echo "}" >> default.nix)
1511done