linuxPackages_latest.broadcom_sta: add patch to compile on Kernel 6.12 (#359484)
[NixPkgs.git] / pkgs / development / python-modules / segyio / default.nix
blob574354ea44a0c366330e7c5ad825a3c7296549dd
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   cmake,
6   ninja,
7   scikit-build,
8   pytest,
9   numpy,
12 buildPythonPackage rec {
13   pname = "segyio";
14   version = "1.9.12";
15   pyproject = false; # Built with cmake
17   patches = [
18     # https://github.com/equinor/segyio/pull/570
19     ./add_missing_cstdint.patch
20   ];
22   postPatch = ''
23     # Removing unecessary build dependency
24     substituteInPlace python/setup.py --replace "'pytest-runner'," ""
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   '';
32   src = fetchFromGitHub {
33     owner = "equinor";
34     repo = pname;
35     rev = "refs/tags/v${version}";
36     hash = "sha256-+N2JvHBxpdbysn4noY/9LZ4npoQ9143iFEzaxoafnms=";
37   };
39   nativeBuildInputs = [
40     cmake
41     ninja
42     scikit-build
43   ];
45   # I'm not modifying the checkPhase nor adding a pytestCheckHook because the pytest is called
46   # within the cmake test phase
47   nativeCheckInputs = [
48     pytest
49     numpy
50   ];
52   meta = with lib; {
53     description = "Fast Python library for SEGY files";
54     homepage = "https://github.com/equinor/segyio";
55     license = licenses.lgpl3Only;
56     maintainers = with maintainers; [ atila ];
57   };