2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
ninja,
|
|
|
|
python,
|
|
|
|
scikit-build,
|
|
|
|
pytest,
|
|
|
|
numpy,
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "segyio";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.9.12";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Removing unecessary build dependency
|
|
|
|
substituteInPlace python/setup.py --replace "'pytest-runner'," ""
|
|
|
|
|
|
|
|
# Fixing bug making one test fail in the python 3.10 build
|
|
|
|
substituteInPlace python/segyio/open.py --replace \
|
|
|
|
"cube_metrics = f.xfd.cube_metrics(iline, xline)" \
|
|
|
|
"cube_metrics = f.xfd.cube_metrics(int(iline), int(xline))"
|
|
|
|
'';
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "equinor";
|
|
|
|
repo = pname;
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-+N2JvHBxpdbysn4noY/9LZ4npoQ9143iFEzaxoafnms=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
python
|
|
|
|
scikit-build
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
# I'm not modifying the checkPhase nor adding a pytestCheckHook because the pytest is called
|
|
|
|
# within the cmake test phase
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytest
|
|
|
|
numpy
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Fast Python library for SEGY files";
|
|
|
|
homepage = "https://github.com/equinor/segyio";
|
|
|
|
license = licenses.lgpl3Only;
|
|
|
|
maintainers = with maintainers; [ atila ];
|
|
|
|
};
|
|
|
|
}
|