void-packages/common/build-style/python2-module.sh
Alessio Sergi 2014e03dac Revert "common/buildstyle/python*: build dir can be used as python identifier"
This reverts commit a02132b2ae.

Actually, the issue with packages using python-distutils-extra hasn't
been solved. On the contrary, python build style now generates malformed
packages, e.g., gufw:

+-- usr
    +-- lib
    |   +-- python3.5
    |       +-- site-packages
    |           +-- build3_5
    |           |   +-- lib
    |           |       +-- gufw
    |           |           +-- __init__.py
    |           |           +-- gufw
    |           |           +-- gufw.py
    |           +-- gufw
    |           |   +-- __init__.py
    |           |   +-- gufw
    |           |   +-- gufw.py
    |           +-- gufw-17.04.1-py3.5.egg-info

I don't have a clean solution handy right now, but that obviously isn't.
2017-01-12 12:27:12 +01:00

37 lines
1.3 KiB
Bash

#
# This helper is for templates installing python2-only modules.
#
do_build() {
if [ -n "$CROSS_BUILD" ]; then
PYPREFIX="$XBPS_CROSS_BASE"
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py2_inc} -I${XBPS_CROSS_BASE}/usr/include"
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py2_lib} -L${XBPS_CROSS_BASE}/usr/lib"
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
LDSHARED="${CC} -shared $LDFLAGS"
env CC="$CC" LDSHARED="$LDSHARED" \
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
LDFLAGS="$LDFLAGS" python2 setup.py \
build --build-base=build-${py2_ver} ${make_build_args}
else
python2 setup.py build --build-base=build-${py2_ver} ${make_build_args}
fi
}
do_install() {
if [ -n "$CROSS_BUILD" ]; then
PYPREFIX="$XBPS_CROSS_BASE"
CFLAGS+=" -I${XBPS_CROSS_BASE}/${py2_inc} -I${XBPS_CROSS_BASE}/usr/include"
LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py2_lib} -L${XBPS_CROSS_BASE}/usr/lib"
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
LDSHARED="${CC} -shared $LDFLAGS"
env CC="$CC" LDSHARED="$LDSHARED" \
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
LDFLAGS="$LDFLAGS" python2 setup.py \
build --build-base=build-${py2_ver} \
install --prefix=/usr --root=${DESTDIR} ${make_install_args}
else
python2 setup.py build --build-base=build-${py2_ver} \
install --prefix=/usr --root=${DESTDIR} ${make_install_args}
fi
}