Nathaniel Manista | b68f3d1 | 2015-01-23 21:32:47 +0000 | [diff] [blame] | 1 | # Copyright 2015, Google Inc. |
| 2 | # All rights reserved. |
| 3 | # |
| 4 | # Redistribution and use in source and binary forms, with or without |
| 5 | # modification, are permitted provided that the following conditions are |
| 6 | # met: |
| 7 | # |
| 8 | # * Redistributions of source code must retain the above copyright |
| 9 | # notice, this list of conditions and the following disclaimer. |
| 10 | # * Redistributions in binary form must reproduce the above |
| 11 | # copyright notice, this list of conditions and the following disclaimer |
| 12 | # in the documentation and/or other materials provided with the |
| 13 | # distribution. |
| 14 | # * Neither the name of Google Inc. nor the names of its |
| 15 | # contributors may be used to endorse or promote products derived from |
| 16 | # this software without specific prior written permission. |
| 17 | # |
| 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | |
Nathaniel Manista | b8b0adf | 2015-01-29 00:30:51 +0000 | [diff] [blame] | 30 | """A setup module for the GRPC Python package.""" |
Nathaniel Manista | b68f3d1 | 2015-01-23 21:32:47 +0000 | [diff] [blame] | 31 | |
Nathaniel Manista | b8b0adf | 2015-01-29 00:30:51 +0000 | [diff] [blame] | 32 | from distutils import core as _core |
Nathaniel Manista | b68f3d1 | 2015-01-23 21:32:47 +0000 | [diff] [blame] | 33 | |
Nathaniel Manista | a4ead5d | 2015-01-31 01:33:27 +0000 | [diff] [blame^] | 34 | _EXTENSION_SOURCES = ( |
| 35 | 'src/_adapter/_c.c', |
| 36 | 'src/_adapter/_call.c', |
| 37 | 'src/_adapter/_channel.c', |
| 38 | 'src/_adapter/_completion_queue.c', |
| 39 | 'src/_adapter/_error.c', |
| 40 | 'src/_adapter/_server.c', |
| 41 | ) |
| 42 | |
| 43 | _EXTENSION_INCLUDE_DIRECTORIES = ( |
| 44 | 'src', |
| 45 | # TODO(nathaniel): Can this path specification be made to work? |
| 46 | #'../../include', |
| 47 | ) |
| 48 | |
| 49 | _EXTENSION_LIBRARIES = ( |
| 50 | 'gpr', |
| 51 | 'grpc', |
| 52 | ) |
| 53 | |
| 54 | _EXTENSION_LIBRARY_DIRECTORIES = ( |
| 55 | # TODO(nathaniel): Can this path specification be made to work? |
| 56 | #'../../libs/dbg', |
| 57 | ) |
| 58 | |
| 59 | _EXTENSION_MODULE = _core.Extension( |
| 60 | '_adapter._c', sources=list(_EXTENSION_SOURCES), |
| 61 | include_dirs=_EXTENSION_INCLUDE_DIRECTORIES, |
| 62 | libraries=_EXTENSION_LIBRARIES, |
| 63 | library_dirs=_EXTENSION_LIBRARY_DIRECTORIES) |
| 64 | |
Nathaniel Manista | b8b0adf | 2015-01-29 00:30:51 +0000 | [diff] [blame] | 65 | _PACKAGES=( |
Nathaniel Manista | a4ead5d | 2015-01-31 01:33:27 +0000 | [diff] [blame^] | 66 | '_adapter', |
Nathaniel Manista | b8b0adf | 2015-01-29 00:30:51 +0000 | [diff] [blame] | 67 | '_framework', |
| 68 | '_framework.base', |
| 69 | '_framework.base.packets', |
| 70 | '_framework.common', |
| 71 | '_framework.face', |
| 72 | '_framework.face.testing', |
| 73 | '_framework.foundation', |
| 74 | '_junkdrawer', |
| 75 | ) |
Nathaniel Manista | b68f3d1 | 2015-01-23 21:32:47 +0000 | [diff] [blame] | 76 | |
Nathaniel Manista | b8b0adf | 2015-01-29 00:30:51 +0000 | [diff] [blame] | 77 | _PACKAGE_DIRECTORIES = { |
Nathaniel Manista | a4ead5d | 2015-01-31 01:33:27 +0000 | [diff] [blame^] | 78 | '_adapter': 'src/_adapter', |
Nathaniel Manista | b8b0adf | 2015-01-29 00:30:51 +0000 | [diff] [blame] | 79 | '_framework': 'src/_framework', |
| 80 | '_junkdrawer': 'src/_junkdrawer', |
| 81 | } |
| 82 | |
| 83 | _core.setup( |
Nathaniel Manista | a4ead5d | 2015-01-31 01:33:27 +0000 | [diff] [blame^] | 84 | name='grpc', version='0.0.1', |
| 85 | ext_modules=[_EXTENSION_MODULE], packages=_PACKAGES, |
Nathaniel Manista | b8b0adf | 2015-01-29 00:30:51 +0000 | [diff] [blame] | 86 | package_dir=_PACKAGE_DIRECTORIES) |