1{ stdenv, lib, buildPythonPackage, fetchPypi, fetchpatch, makeWrapper, isPy3k,
2 python, twisted, jinja2, zope_interface, future, sqlalchemy,
3 sqlalchemy_migrate, dateutil, txaio, autobahn, pyjwt, pyyaml, treq,
4 txrequests, pyjade, boto3, moto, mock, python-lz4, setuptoolsTrial,
5 isort, pylint, flake8, buildbot-worker, buildbot-pkg, buildbot-plugins,
6 parameterized, git, openssh, glibcLocales, nixosTests }:
7
8let
9 withPlugins = plugins: buildPythonPackage {
10 name = "${package.name}-with-plugins";
11 phases = [ "installPhase" "fixupPhase" ];
12 buildInputs = [ makeWrapper ];
13 propagatedBuildInputs = plugins ++ package.propagatedBuildInputs;
14
15 installPhase = ''
16 makeWrapper ${package}/bin/buildbot $out/bin/buildbot \
17 --prefix PYTHONPATH : "${package}/${python.sitePackages}:$PYTHONPATH"
18 ln -sfv ${package}/lib $out/lib
19 '';
20
21 passthru = package.passthru // {
22 withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
23 };
24 };
25
26 package = buildPythonPackage rec {
27 pname = "buildbot";
28 version = "2.8.2";
29
30 src = fetchPypi {
31 inherit pname version;
32 sha256 = "0rdrz2zkd6xaf9kb5l41xmbfzq618sz498w23irshih4c802pdv5";
33 };
34
35 propagatedBuildInputs = [
36 # core
37 twisted
38 jinja2
39 zope_interface
40 sqlalchemy
41 sqlalchemy_migrate
42 dateutil
43 txaio
44 autobahn
45 pyjwt
46 pyyaml
47 ]
48 # tls
49 ++ twisted.extras.tls;
50
51 checkInputs = [
52 treq
53 txrequests
54 pyjade
55 boto3
56 moto
57 mock
58 python-lz4
59 setuptoolsTrial
60 isort
61 pylint
62 flake8
63 buildbot-worker
64 buildbot-pkg
65 buildbot-plugins.www
66 parameterized
67 git
68 openssh
69 glibcLocales
70 ];
71
72 patches = [
73 # This patch disables the test that tries to read /etc/os-release which
74 # is not accessible in sandboxed builds.
75 ./skip_test_linux_distro.patch
76
77 # fix compatibility with the latest SQLAlchemy
78 (fetchpatch {
79 url = "https://github.com/buildbot/buildbot/commit/96f3cd1c5f5c82b733baecb133576366ecf544fc.patch";
80 sha256 = "0n1jm13h08j7ksbs8ixayn3wziq5hzyp3kscz9fpgxd8gl885y5n";
81 stripLen = 1;
82 })
83 ];
84
85 postPatch = ''
86 substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
87 '';
88
89 # TimeoutErrors on slow machines -> aarch64
90 doCheck = !stdenv.isAarch64;
91
92 preCheck = ''
93 export LC_ALL="en_US.UTF-8"
94 export PATH="$out/bin:$PATH"
95 '';
96
97 disabled = !isPy3k;
98
99 passthru = {
100 inherit withPlugins;
101 tests.buildbot = nixosTests.buildbot;
102 };
103
104 meta = with lib; {
105 homepage = "https://buildbot.net/";
106 description = "Buildbot is an open-source continuous integration framework for automating software build, test, and release processes";
107 maintainers = with maintainers; [ nand0p ryansydnor lopsided98 ];
108 license = licenses.gpl2;
109 };
110 };
111in package