desktop/freecad/PKGBUILD
2013-12-10 03:39:43 +00:00

78 lines
2.6 KiB
Bash

#
# Apps Packages for Chakra, part of chakra-project.org
#
pkgname=freecad
pkgver=0.13.1830
pkgrel=3
pkgdesc='A general purpose 3D CAD modeler'
arch=('x86_64')
url='http://www.freecadweb.org/wiki'
license=('GPL')
depends=('boost-libs' 'curl' 'opencascade>=6.5.2' 'pivy-hg' 'python2-pyqt4' 'xerces-c' 'libspnav' 'shared-mime-info' 'hicolor-icon-theme')
makedepends=('boost' 'eigen3' 'gcc-fortran' 'swig' 'xerces-c' 'desktop-file-utils' 'zlib' 'cmake' 'coin>=3.1.3-2')
options=(!libtool !makeflags)
install=freecad.install
source=("http://downloads.sourceforge.net/sourceforge/free-cad/freecad-${pkgver}.tar.gz" "${pkgname}.desktop" "${pkgname}.xml")
md5sums=('13b8fddef12f5f8419dcf4adbab596eb'
'f930c02689c0b2cc75b9dab833e46932'
'c2f4154c8e4678825411de8e7fa54c6b')
build() {
cd "${srcdir}/freecad-${pkgver}/"
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/lib/$pkgname .. \
-DOCC_INCLUDE_DIR:PATH=/opt/opencascade/inc/ \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 \
-DFREECAD_USE_EXTERNAL_PIVY:BOOL=ON
# Seems that this configurations doesn't work (tested with version 0.13.1830)
# -DCMAKE_INSTALL_DATADIR:PATH=/usr/share/${pkgname} .. \
# -DCMAKE_INSTALL_INCLUDEDIR:PATH=/usr/include/${pkgname} .. \
# -DCMAKE_INSTALL_DOCDIR:PATH=/usr/share/doc/${pkgname} .. \
# add these options to copmile without coin debian patch
# http://sourceforge.net/apps/mantisbt/free-cad/view.php?id=664
# -DCMAKE_C_FLAGS:STRING="$CFLAGS -fpermissive" \
# -DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS -fpermissive"
# Build main program
make
# Builds Qt plugin
cd "${srcdir}/freecad-${pkgver}/src/Tools/plugins/widget/"
qmake plugin.pro
make
}
package() {
cd "${srcdir}/freecad-${pkgver}/build"
# Install main program
make DESTDIR=${pkgdir} install
# Symlink to /usr/bin
mkdir -p ${pkgdir}/usr/bin/
ln -sf /usr/lib/${pkgname}/bin/FreeCAD "${pkgdir}/usr/bin/${pkgname}"
ln -sf /usr/lib/${pkgname}/bin/FreeCADCmd "${pkgdir}/usr/bin/freecadcmd"
# Installs Qt plugin
install -Dm755 ../src/Tools/plugins/widget/libFreeCAD_widgets.so "${pkgdir}/usr/lib/qt/plugins/designer/libFreeCAD_widgets.so"
# Install pixmaps and desktop shortcut
desktop-file-install \
--dir="${pkgdir}/usr/share/applications" \
"${srcdir}/${pkgname}.desktop"
# Mime info
install -D -m644 "${srcdir}/${pkgname}.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}.xml"
mkdir -p "${pkgdir}/usr/share/icons/hicolor/48x48/mimetypes/"
ln -s /usr/share/${pkgname}/freecad.xpm "${pkgdir}/usr/share/icons/hicolor/48x48/mimetypes/application-x-extension-fcstd.xpm"
}