config.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # Modify build version
  27. pwd
  28. ls
  29. python setup.py bdist_wheel --cpp_implementation --compile_static_extension
  30. cp dist/*.whl $abs_wheelhouse
  31. }
  32. function build_wheel {
  33. build_wheel_cmd "bdist_wheel_cmd" $@
  34. }
  35. function run_tests {
  36. # Runs tests on installed distribution from an empty directory
  37. python --version
  38. python -c "from google.protobuf.pyext import _message;"
  39. }