2022-01-25 03:21:06 +00:00
|
|
|
{ lib, python3, fetchFromGitHub, withServer ? false }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
let
|
2022-09-09 14:08:57 +00:00
|
|
|
serverRequire = with python3.pkgs; [
|
2022-01-25 03:21:06 +00:00
|
|
|
requests
|
|
|
|
flask
|
|
|
|
flask-admin
|
|
|
|
flask-api
|
|
|
|
flask-bootstrap
|
|
|
|
flask-paginate
|
2022-06-16 17:23:12 +00:00
|
|
|
flask-wtf
|
2022-01-25 03:21:06 +00:00
|
|
|
arrow
|
|
|
|
werkzeug
|
|
|
|
click
|
|
|
|
vcrpy
|
|
|
|
toml
|
|
|
|
];
|
2021-07-24 12:14:16 +00:00
|
|
|
in
|
2022-09-09 14:08:57 +00:00
|
|
|
with python3.pkgs; buildPythonApplication rec {
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "4.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "buku";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jarun";
|
|
|
|
repo = "buku";
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
sha256 = "sha256-kPVlfTYUusf5CZnKB53WZcCHo3MEnA2bLUHTRPGPn+8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
hypothesis
|
|
|
|
pytest
|
2023-04-29 16:46:19 +00:00
|
|
|
pytest-recording
|
2020-04-24 23:36:52 +00:00
|
|
|
pyyaml
|
|
|
|
mypy-extensions
|
2022-01-25 03:21:06 +00:00
|
|
|
click
|
2022-09-09 14:08:57 +00:00
|
|
|
pylint
|
|
|
|
flake8
|
|
|
|
pytest-cov
|
|
|
|
pyyaml
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cryptography
|
|
|
|
beautifulsoup4
|
2022-01-25 03:21:06 +00:00
|
|
|
certifi
|
2020-04-24 23:36:52 +00:00
|
|
|
urllib3
|
|
|
|
html5lib
|
2022-01-25 03:21:06 +00:00
|
|
|
] ++ lib.optionals withServer serverRequire;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Disables a test which requires internet
|
|
|
|
substituteInPlace tests/test_bukuDb.py \
|
|
|
|
--replace "@pytest.mark.slowtest" "@unittest.skip('skipping')" \
|
2021-07-24 12:14:16 +00:00
|
|
|
--replace "self.assertEqual(shorturl, \"http://tny.im/yt\")" "" \
|
|
|
|
--replace "self.assertEqual(url, \"https://www.google.com\")" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace mypy-extensions==0.4.1 mypy-extensions>=0.4.1
|
2022-01-25 03:21:06 +00:00
|
|
|
'' + lib.optionalString (!withServer) ''
|
|
|
|
rm tests/test_{server,views}.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
make install PREFIX=$out
|
|
|
|
|
|
|
|
mkdir -p $out/share/zsh/site-functions $out/share/bash-completion/completions $out/share/fish/vendor_completions.d
|
|
|
|
cp auto-completion/zsh/* $out/share/zsh/site-functions
|
|
|
|
cp auto-completion/bash/* $out/share/bash-completion/completions
|
|
|
|
cp auto-completion/fish/* $out/share/fish/vendor_completions.d
|
2022-01-25 03:21:06 +00:00
|
|
|
'' + lib.optionalString (!withServer) ''
|
|
|
|
rm $out/bin/bukuserver
|
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
|
|
|
description = "Private cmdline bookmark manager";
|
|
|
|
homepage = "https://github.com/jarun/Buku";
|
|
|
|
license = licenses.gpl3;
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = platforms.unix;
|
2023-10-19 13:55:26 +00:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer infinisil ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|