2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
cython,
|
|
|
|
numpy,
|
|
|
|
libdynd,
|
|
|
|
fetchpatch,
|
|
|
|
cmake,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonAtLeast,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
version = "0.7.2";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "dynd";
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonAtLeast "3.11";
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "libdynd";
|
|
|
|
repo = "dynd-python";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "19igd6ibf9araqhq9bxmzbzdz05vp089zxvddkiik3b5gb7l17nh";
|
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
patches = [
|
|
|
|
# Fix numpy compatibility
|
|
|
|
# https://github.com/libdynd/dynd-python/issues/746
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://aur.archlinux.org/cgit/aur.git/plain/numpy-compatibility.patch?h=python-dynd&id=e626acabd041069861311f314ac3dbe9e6fd24b7";
|
|
|
|
sha256 = "sha256-oA/3G8CGeDhiYXbNX+G6o3QSb7rkKItuCDCbnK3Rt10=";
|
|
|
|
name = "numpy-compatibility.patch";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# setup.py invokes git on build but we're fetching a tarball, so
|
|
|
|
# can't retrieve git version. We hardcode:
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace setup.py --replace "ver = check_output(['git', 'describe', '--dirty'," "ver = '${version}'"
|
|
|
|
substituteInPlace setup.py --replace "'--always', '--match', 'v*']).decode('ascii').strip('\n')" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cython
|
|
|
|
libdynd.dev
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
libdynd
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
|
|
|
|
# ModuleNotFoundError: No module named 'dynd.config'
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "dynd" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://libdynd.org";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
description = "Python exposure of dynd";
|
|
|
|
maintainers = with maintainers; [ teh ];
|
|
|
|
};
|
|
|
|
}
|