nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, numpy
4, scipy
5, pyamg
6, pysparse
7, future
8, matplotlib
9, tkinter
10, mpi4py
11, scikit-fmm
12, isPy27
13, gmsh
14, python
15, stdenv
16, openssh
17, fetchurl
18}:
19
20buildPythonPackage rec {
21 pname = "fipy";
22 version = "3.4.2.1";
23
24 src = fetchurl {
25 url = "https://github.com/usnistgov/fipy/releases/download/${version}/FiPy-${version}.tar.gz";
26 sha256 = "0v5yk9b4hksy3176w4vm4gagb9kxqgv75zcyswlqvl371qwy1grk";
27 };
28
29 propagatedBuildInputs = [
30 numpy
31 scipy
32 pyamg
33 matplotlib
34 tkinter
35 mpi4py
36 future
37 scikit-fmm
38 openssh
39 ] ++ lib.optionals isPy27 [ pysparse ]
40 ++ lib.optionals (!stdenv.isDarwin) [ gmsh ];
41
42 # Reading version string from Gmsh is broken in latest release of FiPy
43 # This issue is repaired on master branch of FiPy
44 # Fixed with: https://github.com/usnistgov/fipy/pull/848/files
45 # Remove patch with next release.
46 patches = [ ./gmsh.patch ];
47
48 checkInputs = lib.optionals (!stdenv.isDarwin) [ gmsh ];
49
50 checkPhase = ''
51 export OMPI_MCA_plm_rsh_agent=${openssh}/bin/ssh
52 ${python.interpreter} setup.py test --modules
53 '';
54
55 meta = with lib; {
56 homepage = "https://www.ctcms.nist.gov/fipy/";
57 description = "A Finite Volume PDE Solver Using Python";
58 license = licenses.free;
59 maintainers = with maintainers; [ costrouc wd15 ];
60 };
61}