pkgname=freecad _pkgname=FreeCAD pkgver=0.16 pkgrel=4 pkgdesc='A general purpose 3D CAD modeler' arch=('x86_64') url='http://www.freecadweb.org/wiki' license=('GPL') depends=('boost-libs' 'curl' 'opencascade' 'pivy-hg' 'xerces-c' 'libspnav' 'shared-mime-info' 'hicolor-icon-theme' 'python2-matplotlib' 'python2-shiboken' 'python2-pyside-tools' 'pyside-tools-common' 'python2-pyqt4' 'qtwebkit') makedepends=('boost' 'eigen3' 'gcc-fortran' 'swig' 'xerces-c' 'desktop-file-utils' 'cmake' 'coin' 'zlib' 'glu') options=(!libtool !makeflags) install=freecad.install source=("freecad::git+https://github.com/${_pkgname}/${_pkgname}.git#branch=releases/${_pkgname}-${pkgver//./-}" "${pkgname}.desktop" "${pkgname}.xml") sha512sums=('SKIP' 'a58dd5f6d8217b6633d5cc24a0b61954b1044d4156b25b78c00ea29f3ac9ca4932e9bde08bd11fc4327d76c7e82500cf3c2ddc934f426e970757cd200b070aec' 'ac0dfe1b2c58335867e94d4ce86696763b6354dcdca68a653bf115b6ea562f0f8ff7d243d42d0c6fd6e758bd488d626e30cd917bb1b5c676c1f0cafdece005d6') prepare() { cd "${srcdir}/${pkgname}" sed -i \ -e "46i\\\tModDir = '/usr/share/freecad/Mod'" \ -e "50i\\\tLibDir = '/usr/lib/freecad'" \ src/App/FreeCADInit.py # http://www.freecadweb.org/tracker/view.php?id=2347 #sed -i 's/boost::re_detail/boost::BOOST_REGEX_DETAIL_NS/' \ # src/Mod/Drawing/App/FeaturePage.cpp } build() { cd "${srcdir}/${pkgname}" mkdir -p build cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX:PATH="/usr" \ -DCMAKE_INSTALL_DOCDIR:PATH="share/freecad/doc" \ -DCMAKE_INSTALL_DATADIR:PATH="share/freecad" \ -DCMAKE_INSTALL_LIBDIR:PATH="lib/freecad" \ -DOCC_INCLUDE_DIR:PATH=/opt/opencascade/inc/ \ -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 \ -DFREECAD_USE_EXTERNAL_PIVY:BOOL=ON make } package() { cd "${srcdir}/${pkgname}/build/" make DESTDIR="${pkgdir}" install # Symlink to /usr/bin ln -sf "FreeCAD" "${pkgdir}/usr/bin/freecad" ln -sf "FreeCADCmd" "${pkgdir}/usr/bin/freecadcmd" cp -ra "${pkgdir}/usr/Mod" "${pkgdir}/usr/share/freecad/" rm -r "${pkgdir}/usr/Mod" # Install pixmaps and desktop shortcut desktop-file-install \ --dir="${pkgdir}/usr/share/applications" \ "${srcdir}/${pkgname}.desktop" install -d ${pkgdir}/usr/share/pixmaps cp ${pkgdir}/usr/share/freecad/freecad.svg ${pkgdir}/usr/share/pixmaps/freecad.svg # Mime info install -D -m644 "${srcdir}/${pkgname}.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}.xml" }