aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Yang <teboring@google.com>2018-01-26 17:36:14 -0800
committerBo Yang <teboring@google.com>2018-01-26 17:36:14 -0800
commit7494c05885204f4ec7f66460bb36022704aa6f88 (patch)
tree444dc84a168530dc265dc208c2ee26ccad8859ef
parente6bf33811f5f424fca390131ae86b352d2a4d1a6 (diff)
downloadprotobuf-7494c05885204f4ec7f66460bb36022704aa6f88.tar.gz
protobuf-7494c05885204f4ec7f66460bb36022704aa6f88.tar.bz2
protobuf-7494c05885204f4ec7f66460bb36022704aa6f88.zip
Fix build on linux
-rw-r--r--.travis.yml2
-rw-r--r--config.sh34
2 files changed, 32 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index 140b44dd..77c980aa 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -61,7 +61,7 @@ before_install:
install:
# Maybe get and clean and patch source
- clean_code $REPO_DIR $BUILD_COMMIT
- - build_wheel $REPO_DIR $PLAT
+ - build_wheel $REPO_DIR/python $PLAT
script:
- install_run $PLAT
diff --git a/config.sh b/config.sh
index 914c682b..40cf39bc 100644
--- a/config.sh
+++ b/config.sh
@@ -4,9 +4,37 @@
function pre_build {
# Any stuff that you need to do before you start building the wheels
# Runs in the root directory of this repository.
- pwd
- ls
- cd protobuf/python
+ pushd protobuf
+
+ # Build protoc
+ ./autogen.sh
+ ./configure
+
+ CXXFLAGS="-fPIC -g -O2" ./configure
+ make -j8
+
+ # Generate python dependencies.
+ pushd python
+ python setup.py build_py
+ popd
+
+ popd
+}
+
+function bdist_wheel_cmd {
+ # Builds wheel with bdist_wheel, puts into wheelhouse
+ #
+ # It may sometimes be useful to use bdist_wheel for the wheel building
+ # process. For example, versioneer has problems with versions which are
+ # fixed with bdist_wheel:
+ # https://github.com/warner/python-versioneer/issues/121
+ local abs_wheelhouse=$1
+ python setup.py bdist_wheel --cpp_implementation --compile_static_extension
+ cp dist/*.whl $abs_wheelhouse
+}
+
+function build_wheel {
+ build_wheel_cmd "bdist_wheel_cmd" $@
}
function run_tests {