at 25.11-pre 2.0 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 7 # build-system 8 setuptools, 9 cython, 10 numpy, 11 12 # tests 13 hypothesis, 14 pytestCheckHook, 15 16 # passthru 17 blis, 18 numpy_1, 19 gitUpdater, 20}: 21 22buildPythonPackage rec { 23 pname = "blis"; 24 version = "1.3.0"; 25 pyproject = true; 26 27 src = fetchFromGitHub { 28 owner = "explosion"; 29 repo = "cython-blis"; 30 tag = "release-v${version}"; 31 hash = "sha256-mSIfFjnLhPLqSNLHMS5gTeAmqmNfXpcbyH7ejv4YgQU="; 32 }; 33 34 build-system = [ 35 setuptools 36 cython 37 numpy 38 ]; 39 40 env = 41 # Fallback to generic architectures when necessary: 42 # https://github.com/explosion/cython-blis?tab=readme-ov-file#building-blis-for-alternative-architectures 43 lib.optionalAttrs 44 ( 45 # error: [Errno 2] No such file or directory: '/build/source/blis/_src/make/linux-cortexa57.jsonl' 46 (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) 47 48 # clang: error: unknown argument '-mavx512pf'; did you mean '-mavx512f'? 49 # Patching blis/_src/config/knl/make_defs.mk to remove the said flag does not work 50 || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) 51 ) 52 { 53 BLIS_ARCH = "generic"; 54 }; 55 56 dependencies = [ numpy ]; 57 58 pythonImportsCheck = [ "blis" ]; 59 60 nativeCheckInputs = [ 61 hypothesis 62 pytestCheckHook 63 ]; 64 65 # remove src module, so tests use the installed module instead 66 preCheck = '' 67 rm -rf ./blis 68 ''; 69 70 passthru = { 71 tests = { 72 numpy_1 = blis.overridePythonAttrs (old: { 73 numpy = numpy_1; 74 }); 75 }; 76 updateScript = gitUpdater { 77 rev-prefix = "release-v"; 78 }; 79 }; 80 81 meta = { 82 changelog = "https://github.com/explosion/cython-blis/releases/tag/release-v${version}"; 83 description = "BLAS-like linear algebra library"; 84 homepage = "https://github.com/explosion/cython-blis"; 85 license = lib.licenses.bsd3; 86 maintainers = with lib.maintainers; [ nickcao ]; 87 }; 88}