1{
2 buildPythonPackage,
3 lib,
4 fetchFromGitHub,
5 gfortran,
6 makeWrapper,
7 setuptools,
8 setuptools-scm,
9 numpy,
10 scipy,
11 distutils,
12 pytestCheckHook,
13 mock,
14 pytest-mock,
15 pythonAtLeast,
16}:
17
18buildPythonPackage rec {
19 pname = "i-pi";
20 version = "3.1.4";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "i-pi";
25 repo = "i-pi";
26 tag = "v${version}";
27 hash = "sha256-qM1DQNHTliYGWtVeYo0KEAg88cdt9GPB9w0pep0erj8=";
28 };
29
30 build-system = [
31 setuptools
32 setuptools-scm
33 ];
34
35 nativeBuildInputs = [
36 gfortran
37 makeWrapper
38 ];
39
40 dependencies = [
41 numpy
42 scipy
43 ];
44
45 nativeCheckInputs = [
46 pytestCheckHook
47 mock
48 pytest-mock
49 ] ++ lib.optional (pythonAtLeast "3.12") distutils;
50
51 pytestFlagsArray = [ "ipi_tests/unit_tests" ];
52 disabledTests = [
53 "test_driver_base"
54 "test_driver_forcebuild"
55 ];
56
57 postFixup = ''
58 wrapProgram $out/bin/i-pi \
59 --set IPI_ROOT $out
60 '';
61
62 meta = with lib; {
63 description = "Universal force engine for ab initio and force field driven (path integral) molecular dynamics";
64 license = with licenses; [
65 gpl3Only
66 mit
67 ];
68 homepage = "http://ipi-code.org/";
69 platforms = platforms.linux;
70 maintainers = [ maintainers.sheepforce ];
71 };
72}