nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 70 lines 1.7 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 cmake, 5 eigen, 6 fetchFromGitHub, 7 mpi, 8 pkgconfig, 9 python, 10 # true or false to enable/disable; null to use upstream defaults 11 withHpmc ? null, 12 withMd ? null, 13 withMetal ? null, 14 withMpcd ? null, 15}: 16 17let 18 optionalCmakeBool = name: value: lib.optionals (value != null) [ (lib.cmakeBool name value) ]; 19in 20buildPythonPackage rec { 21 version = "6.0.0"; 22 pname = "hoomd-blue"; 23 pyproject = false; # Built with cmake 24 25 src = fetchFromGitHub { 26 owner = "glotzerlab"; 27 repo = "hoomd-blue"; 28 tag = "v${version}"; 29 hash = "sha256-dmDBAJU6FxMQXuMO+nE1yzOY1m6/x43eH3USBQNVu8A="; 30 fetchSubmodules = true; 31 }; 32 33 nativeBuildInputs = [ 34 cmake 35 pkgconfig 36 ]; 37 buildInputs = [ 38 eigen 39 mpi 40 ]; 41 42 dependencies = with python.pkgs; [ 43 numpy 44 mpi4py 45 pybind11 46 ]; 47 48 dontAddPrefix = true; 49 cmakeFlags = [ 50 (lib.cmakeBool "BUILD_TESTING" doCheck) 51 (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/${python.sitePackages}") 52 ] 53 ++ optionalCmakeBool "BUILD_MD" withMd 54 ++ optionalCmakeBool "BUILD_HPMC" withHpmc 55 ++ optionalCmakeBool "BUILD_METAL" withMetal 56 ++ optionalCmakeBool "BUILD_MPCD" withMpcd; 57 58 # Tests are performed as part of the installPhase when -DBUILD_TESTING=TRUE, 59 # not the checkPhase or installCheckPhase. 60 # But leave doCheck here so people can override it as they may expect. 61 doCheck = true; 62 63 meta = { 64 homepage = "https://glotzerlab.engin.umich.edu/software/"; 65 description = "HOOMD-blue is a general-purpose particle simulation toolkit"; 66 changelog = "https://github.com/glotzerlab/hoomd-blue/blob/${src.tag}/CHANGELOG.rst"; 67 license = lib.licenses.bsd3; 68 maintainers = [ ]; 69 }; 70}