1{
2 lib,
3 stdenv,
4 buildPythonApplication,
5 fetchFromGitHub,
6 makeWrapper,
7 # Tie withPlugins through the fixed point here, so it will receive an
8 # overridden version properly
9 buildbot,
10 pythonOlder,
11 python,
12 twisted,
13 jinja2,
14 msgpack,
15 zope-interface,
16 sqlalchemy,
17 alembic,
18 python-dateutil,
19 txaio,
20 autobahn,
21 pyjwt,
22 pyyaml,
23 treq,
24 txrequests,
25 pypugjs,
26 boto3,
27 moto,
28 markdown,
29 lz4,
30 brotli,
31 zstandard,
32 setuptools-trial,
33 buildbot-worker,
34 buildbot-plugins,
35 buildbot-pkg,
36 parameterized,
37 git,
38 openssh,
39 setuptools,
40 croniter,
41 importlib-resources,
42 packaging,
43 unidiff,
44 nixosTests,
45}:
46
47let
48 withPlugins =
49 plugins:
50 buildPythonApplication {
51 pname = "${buildbot.pname}-with-plugins";
52 inherit (buildbot) version;
53 format = "other";
54
55 dontUnpack = true;
56 dontBuild = true;
57 doCheck = false;
58
59 nativeBuildInputs = [
60 makeWrapper
61 ];
62
63 propagatedBuildInputs = plugins ++ buildbot.propagatedBuildInputs;
64
65 installPhase = ''
66 makeWrapper ${buildbot}/bin/buildbot $out/bin/buildbot \
67 --prefix PYTHONPATH : "${buildbot}/${python.sitePackages}:$PYTHONPATH"
68 ln -sfv ${buildbot}/lib $out/lib
69 '';
70
71 passthru = buildbot.passthru // {
72 withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
73 };
74 };
75in
76buildPythonApplication rec {
77 pname = "buildbot";
78 version = "4.2.1";
79 format = "pyproject";
80
81 disabled = pythonOlder "3.8";
82
83 src = fetchFromGitHub {
84 owner = "buildbot";
85 repo = "buildbot";
86 rev = "v${version}";
87 hash = "sha256-Kf8sxZE2cQDQSVSMpRTokJU4f3/M6OJq6bXzGonrRLU=";
88 };
89
90 build-system = [
91 ];
92
93 pythonRelaxDeps = [
94 "twisted"
95 ];
96
97 propagatedBuildInputs =
98 [
99 # core
100 twisted
101 jinja2
102 msgpack
103 zope-interface
104 sqlalchemy
105 alembic
106 python-dateutil
107 txaio
108 autobahn
109 pyjwt
110 pyyaml
111 setuptools
112 croniter
113 importlib-resources
114 packaging
115 unidiff
116 treq
117 brotli
118 zstandard
119 ]
120 # tls
121 ++ twisted.optional-dependencies.tls;
122
123 nativeCheckInputs = [
124 treq
125 txrequests
126 pypugjs
127 boto3
128 moto
129 markdown
130 lz4
131 setuptools-trial
132 buildbot-worker
133 buildbot-pkg
134 buildbot-plugins.www
135 parameterized
136 git
137 openssh
138 ];
139
140 patches = [
141 # This patch disables the test that tries to read /etc/os-release which
142 # is not accessible in sandboxed builds.
143 ./skip_test_linux_distro.patch
144 ];
145
146 postPatch = ''
147 cd master
148 touch buildbot/py.typed
149 substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
150 '';
151
152 # TimeoutErrors on slow machines -> aarch64
153 doCheck = !stdenv.hostPlatform.isAarch64;
154
155 preCheck = ''
156 export PATH="$out/bin:$PATH"
157 '';
158
159 passthru =
160 {
161 inherit withPlugins python;
162 updateScript = ./update.sh;
163 }
164 // lib.optionalAttrs stdenv.hostPlatform.isLinux {
165 tests = {
166 inherit (nixosTests) buildbot;
167 };
168 };
169
170 meta = with lib; {
171 description = "Open-source continuous integration framework for automating software build, test, and release processes";
172 homepage = "https://buildbot.net/";
173 changelog = "https://github.com/buildbot/buildbot/releases/tag/v${version}";
174 teams = [ teams.buildbot ];
175 license = licenses.gpl2Only;
176 };
177}