From f844f24dc59dd43f1c8dc03c228b31ec646dfbd3 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 6 Jul 2026 15:52:05 +0000 Subject: [PATCH 1/2] python3Packages.ale-py: add missing nvcc to fix CUDA build --- pkgs/development/python-modules/ale-py/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/ale-py/default.nix b/pkgs/development/python-modules/ale-py/default.nix index ec10c5decc26..e10dd2713436 100644 --- a/pkgs/development/python-modules/ale-py/default.nix +++ b/pkgs/development/python-modules/ale-py/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, + config, buildPythonPackage, fetchFromGitHub, @@ -17,6 +18,9 @@ opencv, zlib, + # nativeBuildInputs + cudaPackages, + # dependencies numpy, @@ -49,6 +53,11 @@ buildPythonPackage (finalAttrs: { jax ]; + nativeBuildInputs = lib.optionals config.cudaSupport [ + # Required by opencv's cmake + cudaPackages.cuda_nvcc + ]; + # disable lto on darwin, cmake cannot find llvm-ar postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace src/ale/CMakeLists.txt \ From aa245ebdb4efae73588defb8e815e2262faa385b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 6 Jul 2026 16:12:49 +0000 Subject: [PATCH 2/2] python3Packages.ale-py: move postPatch below src (cosmetic) --- .../python-modules/ale-py/default.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/ale-py/default.nix b/pkgs/development/python-modules/ale-py/default.nix index e10dd2713436..3185b3d0057f 100644 --- a/pkgs/development/python-modules/ale-py/default.nix +++ b/pkgs/development/python-modules/ale-py/default.nix @@ -43,6 +43,14 @@ buildPythonPackage (finalAttrs: { hash = "sha256-hFbreHk0i4h+JOyvDYcNX3TmwgvxNC5U0l5Xrqqz1zQ="; }; + # 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)' + ''; + build-system = [ cmake ninja @@ -58,14 +66,6 @@ buildPythonPackage (finalAttrs: { cudaPackages.cuda_nvcc ]; - # 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 = [ @@ -111,7 +111,6 @@ buildPythonPackage (finalAttrs: { ]; disabledTestPaths = [ - # "tests/python/test_atari_vector_xla.py" ];