2021-04-18 03:10:35 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
2022-05-05 22:09:09 +00:00
|
|
|
, buildGoModule
|
2021-04-18 03:10:35 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, srht
|
|
|
|
, alembic
|
|
|
|
, pytest
|
2023-10-08 03:32:12 +00:00
|
|
|
, factory-boy
|
2021-04-18 03:10:35 +00:00
|
|
|
, python
|
2022-05-05 22:09:09 +00:00
|
|
|
, unzip
|
2023-11-28 10:33:29 +00:00
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
2021-04-18 03:10:35 +00:00
|
|
|
}:
|
2019-01-22 02:01:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "todosrht";
|
2023-04-02 22:48:36 +00:00
|
|
|
version = "0.74.6";
|
2023-11-28 10:33:29 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2019-01-22 02:01:52 +00:00
|
|
|
|
2021-04-18 03:10:35 +00:00
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "todo.sr.ht";
|
2019-01-22 02:01:52 +00:00
|
|
|
rev = version;
|
2023-04-02 22:48:36 +00:00
|
|
|
sha256 = "sha256-j12pCGfKf6+9R8NOBIrH2V4OuSMuncU6S1AMWFVoHts=";
|
2019-01-22 02:01:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-05 22:09:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
todosrht-api = buildGoModule ({
|
|
|
|
inherit src version;
|
|
|
|
pname = "todosrht-api";
|
|
|
|
modRoot = "api";
|
2023-04-02 22:48:36 +00:00
|
|
|
vendorHash = "sha256-rvfG5F6ez8UM0dYVhKfzwtb7ZEJlaKMBAfKDbo3Aofc=";
|
2022-10-30 21:03:19 +00:00
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
|
2019-01-22 02:01:52 +00:00
|
|
|
|
2023-11-28 10:33:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2019-01-22 02:01:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
alembic
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2021-04-18 03:10:35 +00:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
2019-01-22 02:01:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-05-05 22:09:09 +00:00
|
|
|
postInstall = ''
|
|
|
|
ln -s ${todosrht-api}/bin/api $out/bin/todosrht-api
|
|
|
|
'';
|
|
|
|
|
2019-12-30 01:04:16 +00:00
|
|
|
# pytest tests fail
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2019-10-05 15:00:49 +00:00
|
|
|
pytest
|
2023-10-08 03:32:12 +00:00
|
|
|
factory-boy
|
2019-10-05 15:00:49 +00:00
|
|
|
];
|
|
|
|
|
2019-12-30 01:04:16 +00:00
|
|
|
dontUseSetuptoolsCheck = true;
|
2021-08-15 21:11:47 +00:00
|
|
|
pythonImportsCheck = [ "todosrht" ];
|
2019-01-22 02:01:52 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://todo.sr.ht/~sircmpwn/todo.sr.ht";
|
2019-01-22 02:01:52 +00:00
|
|
|
description = "Ticket tracking service for the sr.ht network";
|
2021-08-15 20:54:11 +00:00
|
|
|
license = licenses.agpl3Only;
|
2019-01-22 02:01:52 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
|
|
|
}
|