2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchPypi,
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build dependencies
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
|
|
|
django,
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
elasticsearch,
|
|
|
|
geopy,
|
|
|
|
nose,
|
|
|
|
pysolr,
|
|
|
|
python-dateutil,
|
|
|
|
requests,
|
|
|
|
whoosh,
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-haystack";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "3.2.1";
|
2023-08-22 20:05:09 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-l+MZeu/CJf5AW28XYAolNL+CfLTWdDEwwgvBoG9yk6Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "geopy==" "geopy>="
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
setuptools
|
2021-12-06 16:07:01 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ django ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
elasticsearch = [ elasticsearch ];
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = lib.versionOlder django.version "4";
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
geopy
|
|
|
|
nose
|
|
|
|
pysolr
|
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
whoosh
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ passthru.optional-dependencies.elasticsearch;
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
python test_haystack/run_tests.py
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Pluggable search for Django";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://haystacksearch.org/";
|
|
|
|
license = licenses.bsd3;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|