2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildGoModule
|
2022-06-16 17:23:12 +00:00
|
|
|
, buildPythonPackage
|
2021-05-20 23:08:51 +00:00
|
|
|
, srht
|
|
|
|
, redis
|
|
|
|
, celery
|
|
|
|
, pyyaml
|
|
|
|
, markdown
|
|
|
|
, ansi2html
|
2023-11-16 04:20:00 +00:00
|
|
|
, lxml
|
2021-05-20 23:08:51 +00:00
|
|
|
, python
|
2022-06-16 17:23:12 +00:00
|
|
|
, unzip
|
2024-01-02 11:29:13 +00:00
|
|
|
, pip
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.89.15";
|
2024-02-29 20:09:43 +00:00
|
|
|
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.39"; };
|
2021-12-30 13:39:12 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "builds.sr.ht";
|
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-rmNaBnTPDDQO/ImkGkMwW8fyjQyBUBchTEnbtAK24pw=";
|
2021-12-30 13:39:12 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildsrht-api = buildGoModule ({
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit src version;
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "buildsrht-api";
|
|
|
|
modRoot = "api";
|
2024-04-21 15:54:59 +00:00
|
|
|
vendorHash = "sha256-dwpuB+aYqzhGSdGVq/F9FTdHWMBkGMtVuZ7I3hB3b+Q=";
|
2024-02-29 20:09:43 +00:00
|
|
|
} // gqlgen);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
buildsrht-worker = buildGoModule ({
|
2022-06-16 17:23:12 +00:00
|
|
|
inherit src version;
|
|
|
|
pname = "buildsrht-worker";
|
2024-02-29 20:09:43 +00:00
|
|
|
modRoot = "worker";
|
2024-04-21 15:54:59 +00:00
|
|
|
vendorHash = "sha256-dwpuB+aYqzhGSdGVq/F9FTdHWMBkGMtVuZ7I3hB3b+Q=";
|
2024-02-29 20:09:43 +00:00
|
|
|
} // gqlgen);
|
2021-05-20 23:08:51 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
2021-12-30 13:39:12 +00:00
|
|
|
inherit src version;
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "buildsrht";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api worker" ""
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pip
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
redis
|
|
|
|
celery
|
|
|
|
pyyaml
|
|
|
|
markdown
|
2023-11-16 04:20:00 +00:00
|
|
|
# Unofficial dependencies
|
2021-05-20 23:08:51 +00:00
|
|
|
ansi2html
|
2023-11-16 04:20:00 +00:00
|
|
|
lxml
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib
|
|
|
|
mkdir -p $out/bin/builds.sr.ht
|
|
|
|
|
|
|
|
cp -r images $out/lib
|
|
|
|
cp contrib/submit_image_build $out/bin/builds.sr.ht
|
2022-06-16 17:23:12 +00:00
|
|
|
ln -s ${buildsrht-api}/bin/api $out/bin/buildsrht-api
|
|
|
|
ln -s ${buildsrht-worker}/bin/worker $out/bin/buildsrht-worker
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [ "buildsrht" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/builds.sr.ht";
|
|
|
|
description = "Continuous integration service for the sr.ht network";
|
2021-12-30 13:39:12 +00:00
|
|
|
license = licenses.agpl3Only;
|
2024-02-29 20:09:43 +00:00
|
|
|
maintainers = with maintainers; [ eadwu christoph-heiss ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|