summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/buildbot-classic/default.nix
blob: 3cb766e92d05b979e186cbfcd9d3b9101ecf937d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ fetchgit, fetchFromGitHub, python2Packages, git, ... }:
let
  # https://github.com/NixOS/nixpkgs/issues/14026
  nixpkgs-fix = import (fetchgit {
    url = https://github.com/nixos/nixpkgs;
    rev = "e026b5c243ea39810826e68362718f5d703fb5d0";
    sha256 = "11lqd480bi6xbi7xbh4krrxmbp6a6iafv1d0q3sj461al0x0has8";
  }) {};

in nixpkgs-fix.buildPythonApplication {
  name = "buildbot-classic-0.8.13";
  namePrefix = "";
  patches = [];

  src = fetchFromGitHub {
    owner = "krebscode";
    repo = "buildbot-classic";
    rev = "5b4f5f6f1";
    sha256 = "1j3xn1gjzvsf90jvfmyln71fzlhjx642ivrqf47zfxpkacljja93";
  };
  postUnpack = "sourceRoot=\${sourceRoot}/master";
  nativeBuildInputs = [ nixpkgs-fix.git ];
  patchPhase =
    # The code insists on /usr/bin/tail, /usr/bin/make, etc.
    '' echo "patching erroneous absolute path references..."
       for i in $(find -name \*.py)
       do
         sed -i "$i" \
             -e "s|/usr/bin/python|$(type -P python)|g ; s|/usr/bin/||g"
       done

      sed -i 's/==/>=/' setup.py
    '';

  propagatedBuildInputs = with nixpkgs-fix.pythonPackages; [
    jinja2
    twisted
    dateutil_1_5
    sqlalchemy_migrate_0_7
  ];
  doCheck = false;
  postInstall = ''
    mkdir -p "$out/share/man/man1"
    cp docs/buildbot.1 "$out/share/man/man1"
  '';
}