Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 cmake, 6 ninja, 7 scikit-build, 8 pytest, 9 numpy, 10}: 11 12buildPythonPackage rec { 13 pname = "segyio"; 14 version = "1.9.12"; 15 pyproject = false; # Built with cmake 16 17 patches = [ 18 # https://github.com/equinor/segyio/pull/570 19 ./add_missing_cstdint.patch 20 ]; 21 22 postPatch = '' 23 # Removing unecessary build dependency 24 substituteInPlace python/setup.py --replace "'pytest-runner'," "" 25 26 # Fixing bug making one test fail in the python 3.10 build 27 substituteInPlace python/segyio/open.py --replace \ 28 "cube_metrics = f.xfd.cube_metrics(iline, xline)" \ 29 "cube_metrics = f.xfd.cube_metrics(int(iline), int(xline))" 30 ''; 31 32 src = fetchFromGitHub { 33 owner = "equinor"; 34 repo = pname; 35 rev = "refs/tags/v${version}"; 36 hash = "sha256-+N2JvHBxpdbysn4noY/9LZ4npoQ9143iFEzaxoafnms="; 37 }; 38 39 nativeBuildInputs = [ 40 cmake 41 ninja 42 scikit-build 43 ]; 44 45 doCheck = true; 46 # I'm not modifying the checkPhase nor adding a pytestCheckHook because the pytest is called 47 # within the cmake test phase 48 nativeCheckInputs = [ 49 pytest 50 numpy 51 ]; 52 53 meta = with lib; { 54 description = "Fast Python library for SEGY files"; 55 homepage = "https://github.com/equinor/segyio"; 56 license = licenses.lgpl3Only; 57 maintainers = with maintainers; [ atila ]; 58 }; 59}