|
1 | | -{ pkgs ? import <nixpkgs> {} }: |
2 | | -let |
3 | | - pkg = (import ./default.nix {}).env; |
4 | | -in |
5 | | - pkgs.lib.overrideDerivation pkg (drv: { |
6 | | - shellHook = '' |
7 | | - export AF_PRINT_ERRORS=1 |
8 | | - export PATH=$PATH:${pkgs.haskellPackages.doctest}/bin |
9 | | - export PATH=$PATH:${pkgs.haskellPackages.cabal-install}/bin |
10 | | - function ghcid () { |
11 | | - ${pkgs.haskellPackages.ghcid.bin}/bin/ghcid -c 'cabal v1-repl lib:arrayfire' |
12 | | - }; |
13 | | - function test-runner () { |
14 | | - ${pkgs.ag}/bin/ag -l | \ |
15 | | - ${pkgs.entr}/bin/entr sh -c \ |
16 | | - 'cabal v1-configure --enable-tests && \ |
17 | | - cabal v1-build test && dist/build/test/test' |
18 | | - } |
19 | | - function test () { |
20 | | - cabal v1-configure --enable-tests && \ |
21 | | - cabal v1-build test && dist/build/test/test |
22 | | - } |
23 | | - function doctest-runner () { |
24 | | - ${pkgs.ag}/bin/ag -l | \ |
25 | | - ${pkgs.entr}/bin/entr sh -c \ |
26 | | - 'cabal v1-configure --enable-tests && \ |
27 | | - cabal v1-build doctests && dist/build/doctests/doctests src/ArrayFire/Algorithm.hs' |
28 | | - } |
29 | | - function exe () { |
30 | | - cabal run main |
31 | | - } |
32 | | - function repl () { |
33 | | - cabal v1-repl lib:arrayfire |
34 | | - } |
35 | | - function docs () { |
36 | | - cabal haddock |
37 | | - open ./dist-newstyle/*/*/*/*/doc/html/arrayfire/index.html |
38 | | - } |
39 | | - ''; |
40 | | - }) |
| 1 | +with (import ./default.nix {}); |
| 2 | + |
| 3 | +pkgs.lib.overrideDerivation hsPkgs.arrayfire.env (drv: { |
| 4 | + shellHook = '' |
| 5 | + export AF_PRINT_ERRORS=1 |
| 6 | + export PATH=$PATH:${hsPkgs.doctest}/bin |
| 7 | +
|
| 8 | + export AF_LIB=${pkgs.arrayfire}/lib |
| 9 | + export AF_INCLUDE=${pkgs.arrayfire}/include |
| 10 | + export LD_LIBRARY_PATH="$AF_LIB:$LD_LIBRARY_PATH" |
| 11 | +
|
| 12 | + echo $LD_LIBRARY_PATH |
| 13 | +
|
| 14 | + export RUN_HS="runhaskell Setup.hs" |
| 15 | + export CFLAGS="-f+disable-default-paths --extra-include-dirs=$AF_INCLUDE --extra-lib-dirs=$AF_LIB" |
| 16 | + export CONFIGURE="$RUN_HS configure $CFLAGS" |
| 17 | +
|
| 18 | + function ghcid () { |
| 19 | + $CONFIGURE && \ |
| 20 | + ${pkgs.ghcid}/bin/ghcid \ |
| 21 | + -c '$RUN_HS repl --repl-options=-fno-code lib:arrayfire' |
| 22 | + } |
| 23 | +
|
| 24 | + function test-runner () { |
| 25 | + $CONFIGURE --enable-tests && \ |
| 26 | + ${pkgs.ag}/bin/ag -l | \ |
| 27 | + ${pkgs.entr}/bin/entr sh -c \ |
| 28 | + '$RUN_HS build test && dist/build/test/test' |
| 29 | + } |
| 30 | +
|
| 31 | + function test() { |
| 32 | + $CONFIGURE --enable-tests && \ |
| 33 | + $RUN_HS build test && dist/build/test/test |
| 34 | + } |
| 35 | +
|
| 36 | + function doctest-runner () { |
| 37 | + ${pkgs.ag}/bin/ag -l | \ |
| 38 | + ${pkgs.entr}/bin/entr sh -c \ |
| 39 | + '$CONFIGURE --enable-tests && \ |
| 40 | + $RUN_HS build doctests && \ |
| 41 | + dist/build/doctests/doctests src/ArrayFire/Algorithm.hs' |
| 42 | + } |
| 43 | + function exe () { |
| 44 | + cabal run main |
| 45 | + } |
| 46 | + function repl () { |
| 47 | + $CONFIGURE && $RUN_HS repl lib:arrayfire |
| 48 | + } |
| 49 | + function docs () { |
| 50 | + cabal haddock |
| 51 | + open ./dist-newstyle/*/*/*/*/doc/html/arrayfire/index.html |
| 52 | + } |
| 53 | + ''; |
| 54 | +}) |
0 commit comments