1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchFromBitbucket,
6 setuptools,
7 numpy,
8 scipy,
9 sympy,
10 recursivenodes,
11 symengine,
12 fenics-ufl,
13 pytestCheckHook,
14 nix-update-script,
15}:
16
17buildPythonPackage rec {
18 pname = "firedrake-fiat";
19 version = "2025.4.2";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "firedrakeproject";
24 repo = "fiat";
25 tag = version;
26 hash = "sha256-SIi/4JW9L4kyFxEmbG9pqe0QtY80UMOh7LSFLmrHhZY=";
27 };
28
29 postPatch =
30 let
31 fiat-reference-data = fetchFromBitbucket {
32 owner = "fenics-project";
33 repo = "fiat-reference-data";
34 rev = "0c8c97f7e4919402129e5ff3b54e3f0b9e902b7c";
35 hash = "sha256-vdCkmCkKvLSYACF6MnZ/WuKuCNAoC3uu1A/9m9KwBK8=";
36 };
37 in
38 ''
39 ln -s ${fiat-reference-data} test/FIAT/regression/fiat-reference-data
40 '';
41
42 build-system = [ setuptools ];
43
44 dependencies = [
45 numpy
46 scipy
47 sympy
48 recursivenodes
49 fenics-ufl
50 symengine
51 ];
52
53 pythonImportsCheck = [
54 "FIAT"
55 "finat"
56 "finat.ufl"
57 "gem"
58 ];
59
60 nativeCheckInputs = [ pytestCheckHook ];
61
62 pytestFlags = [
63 "--skip-download"
64 ];
65
66 passthru = {
67 # python updater script sets the wrong tag
68 skipBulkUpdate = true;
69
70 updateScript = nix-update-script {
71 extraArgs = [
72 "--version-regex"
73 "([0-9.]+)"
74 ];
75 };
76 };
77
78 meta = {
79 description = "FInite element Automatic Tabulator";
80 homepage = "http://fenics-fiat.readthedocs.org/";
81 downloadPage = "https://github.com/firedrakeproject/fiat";
82 license = lib.licenses.lgpl3Plus;
83 maintainers = with lib.maintainers; [ qbisi ];
84 };
85}