diff options
-rwxr-xr-x | .ci/linux-build.sh | 7 | ||||
-rwxr-xr-x | debian/rules | 11 |
2 files changed, 15 insertions, 3 deletions
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index c396ec1e8..9746a8239 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -212,6 +212,13 @@ if [ "$DEB_PACKAGE" ]; then echo $deps | xargs sudo apt -y install # install the locally built openvswitch packages sudo dpkg -i $packages + + # Check that python C extension is built correctly. + python3 -c " +from ovs import _json +import ovs.json +assert ovs.json.from_string('{\"a\": 42}') == {'a': 42}" + exit 0 fi diff --git a/debian/rules b/debian/rules index 1ab0c74a0..971bc1775 100755 --- a/debian/rules +++ b/debian/rules @@ -2,6 +2,7 @@ # -*- makefile -*- #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_CFLAGS_MAINT_APPEND = -fPIC %: dh $@ @@ -91,10 +92,14 @@ override_dh_auto_install: execute_after_dh_install: set -e && for pyvers in $(PYTHON3S); do \ - cd python && \ + cd python; \ + export PKG_CONFIG_PATH=$(CURDIR)/debian/tmp/usr/lib/pkgconfig; \ + export PKG_CONFIG_SYSROOT_DIR=$(CURDIR)/debian/tmp; \ + export PKG_CONFIG_SYSTEM_INCLUDE_PATH=/; \ + export PKG_CONFIG_SYSTEM_LIBRARY_PATH=/; \ enable_shared=no \ - CFLAGS=-I$(CURDIR)/debian/tmp/usr/include \ - LDFLAGS=$(CURDIR)/debian/tmp/usr/lib/libopenvswitch.a \ + extra_cflags="`pkg-config --cflags libopenvswitch`" \ + extra_libs="-Wl,-Bstatic -lopenvswitch -Wl,-Bdynamic `pkg-config --libs --static libopenvswitch`" \ python$$pyvers setup.py install --install-layout=deb \ --root $(CURDIR)/debian/python3-openvswitch; \ cd ..; \ |