config.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. yum install -y devtoolset-2-libatomic-devel
  8. # Build protoc
  9. ./autogen.sh
  10. ./configure
  11. CXXFLAGS="-fPIC -g -O2" ./configure
  12. make -j8
  13. # Generate python dependencies.
  14. pushd python
  15. python setup.py build_py
  16. popd
  17. popd
  18. }
  19. function bdist_wheel_cmd {
  20. # Builds wheel with bdist_wheel, puts into wheelhouse
  21. #
  22. # It may sometimes be useful to use bdist_wheel for the wheel building
  23. # process. For example, versioneer has problems with versions which are
  24. # fixed with bdist_wheel:
  25. # https://github.com/warner/python-versioneer/issues/121
  26. local abs_wheelhouse=$1
  27. # Modify build version
  28. pwd
  29. ls
  30. python setup.py bdist_wheel --cpp_implementation --compile_static_extension
  31. cp dist/*.whl $abs_wheelhouse
  32. }
  33. function build_wheel {
  34. build_wheel_cmd "bdist_wheel_cmd" $@
  35. }
  36. function run_tests {
  37. # Runs tests on installed distribution from an empty directory
  38. python --version
  39. python -c "from google.protobuf.pyext import _message;"
  40. }