config.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Define custom utilities
  2. # Test for OSX with [ -n "$IS_OSX" ]
  3. function pre_build {
  4. # Any stuff that you need to do before you start building the wheels
  5. # Runs in the root directory of this repository.
  6. pushd protobuf
  7. # Build protoc
  8. ./autogen.sh
  9. ./configure
  10. CXXFLAGS="-fPIC -g -O2" ./configure
  11. make -j8
  12. # Generate python dependencies.
  13. pushd python
  14. python setup.py build_py
  15. popd
  16. popd
  17. }
  18. function bdist_wheel_cmd {
  19. # Builds wheel with bdist_wheel, puts into wheelhouse
  20. #
  21. # It may sometimes be useful to use bdist_wheel for the wheel building
  22. # process. For example, versioneer has problems with versions which are
  23. # fixed with bdist_wheel:
  24. # https://github.com/warner/python-versioneer/issues/121
  25. local abs_wheelhouse=$1
  26. python setup.py bdist_wheel --cpp_implementation --compile_static_extension
  27. cp dist/*.whl $abs_wheelhouse
  28. }
  29. function build_wheel {
  30. build_wheel_cmd "bdist_wheel_cmd" $@
  31. }
  32. function run_tests {
  33. # Runs tests on installed distribution from an empty directory
  34. python --version
  35. python -c "import google.protobuf;"
  36. }