summary refs log tree commit diff
path: root/pkgs/development/python-modules/lammps-cython/default.nix
blob: df2a122d068177170716bc3fef330f12c3c4f62a (plain) (blame)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ lib
, fetchurl
, buildPythonPackage
, lammps-mpi
, mpi
, mpi4py
, numpy
, cython
, pymatgen
, ase
, pytestrunner
, pytest_4
, pytestcov
, isPy3k
, openssh
}:

buildPythonPackage rec {
  pname = "lammps-cython";
  version = "0.5.7";
  disabled = (!isPy3k);

  src = fetchurl {
     url = "https://gitlab.com/costrouc/${pname}/-/archive/v${version}/${pname}-v${version}.tar.gz";
     sha256 = "1wj9scmjdl00af13b5ihfccrjpikrdgkzd88ialam1nkxvxi42bl";
  };

  buildInputs = [ cython pytestrunner ];
  checkInputs = [ pytest_4 pytestcov openssh ];
  propagatedBuildInputs = [ mpi4py pymatgen ase numpy ];

  preBuild = ''
    echo "Creating lammps.cfg file..."
    cat << EOF > lammps.cfg
    [lammps]
    lammps_include_dir = ${lammps-mpi}/include
    lammps_library_dir = ${lammps-mpi}/lib
    lammps_library = lammps_mpi

    [mpi]
    mpi_include_dir = ${mpi}/include
    mpi_library_dir = ${mpi}/lib
    mpi_library     = mpi
    EOF
  '';

  meta = {
    description = "Pythonic Wrapper to LAMMPS using cython";
    homepage = https://gitlab.com/costrouc/lammps-cython;
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ costrouc ];
  };
}