on master help sign in
Add ghc 8.10.1 support and bump version
commite671d1851dc335087398951f5ca5fad46093146e authorHamish Mackenzie <Hamish.K.Mackenzie@gmail.com> dateSat 18 Jul 2020, 17:06 (6 years ago) parent17e9e3a
10 files changed+207−54
cabal.project+4−7 default.nix+9−26 jsaddle-clib/jsaddle-clib.cabal+2−2 jsaddle-warp/jsaddle-warp.cabal+5−5 jsaddle-webkit2gtk/jsaddle-webkit2gtk.cabal+2−2 jsaddle-wkwebview/jsaddle-wkwebview.cabal+2−2 jsaddle/jsaddle.cabal+7−7 nix/sources.json+38 nix/sources.nix+134 shell.nix+4−3
cabal.project+4−7
@@ -6,12 +6,9 @@ packages:
66 jsaddle-webkit2gtk/
77 jsaddle-clib/
88
9−constraints: haskell-gi-overloading == 0.0
9+constraints: haskell-gi-overloading == 0.0, random >=1.2, time >=1.10, process >=1.6.10.0
1010
11−write-ghc-environment-files: never
11+package jsaddle-warp
12+ tests: False
1213
13−source-repository-package
14− type: git
15− location: https://github.com/gtk2hs/webkit-javascriptcore
16− tag: 5868624d0ea1db6e6279c301f7f56adb808a85bf
17− --sha256: 0aj0cvcbnzrdi1ynahpb4034vadfrs99n5qa8dar1srhijv55g8b
14+allow-newer: websockets:random splitmix:time *:time *:unix *:process
default.nix+9−26
@@ -1,28 +1,11 @@
1−{ pkgs ? import nixpkgs (haskellNixpkgsArgs // (if system == null then {} else { inherit system; }) //
2− { overlays = haskellNixpkgsArgs.overlays ++ [(self: super: {
3− inherit (self.haskell-nix.haskellPackages) alex happy;
4− })];})
5−, nixpkgs ? haskellNixSrc + "/nixpkgs"
6−, haskellNixpkgsArgs ? import haskellNixSrc
7−, haskellNixSrc ? builtins.fetchTarball {
8− url = "https://github.com/input-output-hk/haskell.nix/archive/1dd6951d6a56115fd368c5b37b8dab47a90ec45c.tar.gz";
9− sha256 = "02nhjy90xwg9wrp81cnlczndxags966c71wlbz6n91423a13mc99";
10− }
11−, haskellCompiler ? "ghc881"
1+{ sourcesOverride ? {}
2+, sources ? import ./nix/sources.nix {} // sourcesOverride
3+, pkgs ? (import sources."haskell.nix" {}).pkgs
4+, compiler-nix-name ? "ghc8101"
125, system ? null
136}:
14−let
15− frameworks = pkgs.lib.optionals pkgs.stdenv.isDarwin (
16− with pkgs.darwin.apple_sdk.frameworks; [ Cocoa Carbon CoreGraphics ]);
17− project = pkgs.haskell-nix.cabalProject' {
18− src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
19− ghc = pkgs.buildPackages.pkgs.haskell-nix.compiler.${haskellCompiler};
20− modules = [
21− ({ config, ...}: {
22− packages.gi-gtk.components.setup.frameworks = frameworks;
23− packages.vault.components.library.doHaddock = false;
24− })
25− ];
26− };
27−in
28− project
7+ pkgs.haskell-nix.project {
8+ inherit compiler-nix-name;
9+ src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; name = "jsaddle"; };
10+ modules = [{ reinstallableLibGhc = true; packages.jsaddle-warp.components.tests.test-tool.buildable = pkgs.lib.mkForce false; }];
11+ }
jsaddle-clib/jsaddle-clib.cabal+2−2
@@ -1,5 +1,5 @@
11name: jsaddle-clib
2−version: 0.9.7.0
2+version: 0.9.7.1
33cabal-version: >=1.10
44build-type: Simple
55license: MIT
@@ -21,7 +21,7 @@ library
2121 Language.Javascript.JSaddle.CLib
2222 Language.Javascript.JSaddle.CLib.Internal
2323 build-depends:
24− aeson >=0.8.0.2 && <1.5,
24+ aeson >=0.8.0.2 && <1.6,
2525 base <5,
2626 base-compat >=0.9.0 && <0.12,
2727 bytestring >=0.10.6.0 && <0.11,
jsaddle-warp/jsaddle-warp.cabal+5−5
@@ -1,5 +1,5 @@
11name: jsaddle-warp
2−version: 0.9.7.0
2+version: 0.9.7.1
33cabal-version: >=1.10
44build-type: Simple
55license: MIT
@@ -27,7 +27,7 @@ library
2727 other-modules:
2828 Language.Javascript.JSaddle.WebSockets.Compat
2929 build-depends:
30− aeson >=0.8.0.2 && <1.5,
30+ aeson >=0.8.0.2 && <1.6,
3131 bytestring >=0.10.6.0 && <0.11,
3232 containers >=0.5.6.2 && <0.7,
3333 foreign-store >=0.2 && <0.3,
@@ -35,7 +35,7 @@ library
3535 jsaddle >=0.9.4.0 && <0.10,
3636 stm >=2.4.4 && <2.6,
3737 text >=1.2.1.3 && <1.3,
38− time >=1.5.0.1 && <1.10,
38+ time >=1.5.0.1 && <1.11,
3939 transformers >=0.4.2.0 && <0.6,
4040 wai >=3.0.3.0 && <3.3,
4141 wai-websockets >=3.0.0.6 && <3.1,
@@ -59,7 +59,7 @@ test-suite test-tool
5959 bytestring -any,
6060 containers -any,
6161 deepseq -any,
62− doctest >=0.10.1 && <0.17,
62+ doctest >=0.10.1 && <0.18,
6363 exceptions -any,
6464 filepath >=1.4.0.0 && <1.5,
6565 foreign-store -any,
@@ -81,7 +81,7 @@ test-suite test-tool
8181 wai -any,
8282 wai-websockets -any,
8383 warp -any,
84− webdriver >=0.8.4 && <1.0,
84+ webdriver >=0.8.4 && <0.10,
8585 websockets -any
8686 type: exitcode-stdio-1.0
8787 main-is: DocTest.hs
jsaddle-webkit2gtk/jsaddle-webkit2gtk.cabal+2−2
@@ -1,5 +1,5 @@
11name: jsaddle-webkit2gtk
2−version: 0.9.7.0
2+version: 0.9.7.1
33cabal-version: >=1.10
44build-type: Simple
55license: MIT
@@ -26,7 +26,7 @@ library
2626 base <5
2727 if !impl(ghcjs -any)
2828 build-depends:
29− aeson >=0.8.0.2 && <1.5,
29+ aeson >=0.8.0.2 && <1.6,
3030 base <5,
3131 bytestring >=0.10.6.0 && <0.11,
3232 directory >=1.0.0.2 && <1.4,
jsaddle-wkwebview/jsaddle-wkwebview.cabal+2−2
@@ -1,5 +1,5 @@
11name: jsaddle-wkwebview
2−version: 0.9.7.0
2+version: 0.9.7.1
33cabal-version: >=1.10
44build-type: Simple
55license: MIT
@@ -35,7 +35,7 @@ library
3535 hs-source-dirs: src-ghcjs
3636 else
3737 build-depends:
38− aeson >=0.8.0.2 && <1.5,
38+ aeson >=0.8.0.2 && <1.6,
3939 bytestring >=0.10.6.0 && <0.11,
4040 directory,
4141 jsaddle >= 0.9.4.0 && <0.10,
jsaddle/jsaddle.cabal+7−7
@@ -1,5 +1,5 @@
11name: jsaddle
2−version: 0.9.7.0
2+version: 0.9.7.1
33cabal-version: >=1.10
44build-type: Simple
55license: MIT
@@ -42,14 +42,14 @@ library
4242 ghc-prim,
4343 http-types >=0.8.6 && <0.13,
4444 process >=1.2.3.0 && <1.7,
45− random >= 1.1 && < 1.2,
45+ random >= 1.1 && < 1.3,
4646 ref-tf >=0.4.0.1 && <0.5,
4747 scientific >=0.3 && <0.4,
4848 stm >=2.4.4 && <2.6,
49− time >=1.5.0.1 && <1.10,
49+ time >=1.5.0.1 && <1.11,
5050 unordered-containers >=0.2 && <0.3,
5151 vector >=0.10 && <0.13,
52− unliftio-core >=0.1 && < 0.2
52+ unliftio-core >=0.1 && < 0.3
5353 exposed-modules:
5454 Data.JSString
5555 Data.JSString.Internal
@@ -107,13 +107,13 @@ library
107107 Language.Javascript.JSaddle.Value
108108 Language.Javascript.JSaddle.Types
109109 build-depends:
110− aeson >=0.8.0.2 && <1.5,
110+ aeson >=0.8.0.2 && <1.6,
111111 base >=4.9 && <5,
112112 base-compat >=0.9.0 && <0.12,
113− base64-bytestring >=1.0.0.1 && <1.1,
113+ base64-bytestring >=1.0.0.1 && <1.2,
114114 bytestring >=0.10.6.0 && <0.11,
115115 exceptions >=0.8 && <0.11,
116− lens >=3.8.5 && <4.19,
116+ lens >=3.8.5 && <4.20,
117117 primitive >=0.6.1.0 && <0.8,
118118 text >=1.2.1.3 && <1.3,
119119 transformers >=0.4.2.0 && <0.6
nix/sources.jsonnew file+38
@@ -0,0 +1,38 @@
1+{
2+ "haskell.nix": {
3+ "branch": "master",
4+ "description": "Alternative Haskell Infrastructure for Nixpkgs",
5+ "homepage": "https://input-output-hk.github.io/haskell.nix",
6+ "owner": "input-output-hk",
7+ "repo": "haskell.nix",
8+ "rev": "91b0a95e4071e7998778e1fe997f8ddcf759d48b",
9+ "sha256": "13jx33vj8ixr3m88181wybzb8qlx0rl249bpphgz944anxp8z521",
10+ "type": "tarball",
11+ "url": "https://github.com/input-output-hk/haskell.nix/archive/91b0a95e4071e7998778e1fe997f8ddcf759d48b.tar.gz",
12+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13+ },
14+ "niv": {
15+ "branch": "master",
16+ "description": "Easy dependency management for Nix projects",
17+ "homepage": "https://github.com/nmattia/niv",
18+ "owner": "nmattia",
19+ "repo": "niv",
20+ "rev": "c27f5a6c57de4495045450b6587d4a2c489851c8",
21+ "sha256": "064lyr1661pk7hh7npgxsmk4cni9bc34hb2d6r76qp4cs2hcazim",
22+ "type": "tarball",
23+ "url": "https://github.com/nmattia/niv/archive/c27f5a6c57de4495045450b6587d4a2c489851c8.tar.gz",
24+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
25+ },
26+ "nixpkgs": {
27+ "branch": "nixos-19.09",
28+ "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
29+ "homepage": "https://github.com/NixOS/nixpkgs",
30+ "owner": "NixOS",
31+ "repo": "nixpkgs-channels",
32+ "rev": "289466dd6a11c65a7de4a954d6ebf66c1ad07652",
33+ "sha256": "0r5ja052s86fr54fm1zlhld3fwawz2w1d1gd6vbvpjrpjfyajibn",
34+ "type": "tarball",
35+ "url": "https://github.com/NixOS/nixpkgs-channels/archive/289466dd6a11c65a7de4a954d6ebf66c1ad07652.tar.gz",
36+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
37+ }
38+}
nix/sources.nixnew file+134
@@ -0,0 +1,134 @@
1+# This file has been generated by Niv.
2+
3+let
4+
5+ #
6+ # The fetchers. fetch_<type> fetches specs of type <type>.
7+ #
8+
9+ fetch_file = pkgs: spec:
10+ if spec.builtin or true then
11+ builtins_fetchurl { inherit (spec) url sha256; }
12+ else
13+ pkgs.fetchurl { inherit (spec) url sha256; };
14+
15+ fetch_tarball = pkgs: spec:
16+ if spec.builtin or true then
17+ builtins_fetchTarball { inherit (spec) url sha256; }
18+ else
19+ pkgs.fetchzip { inherit (spec) url sha256; };
20+
21+ fetch_git = spec:
22+ builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; };
23+
24+ fetch_builtin-tarball = spec:
25+ builtins.trace
26+ ''
27+ WARNING:
28+ The niv type "builtin-tarball" will soon be deprecated. You should
29+ instead use `builtin = true`.
30+
31+ $ niv modify <package> -a type=tarball -a builtin=true
32+ ''
33+ builtins_fetchTarball { inherit (spec) url sha256; };
34+
35+ fetch_builtin-url = spec:
36+ builtins.trace
37+ ''
38+ WARNING:
39+ The niv type "builtin-url" will soon be deprecated. You should
40+ instead use `builtin = true`.
41+
42+ $ niv modify <package> -a type=file -a builtin=true
43+ ''
44+ (builtins_fetchurl { inherit (spec) url sha256; });
45+
46+ #
47+ # Various helpers
48+ #
49+
50+ # The set of packages used when specs are fetched using non-builtins.
51+ mkPkgs = sources:
52+ let
53+ sourcesNixpkgs =
54+ import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
55+ hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
56+ hasThisAsNixpkgsPath = <nixpkgs> == ./.;
57+ in
58+ if builtins.hasAttr "nixpkgs" sources
59+ then sourcesNixpkgs
60+ else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
61+ import <nixpkgs> {}
62+ else
63+ abort
64+ ''
65+ Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
66+ add a package called "nixpkgs" to your sources.json.
67+ '';
68+
69+ # The actual fetching function.
70+ fetch = pkgs: name: spec:
71+
72+ if ! builtins.hasAttr "type" spec then
73+ abort "ERROR: niv spec ${name} does not have a 'type' attribute"
74+ else if spec.type == "file" then fetch_file pkgs spec
75+ else if spec.type == "tarball" then fetch_tarball pkgs spec
76+ else if spec.type == "git" then fetch_git spec
77+ else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec
78+ else if spec.type == "builtin-url" then fetch_builtin-url spec
79+ else
80+ abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
81+
82+ # Ports of functions for older nix versions
83+
84+ # a Nix version of mapAttrs if the built-in doesn't exist
85+ mapAttrs = builtins.mapAttrs or (
86+ f: set: with builtins;
87+ listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
88+ );
89+
90+ # fetchTarball version that is compatible between all the versions of Nix
91+ builtins_fetchTarball = { url, sha256 }@attrs:
92+ let
93+ inherit (builtins) lessThan nixVersion fetchTarball;
94+ in
95+ if lessThan nixVersion "1.12" then
96+ fetchTarball { inherit url; }
97+ else
98+ fetchTarball attrs;
99+
100+ # fetchurl version that is compatible between all the versions of Nix
101+ builtins_fetchurl = { url, sha256 }@attrs:
102+ let
103+ inherit (builtins) lessThan nixVersion fetchurl;
104+ in
105+ if lessThan nixVersion "1.12" then
106+ fetchurl { inherit url; }
107+ else
108+ fetchurl attrs;
109+
110+ # Create the final "sources" from the config
111+ mkSources = config:
112+ mapAttrs (
113+ name: spec:
114+ if builtins.hasAttr "outPath" spec
115+ then abort
116+ "The values in sources.json should not have an 'outPath' attribute"
117+ else
118+ spec // { outPath = fetch config.pkgs name spec; }
119+ ) config.sources;
120+
121+ # The "config" used by the fetchers
122+ mkConfig =
123+ { sourcesFile ? ./sources.json
124+ , sources ? builtins.fromJSON (builtins.readFile sourcesFile)
125+ , pkgs ? mkPkgs sources
126+ }: rec {
127+ # The sources, i.e. the attribute set of spec name to spec
128+ inherit sources;
129+
130+ # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
131+ inherit pkgs;
132+ };
133+in
134+mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
shell.nix+4−3
@@ -1,3 +1,4 @@
1−{ haskellCompiler ? "ghc881" }:
2−(import ./. { inherit haskellCompiler; }).hsPkgs.shellFor {}
3−
1+{ sourcesOverride ? {}, compiler-nix-name ? "ghc8101" }:
2+(import ./. { inherit sourcesOverride compiler-nix-name; }).shellFor {
3+ tools = { cabal = "3.2.0.0"; };
4+}