2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
2022-06-16 17:23:12 +00:00
|
|
|
, buildGoModule
|
2021-05-20 23:08:51 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, srht
|
|
|
|
, redis
|
|
|
|
, alembic
|
|
|
|
, pystache
|
|
|
|
, pytest
|
|
|
|
, factory_boy
|
|
|
|
, python
|
2022-06-16 17:23:12 +00:00
|
|
|
, unzip
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "todosrht";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "0.72.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "todo.sr.ht";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-FLjVO8Y/9s2gFfMXwcY7Rj3WNzPEBYs1AEjiVZFWsT8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
todosrht-api = buildGoModule ({
|
|
|
|
inherit src version;
|
|
|
|
pname = "todosrht-api";
|
|
|
|
modRoot = "api";
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-LB1H4jwnvoEyaaYJ09NI/M6IkgZwRet/fkso6b9EPV0=";
|
2022-11-02 22:02:43 +00:00
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
redis
|
|
|
|
alembic
|
|
|
|
pystache
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2021-05-20 23:08:51 +00:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postInstall = ''
|
|
|
|
ln -s ${todosrht-api}/bin/api $out/bin/todosrht-api
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# pytest tests fail
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
pytest
|
|
|
|
factory_boy
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUseSetuptoolsCheck = true;
|
2021-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [ "todosrht" ];
|
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
|
|
|
homepage = "https://todo.sr.ht/~sircmpwn/todo.sr.ht";
|
|
|
|
description = "Ticket tracking service for the sr.ht network";
|
2021-12-30 13:39:12 +00:00
|
|
|
license = licenses.agpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
|
|
|
}
|