Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkgs/development/python-modules/librosa/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ buildPythonPackage rec {
hash = "sha256-T58J/Gi3tHzelr4enbYJi1KmO46QxE5Zlhkc0+EgvRg=";
};

patches = [
# <https://github.com/librosa/librosa/pull/1977>
./fix-with-numba-0.62.0.patch
];

build-system = [ setuptools ];

dependencies = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 902bcca8cfc84801cf93a6c3ca59da283072a79f Mon Sep 17 00:00:00 2001
From: Emily <hello@emily.moe>
Date: Wed, 27 Aug 2025 18:58:07 +0100
Subject: [PATCH] Fix types in beat tracking code

The development version of Numba 0.62.0 is unhappy about `range`
being applied to floating point values here.
---
librosa/beat.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/librosa/beat.py b/librosa/beat.py
index 1a19005d..4ed9e945 100644
--- a/librosa/beat.py
+++ b/librosa/beat.py
@@ -582,7 +582,7 @@ def __beat_track_dp(localscore, frames_per_beat, tightness, backlink, cumscore):
# Search over all possible predecessors to find the best preceding beat
# NOTE: to provide time-varying tempo estimates, we replace
# frames_per_beat[0] by frames_per_beat[i] in this loop body.
- for loc in range(i - np.round(frames_per_beat[tv * i] / 2), i - 2 * frames_per_beat[tv * i] - 1, - 1):
+ for loc in range(i - round(frames_per_beat[tv * i] / 2), int(i - 2 * frames_per_beat[tv * i] - 1), - 1):
# Once we're searching past the start, break out
if loc < 0:
break
--
2.50.1

32 changes: 20 additions & 12 deletions pkgs/development/python-modules/llvmlite/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,25 @@

setuptools,

cmake,
ninja,

llvm_20,
libxml2,

# tests
pytestCheckHook,
llvm,
libxml2,

withStaticLLVM ? true,
}:

let
llvm = llvm_20;
in

buildPythonPackage rec {
pname = "llvmlite";
version = "0.44.0";
version = "0.45.0rc1";
pyproject = true;

disabled = isPyPy || pythonAtLeast "3.14";
Expand All @@ -27,28 +35,28 @@ buildPythonPackage rec {
owner = "numba";
repo = "llvmlite";
tag = "v${version}";
hash = "sha256-ZIA/JfK9ZP00Zn6SZuPus30Xw10hn3DArHCkzBZAUV0=";
hash = "sha256-wMTNtUuslCjopyfF6FAtfJAR0zuWjL8N8G16UKiplN0=";
};

build-system = [ setuptools ];

buildInputs = [ llvm ] ++ lib.optionals withStaticLLVM [ libxml2.dev ];

postPatch = lib.optionalString withStaticLLVM ''
substituteInPlace ffi/build.py --replace-fail "--system-libs --libs all" "--system-libs --libs --link-static all"
'';
nativeBuildInputs = [
cmake
ninja
];

# Set directory containing llvm-config binary
env.LLVM_CONFIG = "${llvm.dev}/bin/llvm-config";
buildInputs = [ llvm ] ++ lib.optionals withStaticLLVM [ libxml2.dev ];

nativeCheckInputs = [ pytestCheckHook ];

dontUseCmakeConfigure = true;

# https://github.com/NixOS/nixpkgs/issues/255262
preCheck = ''
cd $out
'';

__impureHostDeps = lib.optionals stdenv.hostPlatform.isDarwin [ "/usr/lib/libm.dylib" ];
env.LLVMLITE_SHARED = !withStaticLLVM;

passthru = lib.optionalAttrs (!withStaticLLVM) { inherit llvm; };

Expand Down
40 changes: 16 additions & 24 deletions pkgs/development/python-modules/numba/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let
cudatoolkit = cudaPackages.cuda_nvcc;
in
buildPythonPackage rec {
version = "0.61.2";
version = "0.62.0rc1";
pname = "numba";
pyproject = true;

Expand All @@ -51,23 +51,16 @@ buildPythonPackage rec {
postFetch = ''
sed -i 's/git_refnames = "[^"]*"/git_refnames = " (tag: ${src.tag})"/' $out/numba/_version.py
'';
hash = "sha256-Qa2B5pOWrLb/1V3PSyiwS1x9ueXwDKRhDMDecBCAN+8=";
hash = "sha256-YnozYetRsrCl5+UvK4y1QQykUqSMshi9vcv/K5A0dts=";
};

postPatch = ''
substituteInPlace numba/cuda/cudadrv/driver.py \
--replace-fail \
"dldir = [" \
"dldir = [ '${addDriverRunpath.driverLink}/lib', "

substituteInPlace setup.py \
--replace-fail 'max_numpy_run_version = "2.3"' 'max_numpy_run_version = "2.4"'
substituteInPlace numba/__init__.py \
--replace-fail "numpy_version > (2, 2)" "numpy_version > (2, 3)"
'';

env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-I${lib.getInclude stdenv.cc.libcxx}/include/c++/v1";

build-system = [
setuptools
numpy
Expand All @@ -80,21 +73,16 @@ buildPythonPackage rec {

buildInputs = lib.optionals cudaSupport [ cudaPackages.cuda_cudart ];

pythonRelaxDeps = [ "numpy" ];
pythonRelaxDeps = [
"numpy"
];

dependencies = [
numpy
llvmlite
];

patches = [
(fetchpatch2 {
url = "https://github.com/numba/numba/commit/e2c8984ba60295def17e363a926d6f75e7fa9f2d.patch";
includes = [ "numba/core/bytecode.py" ];
hash = "sha256-HIVbp3GSmnq6W7zrRIirIbhGjJsFN3PNyHSfAE8fdDw=";
})
]
++ lib.optionals cudaSupport [
patches = lib.optionals cudaSupport [
(replaceVars ./cuda_path.patch {
cuda_toolkit_path = cudatoolkit;
cuda_toolkit_lib_path = lib.getLib cudatoolkit;
Expand All @@ -111,12 +99,16 @@ buildPythonPackage rec {
cd $out
'';

enabledTestPaths = lib.optionals (!doFullCheck) [
# These are the most basic tests. Running all tests is too expensive, and
# some of them fail (also differently on different platforms), so it will
# be too hard to maintain such a `disabledTests` list.
"${python.sitePackages}/numba/tests/test_usecases.py"
];
enabledTestPaths =
if doFullCheck then
null
else
[
# These are the most basic tests. Running all tests is too expensive, and
# some of them fail (also differently on different platforms), so it will
# be too hard to maintain such a `disabledTests` list.
"${python.sitePackages}/numba/tests/test_usecases.py"
];

disabledTests = lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# captured stderr: Fatal Python error: Segmentation fault
Expand Down
3 changes: 1 addition & 2 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8641,8 +8641,7 @@ self: super: with self; {
llmx = callPackage ../development/python-modules/llmx { };

llvmlite = callPackage ../development/python-modules/llvmlite {
# llvmlite always requires a specific version of llvm.
llvm = pkgs.llvm_16;
inherit (pkgs) cmake ninja;
};

lm-eval = callPackage ../development/python-modules/lm-eval { };
Expand Down
Loading