2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
llvmPackages,
|
|
|
|
zlib,
|
|
|
|
cython_0,
|
|
|
|
oldest-supported-numpy,
|
|
|
|
setuptools,
|
|
|
|
wheel,
|
|
|
|
astunparse,
|
|
|
|
numpy,
|
|
|
|
packaging,
|
|
|
|
pyparsing,
|
|
|
|
scipy,
|
|
|
|
gsd,
|
|
|
|
networkx,
|
|
|
|
pandas,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
tables,
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mdtraj";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.10.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mdtraj";
|
|
|
|
repo = "mdtraj";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-hNv/humEZOX4W7cOlJSAodk9pIi18//YJNSWNiEFiVg=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gsd_3-compatibility.patch";
|
|
|
|
url = "https://github.com/mdtraj/mdtraj/commit/81209d00817ab07cfc4668bf5ec88088d16904c0.patch";
|
|
|
|
hash = "sha256-ttNmij7csxF0Z5wPPwhGumRX055W2IgFjRAe6nI6GNY=";
|
|
|
|
})
|
2024-05-15 15:35:15 +00:00
|
|
|
# remove pkg_resources usage
|
|
|
|
# https://github.com/mdtraj/mdtraj/pull/1837
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-runtime-error.patch";
|
|
|
|
url = "https://github.com/mdtraj/mdtraj/commit/02d44d4db7039fceb199c85b4f993244804f470d.patch";
|
|
|
|
hash = "sha256-nhbi3iOrDSM87DyIp1KVt383Vvb6aYOgkjuYzviqiq8=";
|
|
|
|
})
|
|
|
|
# remove distutils usage
|
|
|
|
# https://github.com/mdtraj/mdtraj/pull/1834
|
|
|
|
(fetchpatch {
|
|
|
|
name = "python312-compatibility.patch";
|
|
|
|
url = "https://github.com/mdtraj/mdtraj/commit/95d79747deef42c976ca362a57806b61933409f3.patch";
|
|
|
|
hash = "sha256-Cq7/d745q6ZgAyWGM4ULnSsWezsbnu1CjSz5eqYSb+g=";
|
|
|
|
})
|
|
|
|
# disable intrinsics when SIMD is not available
|
|
|
|
# TODO: enable SIMD with python3.12
|
|
|
|
# https://github.com/mdtraj/mdtraj/pull/1884
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-intrinsics-flag.patch";
|
|
|
|
url = "https://github.com/mdtraj/mdtraj/commit/d6041c645d51898e2a09030633210213eec7d4c5.patch";
|
|
|
|
hash = "sha256-kcnlHMoA/exJzV8iQltH+LWXrvSk7gsUV+yWK6xn0jg=";
|
2024-06-05 15:53:02 +00:00
|
|
|
})
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
2024-04-21 15:54:59 +00:00
|
|
|
cython_0
|
2024-01-02 11:29:13 +00:00
|
|
|
oldest-supported-numpy
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ zlib ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2024-01-02 11:29:13 +00:00
|
|
|
astunparse
|
|
|
|
numpy
|
2024-05-15 15:35:15 +00:00
|
|
|
packaging
|
2024-01-02 11:29:13 +00:00
|
|
|
pyparsing
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-incompatible-function-pointer-types";
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
gsd
|
|
|
|
networkx
|
|
|
|
pandas
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
tables
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
cd tests
|
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# require network access
|
|
|
|
"test_pdb_from_url"
|
|
|
|
"test_1vii_url_and_gz"
|
|
|
|
|
|
|
|
# fail due to data race
|
|
|
|
"test_read_atomindices_1"
|
|
|
|
"test_read_atomindices_2"
|
|
|
|
|
|
|
|
# flaky test
|
2024-05-15 15:35:15 +00:00
|
|
|
"test_compare_rdf_t_master"
|
2024-01-02 11:29:13 +00:00
|
|
|
"test_distances_t"
|
2024-05-15 15:35:15 +00:00
|
|
|
"test_precentered_2"
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "mdtraj" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Open library for the analysis of molecular dynamics trajectories";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/mdtraj/mdtraj";
|
|
|
|
changelog = "https://github.com/mdtraj/mdtraj/releases/tag/${src.rev}";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|