2021-04-05 15:23:46 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nixosTests
|
2024-07-27 06:49:29 +00:00
|
|
|
, nix-update-script
|
2021-04-05 15:23:46 +00:00
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
2024-09-19 14:19:46 +00:00
|
|
|
self = python;
|
2023-03-15 16:39:30 +00:00
|
|
|
packageOverrides = self: super: {
|
2024-01-13 08:15:51 +00:00
|
|
|
sqlalchemy = super.sqlalchemy_1_4;
|
2023-03-15 16:39:30 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
python.pkgs.buildPythonApplication rec {
|
2021-04-05 15:23:46 +00:00
|
|
|
pname = "calibre-web";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.6.22";
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "janeczku";
|
|
|
|
repo = "calibre-web";
|
|
|
|
rev = version;
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-nWZmDasBH+DW/+Cvw510mOv11CXorRnoBwNFpoKPErY=";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2022-04-27 09:35:20 +00:00
|
|
|
advocate
|
2024-07-27 06:49:29 +00:00
|
|
|
apscheduler
|
|
|
|
babel
|
|
|
|
bleach
|
2022-06-26 10:26:21 +00:00
|
|
|
chardet
|
2024-07-27 06:49:29 +00:00
|
|
|
flask
|
2022-01-13 20:06:32 +00:00
|
|
|
flask-babel
|
2024-07-27 06:49:29 +00:00
|
|
|
flask-limiter
|
2022-10-21 18:38:19 +00:00
|
|
|
flask-login
|
2023-10-09 19:29:22 +00:00
|
|
|
flask-principal
|
2022-06-16 17:23:12 +00:00
|
|
|
flask-wtf
|
2022-01-13 20:06:32 +00:00
|
|
|
iso-639
|
2023-10-09 19:29:22 +00:00
|
|
|
jsonschema
|
2022-01-13 20:06:32 +00:00
|
|
|
lxml
|
2023-04-29 16:46:19 +00:00
|
|
|
pypdf
|
2024-07-27 06:49:29 +00:00
|
|
|
python-magic
|
|
|
|
pytz
|
|
|
|
regex
|
2022-01-13 20:06:32 +00:00
|
|
|
requests
|
|
|
|
sqlalchemy
|
|
|
|
tornado
|
|
|
|
unidecode
|
2022-11-21 17:40:18 +00:00
|
|
|
wand
|
2022-04-27 09:35:20 +00:00
|
|
|
werkzeug
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
patches = [
|
|
|
|
# default-logger.patch switches default logger to /dev/stdout. Otherwise calibre-web tries to open a file relative
|
|
|
|
# to its location, which can't be done as the store is read-only. Log file location can later be configured using UI
|
|
|
|
# if needed.
|
|
|
|
./default-logger.patch
|
|
|
|
# DB migrations adds an env var __RUN_MIGRATIONS_ANDEXIT that, when set, instructs calibre-web to run DB migrations
|
|
|
|
# and exit. This is gonna be used to configure calibre-web declaratively, as most of its configuration parameters
|
|
|
|
# are stored in the DB.
|
|
|
|
./db-migrations.patch
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
# calibre-web doesn't follow setuptools directory structure.
|
2021-04-05 15:23:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
mkdir -p src/calibreweb
|
|
|
|
mv cps.py src/calibreweb/__init__.py
|
|
|
|
mv cps src/calibreweb
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
substituteInPlace setup.cfg \
|
2024-07-27 06:49:29 +00:00
|
|
|
--replace-fail "cps = calibreweb:main" "calibre-web = calibreweb:main"
|
2021-04-05 15:23:46 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Upstream repo doesn't provide any tests.
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
passthru = {
|
|
|
|
tests.calibre-web = nixosTests.calibre-web;
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Web app for browsing, reading and downloading eBooks stored in a Calibre database";
|
|
|
|
homepage = "https://github.com/janeczku/calibre-web";
|
|
|
|
license = licenses.gpl3Plus;
|
2022-01-13 20:06:32 +00:00
|
|
|
maintainers = with maintainers; [ pborzenkov ];
|
2021-04-05 15:23:46 +00:00
|
|
|
platforms = platforms.all;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "calibre-web";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
}
|