Unverified Commit fe8152e9 authored by OTABI Tomoya's avatar OTABI Tomoya Committed by GitHub
Browse files

Merge pull request #331510 from GaetanLepage/ale

python312Packages.ale-py: 0.9.0 -> 0.9.1
parents 25d179ef 8a67aa85
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
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)
+21 −11
Original line number Diff line number Diff line
@@ -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,7 +61,13 @@ buildPythonPackage rec {
    typing-extensions
  ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];

  postPatch = ''
  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}"'
    '';