Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Maintainer: Mineko
- # Submitter: Giuseppe Borzi <gborzi@ieee.org> (Previous maintainer)
- pkgname=freecad-git
- _gitname="free-cad-code"
- #-----------------------[[Because being smart is fun!]]-----------------------#
- if [ -f "version" ]; then
- echo -e $(tput bold) "\e[91m"
- echo "Oh good, version is here.." #Unnecessary but why the hell not.
- echo $(tput sgr0)
- else
- echo -e $(tput bold) "\e[91m"
- echo "Oh teh noes, version isn't here!"
- echo "Then I only have one choice.. I must make it myself!"
- echo $(tput sgr0)
- echo "1" > version
- fi
- #----------------------------[[It never ends...]]-----------------------------#
- pkgrel=$(cat version)
- pkgver=git
- pkgdesc="FreeCAD Parametric 3D & 2D CAD-CAE modeler"
- arch=('i686' 'x86_64')
- url="http://www.freecadweb.org/"
- license=('LGPL2+')
- #-----------------------[[Because we can't have a friggin' OR statement]]-----------------------#
- if pacman -Qq opencascade >/dev/null 2>&1; then
- depends=('opencascade>=6.6.0' 'boost-libs' 'python2-matplotlib' 'python2-pyqt4' 'xerces-c' 'freetype2' 'wget' 'ode' 'coin' 'soqt')
- elif pacman -Qq oce >/dev/null 2>&1; then
- depends=('oce' 'boost-libs' 'python2-matplotlib' 'python2-pyqt4' 'xerces-c' 'freetype2' 'wget' 'ode' 'coin' 'soqt')
- elif pacman -Qq oce-git >/dev/null 2>&1; then
- depends=('oce-git' 'boost-libs' 'python2-matplotlib' 'python2-pyqt4' 'xerces-c' 'freetype2' 'wget' 'ode' 'coin' 'soqt')
- else
- echo -e $(tput bold) "\e[91m"
- echo "This package requires either Opencascade Community Edition (OCE) or Opencascade, but neither is installed."
- echo "Install one or the other, but not both, they both work fine, just trying to give a choice.."
- echo "Compilation aborted."
- echo $(tput sgr0)
- return 1
- fi
- #-------------------------------------------[[qq]]----------------------------------------------#
- makedepends=('boost' 'eigen3' 'gcc-fortran' 'git' 'swig' 'cmake' 'coin>=3.1.3-9' 'zlib')
- optdepends=('python2-matplotlib' 'pycollada-git' 'pivy-hg' 'libspnav' 'gts')
- provides=('freecad-git')
- source=($pkgname.desktop)
- md5sums=('0c358dd504e837c60acec71a3f741710')
- _gitroot="git://git.code.sf.net/p/free-cad/code"
- prepare() {
- cd ..
- if [ ! -d $_gitname ]; then
- git clone $_gitroot $_gitname
- else
- echo -e $(tput bold) "\e[91m"
- read -p "Would you like to update FreeCAD to the latest git version? [Y/N]"
- if [[ $REPLY == [yY] ]]; then
- echo "Fetching latest FreeCAD git version..."
- echo $(expr $pkgrel + 1) > version
- pkgrel=$(expr $pkgrel + 1)
- cd $_gitname
- git pull
- else
- echo "Alright then, your choice."
- fi
- echo $(tput sgr0)
- fi
- }
- build() {
- cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/lib/$pkgname \
- -DCMAKE_INSTALL_DATADIR:PATH=/usr/share/$pkgname \
- -DCMAKE_INSTALL_INCLUDEDIR:PATH=/usr/include/$pkgname \
- -DCMAKE_INSTALL_DOCDIR:PATH=/usr/share/doc/$pkgname \
- -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 \
- -DFREECAD_USE_EXTERNAL_PIVY:BOOL=ON \
- -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4 \
- ../$_gitname
- make
- }
- package() {
- make DESTDIR="$pkgdir/" install
- install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
- install -dm755 "$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-git"
- }
Add Comment
Please, Sign In to add comment