void-packages/srcpkgs/python3-pivy/template

67 lines
2.1 KiB
Bash

# Template file for 'python3-pivy'
pkgname=python3-pivy
version=0.6.5
revision=2
wrksrc="pivy-${version}"
build_style=python3-module
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="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
# 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).
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)
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() {
vlicense LICENSE
}