void-packages/srcpkgs/freecad/template
2017-04-22 17:53:39 +00:00

65 lines
2.4 KiB
Bash

# Template file for 'freecad'
pkgname=freecad
version=0.16
revision=5
wrksrc="FreeCAD-${version}"
build_style=cmake
_inst_prefix=usr/lib/${pkgname}
# set CMAKE_INSTALL_LIBDIR to {CMAKE_INSTALL_PREFIX}/lib" or patch LibDir in src/App/FreeCADInit.py
configure_args="
-DCMAKE_INSTALL_PREFIX=/${_inst_prefix}
-DCMAKE_INSTALL_DATADIR=/${_inst_prefix}/data
-DCMAKE_INSTALL_DOCDIR=/${_inst_prefix}/doc
-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/${pkgname}
-DCMAKE_INSTALL_LIBDIR=/${_inst_prefix}/lib"
hostmakedepends="python swig pkg-config doxygen graphviz"
makedepends="python-devel oce-devel qt-devel qt-webkit-devel coin3-devel eigen
libxerces-c-devel libspnav-devel libshiboken-python-devel libpyside-python-devel
pyside-tools python-matplotlib boost-python coin3-doc"
# qt-devel-tools, qt-plugin-sqlite: Help uses qt/assistant, its data in SQLite format
depends="python-matplotlib python-pyside qt-devel-tools qt-plugin-sqlite python-pivy"
pycompile_dirs="usr/lib/${pkgname}/Mod usr/lib/${pkgname}/data/Mod"
short_desc="A general purpose 3D CAD modeler"
maintainer="yopito <pierre.bourgin@free.fr>"
license="LGPL-2.1"
homepage="http://freecadweb.org/"
distfiles="https://github.com/FreeCAD/FreeCAD/archive/${version}.tar.gz"
checksum=6cc71ab4b0dc60b493d3aaa4b42f1ce1af9d4fcd539309ab0792804579e18e09
case "${XBPS_TARGET_MACHINE}" in
aarch64*) broken="https://build.voidlinux.eu/builders/aarch64-musl_builder/builds/1402";;
esac
post_install() {
# AppHomePath is computed with binary's realpath:
# do not move binaries but symlink them instead.
vmkdir usr/bin
for f in FreeCAD FreeCADCmd; do
ln -s /${_inst_prefix}/bin/${f} ${DESTDIR}/usr/bin/${f}
done
# desktop integration
vmkdir usr/share/applications
vcopy ${FILESDIR}/freecad.desktop usr/share/applications
sed -i -e "s,@_inst_prefix@,/${_inst_prefix}," ${DESTDIR}/usr/share/applications/freecad.desktop
vmkdir usr/share/appdata
vcopy ${FILESDIR}/freecad.appdata.xml usr/share/appdata
vmkdir usr/share/mime/packages
vcopy ${FILESDIR}/freecad.xml usr/share/mime/packages
for s in 16 32 48 64; do
_dest_icon=usr/share/icons/hicolor/${s}x${s}/apps
vmkdir ${_dest_icon}
ln -s /${_inst_prefix}/data/freecad-icon-${s}.png ${DESTDIR}/${_dest_icon}/freecad.png
ln -s /${_inst_prefix}/data/freecad.xpm ${DESTDIR}/${_dest_icon}/freecad.xpm
done
vmkdir usr/share/icons/scalable/apps
ln -s /${_inst_prefix}/data/freecad.svg ${DESTDIR}/usr/share/icons/scalable/apps/freecad.svg
}