From 550360d98e59300a23d52c182c5369fc12e491e9 Mon Sep 17 00:00:00 2001 From: Kirill Radzikhovskyy Date: Mon, 1 Jun 2026 20:20:42 +1000 Subject: [PATCH] python3Packages.ale-py: fix darwin build --- pkgs/development/python-modules/ale-py/default.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/ale-py/default.nix b/pkgs/development/python-modules/ale-py/default.nix index 3282fd421f5d..ec10c5decc26 100644 --- a/pkgs/development/python-modules/ale-py/default.nix +++ b/pkgs/development/python-modules/ale-py/default.nix @@ -48,6 +48,15 @@ buildPythonPackage (finalAttrs: { ++ lib.optionals stdenv.hostPlatform.isLinux [ jax ]; + + # disable lto on darwin, cmake cannot find llvm-ar + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/ale/CMakeLists.txt \ + --replace-fail \ + 'set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)' \ + 'set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)' + ''; + dontUseCmakeConfigure = true; buildInputs = [ @@ -104,10 +113,5 @@ buildPythonPackage (finalAttrs: { changelog = "https://github.com/Farama-Foundation/Arcade-Learning-Environment/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.gpl2; maintainers = with lib.maintainers; [ billhuang ]; - badPlatforms = [ - # FAILED: src/ale/libale.a - # /bin/sh: CMAKE_CXX_COMPILER_AR-NOTFOUND: command not found - lib.systems.inspect.patterns.isDarwin - ]; }; })