1{ stdenv, lib, buildPythonPackage, fetchPypi, makeWrapper, isPy3k
2, python, twisted, jinja2, zope_interface, sqlalchemy
3, sqlalchemy-migrate, python-dateutil, txaio, autobahn, pyjwt, pyyaml, unidiff, treq
4, txrequests, pypugjs, boto3, moto, mock, lz4, setuptoolsTrial
5, isort, pylint, flake8, buildbot-worker, buildbot-pkg, buildbot-plugins
6, parameterized, git, openssh, glibcLocales, ldap3, nixosTests
7}:
8
9let
10 withPlugins = plugins: buildPythonPackage {
11 pname = "${package.pname}-with-plugins";
12 inherit (package) version;
13
14 dontUnpack = true;
15 dontBuild = true;
16 doCheck = false;
17
18 nativeBuildInputs = [ makeWrapper ];
19 propagatedBuildInputs = plugins ++ package.propagatedBuildInputs;
20
21 installPhase = ''
22 makeWrapper ${package}/bin/buildbot $out/bin/buildbot \
23 --prefix PYTHONPATH : "${package}/${python.sitePackages}:$PYTHONPATH"
24 ln -sfv ${package}/lib $out/lib
25 '';
26
27 passthru = package.passthru // {
28 withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
29 };
30 };
31
32 package = buildPythonPackage rec {
33 pname = "buildbot";
34 version = "3.3.0";
35
36 src = fetchPypi {
37 inherit pname version;
38 sha256 = "sha256-FST+mCIQpzxc/5iQdsSNBlKxY985v+z6Xeh8ZQRu2FE=";
39 };
40
41 propagatedBuildInputs = [
42 # core
43 twisted
44 jinja2
45 zope_interface
46 sqlalchemy
47 sqlalchemy-migrate
48 python-dateutil
49 txaio
50 autobahn
51 pyjwt
52 pyyaml
53 unidiff
54 ]
55 # tls
56 ++ twisted.extras.tls;
57
58 checkInputs = [
59 treq
60 txrequests
61 pypugjs
62 boto3
63 moto
64 mock
65 lz4
66 setuptoolsTrial
67 isort
68 pylint
69 flake8
70 buildbot-worker
71 buildbot-pkg
72 buildbot-plugins.www
73 parameterized
74 git
75 openssh
76 glibcLocales
77 # optional dependency that was accidentally made required for tests
78 # https://github.com/buildbot/buildbot/pull/5857
79 ldap3
80 ];
81
82 patches = [
83 # This patch disables the test that tries to read /etc/os-release which
84 # is not accessible in sandboxed builds.
85 ./skip_test_linux_distro.patch
86 ];
87
88 postPatch = ''
89 substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
90 '';
91
92 # TimeoutErrors on slow machines -> aarch64
93 doCheck = !stdenv.isAarch64;
94
95 preCheck = ''
96 export LC_ALL="en_US.UTF-8"
97 export PATH="$out/bin:$PATH"
98 '';
99
100 disabled = !isPy3k;
101
102 passthru = {
103 inherit withPlugins;
104 tests.buildbot = nixosTests.buildbot;
105 updateScript = ./update.sh;
106 };
107
108 meta = with lib; {
109 homepage = "https://buildbot.net/";
110 description = "An open-source continuous integration framework for automating software build, test, and release processes";
111 maintainers = with maintainers; [ ryansydnor lopsided98 ];
112 license = licenses.gpl2;
113 };
114 };
115in package