on develop help sign in
Simplify the Nix
9671472John Ericson
default.nix+52−4
@@ -3,9 +3,57 @@ haskellPackages: let
3 inherit (pkgs) stdenv;
3 inherit (pkgs) stdenv;
4 haskellLib = pkgs.haskell.lib;
4 haskellLib = pkgs.haskell.lib;
5in {
5in {
6− reflex-dom = haskellPackages.callPackage ./reflex-dom {};
6+ reflex-dom-core = haskellPackages.callPackage
7− reflex-dom-core = haskellPackages.callPackage ./reflex-dom-core {
7+ ({ temporary, jsaddle-warp, process, chrome-test-utils
8− inherit (pkgs) iproute chromium;
8+ , selenium-server-standalone, which, fontconfig, chromium, pkgs
9+ }: let
10+ inherit (haskellPackages) ghc;
11+ noGcTest = stdenv.hostPlatform.system != "x86_64-linux"
12+ || stdenv.hostPlatform != stdenv.buildPlatform
13+ || (ghc.isGhcjs or false);
14+ in haskellLib.overrideCabal
15+ (haskellPackages.callCabal2nix "reflex-dom-core" ./reflex-dom-core { })
16+ (drv: {
17+ #TODO: Get hlint working for cross-compilation
18+ doCheck = stdenv.hostPlatform == stdenv.buildPlatform && !(ghc.isGhcjs or false);
19+
20+ # The headless browser run as part of the tests will exit without this
21+ preBuild = ''
22+ export HOME="$PWD"
23+ '';
24+
25+ # Show some output while running tests, so we might notice what's wrong
26+ testTarget = "--show-details=streaming";
27+
28+ testHaskellDepends = (drv.testHaskellDepends or []) ++ stdenv.lib.optionals (!noGcTest) [
29+ temporary
30+ jsaddle-warp
31+ process
32+ chrome-test-utils
33+ ];
34+
35+ testSystemDepends = (drv.testSystemDepends or []) ++ [
36+ selenium-server-standalone which
37+ ] ++ stdenv.lib.optionals (!noGcTest) [
38+ chromium
39+ pkgs.iproute
40+ ];
41+ } // stdenv.lib.optionalAttrs (!noGcTest) {
42+ # The headless browser run as part of gc tests would hang/crash without this
43+ preCheck = ''
44+ export FONTCONFIG_PATH=${fontconfig.out}/etc/fonts
45+ '';
46+ }))
47+ {};
48+ reflex-dom = haskellPackages.callPackage
49+ ({ android-activity }: haskellLib.overrideCabal
50+ (haskellPackages.callCabal2nix "reflex-dom" ./reflex-dom { })
51+ (drv: {
52+ # Hack until https://github.com/NixOS/cabal2nix/pull/432 lands
53+ libraryHaskellDepends = (drv.libraryHaskellDepends or []) ++ stdenv.lib.optionals (with stdenv.hostPlatform; isAndroid && is32bit) [
54+ android-activity
55+ ];
56+ }))
9− };
57+ {};
10 chrome-test-utils = haskellPackages.callCabal2nix "chrome-test-utils" ./chrome-test-utils {};
58 chrome-test-utils = haskellPackages.callCabal2nix "chrome-test-utils" ./chrome-test-utils {};
11}
59}
reflex-dom-core/default.nixdeleted−63
@@ -1,63 +0,0 @@
1−{ mkDerivation, aeson, base, bifunctors, bimap, blaze-builder
2−, bytestring, chrome-test-utils, constraints, constraints-extras, containers
3−, contravariant, data-default, dependent-map, dependent-sum
4−, dependent-sum-template, directory, exception-transformers
5−, exceptions, filepath, ghcjs-dom, hlint, hspec, hspec-webdriver, http-types, HUnit
6−, jsaddle, jsaddle-warp, keycode, lens, lifted-base
7−, monad-control, mtl, network, network-uri, primitive, process
8−, random, ref-tf, reflex, semigroups, silently, stdenv, stm
9−, template-haskell, temporary, text, these, transformers, unix, wai
10−, wai-websockets, warp, webdriver, websockets, zenc
11−, ghc, iproute, chromium, hashable, selenium-server-standalone, which, fontconfig
12−}:
13−let addGcTestDepends = drv: if (stdenv.system != "x86_64-linux" || stdenv.hostPlatform != stdenv.buildPlatform || (ghc.isGhcjs or false)) then drv else drv // {
14− # The headless browser run as part of gc tests would hang/crash without this
15− preCheck = ''
16− export FONTCONFIG_PATH=${fontconfig.out}/etc/fonts
17− '';
18− testHaskellDepends = (drv.testHaskellDepends or []) ++ [
19− temporary
20− jsaddle-warp
21− process
22− chrome-test-utils
23− ];
24− testSystemDepends = (drv.testSystemDepends or []) ++ [ chromium iproute ];
25− };
26−in mkDerivation (addGcTestDepends {
27− pname = "reflex-dom-core";
28− version = "0.5.2.0";
29− src = ./.;
30− libraryHaskellDepends = [
31− aeson base bifunctors bimap blaze-builder bytestring constraints
32− containers contravariant data-default dependent-map dependent-sum
33− dependent-sum-template directory exception-transformers ghcjs-dom
34− jsaddle keycode lens monad-control mtl network-uri primitive random
35− ref-tf reflex semigroups stm template-haskell text these
36− transformers unix zenc
37− ] ++ (if ghc.isGhcjs or false then [
38− hashable
39− ] else []);
40−
41− #TODO: Get hlint working for cross-compilation
42− doCheck = stdenv.hostPlatform == stdenv.buildPlatform && !(ghc.isGhcjs or false);
43−
44− # The headless browser run as part of the tests will exit without this
45− preBuild = ''
46− export HOME="$PWD"
47− '';
48−
49− # Show some output while running tests, so we might notice what's wrong
50− testTarget = "--show-details=streaming";
51−
52− testSystemDepends = [ selenium-server-standalone which ];
53− testHaskellDepends = [
54− aeson base bytestring constraints constraints-extras containers
55− dependent-map dependent-sum dependent-sum-template directory
56− exceptions filepath ghcjs-dom hlint hspec hspec-webdriver http-types HUnit jsaddle
57− jsaddle-warp lens lifted-base network process random reflex
58− silently temporary text unix wai wai-websockets warp webdriver
59− websockets
60− ];
61− description = "Functional Reactive Web Apps with Reflex";
62− license = stdenv.lib.licenses.bsd3;
63−})
reflex-dom/default.nixdeleted−36
@@ -1,36 +0,0 @@
1−{ mkDerivation, base, bytestring, jsaddle-webkit2gtk, jsaddle-wkwebview, jsaddle-warp, reflex
2−, reflex-dom-core, stdenv, text, ghc, hostPlatform, jsaddle-clib, android-activity ? null
3−, ghcBackend ? if hostPlatform.isDarwin then "wkwebview" else "webkit2gtk"
4−}:
5−assert (builtins.elem ghcBackend [ "warp" "webkit2gtk" "wkwebview" ]);
6−let isAndroid = hostPlatform.libc == "bionic";
7− ghcBackendPackage = {
8− webkit2gtk = jsaddle-webkit2gtk;
9− warp = jsaddle-warp;
10− wkwebview = jsaddle-wkwebview;
11− }.${ghcBackend};
12−in mkDerivation {
13− pname = "reflex-dom";
14− version = "0.5.2.0";
15− src = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ ".git" "dist" ])) ./.;
16− libraryHaskellDepends = [
17− base bytestring reflex reflex-dom-core text
18− ] ++ (if ghc.isGhcjs or false then [
19− ] else if hostPlatform.isiOS then [
20− jsaddle-wkwebview
21− ] else if isAndroid then [
22− jsaddle-clib
23− android-activity
24− ] else if hostPlatform.isMacOS then [
25− jsaddle-wkwebview
26− ghcBackendPackage
27− ] else [
28− ghcBackendPackage
29− ]);
30− configureFlags = if ghcBackend == "warp" then [
31− "-fuse-warp"
32− ] else [
33− ];
34− description = "Functional Reactive Web Apps with Reflex";
35− license = stdenv.lib.licenses.bsd3;
36−}