1{ 2 buildPythonPackage, 3 cmake, 4 fetchFromGitHub, 5 gtest, 6 hydra-core, 7 lib, 8 nlohmann_json, 9 pybind11, 10 pyvirtualdisplay, 11 sfml, 12 substituteAll, 13}: 14 15buildPythonPackage rec { 16 pname = "nocturne"; 17 version = "unstable-2022-10-15"; 18 format = "setuptools"; 19 20 src = fetchFromGitHub { 21 owner = "facebookresearch"; 22 repo = pname; 23 rev = "ae0a4e361457caf6b7e397675cc86f46161405ed"; 24 hash = "sha256-pFVbl4m7qX1mJgleNabRboS9klDDsbzUa4PYL5+Jupc="; 25 }; 26 27 # Simulate the git submodules but with nixpkgs dependencies 28 postUnpack = '' 29 rm -rf $sourceRoot/third_party/* 30 ln -s ${nlohmann_json.src} $sourceRoot/third_party/json 31 ln -s ${pybind11.src} $sourceRoot/third_party/pybind11 32 ''; 33 34 patches = [ 35 (substituteAll { 36 src = ./dependencies.patch; 37 gtest_src = gtest.src; 38 }) 39 ]; 40 41 nativeBuildInputs = [ cmake ]; 42 dontUseCmakeConfigure = true; 43 44 buildInputs = [ sfml ]; 45 46 # hydra-core and pyvirtualdisplay are not declared as dependences but they are requirements 47 propagatedBuildInputs = [ 48 hydra-core 49 pyvirtualdisplay 50 ]; 51 52 # Test suite requires hydra-submitit-launcher which is not packaged as of 2022-01-02 53 doCheck = false; 54 55 pythonImportsCheck = [ "nocturne" ]; 56 57 meta = with lib; { 58 description = "A data-driven, fast driving simulator for multi-agent coordination under partial observability"; 59 homepage = "https://github.com/facebookresearch/nocturne"; 60 license = licenses.mit; 61 maintainers = with maintainers; [ samuela ]; 62 }; 63}