2022-12-05 21:00:45 +01:00
|
|
|
{ buildPythonPackage
|
|
|
|
, SDL2
|
|
|
|
, cmake
|
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, gym
|
|
|
|
, importlib-metadata
|
|
|
|
, importlib-resources
|
|
|
|
, lib
|
|
|
|
, ninja
|
|
|
|
, numpy
|
|
|
|
, pybind11
|
|
|
|
, pytestCheckHook
|
|
|
|
, python
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
|
|
|
, stdenv
|
|
|
|
, typing-extensions
|
|
|
|
, wheel
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ale-py";
|
2023-02-27 02:14:05 +01:00
|
|
|
version = "0.8.1";
|
2022-12-05 21:00:45 +01:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mgbellemare";
|
|
|
|
repo = "Arcade-Learning-Environment";
|
2023-02-27 02:14:05 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-03 01:48:06 +01:00
|
|
|
hash = "sha256-B2AxhlzvBy1lJ3JttJjImgTjMtEUyZBv+xHU2IC7BVE=";
|
2022-12-05 21:00:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# don't download pybind11, use local pybind11
|
|
|
|
./cmake-pybind11.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-08-19 18:36:35 +02:00
|
|
|
ninja
|
2022-12-05 21:00:45 +01:00
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
pybind11
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
zlib
|
|
|
|
SDL2
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
typing-extensions
|
|
|
|
importlib-resources
|
|
|
|
numpy
|
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
|
|
|
|
2023-01-21 13:00:00 +01:00
|
|
|
nativeCheckInputs = [
|
2022-12-05 21:00:45 +01:00
|
|
|
pytestCheckHook
|
|
|
|
gym
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'dynamic = ["version"]' 'version = "${version}"'
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], cwd=here)' 'b"${src.rev}"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "ale_py" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "a simple framework that allows researchers and hobbyists to develop AI agents for Atari 2600 games";
|
|
|
|
homepage = "https://github.com/mgbellemare/Arcade-Learning-Environment";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ billhuang ];
|
|
|
|
broken = stdenv.isDarwin; # fails to link with missing library
|
|
|
|
};
|
|
|
|
}
|