desktop/freecad/PKGBUILD

98 lines
3.0 KiB
Bash
Raw Normal View History

#
# Apps Packages for Chakra, part of chakra-project.org
#
# Contributors from AUR:
# mickele
# Jordi De Groof <jordi (dot) degroof (at) gmail (dot) com>
# manwithgrenade
# bricem13
# gborzi
pkgname=freecad
pkgver=0.12.5284
pkgrel=1
pkgdesc='A general purpose 3D CAD modeler'
arch=('i686' 'x86_64')
url='http://sourceforge.net/apps/mediawiki/free-cad/'
license=('GPL')
depends=('boost-libs' 'curl' 'opencascade>=6.5.2' 'pivy-hg' 'pyqt' 'xerces-c' 'libspnav' 'shared-mime-info' 'hicolor-icon-theme')
makedepends=('boost' 'eigen3' 'gcc-fortran' 'swig1' 'xerces-c' 'desktop-file-utils')
options=(!libtool !makeflags)
install=freecad.install
source=("http://downloads.sourceforge.net/sourceforge/free-cad/freecad-${pkgver}.tar.gz" "${pkgname}.desktop" "${pkgname}.xml" "occ652.patch")
md5sums=('fcd91286c578a219491ffebb2111bddf'
'0d3e92a0cb31f2621e9824a099e8a244'
'c2f4154c8e4678825411de8e7fa54c6b'
'4bafdb67647fd0f1a2cf827e517e6188')
build() {
cd "${srcdir}/FreeCAD-${pkgver}/"
patch -Np1 -i "${srcdir}/occ652.patch"
# fix boost*-mt libs
sed -i -e 's/-lboost\(.*\)-mt/-lboost\1/' acinclude.m4
./autogen.sh
./configure \
--prefix=/usr/lib/${pkgname} \
--datadir=/usr/share/${pkgname} \
--includedir=/usr/include/${pkgname} \
--docdir=/usr/share/doc/${pkgname} \
--with-qt4-dir=/usr/lib/qt/ \
--with-qt4-bin=/usr/bin/ \
--with-qt4-include=/usr/include/ \
--with-qt4-lib=/usr/lib/qt/ \
PYTHON=/usr/bin/python2 \
--with-python-include=/usr/include/python2.7/ \
--with-python-lib=/usr/lib/python2.7/ \
--with-boost-include=/usr/include/boost \
--with-boost-lib=/usr/lib \
--with-occ-lib=/opt/opencascade/lib \
--with-occ-include=/opt/opencascade/inc \
--disable-debug
# Build main program
make
# Builds Qt plugin
cd src/Tools/plugins/widget/
qmake plugin.pro
make
}
package() {
cd "${srcdir}/FreeCAD-${pkgver}/"
# 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"
# Fix hard boost dep
BOOSTVER=`pacman -Q boost|sed -e 's_-.*__' -e 's_boost __'`
cd "${pkgdir}/usr/lib/${pkgname}/lib"
for i in _program_options _signals _regex _filesystem _system; do
ln -s /usr/lib/libboost$i.so libboost$i.so.$BOOSTVER
done
}