1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 scikit-build-core, 6 nanobind, 7 cmake, 8 ninja, 9 pkg-config, 10 blas, 11 lapack, 12 numpy, 13 sympy, 14 scipy, 15 matplotlib, 16 fenics-ufl, 17 pytest-xdist, 18 pytestCheckHook, 19}: 20 21buildPythonPackage rec { 22 pname = "fenics-basix"; 23 version = "0.9.0"; 24 pyproject = true; 25 26 src = fetchFromGitHub { 27 owner = "fenics"; 28 repo = "basix"; 29 tag = "v${version}"; 30 hash = "sha256-jLQMDt6zdl+oixd5Qevn4bvxBsXpTNcbH2Os6TC9sRQ="; 31 }; 32 33 dontUseCmakeConfigure = true; 34 35 build-system = [ 36 scikit-build-core 37 nanobind 38 ]; 39 40 nativeBuildInputs = [ 41 cmake 42 ninja 43 pkg-config 44 ]; 45 46 dependencies = [ 47 numpy 48 ]; 49 50 buildInputs = [ 51 blas 52 lapack 53 ]; 54 55 # Prefer finding BLAS and LAPACK via pkg-config. 56 # Avoid using the Accelerate.framework from the Darwin SDK. 57 # Also, avoid mistaking BLAS for LAPACK. 58 env.CMAKE_ARGS = lib.cmakeBool "BLA_PREFER_PKGCONFIG" true; 59 60 pythonImportsCheck = [ 61 "basix" 62 ]; 63 64 nativeCheckInputs = [ 65 sympy 66 scipy 67 matplotlib 68 fenics-ufl 69 pytest-xdist 70 pytestCheckHook 71 ]; 72 73 meta = { 74 homepage = "https://fenicsproject.org"; 75 downloadPage = "https://github.com/fenics/basix"; 76 description = "Finite element definition and tabulation runtime library"; 77 changelog = "https://github.com/fenics/basix/releases/tag/${src.tag}"; 78 license = lib.licenses.mit; 79 maintainers = with lib.maintainers; [ qbisi ]; 80 }; 81}