2022-07-25 12:58:20 +03:00
|
|
|
{ lib, nixosTests, python3, python3Packages, npins, pins }:
|
2022-05-24 20:38:07 +03:00
|
|
|
|
2023-01-09 00:36:42 +02:00
|
|
|
let
|
|
|
|
pin = pins.searxng;
|
|
|
|
repo = pin.repository;
|
|
|
|
in with python3Packages;
|
2022-05-24 20:38:07 +03:00
|
|
|
|
2023-01-09 00:36:42 +02:00
|
|
|
toPythonModule (buildPythonApplication rec {
|
2022-05-24 20:38:07 +03:00
|
|
|
pname = "searxng";
|
2023-01-09 00:36:42 +02:00
|
|
|
version = "1.0.0pre_${builtins.substring 0 7 pin.revision}";
|
2022-05-26 22:39:50 +03:00
|
|
|
|
2022-07-25 12:58:20 +03:00
|
|
|
src = npins.mkSource pins.searxng;
|
2022-05-24 20:38:07 +03:00
|
|
|
|
2023-01-31 00:30:06 +02:00
|
|
|
patches = [
|
|
|
|
# wait for https://github.com/NixOS/nixpkgs/pull/211654
|
|
|
|
./revert-flask-babel-3.0.0.patch
|
|
|
|
];
|
|
|
|
|
2022-05-24 20:38:07 +03:00
|
|
|
postPatch = ''
|
2022-12-18 20:35:34 +02:00
|
|
|
sed -i \
|
|
|
|
-e 's/==.*$//' \
|
2023-01-09 00:26:40 +02:00
|
|
|
-e 's/fasttext-predict/fasttext/g' \
|
2022-12-18 20:35:34 +02:00
|
|
|
requirements.txt
|
2023-01-09 00:36:42 +02:00
|
|
|
cat >searx/version_frozen.py <<EOF
|
|
|
|
VERSION_STRING="${version}"
|
|
|
|
VERSION_TAG="${pin.revision}"
|
|
|
|
GIT_URL="https://github.com/${repo.owner}/${repo.repo}"
|
|
|
|
GIT_BRANCH="${pin.branch}"
|
2023-01-30 22:37:29 +02:00
|
|
|
DOCKER_TAG="none"
|
2023-01-09 00:36:42 +02:00
|
|
|
EOF
|
2022-05-24 20:38:07 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export SEARX_DEBUG="true";
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
Babel
|
|
|
|
certifi
|
|
|
|
python-dateutil
|
|
|
|
flask
|
|
|
|
flaskbabel
|
|
|
|
brotli
|
|
|
|
jinja2
|
|
|
|
langdetect
|
|
|
|
lxml
|
|
|
|
h2
|
|
|
|
pygments
|
|
|
|
pyyaml
|
|
|
|
redis
|
|
|
|
uvloop
|
|
|
|
setproctitle
|
|
|
|
httpx
|
|
|
|
httpx-socks
|
|
|
|
markdown-it-py
|
2022-12-18 20:35:34 +02:00
|
|
|
fasttext
|
|
|
|
pybind11
|
2022-05-24 20:38:07 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
# tests try to connect to network
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "searx" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Create a symlink for easier access to static data
|
|
|
|
mkdir -p $out/share
|
|
|
|
ln -s ../${python3.sitePackages}/searx/static $out/share/
|
|
|
|
'';
|
|
|
|
})
|