diff --git a/common/build_style/python-module.sh b/common/build_style/python-module.sh index 2ab6e079b9..624ae5223b 100644 --- a/common/build_style/python-module.sh +++ b/common/build_style/python-module.sh @@ -4,54 +4,50 @@ do_build() { : ${python_versions:=2.7} - local python_version= pysufx="m" + local pyver= pysufx= - for python_version in $python_versions; do + for pyver in $python_versions; do if [ -n "$CROSS_BUILD" ]; then PYPREFIX="$XBPS_CROSS_BASE" - if [ "$python_versions" = "2.7" ]; then - CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${python_version} -I${XBPS_CROSS_BASE}/usr/include" - else - CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${python_version}${pysufx} -I${XBPS_CROSS_BASE}/usr/include" + if [ "$pyver" != "2.7" ]; then + pysufx=m fi - LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${python_version} -L${XBPS_CROSS_BASE}/usr/lib" + CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${pyver}${pysufx} -I${XBPS_CROSS_BASE}/usr/include" + LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${pyver} -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" python${python_version} setup.py \ - build --build-base=build-$python_version ${make_build_args} + LDFLAGS="$LDFLAGS" python${pyver} setup.py \ + build --build-base=build-${pyver} ${make_build_args} else - python${python_version} setup.py build --build-base=build-$python_version \ - ${make_build_args} + python${pyver} setup.py build --build-base=build-${pyver} ${make_build_args} fi done } do_install() { : ${python_versions:=2.7} - local python_version= pysufx="m" + local pyver= pysufx= make_install_args+=" --prefix=/usr --root=$DESTDIR" - for python_version in $python_versions; do + for pyver in $python_versions; do if [ -n "$CROSS_BUILD" ]; then PYPREFIX="$XBPS_CROSS_BASE" - if [ "$python_versions" = "2.7" ]; then - CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${python_version} -I${XBPS_CROSS_BASE}/usr/include" - else - CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${python_version}${pysufx} -I${XBPS_CROSS_BASE}/usr/include" + if [ "$pyver" != "2.7" ]; then + pysufx=m fi - LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${python_version} -L${XBPS_CROSS_BASE}/usr/lib" + CFLAGS+=" -I${XBPS_CROSS_BASE}/include/python${pyver}${pysufx} -I${XBPS_CROSS_BASE}/usr/include" + LDFLAGS+=" -L${XBPS_CROSS_BASE}/lib/python${pyver} -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" python${python_version} setup.py \ - build --build-base=build-$python_version install ${make_install_args} + LDFLAGS="$LDFLAGS" python${pyver} setup.py \ + build --build-base=build-${pyver} install ${make_install_args} else - python${python_version} setup.py build --build-base=build-$python_version install \ - ${make_install_args} + python${pyver} setup.py build --build-base=build-${pyver} install ${make_install_args} fi done }