Martin Weinelt ae4a1a485a
treewide: add explicit format attribute for Python packages
If a Python package does not come with either `format` or `pyproject` we
consider it a setuptools build, that calls `setup.py` directly, which is
deprecated.

This change, as a first step, migrates a large chunk of these packages to
set setuptools as their explicit format

This is so we can unify the problem space for the next step of the
migration.
2025-07-02 05:56:47 +02:00

75 lines
1.6 KiB
Nix

{
lib,
fetchFromGitHub,
python3,
withLdap ? false,
withPostgres ? true,
nix-update-script,
nixosTests,
}:
python3.pkgs.buildPythonApplication rec {
pname = "etebase-server";
version = "0.14.2";
format = "setuptools";
src = fetchFromGitHub {
owner = "etesync";
repo = "server";
tag = "v${version}";
hash = "sha256-W2u/d8X8luOzgy1CLNgujnwaoO1pR1QO1Ma7i4CGkdU=";
};
patches = [ ./secret.patch ];
doCheck = false;
propagatedBuildInputs =
with python3.pkgs;
[
aiofiles
django_4
fastapi
msgpack
pynacl
redis
uvicorn
websockets
watchfiles
uvloop
pyyaml
python-dotenv
httptools
typing-extensions
]
++ lib.optional withLdap python-ldap
++ lib.optional withPostgres psycopg2;
postInstall = ''
mkdir -p $out/bin $out/lib
cp manage.py $out/bin/etebase-server
wrapProgram $out/bin/etebase-server --prefix PYTHONPATH : "$PYTHONPATH"
chmod +x $out/bin/etebase-server
'';
passthru.updateScript = nix-update-script { };
passthru.python = python3;
# PYTHONPATH of all dependencies used by the package
passthru.pythonPath = python3.pkgs.makePythonPath propagatedBuildInputs;
passthru.tests = {
nixosTest = nixosTests.etebase-server;
};
meta = {
homepage = "https://github.com/etesync/server";
description = "Etebase (EteSync 2.0) server so you can run your own";
mainProgram = "etebase-server";
changelog = "https://github.com/etesync/server/blob/${version}/ChangeLog.md";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [
felschr
phaer
];
};
}