1{ stdenv, lib, buildPythonPackage, fetchPypi, makeWrapper, isPy3k
2, python, twisted, jinja2, msgpack, zope_interface, sqlalchemy, alembic
3, python-dateutil, txaio, autobahn, pyjwt, pyyaml, treq, txrequests, pypugjs
4, boto3, moto, mock, lz4, setuptoolsTrial
5, buildbot-worker, buildbot-pkg, buildbot-plugins, parameterized, git, openssh
6, glibcLocales
7, nixosTests
8}:
9
10let
11 withPlugins = plugins: buildPythonPackage {
12 pname = "${package.pname}-with-plugins";
13 inherit (package) version;
14 format = "other";
15
16 dontUnpack = true;
17 dontBuild = true;
18 doCheck = false;
19
20 nativeBuildInputs = [ makeWrapper ];
21 propagatedBuildInputs = plugins ++ package.propagatedBuildInputs;
22
23 installPhase = ''
24 makeWrapper ${package}/bin/buildbot $out/bin/buildbot \
25 --prefix PYTHONPATH : "${package}/${python.sitePackages}:$PYTHONPATH"
26 ln -sfv ${package}/lib $out/lib
27 '';
28
29 passthru = package.passthru // {
30 withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
31 };
32 };
33
34 package = buildPythonPackage rec {
35 pname = "buildbot";
36 version = "3.6.1";
37
38 src = fetchPypi {
39 inherit pname version;
40 sha256 = "sha256-ByJPkI0AHis+Ey1lSuMly4M6W4s/xes4eG0gPPJ3fZA=";
41 };
42
43 propagatedBuildInputs = [
44 # core
45 twisted
46 jinja2
47 msgpack
48 zope_interface
49 sqlalchemy
50 alembic
51 python-dateutil
52 txaio
53 autobahn
54 pyjwt
55 pyyaml
56 ]
57 # tls
58 ++ twisted.optional-dependencies.tls;
59
60 checkInputs = [
61 treq
62 txrequests
63 pypugjs
64 boto3
65 moto
66 mock
67 lz4
68 setuptoolsTrial
69 buildbot-worker
70 buildbot-pkg
71 buildbot-plugins.www
72 parameterized
73 git
74 openssh
75 glibcLocales
76 ];
77
78 patches = [
79 # This patch disables the test that tries to read /etc/os-release which
80 # is not accessible in sandboxed builds.
81 ./skip_test_linux_distro.patch
82 ];
83
84 postPatch = ''
85 substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
86 '';
87
88 # TimeoutErrors on slow machines -> aarch64
89 doCheck = !stdenv.isAarch64;
90
91 preCheck = ''
92 export LC_ALL="en_US.UTF-8"
93 export PATH="$out/bin:$PATH"
94
95 # remove testfile which is missing configuration file from sdist
96 rm buildbot/test/integration/test_graphql.py
97 '';
98
99 disabled = !isPy3k;
100
101 passthru = {
102 inherit withPlugins;
103 tests.buildbot = nixosTests.buildbot;
104 updateScript = ./update.sh;
105 };
106
107 meta = with lib; {
108 broken = stdenv.isDarwin;
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