Gaetan Lepage
2024-08-01 13:03:45 +02:00
committed by Florian Brandes
parent 4af4087dee
commit 4f564ff5ea
2 changed files with 21 additions and 29 deletions

View File

@@ -1,18 +0,0 @@
diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index 911e280..d484943 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -1,12 +1,6 @@
find_package(Python3 COMPONENTS Interpreter Development.Module REQUIRED)
-include(FetchContent)
-FetchContent_Declare(
- pybind11
- GIT_REPOSITORY https://github.com/pybind/pybind11
- GIT_TAG v2.10.0)
-FetchContent_MakeAvailable(pybind11)
-
+find_package(pybind11 REQUIRED)
add_library(ale-py MODULE ale_python_interface.cpp)
# Depend on the ALE and pybind11 module
target_link_libraries(ale-py PUBLIC ale ale-lib)

View File

@@ -3,25 +3,34 @@
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
# build-system
cmake,
ninja,
pybind11,
setuptools,
wheel,
# buildInputs
SDL2,
zlib,
# dependencies
importlib-resources,
numpy,
typing-extensions,
importlib-metadata,
# checks
gymnasium,
pytestCheckHook,
stdenv,
}:
buildPythonPackage rec {
pname = "ale-py";
version = "0.9.0";
version = "0.9.1";
pyproject = true;
disabled = pythonOlder "3.8";
@@ -30,14 +39,9 @@ buildPythonPackage rec {
owner = "Farama-Foundation";
repo = "Arcade-Learning-Environment";
rev = "refs/tags/v${version}";
hash = "sha256-obZfNQ0+ppnq/BD4IFeMFAqJnCVV3X/2HeRwbdSKRFk=";
hash = "sha256-MpumAQ5OW/+fRIvrBlRWkgioxMVceb5LxEH2JjRk5zY=";
};
patches = [
# don't download pybind11, use local pybind11
./cmake-pybind11.patch
];
build-system = [
cmake
ninja
@@ -57,10 +61,16 @@ buildPythonPackage rec {
typing-extensions
] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
'';
postPatch =
# Relax the pybind11 version
''
substituteInPlace src/python/CMakeLists.txt \
--replace-fail 'find_package(pybind11 ''${PYBIND11_VER} QUIET)' 'find_package(pybind11 QUIET)'
''
+ ''
substituteInPlace pyproject.toml \
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
'';
dontUseCmakeConfigure = true;