Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09-beta 65 lines 1.7 kB view raw
1{ stdenv, fetchgit 2, cmake, pkgconfig 3, python 4, mpi ? null 5}: 6 7let components = { 8 cgcmm = true; 9 depreciated = true; 10 hpmc = true; 11 md = true; 12 metal = true; 13 }; 14 onOffBool = b: if b then "ON" else "OFF"; 15 withMPI = (mpi != null); 16in 17stdenv.mkDerivation rec { 18 version = "2.3.4"; 19 pname = "hoomd-blue"; 20 21 src = fetchgit { 22 url = "https://bitbucket.org/glotzer/hoomd-blue"; 23 rev = "v${version}"; 24 sha256 = "0in49f1dvah33nl5n2qqbssfynb31pw1ds07j8ziryk9w252j1al"; 25 }; 26 27 passthru = { 28 inherit components mpi; 29 }; 30 31 nativeBuildInputs = [ cmake pkgconfig ]; 32 buildInputs = stdenv.lib.optionals withMPI [ mpi ]; 33 propagatedBuildInputs = [ python.pkgs.numpy ] 34 ++ stdenv.lib.optionals withMPI [ python.pkgs.mpi4py ]; 35 36 enableParallelBuilding = true; 37 38 dontAddPrefix = true; 39 cmakeFlags = [ 40 "-DENABLE_MPI=${onOffBool withMPI}" 41 "-DBUILD_CGCMM=${onOffBool components.cgcmm}" 42 "-DBUILD_DEPRECIATED=${onOffBool components.depreciated}" 43 "-DBUILD_HPMC=${onOffBool components.hpmc}" 44 "-DBUILD_MD=${onOffBool components.md}" 45 "-DBUILD_METAL=${onOffBool components.metal}" 46 ]; 47 48 preConfigure = '' 49 # Since we can't expand $out in `cmakeFlags` 50 cmakeFlags="$cmakeFlags -DCMAKE_INSTALL_PREFIX=$out/${python.sitePackages}" 51 ''; 52 53 # tests fail but have tested that package runs properly 54 doCheck = false; 55 checkTarget = "test"; 56 57 meta = with stdenv.lib; { 58 homepage = "http://glotzerlab.engin.umich.edu/hoomd-blue/"; 59 description = "HOOMD-blue is a general-purpose particle simulation toolkit"; 60 license = licenses.bsdOriginal; 61 platforms = [ "x86_64-linux" ]; 62 maintainers = [ maintainers.costrouc ]; 63 }; 64 65}