python3-pivy: rebuild against coin3-4.0.0

* fix license
* fix update detection
* setup.py: switch to cmake that is needed for coin3 4.0
This commit is contained in:
yopito 2020-11-23 00:54:54 +01:00 committed by Piraty
parent 4fa3cd554b
commit 00dbc37f39
2 changed files with 43 additions and 21 deletions

View file

@ -1,39 +1,64 @@
# Template file for 'python3-pivy'
pkgname=python3-pivy
version=0.6.5
revision=1
revision=2
wrksrc="pivy-${version}"
build_style=python3-module
hostmakedepends="python3-devel swig"
makedepends="python3-devel coin3-devel qt5-devel"
hostmakedepends="python3-devel swig cmake"
makedepends="python3-devel coin3-devel"
short_desc="Python3 bindings for the high-level 3D graphics library Coin"
maintainer="yopito <pierre.bourgin@free.fr>"
license="0BSD"
license="ISC"
homepage="https://github.com/coin3d/pivy"
distfiles="${homepage}/archive/${version}.tar.gz"
checksum=16f2e339e5c59a6438266abe491013a20f53267e596850efad1559564a2c1719
# still relevant with pivy 0.6.5 ?
case "$XBPS_TARGET_MACHINE" in
ppc64*);;
ppc*) broken="{standard input}:3376761: Error: operand out of range";;
esac
if [ "$CROSS_BUILD" ]; then
CFLAGS+=" -I$XBPS_CROSS_BASE/usr/include/Coin3"
fi
# setup.py calls cmake directly, so can't rely on xbps's cmake crossbuild support:
# let's recreate here. Upstream should switch to cmake on next release (0.6.6).
post_extract() (
# use setup_old.py until have Coin with cmake support
mv -f setup_old.py setup.py
)
pre_configure() {
[ -z "$CROSS_BUILD" ] && return 0
case "$XBPS_TARGET_MACHINE" in
x86_64*) _CMAKE_SYSTEM_PROCESSOR=x86_64 ;;
i686*) _CMAKE_SYSTEM_PROCESSOR=x86 ;;
aarch64*) _CMAKE_SYSTEM_PROCESSOR=aarch64 ;;
arm*) _CMAKE_SYSTEM_PROCESSOR=arm ;;
mips*) _CMAKE_SYSTEM_PROCESSOR=mips ;;
ppc64le*) _CMAKE_SYSTEM_PROCESSOR=ppc64le ;;
ppc64*) _CMAKE_SYSTEM_PROCESSOR=ppc64 ;;
ppcle*) _CMAKE_SYSTEM_PROCESSOR=ppcle ;;
ppc*) _CMAKE_SYSTEM_PROCESSOR=ppc ;;
*) _CMAKE_SYSTEM_PROCESSOR=generic ;;
esac
cat >cross_${XBPS_CROSS_TRIPLET}.cmake <<_EOF
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
post_patch() {
if [ "$CROSS_BUILD" ]; then
vsed -i setup.py \
-e '/if not self[.]check_cmd_exists.*coin-config/,+1d' \
-e "s!coin-config!$XBPS_CROSS_BASE/usr/bin/coin-config!" \
-e "/INCLUDE_DIR.*coin-config/s!=!= \"$XBPS_CROSS_BASE\" +!"
fi
SET(CMAKE_C_COMPILER ${CC})
SET(CMAKE_CXX_COMPILER ${CXX})
SET(CMAKE_CROSSCOMPILING TRUE)
SET(CMAKE_SYSTEM_PROCESSOR ${_CMAKE_SYSTEM_PROCESSOR})
SET(CMAKE_FIND_ROOT_PATH "${XBPS_CROSS_BASE}/usr;${XBPS_CROSS_BASE}")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(wxWidgets_CONFIG_EXECUTABLE ${XBPS_WRAPPERDIR}/${wx_config:=wx-config})
_EOF
cat >$XBPS_WRAPPERDIR/cmake <<_EOF
#!/bin/sh
/usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$wrksrc/cross_${XBPS_CROSS_TRIPLET}.cmake "$@"
_EOF
chmod +x $XBPS_WRAPPERDIR/cmake
}
post_install() {

View file

@ -1,3 +0,0 @@
site=https://bitbucket.org/Coin3D/pivy/downloads/?tab=tags
pkgname=
ignore="20101207"