build-style/python[3]-module: override _PYTHON_SYSCONFIGDATA_NAME
Use the sysconfigdata for the appropriate cross arch. Upstream change: https://bugs.python.org/issue36235
This commit is contained in:
parent
69e7262005
commit
d3968bef3c
2 changed files with 34 additions and 2 deletions
|
@ -10,13 +10,23 @@ do_build() {
|
||||||
if [ -n "$CROSS_BUILD" ]; then
|
if [ -n "$CROSS_BUILD" ]; then
|
||||||
CFLAGS="$tmp_cflags"
|
CFLAGS="$tmp_cflags"
|
||||||
LDFLAGS="$tmp_ldflags"
|
LDFLAGS="$tmp_ldflags"
|
||||||
|
ADDENV=
|
||||||
|
|
||||||
PYPREFIX="$XBPS_CROSS_BASE"
|
PYPREFIX="$XBPS_CROSS_BASE"
|
||||||
CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${pyver} -I${XBPS_CROSS_BASE}/usr/include"
|
CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${pyver} -I${XBPS_CROSS_BASE}/usr/include"
|
||||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${pyver} -L${XBPS_CROSS_BASE}/usr/lib"
|
LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${pyver} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||||
LDSHARED="${CC} -shared $LDFLAGS"
|
LDSHARED="${CC} -shared $LDFLAGS"
|
||||||
env CC="$CC" LDSHARED="$LDSHARED" \
|
case $pyver in
|
||||||
|
3.*)
|
||||||
|
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
|
||||||
|
f=${f##*/}
|
||||||
|
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
|
||||||
|
done
|
||||||
|
ADDENV+=" PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}"
|
||||||
|
ADDENV+=" _PYTHON_SYSCONFIGDATA_NAME="$_PYTHON_SYSCONFIGDATA_NAME""
|
||||||
|
esac
|
||||||
|
env CC="$CC" LDSHARED="$LDSHARED" $ADDENV \
|
||||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||||
LDFLAGS="$LDFLAGS" python${pyver} setup.py \
|
LDFLAGS="$LDFLAGS" python${pyver} setup.py \
|
||||||
build --build-base=build-${pyver} ${make_build_args}
|
build --build-base=build-${pyver} ${make_build_args}
|
||||||
|
@ -50,12 +60,22 @@ do_install() {
|
||||||
|
|
||||||
for pyver in $python_versions; do
|
for pyver in $python_versions; do
|
||||||
if [ -n "$CROSS_BUILD" ]; then
|
if [ -n "$CROSS_BUILD" ]; then
|
||||||
|
ADDENV=
|
||||||
PYPREFIX="$XBPS_CROSS_BASE"
|
PYPREFIX="$XBPS_CROSS_BASE"
|
||||||
CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${pyver} -I${XBPS_CROSS_BASE}/usr/include"
|
CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${pyver} -I${XBPS_CROSS_BASE}/usr/include"
|
||||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${pyver} -L${XBPS_CROSS_BASE}/usr/lib"
|
LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${pyver} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||||
LDSHARED="${CC} -shared $LDFLAGS"
|
LDSHARED="${CC} -shared $LDFLAGS"
|
||||||
env CC="$CC" LDSHARED="$LDSHARED" \
|
case $pyver in
|
||||||
|
3.*)
|
||||||
|
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
|
||||||
|
f=${f##*/}
|
||||||
|
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
|
||||||
|
done
|
||||||
|
ADDENV+=" PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}"
|
||||||
|
ADDENV+=" _PYTHON_SYSCONFIGDATA_NAME="$_PYTHON_SYSCONFIGDATA_NAME""
|
||||||
|
esac
|
||||||
|
env CC="$CC" LDSHARED="$LDSHARED" $ADDENV \
|
||||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||||
LDFLAGS="$LDFLAGS" python${pyver} setup.py \
|
LDFLAGS="$LDFLAGS" python${pyver} setup.py \
|
||||||
build --build-base=build-${pyver} \
|
build --build-base=build-${pyver} \
|
||||||
|
|
|
@ -9,8 +9,14 @@ do_build() {
|
||||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
|
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||||
LDSHARED="${CC} -shared $LDFLAGS"
|
LDSHARED="${CC} -shared $LDFLAGS"
|
||||||
|
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
|
||||||
|
f=${f##*/}
|
||||||
|
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
|
||||||
|
done
|
||||||
env CC="$CC" LDSHARED="$LDSHARED" \
|
env CC="$CC" LDSHARED="$LDSHARED" \
|
||||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||||
|
PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib} \
|
||||||
|
_PYTHON_SYSCONFIGDATA_NAME="$_PYTHON_SYSCONFIGDATA_NAME" \
|
||||||
LDFLAGS="$LDFLAGS" python3 setup.py build ${make_build_args}
|
LDFLAGS="$LDFLAGS" python3 setup.py build ${make_build_args}
|
||||||
else
|
else
|
||||||
python3 setup.py build ${make_build_args}
|
python3 setup.py build ${make_build_args}
|
||||||
|
@ -36,8 +42,14 @@ do_install() {
|
||||||
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
|
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
|
||||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
|
||||||
LDSHARED="${CC} -shared $LDFLAGS"
|
LDSHARED="${CC} -shared $LDFLAGS"
|
||||||
|
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
|
||||||
|
f=${f##*/}
|
||||||
|
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
|
||||||
|
done
|
||||||
env CC="$CC" LDSHARED="$LDSHARED" \
|
env CC="$CC" LDSHARED="$LDSHARED" \
|
||||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||||
|
PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib} \
|
||||||
|
_PYTHON_SYSCONFIGDATA_NAME="$_PYTHON_SYSCONFIGDATA_NAME" \
|
||||||
LDFLAGS="$LDFLAGS" python3 setup.py \
|
LDFLAGS="$LDFLAGS" python3 setup.py \
|
||||||
install --prefix=/usr --root=${DESTDIR} ${make_install_args}
|
install --prefix=/usr --root=${DESTDIR} ${make_install_args}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue