Skip to content

Commit ba8d9bd

Browse files
committed
wheel.mk: Make compatible with spksrc.crossenv.mk
1 parent 6f65dca commit ba8d9bd

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

mk/spksrc.wheel.mk

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ WHEEL_COOKIE = $(WORK_DIR)/.$(COOKIE_PREFIX)wheel_done
1717
## python wheel specific configurations
1818
include ../../mk/spksrc.wheel-env.mk
1919

20+
## python wheel specific configurations
21+
include ../../mk/spksrc.crossenv.mk
22+
2023
##
2124

2225
ifeq ($(strip $(PRE_WHEEL_TARGET)),)
@@ -106,7 +109,7 @@ wheel_msg_target:
106109
# building a wheel for x64-6.2.4 may look successfull while
107110
# it actually used a cache built from x64-7.1
108111
#
109-
pre_wheel_target: wheel_msg_target wheeldownload
112+
pre_wheel_target: build-crossenv wheel_msg_target wheeldownload
110113
ifneq ($(strip $(WHEELS)),)
111114
@if [ -n "$(PIP_CACHE_OPT)" ] ; then \
112115
mkdir -p $(PIP_CACHE_DIR) ; \
@@ -140,25 +143,33 @@ endif
140143
build_wheel_target: SHELL:=/bin/bash
141144
build_wheel_target: $(PRE_WHEEL_TARGET)
142145
ifneq ($(strip $(WHEELS)),)
143-
$(foreach e,$(shell cat $(WORK_DIR)/python-cc.mk),$(eval $(e)))
146+
# $(foreach e,$(shell cat $(WORK_DIR)/python-cc.mk),$(eval $(e)))
144147
@if [ -s $(WHEELHOUSE)/$(WHEELS_CROSSENV_COMPILE) -o -s $(WHEELHOUSE)/$(WHEELS_LIMITED_API) ]; then \
145-
$(MSG) "Cross-compiling wheels" ; \
146-
crossenvPIP=$(PIP) ; \
147-
if [ -s "$(CROSSENV)" ] ; then \
148-
crossenvPIP=$$(. $(CROSSENV) && which pip) ; \
149-
$(MSG) "Python crossenv found: [$(CROSSENV)]" ; \
150-
$(MSG) "pip crossenv found: [$${crossenvPIP}]" ; \
151-
elif [ "$(PYTHON_VERSION)" != "2.7" ] ; then \
152-
$(MSG) "WARNING: Python crossenv NOT found!" ; \
153-
$(MSG) "WARNING: pip crossenv NOT found!" ; \
154-
else \
155-
$(MSG) "Python $(PYTHON_VERSION) uses pip: $${crossenvPIP}" ; \
156-
fi ; \
157148
while IFS= read -r requirement ; do \
158149
wheel=$${requirement#*:} ; \
159150
file=$$(basename $${requirement%%:*}) ; \
160-
[ "$${file}" = "$(WHEELS_LIMITED_API)" ] && abi3="--build-option=--py-limited-api=$(PYTHON_LIMITED_API)" || abi3="" ; \
161151
[ "$$(grep -s egg <<< $${wheel})" ] && name=$$(echo $${wheel#*egg=} | cut -f1 -d=) || name=$${wheel%%[<>=]=*} ; \
152+
echo "WHEEL=\"$${wheel}\" $(MAKE) crossenv-$(ARCH)-$(TCVERSION)" ; \
153+
WHEEL="$${wheel}" $(MAKE) crossenv-$(ARCH)-$(TCVERSION) ; \
154+
for crossenv in $(WORK_DIR)/crossenv-$${wheel} $(WORK_DIR)/crossenv-$${name} $(WORK_DIR)/crossenv ; do \
155+
echo "DIR CHECK EN COURS: $${crossenv}" ; \
156+
echo "ACTIVATE EN COURS: $${crossenv}/build/python-cc.mk" ; \
157+
[ -d $${crossenv} ] && . $${crossenv}/build/python-cc.mk && break ; \
158+
done ; \
159+
crossenvPIP=$(PIP) ; \
160+
echo "CROSSENV: $${CROSSENV}" ; \
161+
if [ -s "$${CROSSENV}" ] ; then \
162+
crossenvPIP=$$(. $${CROSSENV} && which pip) ; \
163+
$(MSG) "Python crossenv found: [$${CROSSENV}]" ; \
164+
$(MSG) "pip crossenv found: [$${crossenvPIP}]" ; \
165+
elif [ "$${PYTHON_VERSION}" != "2.7" ] ; then \
166+
$(MSG) "WARNING: Python crossenv NOT found!" ; \
167+
$(MSG) "WARNING: pip crossenv NOT found!" ; \
168+
else \
169+
$(MSG) "Python $${PYTHON_VERSION} uses pip: $${crossenvPIP}" ; \
170+
fi ; \
171+
$(MSG) "Cross-compiling [$${wheel}] wheel using $${CROSSENV_PATH}" ; \
172+
[ "$${file}" = "$(WHEELS_LIMITED_API)" ] && abi3="--build-option=--py-limited-api=$(PYTHON_LIMITED_API)" || abi3="" ; \
162173
global_options=$$(echo $(WHEELS_BUILD_ARGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs) ; \
163174
localCFLAGS=($$(echo $(WHEELS_CFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \
164175
localLDFLAGS=($$(echo $(WHEELS_LDFLAGS) | sed -e 's/ \[/\n\[/g' | grep -i $${name} | cut -f2 -d] | xargs)) ; \

0 commit comments

Comments
 (0)