summary refs log tree commit diff
path: root/pkgs/applications/virtualization/openstack/neutron.nix
blob: ce3e71b16ee59876601a8cbf1e09b45231c8fb72 (plain) (blame)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ stdenv, fetchurl, pythonPackages, xmlsec, which }:

pythonPackages.buildPythonPackage rec {
  name = "neutron-${version}";
  version = "7.0.0";
  namePrefix = "";

  PBR_VERSION = "${version}";

  src = fetchurl {
    url = "https://github.com/openstack/neutron/archive/${version}.tar.gz";
    sha256 = "02ll081xly7zfjmgkal81fy3aplbnn5zgx8xfy3yy1nv3kfnyi40";
  };

  # https://github.com/openstack/neutron/blob/stable/liberty/requirements.txt
  propagatedBuildInputs = with pythonPackages; [
   pbr paste PasteDeploy routes debtcollector eventlet greenlet httplib2 requests2
   jinja2 keystonemiddleware netaddr retrying sqlalchemy_1_0 webob alembic six
   stevedore pecan ryu networking-hyperv MySQL_python

   # clients
   keystoneclient neutronclient novaclient

   # oslo components
   oslo-concurrency oslo-config oslo-context oslo-db oslo-i18n oslo-log oslo-messaging
   oslo-middleware oslo-policy oslo-rootwrap oslo-serialization oslo-service oslo-utils
   oslo-versionedobjects
  ];

  # make sure we include migrations
  patchPhase = ''
    echo "graft neutron" >> MANIFEST.in
  '';

  buildInputs = with pythonPackages; [
    cliff coverage fixtures mock subunit requests-mock oslosphinx testrepository
    testtools testresources testscenarios webtest oslotest os-testr tempest-lib
    ddt pep8
  ];

  postInstall = ''
    # requires extra optional dependencies
    # TODO: package networking_mlnx, networking_vsphere, bsnstacklib, XenAPI
    rm $out/bin/{neutron-mlnx-agent,neutron-ovsvapp-agent,neutron-restproxy-agent,neutron-rootwrap-xen-dom0}

    # check all binaries don't crash
    for i in $out/bin/*; do
      case "$i" in
      *neutron-pd-notify|*neutron-rootwrap-daemon|*neutron-rootwrap)
        :
        ;;
      *)
         $i --help
      esac
    done
  '';

  meta = with stdenv.lib; {
    homepage = http://neutron.openstack.org/;
    description = "Virtual network service for Openstack";
    license = stdenv.lib.licenses.asl20;
    platforms = stdenv.lib.platforms.linux;
  };
}