1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 fetchpatch,
7 cmake,
8 cython,
9 oldest-supported-numpy,
10 scikit-build,
11 setuptools,
12 tbb,
13 numpy,
14 rowan,
15 scipy,
16 pytestCheckHook,
17 python,
18 gsd,
19 matplotlib,
20 sympy,
21}:
22
23buildPythonPackage rec {
24 pname = "freud";
25 version = "3.1.0";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "glotzerlab";
30 repo = "freud";
31 tag = "v${version}";
32 hash = "sha256-jlscEHQ1q4oqxE06NhVWCOlPRcjDcJVrvy4h6iYrkz0=";
33 fetchSubmodules = true;
34 };
35
36 patches = [
37 # https://github.com/glotzerlab/freud/issues/1269
38 (fetchpatch {
39 url = "https://github.com/glotzerlab/freud/commit/8f636e3815737945e45da5b9996b5f69df07c9a5.patch";
40 hash = "sha256-PLorRrYj16oBWHYzXDq62kECzVTtyr+1Z20DJqTkXxg=";
41 })
42 ];
43
44 # Because we prefer to not `leaveDotGit`, we need to fool upstream into
45 # thinking we left the .git files in the submodules, so cmake won't think we
46 # didn't initialize them. Upstream doesn't support using the system wide
47 # installed version of these libraries, and it's probably aint's worth the
48 # hassle, because upstream also doesn't distribute all of these dependencies'
49 # libraries, and probably it uses only what it needs.
50 preConfigure = ''
51 touch extern/{voro++,fsph,Eigen}/.git
52 '';
53
54 nativeBuildInputs = [
55 cmake
56 cython
57 oldest-supported-numpy
58 scikit-build
59 setuptools
60 ];
61 dontUseCmakeConfigure = true;
62 buildInputs = [ tbb ];
63
64 propagatedBuildInputs = [
65 numpy
66 rowan
67 scipy
68 ];
69
70 nativeCheckInputs = [
71 pytestCheckHook
72 gsd
73 matplotlib
74 sympy
75 ];
76 disabledTests = [
77 # https://github.com/glotzerlab/freud/issues/961
78 #
79 # For x86_64-linux, see:
80 #
81 # https://github.com/glotzerlab/freud/issues/961#issuecomment-2553344968
82 "test_docstring"
83 ];
84 # On top of cd $out due to https://github.com/NixOS/nixpkgs/issues/255262 ,
85 # we need to also copy the tests because otherwise pytest won't find them.
86 preCheck = ''
87 cp -R tests $out/${python.sitePackages}/freud/tests
88 cd $out
89 '';
90
91 pythonImportsCheck = [ "freud" ];
92
93 meta = {
94 description = "Powerful, efficient particle trajectory analysis in scientific Python";
95 homepage = "https://github.com/glotzerlab/freud";
96 changelog = "https://github.com/glotzerlab/freud/blob/${src.rev}/ChangeLog.md";
97 license = lib.licenses.bsd3;
98 maintainers = with lib.maintainers; [ doronbehar ];
99 };
100}