Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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 ]; 53 54 preConfigure = '' 55 # Since we can't expand $out in `cmakeFlags` 56 cmakeFlags="$cmakeFlags -DCMAKE_INSTALL_PREFIX=$out/${python.sitePackages}" 57 ''; 58 59 # tests fail but have tested that package runs properly 60 doCheck = false; 61 checkTarget = "test"; 62 63 meta = with lib; { 64 homepage = "http://glotzerlab.engin.umich.edu/hoomd-blue/"; 65 description = "HOOMD-blue is a general-purpose particle simulation toolkit"; 66 license = licenses.bsdOriginal; 67 platforms = [ "x86_64-linux" ]; 68 maintainers = [ ]; 69 # Has compilation errors since some dependencies got updated, will probably 70 # be fixed if updated by itself to the latest version. 71 broken = true; 72 }; 73}