diff options
-rw-r--r-- | packages/sundials/nixpkgs.nix | 1 | ||||
-rw-r--r-- | packages/sundials/shell.nix | 20 | ||||
-rw-r--r-- | packages/sundials/stack.yaml | 4 |
3 files changed, 25 insertions, 0 deletions
diff --git a/packages/sundials/nixpkgs.nix b/packages/sundials/nixpkgs.nix new file mode 100644 index 0000000..b416238 --- /dev/null +++ b/packages/sundials/nixpkgs.nix | |||
@@ -0,0 +1 @@ | |||
import (fetchTarball "https://github.com/nixos/nixpkgs/archive/54ade273e7a677ec35e501174d86d253d9d8dede.tar.gz") | |||
diff --git a/packages/sundials/shell.nix b/packages/sundials/shell.nix new file mode 100644 index 0000000..c034dde --- /dev/null +++ b/packages/sundials/shell.nix | |||
@@ -0,0 +1,20 @@ | |||
1 | {ghc}: | ||
2 | |||
3 | with import <nixpkgs> {}; | ||
4 | |||
5 | let | ||
6 | gfortranlibdir = "${gfortran7.cc.lib}"; | ||
7 | # XXX Workaround https://ghc.haskell.org/trac/ghc/ticket/11042. | ||
8 | libHack = if stdenv.isDarwin then { | ||
9 | DYLD_LIBRARY_PATH = [gfortranlibdir]; | ||
10 | } else { | ||
11 | LD_LIBRARY_PATH = [gfortranlibdir]; | ||
12 | }; | ||
13 | in | ||
14 | haskell.lib.buildStackProject ({ | ||
15 | name = "haskell-sundials"; | ||
16 | buildInputs = [blas liblapack sundials zlib]; | ||
17 | inherit ghc; | ||
18 | # XXX Workaround https://ghc.haskell.org/trac/ghc/ticket/11042. | ||
19 | extraArgs = ["--extra-lib-dirs=${gfortranlibdir}"]; | ||
20 | } // libHack) | ||
diff --git a/packages/sundials/stack.yaml b/packages/sundials/stack.yaml index 5529e0a..d87e6fd 100644 --- a/packages/sundials/stack.yaml +++ b/packages/sundials/stack.yaml | |||
@@ -6,3 +6,7 @@ packages: | |||
6 | extra-deps: | 6 | extra-deps: |
7 | - diagrams-rasterific-1.4 | 7 | - diagrams-rasterific-1.4 |
8 | - plots-0.1.0.2 | 8 | - plots-0.1.0.2 |
9 | |||
10 | nix: | ||
11 | path: [nixpkgs=./nixpkgs.nix] | ||
12 | shell-file: shell.nix | ||