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