GHCJS support for Dhall (#734)

This adds a GHCJS build for Dhall so that:

* We can build a `try.dhall-lang.org` to try Dhall in the
  browser until the PureScript implementation comes online
* We can document how to build `dhall` using GHCJS
* We can verify that new changes to `dhall` or its dependencies
  don't break GHCJS support
* CI can build and cache GHCJS-related dependencies
This commit is contained in:
Gabriel Gonzalez 2018-12-03 08:07:18 -08:00 committed by GitHub
parent ec2d6c866c
commit 10a781534d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 3 deletions

21
nix/cborg.nix Normal file
View File

@ -0,0 +1,21 @@
{ mkDerivation, aeson, array, base, base16-bytestring
, base64-bytestring, bytestring, containers, deepseq, fail
, ghc-prim, half, integer-gmp, primitive, QuickCheck, scientific
, stdenv, tasty, tasty-hunit, tasty-quickcheck, text, vector
}:
mkDerivation {
pname = "cborg";
version = "0.2.1.0";
sha256 = "9198735f7645ae492345505448f790433f5fe407b19e1c6b2ec2a4c76bd97483";
libraryHaskellDepends = [
array base bytestring containers deepseq ghc-prim half integer-gmp
primitive text
];
testHaskellDepends = [
aeson array base base16-bytestring base64-bytestring bytestring
deepseq fail half QuickCheck scientific tasty tasty-hunit
tasty-quickcheck text vector
];
description = "Concise Binary Object Representation";
license = stdenv.lib.licenses.bsd3;
}

16
nix/haskeline_0_7_3_1.nix Normal file
View File

@ -0,0 +1,16 @@
{ mkDerivation, base, bytestring, containers, directory, filepath
, process, stdenv, stm, transformers, unix
}:
mkDerivation {
pname = "haskeline";
version = "0.7.4.3";
sha256 = "046d0930bc2dbc57a7cd9ddb5d1e92c7fdb71c6b91b2bbf673f5406843d6b679";
configureFlags = [ "-f-terminfo" ];
libraryHaskellDepends = [
base bytestring containers directory filepath process stm
transformers unix
];
homepage = "https://github.com/judah/haskeline";
description = "A command-line interface for user input, written in Haskell";
license = stdenv.lib.licenses.bsd3;
}

View File

@ -57,9 +57,9 @@ let
pkgsNew.haskell.lib.dontCheck drv;
failOnAllWarnings = drv:
# GHC 7.10.3 incorrectly detects non-exhaustive pattern
# matches
if compiler == "ghc7103"
# Older versions of GHC incorrectly detect non-exhaustive
# pattern matches
if compiler == "ghc7103" || compiler == "ghcjs"
then drv
else pkgsNew.haskell.lib.failOnAllWarnings drv;
@ -69,7 +69,11 @@ let
"comonad"
"distributive"
"doctest"
"half"
"http-types"
"megaparsec"
"prettyprinter"
"prettyprinter-ansi-terminal"
# https://github.com/well-typed/cborg/issues/172
"serialise"
"unordered-containers"

View File

@ -5,6 +5,9 @@ let
shared_8_6_1 =
import ./nix/shared.nix { compiler = "ghc861"; };
shared_ghcjs =
import ./nix/shared.nix { compiler = "ghcjs"; };
shared =
import ./nix/shared.nix { };
@ -38,6 +41,9 @@ in
shared.tarball-dhall-json
shared.tarball-dhall-text
# Verify that `dhall` can be built using GHCJS
shared_ghcjs.dhall
# This is the only `dhall` build that runs the test suite
coverage.dhall