at master 1.8 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchgit, 5 cmake, 6 pkgconfig, 7 python, 8 mpi ? null, 9}: 10 11let 12 components = { 13 cgcmm = true; 14 depreciated = true; 15 hpmc = true; 16 md = true; 17 metal = true; 18 }; 19 onOffBool = b: if b then "ON" else "OFF"; 20 withMPI = (mpi != null); 21in 22buildPythonPackage rec { 23 version = "2.3.4"; 24 pname = "hoomd-blue"; 25 pyproject = false; # Built with cmake 26 27 src = fetchgit { 28 url = "https://bitbucket.org/glotzer/hoomd-blue"; 29 rev = "v${version}"; 30 sha256 = "0in49f1dvah33nl5n2qqbssfynb31pw1ds07j8ziryk9w252j1al"; 31 }; 32 33 passthru = { 34 inherit components mpi; 35 }; 36 37 nativeBuildInputs = [ 38 cmake 39 pkgconfig 40 ]; 41 buildInputs = lib.optionals withMPI [ mpi ]; 42 propagatedBuildInputs = [ python.pkgs.numpy ] ++ lib.optionals withMPI [ python.pkgs.mpi4py ]; 43 44 dontAddPrefix = true; 45 cmakeFlags = [ 46 "-DENABLE_MPI=${onOffBool withMPI}" 47 "-DBUILD_CGCMM=${onOffBool components.cgcmm}" 48 "-DBUILD_DEPRECIATED=${onOffBool components.depreciated}" 49 "-DBUILD_HPMC=${onOffBool components.hpmc}" 50 "-DBUILD_MD=${onOffBool components.md}" 51 "-DBUILD_METAL=${onOffBool components.metal}" 52 "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/${python.sitePackages}" 53 ]; 54 55 # tests fail but have tested that package runs properly 56 doCheck = false; 57 checkTarget = "test"; 58 59 meta = with lib; { 60 homepage = "http://glotzerlab.engin.umich.edu/hoomd-blue/"; 61 description = "HOOMD-blue is a general-purpose particle simulation toolkit"; 62 license = licenses.bsdOriginal; 63 platforms = [ "x86_64-linux" ]; 64 maintainers = [ ]; 65 # Has compilation errors since some dependencies got updated, will probably 66 # be fixed if updated by itself to the latest version. 67 broken = true; 68 }; 69}