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.3.0";
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-yUtOJRI04/clCMImh5sokpj6MeBIXjEAdf9xnToqJZs=";
88 };
89
90 build-system = [
91 ];
92
93 pythonRelaxDeps = [
94 "twisted"
95 ];
96
97 propagatedBuildInputs = [
98 # core
99 twisted
100 jinja2
101 msgpack
102 zope-interface
103 sqlalchemy
104 alembic
105 python-dateutil
106 txaio
107 autobahn
108 pyjwt
109 pyyaml
110 setuptools
111 croniter
112 importlib-resources
113 packaging
114 unidiff
115 treq
116 brotli
117 zstandard
118 ]
119 # tls
120 ++ twisted.optional-dependencies.tls;
121
122 nativeCheckInputs = [
123 treq
124 txrequests
125 pypugjs
126 boto3
127 moto
128 markdown
129 lz4
130 setuptools-trial
131 buildbot-worker
132 buildbot-pkg
133 buildbot-plugins.www
134 parameterized
135 git
136 openssh
137 ];
138
139 patches = [
140 # This patch disables the test that tries to read /etc/os-release which
141 # is not accessible in sandboxed builds.
142 ./skip_test_linux_distro.patch
143 ];
144
145 postPatch = ''
146 cd master
147 touch buildbot/py.typed
148 substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
149 '';
150
151 # TimeoutErrors on slow machines -> aarch64
152 doCheck = !stdenv.hostPlatform.isAarch64;
153
154 preCheck = ''
155 export PATH="$out/bin:$PATH"
156 '';
157
158 passthru = {
159 inherit withPlugins python;
160 updateScript = ./update.sh;
161 }
162 // lib.optionalAttrs stdenv.hostPlatform.isLinux {
163 tests = {
164 inherit (nixosTests) buildbot;
165 };
166 };
167
168 meta = with lib; {
169 description = "Open-source continuous integration framework for automating software build, test, and release processes";
170 homepage = "https://buildbot.net/";
171 changelog = "https://github.com/buildbot/buildbot/releases/tag/v${version}";
172 teams = [ teams.buildbot ];
173 license = licenses.gpl2Only;
174 };
175}