ref: 4161ae98a0bd95edcd9a8f48c5daf019dd7164bb misc/reflex-gl-demo/default.nix -rw-r--r-- 1.0 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ nixpkgs ? import ./nix/nixpkgs.nix {}
, compiler ? "default"
, doBenchmark ? false
}:

let
  inherit (nixpkgs) pkgs;

  codex = import ./nix/codex.nix;

  baseHaskellPackages = if compiler == "default"
                       then pkgs.haskellPackages
                       else pkgs.haskell.packages.${compiler};

  haskellPackages = baseHaskellPackages.override {
    overrides = self: super: with pkgs.haskell.lib; {
      reflex = overrideCabal super.reflex (drv: {
        broken = false;
        doCheck = false;
      });

      reflex-sdl2 = overrideCabal super.reflex-sdl2 (drv: {
        broken = false;
        jailbreak = true;
      });

      glow = super.callCabal2nix "glow" "${codex}/glow" {};
      ptrdiff = super.callCabal2nix "ptrdiff" "${codex}/ptrdiff" {};
      reflex-basic-host = super.callCabal2nix "reflex-basic-host"
        (import ./nix/reflex-basic-host.nix) {};
    };
  };

  variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
in
  variant (haskellPackages.callPackage ./reflex-gl-demo.nix {})