1{ lib
2, stdenv
3, buildPythonPackage
4, buildPythonApplication
5, fetchPypi
6, makeWrapper
7, pythonOlder
8, python
9, twisted
10, jinja2
11, msgpack
12, zope_interface
13, sqlalchemy
14, alembic
15, python-dateutil
16, txaio
17, autobahn
18, pyjwt
19, pyyaml
20, treq
21, txrequests
22, pypugjs
23, boto3
24, moto
25, mock
26, lz4
27, setuptoolsTrial
28, buildbot-worker
29, buildbot-plugins
30, buildbot-pkg
31, parameterized
32, git
33, openssh
34, glibcLocales
35, nixosTests
36, callPackage
37}:
38
39let
40 withPlugins = plugins: buildPythonApplication {
41 pname = "${package.pname}-with-plugins";
42 inherit (package) version;
43 format = "other";
44
45 dontUnpack = true;
46 dontBuild = true;
47 doCheck = false;
48
49 nativeBuildInputs = [
50 makeWrapper
51 ];
52
53 propagatedBuildInputs = plugins ++ package.propagatedBuildInputs;
54
55 installPhase = ''
56 makeWrapper ${package}/bin/buildbot $out/bin/buildbot \
57 --prefix PYTHONPATH : "${package}/${python.sitePackages}:$PYTHONPATH"
58 ln -sfv ${package}/lib $out/lib
59 '';
60
61 passthru = package.passthru // {
62 withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
63 };
64 };
65
66 package = buildPythonApplication rec {
67 pname = "buildbot";
68 version = "3.8.0";
69 format = "setuptools";
70
71 disabled = pythonOlder "3.7";
72
73 src = fetchPypi {
74 inherit pname version;
75 hash = "sha256-Z4BmC6Ed+7y4rJologiLXhkIvucXz65KEBxX3LFqExY=";
76 };
77
78 propagatedBuildInputs = [
79 # core
80 twisted
81 jinja2
82 msgpack
83 zope_interface
84 sqlalchemy
85 alembic
86 python-dateutil
87 txaio
88 autobahn
89 pyjwt
90 pyyaml
91 ]
92 # tls
93 ++ twisted.optional-dependencies.tls;
94
95 nativeCheckInputs = [
96 treq
97 txrequests
98 pypugjs
99 boto3
100 moto
101 mock
102 lz4
103 setuptoolsTrial
104 buildbot-worker
105 buildbot-pkg
106 buildbot-plugins.www
107 parameterized
108 git
109 openssh
110 glibcLocales
111 ];
112
113 patches = [
114 # This patch disables the test that tries to read /etc/os-release which
115 # is not accessible in sandboxed builds.
116 ./skip_test_linux_distro.patch
117 ];
118
119 postPatch = ''
120 substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
121 '';
122
123 # Silence the depreciation warning from SqlAlchemy
124 SQLALCHEMY_SILENCE_UBER_WARNING = 1;
125
126 # TimeoutErrors on slow machines -> aarch64
127 doCheck = !stdenv.isAarch64;
128
129 preCheck = ''
130 export LC_ALL="en_US.UTF-8"
131 export PATH="$out/bin:$PATH"
132
133 # remove testfile which is missing configuration file from sdist
134 rm buildbot/test/integration/test_graphql.py
135 # tests in this file are flaky, see https://github.com/buildbot/buildbot/issues/6776
136 rm buildbot/test/integration/test_try_client.py
137 '';
138
139 passthru = {
140 inherit withPlugins;
141 tests.buildbot = nixosTests.buildbot;
142 updateScript = ./update.sh;
143 };
144
145 meta = with lib; {
146 description = "An open-source continuous integration framework for automating software build, test, and release processes";
147 homepage = "https://buildbot.net/";
148 changelog = "https://github.com/buildbot/buildbot/releases/tag/v${version}";
149 maintainers = with maintainers; [ ryansydnor lopsided98 ];
150 license = licenses.gpl2Only;
151 broken = stdenv.isDarwin;
152 };
153 };
154in package