Skip to content

Commit

Permalink
Python: fix cryptography wheel for ARM
Browse files Browse the repository at this point in the history
Add WHEELS_CFLAGS and WHEELS_LDFLAGS to pass additional cross-compilation
options to "pip wheel"

Resolves #3246 #3201
  • Loading branch information
ymartin59 committed May 28, 2018
1 parent e4bbcfd commit ce6e8f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mk/spksrc.wheel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ build_wheel_target: $(PRE_WHEEL_TARGET)
$(foreach e,$(shell cat $(WORK_DIR)/python-cc.mk),$(eval $(e))) \
if [ ! -z "$(CROSS_COMPILE_WHEELS)" ] ; then \
$(MSG) "Force cross-compile" ; \
$(RUN) CFLAGS="$(CFLAGS) -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR)" $(PIP_WHEEL) ; \
$(RUN) CFLAGS="$(CFLAGS) -I$(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) $(WHEELS_CFLAGS)" LDFLAGS="$(LDFLAGS) $(WHEELS_LDFLAGS)" $(PIP_WHEEL) ; \
else \
$(MSG) "Force pure-python" ; \
export LD= LDSHARED= CPP= NM= CC= AS= RANLIB= CXX= AR= STRIP= OBJDUMP= READELF= CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= && \
$(RUN) $(PIP_WHEEL) ; \
fi ; \
fi


post_wheel_target: $(WHEEL_TARGET)
@if [ -d "$(WORK_DIR)/wheelhouse" ] ; then \
Expand Down
9 changes: 8 additions & 1 deletion spk/python/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SPK_NAME = python
SPK_SHORT_VERS = 2.7
SPK_VERS = $(SPK_SHORT_VERS).14
SPK_REV = 18
SPK_REV = 19
SPK_ICON = src/python.png

DEPENDS = cross/busybox cross/$(SPK_NAME)
Expand All @@ -16,6 +16,7 @@ DEPENDS += cross/pyyaml cross/pyzmq cross/uwsgi

WHEELS = src/requirements.txt


MAINTAINER = Safihre
DESCRIPTION = Python 2.7 Programming Language.
DESCRIPTION_FRE = Langage de programmation Python 2.7.
Expand All @@ -41,6 +42,12 @@ ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)"

include ../../mk/spksrc.spk.mk

# Wheel "cryptography" lacks libpthread when cross-compile for ARM
ifeq ($(findstring $(ARCH),$(ARM_ARCHES)),$(ARCH))
WHEELS_CFLAGS = "-pthread"
WHEELS_LDFLAGS = "-lpthread"
endif

.PHONY: python_extra_install
python_extra_install:
rm -f $(STAGING_DIR)/$(PYTHON_LIB_DIR)/config/libpython*.a
Expand Down

0 comments on commit ce6e8f1

Please sign in to comment.