3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/version-management/sourcehut/builds.nix

73 lines
1.5 KiB
Nix
Raw Normal View History

2021-04-18 04:10:01 +01:00
{ lib
, fetchFromSourcehut
, buildPythonPackage
, buildGoModule
2021-04-18 04:10:01 +01:00
, srht
, redis
, celery
, pyyaml
, markdown
, ansi2html
, python
}:
let
version = "0.74.17";
2021-04-18 04:10:01 +01:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "builds.sr.ht";
rev = version;
sha256 = "sha256-6Yc33lkhozpnx8e6yukUfo+/Qw5mwpJQQKuYbC7uqcU=";
};
buildWorker = src: buildGoModule {
inherit src version;
pname = "builds-sr-ht-worker";
2021-12-14 05:43:52 +00:00
vendorSha256 = "sha256-Pf1M9a43eK4jr6QMi6kRHA8DodXQU0pqq9ua5VC3ER0=";
};
in
buildPythonPackage rec {
inherit src version;
pname = "buildsrht";
patches = [
# Revert change breaking Unix socket support for Redis
patches/redis-socket/build/0001-Revert-Add-build-submission-and-queue-monitoring.patch
];
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [
srht
redis
celery
pyyaml
markdown
2021-04-18 04:10:01 +01:00
ansi2html
];
preBuild = ''
export PKGVER=${version}
2021-04-18 04:10:01 +01:00
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
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
cp ${buildWorker "${src}/worker"}/bin/worker $out/bin/builds.sr.ht-worker
'';
2021-08-15 22:11:47 +01:00
pythonImportsCheck = [ "buildsrht" ];
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/builds.sr.ht";
description = "Continuous integration service for the sr.ht network";
2021-08-15 21:54:11 +01:00
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu ];
};
}