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
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.86.10";
|
2021-12-30 13:39:12 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "builds.sr.ht";
|
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-frwJgwJst2/NWd8VR0KbsVwm8JfWuekkY2oIIAdh3Fw=";
|
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";
|
2023-11-16 04:20:00 +00:00
|
|
|
vendorHash = "sha256-2khk7j22KON4MsuvFUNKSUpouJtVIOxE0hkh63iaxZ4=";
|
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.29"; });
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildsrht-worker = buildGoModule {
|
|
|
|
inherit src version;
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/worker";
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "buildsrht-worker";
|
2023-11-16 04:20:00 +00:00
|
|
|
vendorHash = "sha256-obdaeRwMhuiCV2kVwDo1c+rU/hmsbiL1IgAf7AcIpoc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
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";
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api worker" ""
|
|
|
|
'';
|
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;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|