1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitLab,
5 pythonAtLeast,
6
7 # build-system
8 setuptools,
9}:
10
11buildPythonPackage {
12 pname = "mathutils";
13 version = "3.3.0";
14 pyproject = true;
15
16 src = fetchFromGitLab {
17 owner = "ideasman42";
18 repo = "blender-mathutils";
19 rev = "d63d623a9e580a567eb6acb7dbed7cad0e4f8c28";
20 hash = "sha256-c28kt2ADw4wHNLN0CBPcJU/kqm6g679QRaICk4WwaBc=";
21 };
22
23 # error: implicit declaration of function ‘_PyLong_AsInt’; did you mean ‘PyLong_AsInt’? [-Wimplicit-function-declaration]
24 # https://github.com/python/cpython/issues/108444
25 postPatch = lib.optionalString (pythonAtLeast "3.13") ''
26 substituteInPlace src/generic/py_capi_utils.{c,h} \
27 --replace-fail "_PyLong_AsInt" "PyLong_AsInt"
28 '';
29
30 build-system = [
31 setuptools
32 ];
33
34 pythonImportsCheck = [ "mathutils" ];
35
36 meta = {
37 description = "General math utilities library providing Matrix, Vector, Quaternion, Euler and Color classes, written in C for speed";
38 homepage = "https://gitlab.com/ideasman42/blender-mathutils";
39 license = lib.licenses.gpl2Plus;
40 maintainers = with lib.maintainers; [ autra ];
41 };
42}