Clean up code and formatting

This commit is contained in:
Markus Hovorka 2017-03-29 14:32:08 +02:00
parent c47f71a271
commit a09136dbcf
2 changed files with 52 additions and 49 deletions

View file

@ -1,6 +1,6 @@
pkgbase = freecad-git pkgbase = freecad-git
pkgdesc = A general purpose 3D CAD modeler - git checkout pkgdesc = A general purpose 3D CAD modeler - git checkout
pkgver = 0.17pre.r3954.g7e9da5e95 pkgver = 0.17pre.r3959.g0ca5ebe78
pkgrel = 1 pkgrel = 1
epoch = 1 epoch = 1
url = http://www.freecadweb.org/ url = http://www.freecadweb.org/

View file

@ -1,8 +1,9 @@
# Maintainer: Markus Hovorka <m.hovorka@live.de> # Maintainer: Markus Hovorka <m.hovorka@live.de>
# Contributer: Christian Hesse <mail@eworm.de> # Contributer: Christian Hesse <mail@eworm.de>
pkgname=freecad-git _appname=freecad
pkgver=0.17pre.r3954.g7e9da5e95 pkgname="${_appname}-git"
pkgver=0.17pre.r3959.g0ca5ebe78
pkgrel=1 pkgrel=1
epoch=1 epoch=1
pkgdesc='A general purpose 3D CAD modeler - git checkout' pkgdesc='A general purpose 3D CAD modeler - git checkout'
@ -11,7 +12,7 @@ url='http://www.freecadweb.org/'
license=('LGPL') license=('LGPL')
depends=('boost-libs' 'curl' 'hicolor-icon-theme' 'libspnav' 'opencascade7' depends=('boost-libs' 'curl' 'hicolor-icon-theme' 'libspnav' 'opencascade7'
'med' 'xerces-c' 'python2-pivy' 'python2-pyside' 'qtwebkit' 'med' 'xerces-c' 'python2-pivy' 'python2-pyside' 'qtwebkit'
'libtheora' 'shared-mime-info' 'vtk-qt4' 'jsoncpp' 'netgen-nogui-occ7') 'libtheora' 'shared-mime-info' 'vtk-qt4' 'jsoncpp' 'netgen-nogui-occ7')
makedepends=('git' 'boost' 'cmake' 'coin' 'python2-pyside-tools' makedepends=('git' 'boost' 'cmake' 'coin' 'python2-pyside-tools'
'desktop-file-utils' 'eigen' 'gcc-fortran' 'swig') 'desktop-file-utils' 'eigen' 'gcc-fortran' 'swig')
optdepends=('python2-matplotlib' optdepends=('python2-matplotlib'
@ -20,9 +21,9 @@ provides=('freecad')
conflicts=('freecad') conflicts=('freecad')
source=("$pkgname::git+https://github.com/FreeCAD/FreeCAD.git" source=("$pkgname::git+https://github.com/FreeCAD/FreeCAD.git"
"freecad.desktop" "freecad.desktop"
"freecad.xml" "freecad.xml"
"rpath.patch" "rpath.patch"
"fix-occ-search.patch") "fix-occ-search.patch")
md5sums=('SKIP' md5sums=('SKIP'
'7e781d41e90a1c137930e47672996a52' '7e781d41e90a1c137930e47672996a52'
'c2f4154c8e4678825411de8e7fa54c6b' 'c2f4154c8e4678825411de8e7fa54c6b'
@ -30,62 +31,64 @@ md5sums=('SKIP'
'5a7beefb78ef73241b0e421fec67f4db') '5a7beefb78ef73241b0e421fec67f4db')
pkgver() { pkgver() {
cd "$pkgname" cd "$pkgname"
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/_//' git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/_//'
} }
prepare() { prepare() {
cd "$srcdir/$pkgname" cd "$srcdir/$pkgname"
patch -Np1 -i "$srcdir/rpath.patch" patch -Np1 -i "$srcdir/rpath.patch"
patch -Np1 -i "$srcdir/fix-occ-search.patch" patch -Np1 -i "$srcdir/fix-occ-search.patch"
} }
build() { build() {
cd "$srcdir/$pkgname" cd "$srcdir/$pkgname"
cmake -DCMAKE_BUILD_TYPE=Release \ cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH="/opt/freecad" \ -DCMAKE_INSTALL_PREFIX:PATH="/opt/${_appname}" \
-DOCC_INCLUDE_DIR:PATH=/opt/opencascade7/include/opencascade \ -DOCC_INCLUDE_DIR:PATH=/opt/opencascade7/include/opencascade \
-DOCC_LIBRARY_DIR:PATH=/opt/opencascade7/lib \ -DOCC_LIBRARY_DIR:PATH=/opt/opencascade7/lib \
-DVTK_DIR:PATH=/opt/vtk-qt4/lib/cmake/vtk-7.0 \ -DVTK_DIR:PATH=/opt/vtk-qt4/lib/cmake/vtk-7.0 \
-DCMAKE_PREFIX_PATH=/opt/opencascade7 \ -DCMAKE_PREFIX_PATH=/opt/opencascade7 \
-DCMAKE_INCLUDE_PATH:PATH=/opt/opencascade7/include/opencascade \ -DCMAKE_INCLUDE_PATH:PATH=/opt/opencascade7/include/opencascade \
-DCMAKE_LIBRARY_PATH:PATH=/opt/opencascade7/lib \ -DCMAKE_LIBRARY_PATH:PATH=/opt/opencascade7/lib \
-DCMAKE_INSTALL_RPATH=/opt/opencascade7/lib:/opt/vtk-qt4/lib \ -DCMAKE_INSTALL_RPATH=/opt/opencascade7/lib:/opt/vtk-qt4/lib \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 \ -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 \
-DPYTHON_SUFFIX=-python2.7 \ -DPYTHON_SUFFIX=-python2.7 \
-DPYTHON_BASENAME=-python2.7 \ -DPYTHON_BASENAME=-python2.7 \
-DPYSIDEUIC4BINARY:FILEPATH=/usr/bin/python2-pyside-uic \ -DPYSIDEUIC4BINARY:FILEPATH=/usr/bin/python2-pyside-uic \
-DBUILD_FEM_NETGEN=1 -DBUILD_FEM_NETGEN=1
make make
} }
package() { package() {
cd "$srcdir/$pkgname" cd "$srcdir/$pkgname"
local bin="FreeCAD"
local bin_cmd="FreeCADCmd"
make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" install
# Symlink binaries to /usr/bin. # Symlink binaries to /usr/bin.
mkdir -p "$pkgdir/usr/bin" mkdir -p "$pkgdir/usr/bin"
ln -s "/opt/freecad/bin/FreeCAD" "$pkgdir/usr/bin/FreeCAD" ln -s "/opt/${_appname}/bin/${bin}" "$pkgdir/usr/bin/${bin}"
ln -s "/opt/freecad/bin/FreeCADCmd" "$pkgdir/usr/bin/FreeCADCmd" ln -s "/opt/${_appname}/bin/${bin_cmd}" "$pkgdir/usr/bin/${bin_cmd}"
# Lowercase aliases like the official arch package. # Lowercase aliases like the official arch package.
ln -s "/opt/freecad/bin/FreeCAD" "$pkgdir/usr/bin/freecad" ln -s "/opt/${_appname}/bin/${bin}" "$pkgdir/usr/bin/${bin,,}"
ln -s "/opt/freecad/bin/FreeCADCmd" "$pkgdir/usr/bin/freecadcmd" ln -s "/opt/${_appname}/bin/${bin_cmd}" "$pkgdir/usr/bin/${bin_cmd,,}"
# Install pixmaps and desktop shortcut. # Install pixmaps and desktop shortcut.
for i in 16 32 48 64; do for i in 16 32 48 64; do
install -Dm644 "src/Gui/Icons/freecad-icon-${i}.png" \ install -Dm644 "src/Gui/Icons/freecad-icon-${i}.png" \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/freecad.png" "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/${_appname}.png"
done done
install -Dm644 "src/Gui/Icons/freecad.svg" \ install -Dm644 "src/Gui/Icons/freecad.svg" \
"$pkgdir/usr/share/icons/hicolor/scalable/apps/freecad.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/${_appname}.svg"
desktop-file-install \ desktop-file-install \
--dir="$pkgdir/usr/share/applications" "$srcdir/freecad.desktop" --dir="$pkgdir/usr/share/applications" "$srcdir/${_appname}.desktop"
# Install mime info. # Install mime info.
install -D -m644 "$srcdir/freecad.xml" \ install -D -m644 "$srcdir/${_appname}.xml" \
"$pkgdir/usr/share/mime/packages/freecad.xml" "$pkgdir/usr/share/mime/packages/${_appname}.xml"
} }